7 #include "configcache.h"
13 static int initO(const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
14 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_FULL, ostream *_log=NULL) {
16 initCache(&Os.back(), cacheid, nequi, nskip, datadir, configmem, configMemSize, cachemode, _log);
19 static void initC(const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
20 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_FULL, ostream *_log=NULL) {
21 initCache(&C, cacheid, nequi, nskip, datadir, configmem, configMemSize, cachemode, _log);
22 mostEquilibratedConfig.second = new char[configMemSize];
25 static int getNEquiLeft() { return nequileft; }
27 static void addPara(const string& parid, const double& val=0);
28 static void setPara(const string& parid, const double& value);
29 static void readO(int obsid, bool& readnewconfig, int& nequileft);
31 static void writeO(int obsid, int actnequi);
33 static void writeHeaderO(int obsid, const string& headerid, char *header, long unsigned int size, int actnequi) { Os[obsid]->writeHeader(headerid, header, size, actnequi); }
34 static void *getHeaderO(int obsid, const string& headerid) { Os[obsid]->getHeader(headerid); }
35 static void writeHeaderC(const string& headerid, char *header, long unsigned int size, int actnequi) { C->writeHeader(headerid, header, size, actnequi); }
36 static void *getHeaderC(const string& headerid) { C->getHeader(headerid); }
38 static void finalize();
40 static int CFilesLeft() { return C->inFilesLeft(); }
48 static void initCache(configcache **cache,
49 const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
50 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_FULL, ostream* _log=NULL);
52 static void initCache( configcache **cache,
53 const string& cacheid, char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_FULL);
55 static configcache *C;
56 static vector<configcache*> Os;
57 static vector<para> delayedParaAdd;
58 static vector<para> delayedParaSet;
60 static string fileOfPath(const string& dressedfile);
61 static string activeCFile;
62 static vector<unsigned long> parentConfigs;
63 static void addParentConfig(const unsigned long *parentconfig);
70 static pair<int, char*> mostEquilibratedConfig;