string truncIn, truncOut;
filedesc->filename = infile;
- filedesc->doVirtualEquilibration = false;
- filedesc->firstUsedConfig = true;
if( infile.size() < 4 ) return false;
return false;
break;
case 2:
- if (atoi(inParts) < NEQUI)
- filedesc->doVirtualEquilibration = true;
filedesc->nequi = atoi(inParts);
break;
case 3:
while( (!inFile.is_open()) && inFiles.size() > 0 ) {
openFileDesc = *inFileIt;
+ if (openFileDesc.nequi < NEQUI)
+ doVirtualEquilibration = true;
+ else
+ doVirtualEquilibration = false;
+
+ firstUsedConfig = true;
+
if(log) *log << "CCACHE: Opening dat-file: " << inFileIt->filename << endl << flush;
inFile.open( (DATADIR + "/" + inFileIt->filename).c_str(), std::ios::binary );
if( inFile.is_open() )
{
- if (openFileDesc.doVirtualEquilibration) {
+ if (doVirtualEquilibration) {
+ cout << nequileft_internal << endl;
+
if(log) *log << "CCACHE: Trying virtual equilibration." << endl << flush;
- openFileDesc.doVirtualEquilibration = false;
+ doVirtualEquilibration = false;
for (iDidVirtualSkips=0; iDidVirtualSkips < (NEQUI-openFileDesc.nequi)/openFileDesc.nskip; iDidVirtualSkips++) {
if( readFullBlock(tmpConfig, configSize) != configSize || ! inFile.is_open() )
break;
nequileft_internal = NEQUI - openFileDesc.nequi - (iDidVirtualSkips+1)*openFileDesc.nskip;
cout << "blabla:" << nequileft_internal << endl;
readnewconfig = true;
- openFileDesc.firstUsedConfig = false;
+ firstUsedConfig = false;
}
}
}
{
memcpy(configMem, tmpConfig, configSize);
readnewconfig = true;
- if (openFileDesc.firstUsedConfig) {
- openFileDesc.firstUsedConfig = false;
- if (NEQUI < openFileDesc.nequi)
+ if (firstUsedConfig) {
+ firstUsedConfig = false;
+ if (openFileDesc.nequi < NEQUI)
nequileft_internal = NEQUI - openFileDesc.nequi - iDidVirtualSkips*openFileDesc.nskip;
else
nequileft_internal = NEQUI - openFileDesc.nequi;
inFiles.clear();
refetchDataFiles = true;
+ nequileft_internal = NEQUI;
}
configcache::~configcache()
}
void o815::sim::nextConfig() {
- bool readnewconfig;
- int nequileftReadConfig;
- bool skippedInEqui = false;
- bool readNoSingleConfig = true;
- bool createdNoNewConfigs = true;
- bool readAtLeastOneConfig;
-
- readAtLeastOneConfig = hypercache::readC();
+ bool readAtLeastOneConfig = hypercache::readC();
/* equilibrate if necessary */
if (hypercache::getNEquiLeft() > 0) {
_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) ) {
+ /* make skip if no config could be read or one skip is left after equilibration */
+ if ( (! readAtLeastOneConfig) || (hypercache::getNEquiLeft() == 0) ) {
cout << "SKIPPING" << endl;
for (int iskip=0; iskip<nskip; iskip++) {
_makeSweep();
}
- createdNoNewConfigs = false;
- }
-
- if (! createdNoNewConfigs) {
- cout << "::" << hypercache::getNEquiLeft() << endl;
hypercache::writeC();
}