extern int opterr;
o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], void (*helpHeader)()) {
- long timestamp;
-
programid = _programid;
comargs.nmeas = 100;
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");
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; idest<numprocs; idest++)
}
void o815::mainLoop() {
- 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);
- }
-
*out->log << "OBS: Starting main loop." << endl;
for (vector<obs*>::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit)
for (vector<string>::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);
*out->log << " " << (*obsit)->obsid;
*out->log << endl << flush;
- Sim->toEquilibrate = true;
-
for( int imeas=0; imeas<comargs.nmeas; imeas++ ) {
bool nextAlready = false;
for (vector<obs*>::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, imeas);
+ }
+ else {
if (!nextAlready) {
Sim->nextConfig();
nextAlready = true;
}
- (*obsit)->meas(false);
+ (*obsit)->meas(false, imeas);
hypercache::writeO( (*obsit)->ocid );
}
- else
- (*obsit)->meas(true);
+
}
while( measProg.madeStep(imeas) )
*out->log << "O815: " << measProg.done()*100 << "% of measurements done." << endl << flush;
for (vector<comoption>::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) {