From: Alex Schmidt Date: Thu, 20 Jun 2013 07:29:33 +0000 (+0200) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/3c0ea1a85b09df3bb85839ba92831fca9e10a82f ... --- diff --git a/configcache.cpp b/configcache.cpp index 0cabc9d..62519a4 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -174,11 +174,9 @@ void * configcache::getHeader(const string& headerid) { return NULL; } -/* returns number of equilibration-steps left with new read configuration - or zero if no new configuration was read */ -void configcache::readConfig(bool& readnewconfig, int& nequileft, vector *excludeFileHashes) +void configcache::readConfig(bool *readnewconfig, int *nequileft, vector *excludeFileHashes) { - readnewconfig = false; + *readnewconfig = false; if(DATADIR == "" || MODE == CACHE_MODE_DISABLED) return; @@ -193,8 +191,8 @@ void configcache::readConfig(bool& readnewconfig, int& nequileft, vector *excludeFileHashes=NULL); + void readConfig(bool *readnewconfig, int *nequileft, vector *excludeFileHashes=NULL); void writeConfig(int actnequi); void addPara(const string& parid, const double& val=0); void setPara(const string& parid, const double& value); diff --git a/hypercache.cpp b/hypercache.cpp index 4ec6339..fd2bbcb 100644 --- a/hypercache.cpp +++ b/hypercache.cpp @@ -74,7 +74,7 @@ string hypercache::fileOfPath(const string& dressedfile) { bool hypercache::readC() { bool readAtLeastOneConfig; - C->readConfig(readAtLeastOneConfig, nequileft, &parentConfigs); + C->readConfig(&readAtLeastOneConfig, &nequileft, &parentConfigs); if ( nequileft < 0 && readAtLeastOneConfig ) activeCFile = fileOfPath(C->getInFileName()); @@ -93,7 +93,7 @@ bool hypercache::readC() { int nequileftReadConfig_ex; memcpy (tmpconfig, C->getConfigMem(), C->getConfigSize()); - C->readConfig(readnewconfig_ex, nequileftReadConfig_ex, NULL); + C->readConfig(&readnewconfig_ex, &nequileftReadConfig_ex, NULL); if (! readnewconfig_ex) { *log << "HYPERCACHE: No more excluded config-files for possible equilibration available." << endl << flush; @@ -118,7 +118,6 @@ bool hypercache::readC() { /* storing most equilibrated config */ if ( nequileft < mostEquilibratedConfig.first && readAtLeastOneConfig ) { - //*log << "HYPERCACHE: Storing a copy of so far most equilibrated config with nequileft = " << nequileft << endl << flush; mostEquilibratedConfig.first = nequileft; memcpy(mostEquilibratedConfig.second, C->getConfigMem(), C->getConfigSize()); } @@ -128,7 +127,6 @@ bool hypercache::readC() { *log << "HYPERCACHE: Injecting back most equilibrated stored config with nequileft = " << mostEquilibratedConfig.first << endl << flush; nequileft = mostEquilibratedConfig.first; memcpy(C->getConfigMem(), mostEquilibratedConfig.second, C->getConfigSize()); - //readAtLeastOneConfig = false; } return readAtLeastOneConfig; @@ -157,10 +155,10 @@ void hypercache::writeO(int obsid) { lastWrittenObsEquis = NEQUI-nequileft-NSKIP; } -void hypercache::readO(int obsid, bool& readnewconfig, int& nequileft) { - Os[obsid]->readConfig(readnewconfig, nequileft); +void hypercache::readO(int obsid, bool *readNewObsConfig, int *nequiObsLeft) { + Os[obsid]->readConfig(readNewObsConfig, nequiObsLeft); - if ( nequileft < 0 ) { + if ( *readNewObsConfig && *nequiObsLeft < 0 ) { unsigned long *parentconfig = (unsigned long*)Os[obsid]->getHeader("concurrent_cfile"); if ( parentconfig != NULL ) addParentConfig(parentconfig); diff --git a/hypercache.h b/hypercache.h index efb97fa..c5f548a 100644 --- a/hypercache.h +++ b/hypercache.h @@ -26,7 +26,7 @@ class hypercache { static void addPara(const string& parid, const double& val=0); static void setPara(const string& parid, const double& value); - static void readO(int obsid, bool& readnewconfig, int& nequileft); + static void readO(int obsid, bool *readNewObsConfig, int *nequiObsLeft); static bool readC(); static void writeO(int obsid); static void writeC(); diff --git a/o815/o815.cpp b/o815/o815.cpp index 3511d80..5271370 100644 --- a/o815/o815.cpp +++ b/o815/o815.cpp @@ -141,7 +141,7 @@ void o815::mainLoop() { bool readnewObs; int nequileftNewObs; - hypercache::readO( (*obsit)->ocid, readnewObs, nequileftNewObs ); + hypercache::readO( (*obsit)->ocid, &readnewObs, &nequileftNewObs ); if ( readnewObs && nequileftNewObs < 0 ) { (*obsit)->meas(true);