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);
11 nequi = O815->comargs.nequi;
12 nskip = O815->comargs.nskip;
13 confmemSize = confmemSize;
16 void o815::sim::nextConfig() {
17 int nequileft = hypercache::readC();
19 if ( nequileft != -1 ) {
20 /* try to use excluded config-file for equilibration */
21 if (toEquilibrate && hypercache::CFilesLeft() > 0) {
23 char *tmpconfig = (char*) malloc(confmemSize);
25 memcpy (tmpconfig, confMem, confmemSize);
26 exnequileft = hypercache::read1CForEqui();
28 if (exnequileft < nequileft) {
29 *log << "SIM: Found suitable excluded config-file configuration for equilibration." << endl << flush;
30 nequileft = exnequileft;
33 *log << "SIM: Could not find suitable excluded config-file configuration for equilibration." << endl << flush;
34 memcpy (confMem, tmpconfig, confmemSize);
40 if(toEquilibrate && nequileft > 0) {
42 *log << "SIM: Starting equilibration." << endl << flush;
43 if (nequileft != nequi)
44 *log << "SIM: " << nequileft << " of " << nequi << " equilibration steps left after virtual equilibration." << endl << flush;
45 progress equiProg(nequileft);
46 for( int iequi=0; iequi<nequileft; iequi++ ) {
48 while( equiProg.madeStep(iequi) ) *log << "SIM: " << equiProg.done()*100 << "% of equilibration done." << endl << flush;
56 toEquilibrate = false;