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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/armci/examples/features/gpc/hashtable/test_hashtable.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
/* $Id:  */
 
2
#include <cstdio>
 
3
#include <cstring>
 
4
#include <cstdlib>
 
5
#include <fstream>
 
6
using namespace std;
 
7
 
 
8
#if HAVE_UNISTD_H
 
9
#   include <unistd.h>
 
10
#elif HAVE_WINDOWS_H
 
11
#   include <windows.h>
 
12
#   define sleep(x) Sleep(1000*(x))
 
13
#endif
 
14
 
 
15
#include "mp3.h"
 
16
#include "armci.h"
 
17
#define ARMCI_ENABLE_GPC_CALLS
 
18
#include "gpc.h"
 
19
 
 
20
#include "Hash_common.h"
 
21
#include "DistHashmap.h"
 
22
int me, nproc;
 
23
 
 
24
 
 
25
void test_distHashmap()
 
26
{
 
27
  
 
28
  ifstream infile("sample.txt");
 
29
  string str;
 
30
 
 
31
  // create a distributed hashmap
 
32
  if(me==0) { printf("Creating a distributed hashmap\n"); fflush(stdout);}
 
33
  DistHashmap *dist_hashmap = new DistHashmap();
 
34
  dist_hashmap->create();
 
35
  if(me==0) { printf("Distributed hashmap created. O.K.\n"); fflush(stdout);}
 
36
 
 
37
  // reads a word from the file and inserts it into the hashmap
 
38
  while(!infile.eof()) {
 
39
    infile >> str;
 
40
    dist_hashmap->insert(str);
 
41
    // if(me==0) { printf("%s\n", str.c_str()); fflush(stdout);}
 
42
  }
 
43
  dist_hashmap->commit();
 
44
  
 
45
  dist_hashmap->print();  fflush(stdout);
 
46
  MP_BARRIER();
 
47
  
 
48
  dist_hashmap->print2();  fflush(stdout);
 
49
  MP_BARRIER();
 
50
 
 
51
  // delete the distributed hashmap
 
52
  dist_hashmap->destroy();
 
53
  if(me==0) { printf("Distributed hashmap deleted. O.K.\n"); fflush(stdout);}
 
54
  
 
55
  infile.close();
 
56
}
 
57
 
 
58
 
 
59
int main(int argc, char* argv[])
 
60
{
 
61
    MP_INIT(argc, argv);
 
62
    MP_PROCS(&nproc);
 
63
    MP_MYID(&me);
 
64
    
 
65
    if(me==0){
 
66
      printf("ARMCI Distributed Hashmap test program (%d processes)\n",nproc); 
 
67
      fflush(stdout);
 
68
      sleep(1);
 
69
    }
 
70
    
 
71
    ARMCI_Init();
 
72
    
 
73
    
 
74
    if(me==0){
 
75
      printf("\nDistributed Hashmap using ARMCI's GPC calls\n");
 
76
      fflush(stdout);
 
77
    }
 
78
    
 
79
    MP_BARRIER();
 
80
    
 
81
    test_distHashmap();
 
82
 
 
83
    ARMCI_AllFence();
 
84
    MP_BARRIER();
 
85
    
 
86
    
 
87
    ARMCI_Finalize();
 
88
    MP_FINALIZE();
 
89
    return(0);
 
90
}