X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/7a385d92335a4707d5b0aae66e4850d137c1fe7d..3c0ea1a85b09df3bb85839ba92831fca9e10a82f:/o815/o815.cpp?ds=sidebyside diff --git a/o815/o815.cpp b/o815/o815.cpp index 4c2b28d..5271370 100644 --- a/o815/o815.cpp +++ b/o815/o815.cpp @@ -125,6 +125,8 @@ void o815::mainLoop() { for (vector::iterator parait = paraQ->allParaIds.begin(); parait != paraQ->allParaIds.end(); ++parait) *out->log << *parait << "=" << (*paraQ)[*parait] << " "; *out->log << ">" << endl << flush; + + Sim->_newParas(); progress measProg(comargs.nmeas); @@ -133,12 +135,18 @@ void o815::mainLoop() { *out->log << " " << (*obsit)->obsid; *out->log << endl << flush; - Sim->toEquilibrate = true; - for( int imeas=0; imeas::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) { - if( hypercache::readO( (*obsit)->ocid ) != -1 ) { + bool readnewObs; + int nequileftNewObs; + + hypercache::readO( (*obsit)->ocid, &readnewObs, &nequileftNewObs ); + + if ( readnewObs && nequileftNewObs < 0 ) { + (*obsit)->meas(true); + } + else { if (!nextAlready) { Sim->nextConfig(); nextAlready = true; @@ -146,8 +154,7 @@ void o815::mainLoop() { (*obsit)->meas(false); hypercache::writeO( (*obsit)->ocid ); } - else - (*obsit)->meas(true); + } while( measProg.madeStep(imeas) ) *out->log << "O815: " << measProg.done()*100 << "% of measurements done." << endl << flush; @@ -239,7 +246,7 @@ o815::comoption* o815::getOptionByVal(int val) { for (vector::iterator opit = comOptions.begin(); opit != comOptions.end(); ++opit) if ( opit->val == val ) return &(*opit); - return NULL; + exit(1); } void o815::listArg(int *target, int tlen, char *listarg) {