X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/7a385d92335a4707d5b0aae66e4850d137c1fe7d..refs/heads/master:/o815/o815.h?ds=inline diff --git a/o815/o815.h b/o815/o815.h index 8b00437..0e2a611 100644 --- a/o815/o815.h +++ b/o815/o815.h @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -20,15 +19,16 @@ class o815 { class obs { public: - obs(const string& _obsid, const string& _datadesc, o815 *_O815, const int& _obsmemSize); + obs(const string& _obsid, const string& _datadesc, o815 *_O815, const int& _obsmemSize, const string& _obsidpostfix=""); void finish(); - void meas(bool loadedobs); + void meas(bool loadedobs, const int& nthmeas); void start(); string getDataDesc() { return datadesc; }; int ocid; string obsid; + string obsidpostfix; private: - virtual void _meas(bool loadedobs)=0; + virtual void _meas(bool loadedobs, const int& nthmeas)=0; virtual void _finish()=0; virtual void _start()=0; protected: @@ -36,23 +36,26 @@ class o815 { char *obsMem; string simid, datadesc; ostream *out, *log; - void printParas(); paraq* paraQ; }; class sim { public: sim(o815 *_O815, const int& _confmemSize); + ~sim (); void nextConfig(); - bool toEquilibrate; char *confMem; + virtual void _newParas()=0; + int nequi, nskip; + void resetConfig(); private: - virtual void _reset()=0; - virtual void _makeSweep(int nsweep)=0; + virtual void _makeSweep()=0; + virtual void _resetConfig()=0; + char *startConfiguration; protected: o815 *O815; ostream *log; - int nequi, nskip, confmemSize; + int confmemSize; }; struct { @@ -65,6 +68,7 @@ class o815 { string outdir; int idonly; int showjobnum; + string startconfig; } comargs; struct comoption { @@ -77,13 +81,14 @@ class o815 { }; o815(int argc, char **argv, const string& _programid, comoption specOps[]=NULL, void (*helpHeader)()=NULL); + void postParaInit(); ~o815(); paraq *paraQ; writeout *out; vector observables; sim* Sim; void mainLoop(); - string headMaster(); + string headMaster( bool hashedrange=false ); void addPara(const string& paraid, const double& paraDefault); void addComOption(const char* name, int has_arg, int *flag, int val, const char* optdesc, const char* argdesc); vector< pair > parsedSpecOps; @@ -91,13 +96,14 @@ class o815 { private: vector comOptions; - MPI_Status mpiStatus; int numprocs, rank; static void listArg(int *target, int tlen, char *listarg); void parseArgs(int argc, char **argv, comoption specOps[]); string programid; int nextParas(); comoption* getOptionByVal(int val); + static void readCacheArgs(const string& arg, string& cachedir, int& cachemode); + unsigned long hash(const string& str); }; #endif