X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/3db2602cfe30c61445e89cc334541ebb4ff76ed8..71a0a66deb80dc52590280b3aa470b970862db93:/o815/o815.h?ds=inline diff --git a/o815/o815.h b/o815/o815.h index 31d36da..9f980f7 100644 --- a/o815/o815.h +++ b/o815/o815.h @@ -5,9 +5,11 @@ #include #include #include +#include #include "latlib/paraq.h" #include "latlib/writeout.h" +#include "latlib/hypercache.h" using namespace std; @@ -15,20 +17,40 @@ class obs; class o815 { public: + class obs { public: - obs(const string& obsid, o815 *_O815); + obs(const string& _obsid, const string& _datadesc, o815 *_O815, const int& _obsmemSize); void finish(); - void meas(); + void meas(bool loadedobs); + void start(); + string getDataDesc() { return datadesc; }; + int ocid; + string obsid; private: virtual void _meas(bool loadedobs)=0; virtual void _finish()=0; + virtual void _start()=0; protected: o815 *O815; char *obsMem; - ostream *oout; - ostream *olog; - string obsid; + string simid, datadesc; + ostream *out, *log; + paraq* paraQ; + }; + + class sim { + public: + sim(o815 *_O815, const int& _confmemSize); + void nextConfig(); + char *confMem; + virtual void _newParas()=0; + private: + virtual void _makeSweep()=0; + protected: + o815 *O815; + ostream *log; + int nequi, nskip, confmemSize; }; struct { @@ -39,22 +61,42 @@ class o815 { pair obscache; pair confcache; string outdir; - bool idonly; - bool showjobnum; + int idonly; + int showjobnum; } comargs; - o815(int argc, char **argv, const string& programid); + struct comoption { + string name; + int has_arg; + int *flag; + int val; + string optdesc; + string argdesc; + }; + + 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(); + 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; + vector lonelyArgs; private: + vector comOptions; MPI_Status mpiStatus; int numprocs, rank; static void listArg(int *target, int tlen, char *listarg); - void parseArgs(int argc, char **argv); + void parseArgs(int argc, char **argv, comoption specOps[]); string programid; - string headMaster(); + int nextParas(); + comoption* getOptionByVal(int val); }; #endif