58 {
60
63 double gE, EnergyRange, OpRange, OpMin;
64
65 if( !Initialize(argc, argv, Nargs_common) ) {
66 std::cerr << "Error: Initialization failed." << std::endl;
67 std::exit(EX_USAGE);
68 }
70
71
72 debug_print(
"# Checking for the directory structure.");
73
74
75
76
77
78#ifdef GPU
79 magma_init();
80 magma_queue_t queue = NULL;
81 magma_int_t dev = 0;
82 magma_getdevice( &dev );
83 magma_queue_create( dev, &queue );
84#else
86#endif
87
88
89 debug_print(
"# Calculating translation-invariant sectors.");
91
92
93
96 std::vector<Integer_t> NdataInShell(dim_max);
97 std::vector<double> eigenEnergy(dim_max);
98 std::vector<double> EXPvalue(dim_max);
101#ifndef GPU
102 matrix<Complex_t> h_tot(dim_max, dim_max);
103 matrix<Complex_t> loc_tot(dim_max, dim_max);
104 #define dh_tot h_tot
105 #define dloc_tot loc_tot
106#endif
107
108
109#ifdef GPU
110
113 Integer_t const LDT = magma_roundup(dim_max, GPU_UNIT);
116 matrix_gpu<Complex_t> dh_tot(LDT, dim_max);
117 matrix_gpu<Complex_t> dloc_tot(LDT, dim_max);
118
119
120
122
123#endif
124
125 double start, t_int, end, temp_t;
126 double T_diag=0, T_post=0, T_pre=0;
127 init_genrand(SEED);
130 generateLocal_h( h,
dloc_h, -1);
131 generateLocal_op(loc,
dloc_op, -1);
132 }
134 std::cout << "(init_genrand): time=" << std::fixed << (end-start) << std::endl;
135
136
137
138
139 FILE* pipe = popen("hostname", "r");
140 char hostname[256];
141 fgets(&(hostname[0]), 255, pipe);
142 pclose(pipe);
143 char* cpos = strchr(hostname, '\n'); *cpos = '\0';
145
147 end = start;
149
150 generateLocal_h( h,
dloc_h, -1);
151 generateLocal_op(loc,
dloc_op, -1);
152
154 {
155 std::stringstream
buff(
"");
156 buff <<
"/Sample_No" << repetition <<
"_" << hostname <<
".txt";
157 filename +=
buff.str();
158 filename = std::regex_replace(filename, std::regex("//"), "/");
159 }
163 OutFs << "\n";
165 OutFs.close();
166
167 if(repetition%10 == 9) {
168 std::cerr << "(Sample=" << std::setw(6) << repetition+1 << ")" << std::endl;
169 }
170 }
171
172 Finalize(argc, argv);
173 #ifdef GPU
174 magma_finalize();
175 #endif
176 return 0;
177}
double getETtime()
Definition EnergySpectrum.c:14
std::vector< TransSector > Sector(n_max+1)
bool checkIsFileOpen(std::ifstream &file, std::string const &filename)
Definition file_util.hpp:22
debug_print("# Determining GPU configuration.")
GPUconfig GPUconf(dim3(nBlock, nBlock, 1), dim3(nThread, nThread, 1), 0, queue)
MKL_INT Integer_t
Definition mytypes.hpp:359
baseDirName
Definition setVariablesForEnsemble.cpp:50
Integer_t const repMin
Definition setVariablesForEnsemble.cpp:31
Integer_t const repMax
Definition setVariablesForEnsemble.cpp:32
Integer_t const dloc_op
Definition setVariablesForEnsemble.cpp:41
Integer_t const dloc_h
Definition setVariablesForEnsemble.cpp:40
Integer_t const n_max
Definition setVariablesForEnsemble.cpp:27
std::stringstream buff("")