#include <vector>
#include <mpi.h>
#include <stdlib.h>
+#include <getopt.h>
#include "latlib/paraq.h"
#include "latlib/writeout.h"
char *obsMem;
string simid, datadesc;
ostream *out, *log;
- void printParas();
paraq* paraQ;
};
public:
sim(o815 *_O815, const int& _confmemSize);
void nextConfig();
- bool toEquilibrate;
char *confMem;
+ virtual void _newParas()=0;
private:
- virtual void _reset()=0;
- virtual void _makeSweep(int nsweep)=0;
+ virtual void _makeSweep()=0;
protected:
o815 *O815;
ostream *log;
- int nequi, nskip;
+ int nequi, nskip, confmemSize;
};
struct {
pair<string,int> obscache;
pair<string,int> 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;
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<int,char*> > parsedSpecOps;
+ vector<char*> lonelyArgs;
private:
+ vector<comoption> 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