3 #include "latlib/hypercache.h"
4 #include "latlib/progress.h"
6 o815::sim::sim(o815 *_O815, const int& _confmemSize) {
9 hypercache::initC(O815->programid, O815->comargs.nequi, O815->comargs.nskip, O815->comargs.confcache.first, &confMem, _confmemSize, O815->comargs.confcache.second, log);
10 nequi = O815->comargs.nequi;
11 nskip = O815->comargs.nskip;
12 confmemSize = confmemSize;
15 void o815::sim::nextConfig() {
16 bool readAtLeastOneConfig = hypercache::readC();
18 /* equilibrate if necessary */
19 if (hypercache::getNEquiLeft() > 0) {
20 *log << "SIM: Starting equilibration." << endl << flush;
21 if (hypercache::getNEquiLeft() != nequi)
22 *log << "SIM: " << hypercache::getNEquiLeft() << " of " << nequi << " equilibration steps left after virtual equilibration." << endl << flush;
23 progress equiProg(hypercache::getNEquiLeft());
24 for ( int iequi = 0; iequi < hypercache::getNEquiLeft(); iequi++ ) {
26 while( equiProg.madeStep(iequi) ) *log << "SIM: " << equiProg.done()*100 << "% of equilibration done." << endl << flush;
30 /* make skip if no config could be read or one skip is left after equilibration */
31 if ( (! readAtLeastOneConfig) || (hypercache::getNEquiLeft() == 0) ) {
32 cout << "SKIPPING" << endl;
33 for (int iskip=0; iskip<nskip; iskip++) {
39 cout << hypercache::getNEquiLeft() << endl;