From 6ad2fe3a6550b77888c46b17f81d8ab74406649d Mon Sep 17 00:00:00 2001 From: Alex Schmidt Date: Wed, 19 Jun 2013 09:58:18 +0200 Subject: [PATCH] ... --- configcache.cpp | 26 ++++++++++++++++---------- configcache.h | 4 ++-- hypercache.cpp | 2 +- o815/sim.cpp | 20 +++----------------- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/configcache.cpp b/configcache.cpp index f642e9f..b6edc17 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -72,8 +72,6 @@ bool configcache::isValidInFile(const string& infile, infiledesc *filedesc) string truncIn, truncOut; filedesc->filename = infile; - filedesc->doVirtualEquilibration = false; - filedesc->firstUsedConfig = true; if( infile.size() < 4 ) return false; @@ -98,8 +96,6 @@ bool configcache::isValidInFile(const string& infile, infiledesc *filedesc) return false; break; case 2: - if (atoi(inParts) < NEQUI) - filedesc->doVirtualEquilibration = true; filedesc->nequi = atoi(inParts); break; case 3: @@ -205,6 +201,13 @@ void configcache::readConfig(bool& readnewconfig, int& nequileft, vector 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 ); @@ -219,9 +222,11 @@ void configcache::readConfig(bool& readnewconfig, int& nequileft, vector::iterator getNextInfile(vector *excludeFileHashes); int nequileft_internal; + + bool doVirtualEquilibration, firstUsedConfig; }; #endif diff --git a/hypercache.cpp b/hypercache.cpp index 0f8d856..1648a84 100644 --- a/hypercache.cpp +++ b/hypercache.cpp @@ -81,7 +81,7 @@ bool hypercache::readC() { readAtLeastOneConfig = true; } - if ( nequileft < 0 ) + if ( nequileft < 0 && readnewconfig_nonex ) activeCFile = fileOfPath(C->getInFileName()); else activeCFile = ""; diff --git a/o815/sim.cpp b/o815/sim.cpp index 6abf7c6..fe30ec5 100644 --- a/o815/sim.cpp +++ b/o815/sim.cpp @@ -13,14 +13,7 @@ o815::sim::sim(o815 *_O815, const int& _confmemSize) { } 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) { @@ -32,21 +25,14 @@ void o815::sim::nextConfig() { _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