X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/36bc55ceb7b62569c7604f28b3e53bc2e42cf0ce..3675da388f7ca12cdc6d93f4a8b94ef4bdd96b19:/o815/o815.cpp diff --git a/o815/o815.cpp b/o815/o815.cpp index 878df0f..708aceb 100644 --- a/o815/o815.cpp +++ b/o815/o815.cpp @@ -10,8 +10,6 @@ using namespace std; extern int opterr; o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], void (*helpHeader)()) { - long timestamp; - programid = _programid; comargs.nmeas = 100; @@ -29,8 +27,6 @@ o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); - paraQ = new paraq(numprocs, rank); - addComOption("lsize", required_argument, NULL, 'L', "define lattice size", "xsize:tsize"); addComOption("nmeas", required_argument, NULL, 'N', "set number of measurements", "nmeas"); addComOption("skip", required_argument, NULL, 'S', "set number of skips between configs", "nskip"); @@ -90,6 +86,15 @@ o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], exit(0); } + paraQ = new paraq(numprocs, rank); + + hypercache::addPara("lx", comargs.lsize[0]); + hypercache::addPara("lt", comargs.lsize[1]); +} + +void o815::postParaInit() { + long timestamp; + if(comargs.idonly) { cout << programid << headMaster() << endl << flush; exit(0); @@ -135,26 +140,26 @@ void o815::mainLoop() { *out->log << " " << (*obsit)->obsid; *out->log << endl << flush; - Sim->nequileft = comargs.nequi; - for( int imeas=0; imeas::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) { bool readnewObs; int nequileftNewObs; - hypercache::readO( (*obsit)->ocid, readnewObs, nequileftNewObs ); + hypercache::readO( (*obsit)->ocid, &readnewObs, &nequileftNewObs ); - if( ! readnewObs ) { + if ( readnewObs && nequileftNewObs < 0 ) { + (*obsit)->meas(true); + } + else { if (!nextAlready) { Sim->nextConfig(); nextAlready = true; } (*obsit)->meas(false); - hypercache::writeO( (*obsit)->ocid, comargs.nmeas ); + hypercache::writeO( (*obsit)->ocid ); } - else - (*obsit)->meas(true); + } while( measProg.madeStep(imeas) ) *out->log << "O815: " << measProg.done()*100 << "% of measurements done." << endl << flush;