X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/71e93c2cca7c6f967c3c77c3e26c037ad4f4f555..a2b065a04a23009d81caab4ce169497b042b352b:/o815/o815.cpp diff --git a/o815/o815.cpp b/o815/o815.cpp index 3511d80..956ad2e 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,11 +86,28 @@ 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); } + if( comargs.showjobnum ) { + for( int i=1; i<=paraQ->getTotalJobs(); i++ ) { + if( paraQ->getTotalJobs()%i == 0 ) cout << paraQ->getTotalJobs()/i << "@" << i << " "; + } + cout << endl; + exit(0); + } + if(rank==0) { timestamp = time(NULL); for(int idest=1; idestgetTotalJobs(); i++ ) { - if( paraQ->getTotalJobs()%i == 0 ) cout << paraQ->getTotalJobs()/i << "@" << i << " "; - } - cout << endl; - exit(0); - } - *out->log << "OBS: Starting main loop." << endl; for (vector::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) @@ -141,7 +146,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);