X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/7d17aa8c6bde2e49502401aa190a900bd4688362..238fccf7dd50a69b5825f4544b3e247bfbf4e417:/o815/o815.h?ds=inline diff --git a/o815/o815.h b/o815/o815.h index 467eca9..1b94170 100644 --- a/o815/o815.h +++ b/o815/o815.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "latlib/paraq.h" #include "latlib/writeout.h" @@ -25,6 +26,7 @@ class o815 { void start(); string getDataDesc() { return datadesc; }; int ocid; + string obsid; private: virtual void _meas(bool loadedobs)=0; virtual void _finish()=0; @@ -32,8 +34,9 @@ class o815 { protected: o815 *O815; char *obsMem; - string obsid, simid, datadesc; + string simid, datadesc; ostream *out, *log; + paraq* paraQ; }; class sim { @@ -42,13 +45,14 @@ class o815 { void nextConfig(); bool toEquilibrate; char *confMem; + virtual void _newParas() {}; private: virtual void _reset()=0; virtual void _makeSweep(int nsweep)=0; protected: o815 *O815; ostream *log; - int nequi, nskip; + int nequi, nskip, confmemSize; }; struct { @@ -59,11 +63,20 @@ 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); ~o815(); paraq *paraQ; writeout *out; @@ -72,14 +85,19 @@ class o815 { 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; int nextParas(); + comoption* getOptionByVal(int val); }; #endif