12
# define sleep(x) Sleep(1000*(x))
17
#define ARMCI_ENABLE_GPC_CALLS
20
#include "Hash_common.h"
21
#include "DistHashmap.h"
25
void test_distHashmap()
28
ifstream infile("sample.txt");
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);}
37
// reads a word from the file and inserts it into the hashmap
38
while(!infile.eof()) {
40
dist_hashmap->insert(str);
41
// if(me==0) { printf("%s\n", str.c_str()); fflush(stdout);}
43
dist_hashmap->commit();
45
dist_hashmap->print(); fflush(stdout);
48
dist_hashmap->print2(); fflush(stdout);
51
// delete the distributed hashmap
52
dist_hashmap->destroy();
53
if(me==0) { printf("Distributed hashmap deleted. O.K.\n"); fflush(stdout);}
59
int main(int argc, char* argv[])
66
printf("ARMCI Distributed Hashmap test program (%d processes)\n",nproc);
75
printf("\nDistributed Hashmap using ARMCI's GPC calls\n");