-
Notifications
You must be signed in to change notification settings - Fork 12
/
OverlapHelement.C
76 lines (56 loc) · 1.75 KB
/
OverlapHelement.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "global.h"
#include "wrapper.h"
#ifndef SERIAL
#include "mpi.h"
#endif
#include "stdio.h"
#include "stdlib.h"
#include <string>
using namespace std;
int main(int argc, char* argv []) {
int rank=0, size=1;
#ifndef SERIAL
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Group orig_group, calc_group;
MPI_Comm_group(MPI_COMM_WORLD, &orig_group);
MPI_Comm_split(MPI_COMM_WORLD, 0, rank, &Calc);
calc = boost::mpi::communicator(Calc, boost::mpi::comm_attach);
#endif
initBoostMPI(argc, argv);
ReadInputFromC(argv[1], 0);
dmrginp.matmultFlops.resize(numthrds, 0.);
double* stackmemory = new double[dmrginp.getMemory()];
Stackmem.resize(numthrds);
Stackmem[0].data = stackmemory;
Stackmem[0].size = dmrginp.getMemory();
//************
//memset(stackmemory, 0, dmrginp.getMemory()*sizeof(double));
int mpsstate=0;
//readMPSFromDiskAndInitializeStaticVariables();
//initializeGlobalMPS(mpsstate);
if (rank ==0)
printf("Reading file %s\n", argv[2]);
test(argv[2]);
//exit(0);
//
//
/*
double overlap, hvalue;
unsigned long temp=1, occ=0;
string occstring = "1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1";
intFromString(occ, occstring.c_str());
evaluateOverlapAndHamiltonian(&occ, 1, &overlap, &hvalue);
printf("<D|0> = %18.10f <D|H|0> = %18.10f <D|H|0>/<D|0> = %18.10f \n", overlap, hvalue, hvalue/overlap);
occstring = "1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 1";
intFromString(occ, occstring.c_str());
evaluateOverlapAndHamiltonian(&occ, 1, &overlap, &hvalue);
printf("<D|0> = %18.10f <D|H|0> = %18.10f <D|H|0>/<D|0> = %18.10f \n", overlap, hvalue, hvalue/overlap);
*/
#ifndef SERIAL
MPI_Comm_free(&Calc);
MPI_Finalize();
#endif
return 0;
}