]> git.treefish.org Git - phys/latlib.git/blobdiff - o815/o815.cpp
modified linked variables description.
[phys/latlib.git] / o815 / o815.cpp
index 8700f675e394ef4d7bd8b20ca7dc4ebd9c703bf6..708acebe2022714784992c7879f8b11cd8cd764a 100644 (file)
@@ -10,8 +10,6 @@ using namespace std;
 extern int opterr;
 
 o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], void (*helpHeader)()) {
 extern int opterr;
 
 o815::o815(int argc, char **argv, const string& _programid, comoption specOps[], void (*helpHeader)()) {
-  long timestamp;
-
   programid = _programid;
 
   comargs.nmeas = 100;
   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);
 
   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");
   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);
   }
 
     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.idonly) {
     cout << programid << headMaster() << endl << flush;
     exit(0);
@@ -125,6 +130,8 @@ void o815::mainLoop() {
     for (vector<string>::iterator parait = paraQ->allParaIds.begin(); parait != paraQ->allParaIds.end(); ++parait)
       *out->log << *parait << "=" << (*paraQ)[*parait] << " ";
     *out->log << ">" << endl << flush;
     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);
 
     
     progress measProg(comargs.nmeas);
 
@@ -133,12 +140,18 @@ void o815::mainLoop() {
       *out->log << " " << (*obsit)->obsid;
     *out->log << endl << flush;
 
       *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) {
     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);
+       }
+       else {
          if (!nextAlready) {
            Sim->nextConfig();
            nextAlready = true;
          if (!nextAlready) {
            Sim->nextConfig();
            nextAlready = true;
@@ -146,8 +159,7 @@ void o815::mainLoop() {
          (*obsit)->meas(false);
          hypercache::writeO( (*obsit)->ocid );
        }
          (*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;
       }
       while( measProg.madeStep(imeas) ) 
        *out->log << "O815: " << measProg.done()*100 << "% of measurements done." << endl << flush;