X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/3db2602cfe30c61445e89cc334541ebb4ff76ed8..22d4f36d4bbd95447a454cceb9084af46927e023:/o815/o815.cpp diff --git a/o815/o815.cpp b/o815/o815.cpp index 956eb09..9fcae16 100644 --- a/o815/o815.cpp +++ b/o815/o815.cpp @@ -50,6 +50,22 @@ o815::o815(int argc, char **argv, const string& _programid) { out = new writeout(comargs.outdir, programid+headMaster(), rank, numprocs, timestamp); } +void o815::mainLoop() { + for (vector::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) { + (*obsit)->start(); + } + + for (int i=0; i<100; i++) { + for (vector::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) { + (*obsit)->meas(); + } + } + + for (vector::iterator obsit = observables.begin(); obsit != observables.end(); ++obsit) { + (*obsit)->finish(); + } +} + void o815::parseArgs(int argc, char **argv) { int opt = 0; @@ -121,3 +137,12 @@ string o815::headMaster() return hm.str(); } +o815::~o815() { + if(comargs.outdir=="") { + MPI_Barrier(MPI_COMM_WORLD); + if(rank==0) + cout << "#end" << endl << flush; + } + delete out; + MPI_Finalize(); +}