27 : simulatorPtr_(&simulator),
28 systemPtr_(&(simulator.system())),
29 randomPtr_(&(simulator.random())),
30 cudaRandomPtr_(&(simulator.cudaRandom())),
88 double oldHamiltonian = simulator().hamiltonian();
91 simulator().saveState();
94 simulator().clearData();
97 attemptMoveTimer_.start();
99 attemptMoveTimer_.stop();
102 compressorTimer_.start();
103 int compress = simulator().compressor().compress();
105 compressorTimer_.stop();
107 bool isConverged =
false;
110 simulator().restoreState();
115 componentTimer_.start();
116 simulator().computeWc();
118 if (simulator().needsCc() || simulator().needsDc()){
121 simulator().computeCc();
124 if (simulator().needsDc()){
125 simulator().computeDc();
127 componentTimer_.stop();
130 hamiltonianTimer_.start();
131 simulator().computeHamiltonian();
132 double newHamiltonian = simulator().hamiltonian();
133 hamiltonianTimer_.stop();
137 decisionTimer_.start();
138 double weight = exp(-(newHamiltonian - oldHamiltonian));
139 accept = random().metropolis(weight);
142 simulator().clearState();
144 simulator().restoreState();
146 decisionTimer_.stop();
165 double total = totalTimer_.time();
167 <<
"Total" << std::setw(17) <<
"Per Move" << std::setw(14) <<
"Fraction" <<
"\n";
168 out <<
"Attempt Move: "
169 <<
Dbl(attemptMoveTimer_.time(), 9, 3) <<
" s, "
170 <<
Dbl(attemptMoveTimer_.time()/nAttempt_, 9, 3) <<
" s, "
171 <<
Dbl(attemptMoveTimer_.time()/total, 9, 3) <<
"\n";
172 out <<
"Compressor: "
173 <<
Dbl(compressorTimer_.time(), 9, 3) <<
" s, "
174 <<
Dbl(compressorTimer_.time()/nAttempt_, 9, 3) <<
" s, "
175 <<
Dbl(compressorTimer_.time()/total, 9, 3) <<
"\n";
176 out <<
"Compute eigen-components: "
177 <<
Dbl(componentTimer_.time(), 9, 3) <<
" s, "
178 <<
Dbl(componentTimer_.time()/nAttempt_, 9, 3) <<
" s, "
179 <<
Dbl(componentTimer_.time()/total, 9, 3) <<
"\n";
180 out <<
"Compute Hamiltonian: "
181 <<
Dbl(hamiltonianTimer_.time(), 9, 3) <<
" s, "
182 <<
Dbl(hamiltonianTimer_.time()/nAttempt_, 9, 3) <<
" s, "
183 <<
Dbl(hamiltonianTimer_.time()/total, 9, 3) <<
"\n";
184 out <<
"Accept or Reject: "
185 <<
Dbl(decisionTimer_.time(), 9, 3) <<
" s, "
186 <<
Dbl(decisionTimer_.time()/nAttempt_, 9, 3) <<
" s, "
187 <<
Dbl(decisionTimer_.time()/total, 9, 3) <<
"\n";
188 out <<
"total time: "
189 <<
Dbl(total, 9, 3) <<
" s, "
190 <<
Dbl(total/nAttempt_, 9, 3) <<
" s \n";