X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/4d1416455c49f0ba19954ca80a72b72f9dfcd33e..dde851eb3186dbb51898dfe8fc530fce1e0a4cd3:/o815/sim.cpp diff --git a/o815/sim.cpp b/o815/sim.cpp index 2e68ae2..6abf7c6 100644 --- a/o815/sim.cpp +++ b/o815/sim.cpp @@ -3,33 +3,52 @@ #include "latlib/hypercache.h" #include "latlib/progress.h" -o815::sim::sim(o815 *_O815, const int& confmemSize) { +o815::sim::sim(o815 *_O815, const int& _confmemSize) { O815 = _O815; log = O815->out->log; - hypercache::initC(O815->programid, O815->comargs.nequi, O815->comargs.nskip, O815->comargs.confcache.first, &confMem, confmemSize, O815->comargs.confcache.second, log); - toEquilibrate = true; + hypercache::initC(O815->programid, O815->comargs.nequi, O815->comargs.nskip, O815->comargs.confcache.first, &confMem, _confmemSize, O815->comargs.confcache.second, log); nequi = O815->comargs.nequi; nskip = O815->comargs.nskip; + confmemSize = confmemSize; } void o815::sim::nextConfig() { - int nequileft = hypercache::readC(); + bool readnewconfig; + int nequileftReadConfig; + bool skippedInEqui = false; + bool readNoSingleConfig = true; + bool createdNoNewConfigs = true; + bool readAtLeastOneConfig; - if ( nequileft != -1 ) { - if(toEquilibrate) { - _reset(); - *log << "SIM: Starting equilibration." << endl << flush; - if (nequileft != nequi) - *log << "SIM: " << nequileft << " of " << nequi << " equilibration steps left after virtual equilibration." << endl << flush; - progress equiProg(nequileft); - for( int iequi=0; iequi 0) { + *log << "SIM: Starting equilibration." << endl << flush; + if (hypercache::getNEquiLeft() != nequi) + *log << "SIM: " << hypercache::getNEquiLeft() << " of " << nequi << " equilibration steps left after virtual equilibration." << endl << flush; + progress equiProg(hypercache::getNEquiLeft()); + for ( int iequi = 0; iequi < hypercache::getNEquiLeft(); iequi++ ) { + _makeSweep(); + while( equiProg.madeStep(iequi) ) *log << "SIM: " << equiProg.done()*100 << "% of equilibration done." << endl << flush; + } + skippedInEqui = true; + createdNoNewConfigs = false; + } + + /* make skip if no config could be read */ + if ( (! readAtLeastOneConfig) ) { + cout << "SKIPPING" << endl; + for (int iskip=0; iskip