X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/1a5483766d4056eec087099f2e411aef51b63cf5..e82cb4b1f88e18f5b9487e49f79b9a091942132f:/o815/o815.h?ds=sidebyside diff --git a/o815/o815.h b/o815/o815.h index 33693b0..4f741a1 100644 --- a/o815/o815.h +++ b/o815/o815.h @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include "latlib/paraq.h" #include "latlib/writeout.h" @@ -19,36 +19,39 @@ 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(); + 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: o815 *O815; char *obsMem; - string obsid, simid, datadesc; + string simid, datadesc; ostream *out, *log; - int ocid; + paraq* paraQ; }; class sim { public: sim(o815 *_O815, const int& _confmemSize); void nextConfig(); - bool toEquilibrate; char *confMem; + virtual void _newParas()=0; + int nequi, nskip; private: - virtual void _reset()=0; - virtual void _makeSweep(int nsweep)=0; + virtual void _makeSweep()=0; protected: o815 *O815; ostream *log; - int nequi, nskip; + int confmemSize; }; struct { @@ -59,11 +62,21 @@ 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; @@ -71,14 +84,19 @@ class o815 { 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: - MPI_Status mpiStatus; + vector comOptions; 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; int nextParas(); + comoption* getOptionByVal(int val); }; #endif