~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/tascel/test/TestQueue.cc

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if HAVE_CONFIG_H
 
2
# include "config.h"
 
3
#endif
 
4
 
 
5
#include <cstdio>
 
6
 
 
7
#include <ga.h>
 
8
#include <mpi.h>
 
9
 
 
10
#if SPLIT_QUEUE
 
11
# include "UniformTaskCollectionSplit.h"
 
12
#elif SHARED_QUEUE
 
13
# include "UniformTaskCollectionShared.h"
 
14
#else
 
15
# error one of SPLIT_QUEUE or SHARED_QUEUE must be defined
 
16
#endif
 
17
 
 
18
using namespace std;
 
19
using namespace tascel;
 
20
 
 
21
 
 
22
#define MAX_TASKS 100
 
23
static int me;
 
24
 
 
25
 
 
26
struct TskDscr {
 
27
  int v;
 
28
  TskDscr(int _v): v(_v) {}
 
29
}; 
 
30
 
 
31
void fn(UniformTaskCollection *coll, void *desc, int dscr_len, void *pldata,
 
32
        int pldata_len, std::vector<void*> data_bufs) {
 
33
  TskDscr *dsc = (TskDscr*)desc;
 
34
  printf("%d: val=%d\n", me, dsc->v);
 
35
  if(dsc->v>0) {
 
36
    TskDscr dsc2(dsc->v-1);
 
37
    coll->addTask(&dsc2, sizeof(dsc2));
 
38
  }
 
39
}
 
40
 
 
41
 
 
42
void the_test() {
 
43
  TslFuncRegTbl frt;
 
44
  TslFunc tf = frt.add(fn);
 
45
  TaskCollProps props;
 
46
  props.functions(tf,frt).taskSize(sizeof(TskDscr)).maxTasks(MAX_TASKS);
 
47
#if SPLIT_QUEUE
 
48
  if(me==0) {
 
49
    printf("SplitQueue version\n");
 
50
  }
 
51
  UniformTaskCollectionSplit utc(props);
 
52
#elif SHARED_QUEUE
 
53
  if(me==0) {
 
54
    printf("SharedQueue version\n");
 
55
  }
 
56
  UniformTaskCollectionShared utc(props);
 
57
#endif
 
58
  if(me==0) {
 
59
    TskDscr dsc(10);
 
60
    utc.addTask(&dsc, sizeof(dsc));
 
61
  }
 
62
  utc.process();  
 
63
}
 
64
 
 
65
 
 
66
int main(int argc, char *argv[]) {
 
67
  MPI_Init(&argc, &argv);
 
68
  MPI_Comm_rank(MPI_COMM_WORLD, &me);
 
69
  GA_Initialize();
 
70
  the_test();
 
71
  GA_Terminate();
 
72
  MPI_Finalize();
 
73
  return 0;
 
74
}