From: Alexander Schmidt Date: Wed, 13 Nov 2013 09:51:43 +0000 (+0100) Subject: Setup o815 skeleton. X-Git-Url: http://git.treefish.org/~alex/phys/heatbath.git/commitdiff_plain/c721fd42d0e3b23e8aa84d998bc8d97e5d8dfc2d Setup o815 skeleton. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3417d67..bedfec9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,6 @@ SET(CMAKE_BUILD_TYPE Release) add_subdirectory(latlib) -add_executable(heatbath heatbath.cc) +add_executable(heatbath heatbath.cpp) #set_target_properties(phi4iso-local PROPERTIES COMPILE_DEFINITIONS "LOCAL_UPDATE_ALGORITHM") -target_link_libraries(heatbath o815) +target_link_libraries(heatbath o815 gsl gslcblas lat_neigh) diff --git a/heatbath.cc b/heatbath.cc deleted file mode 100644 index 086f367..0000000 --- a/heatbath.cc +++ /dev/null @@ -1,5 +0,0 @@ -int main (int argc, char *argv[]) -{ - - return 0; -} diff --git a/heatbath.cpp b/heatbath.cpp new file mode 100644 index 0000000..70e2140 --- /dev/null +++ b/heatbath.cpp @@ -0,0 +1,46 @@ +#include "latlib/o815/o815.h" + +#include "sim.hpp" + +o815 *O815; +sim *Sim; + +o815::comoption specOps[] = { + { "mass", required_argument, NULL, 'm', "set mass", "min:max:inc" }, + { "", 0, NULL, 0, "", "" } +}; + +void parseSpecOps() +{ + for (int isopt = 0; isopt < O815->parsedSpecOps.size(); isopt++) + switch(O815->parsedSpecOps[isopt].first) { + case 'm': + O815->paraQ->addRange("mass", O815->parsedSpecOps[isopt].second); + break; + } +} + +void helpHeader() +{ + cout << "Usage: ./heatbath [OPTIONS] [obs1] ... [obsN]" << endl << endl; +} + +int main (int argc, char *argv[]) +{ + O815 = new o815(argc, argv, "heatbath", specOps, &helpHeader); + + O815->addPara("mass", 1); + + parseSpecOps(); + + O815->postParaInit(); + + O815->Sim = new sim(O815); + + //parseLonelyArgs(); + + O815->mainLoop(); + + delete O815; + return 0; +} diff --git a/latlib b/latlib index 2918744..a2b065a 160000 --- a/latlib +++ b/latlib @@ -1 +1 @@ -Subproject commit 2918744d037d9254538dd84311aa346576e0fe04 +Subproject commit a2b065a04a23009d81caab4ce169497b042b352b diff --git a/sim.hpp b/sim.hpp new file mode 100644 index 0000000..e58c70d --- /dev/null +++ b/sim.hpp @@ -0,0 +1,46 @@ +#ifndef SIM_HPP +#define SIM_HPP + +#include + +#include "latlib/neigh.h" + +class sim : public o815::sim { +public: + struct siteconf { + int k[2][4]; + int l[2][4]; + }; + sim(o815 *_O815); + siteconf* conf; + int LSIZE4; + +private: + void _makeSweep(); + void _newParas(); + + gsl_rng* rangsl; + + neigh *nb; +}; + +sim::sim(o815 *_O815) : o815::sim( _O815, + sizeof(siteconf)* + (_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { + conf = (siteconf*)confMem; + LSIZE4 = _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; + + rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); + gsl_rng_set(rangsl, time(NULL)); + + nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]); +} + +void sim::_makeSweep() { +} + +void sim::_newParas() { + /* reset variables */ +} + +#endif