Commit 3713b5ca authored by Lukas Weber's avatar Lukas Weber
Browse files

forgot to adjust header

parent c7005aee
......@@ -9,15 +9,10 @@ set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O3 -std=c++17 -pedantic ${MPI_LINK_FLAGS} ${MPI_COMPILE_FLAGS}")
include_directories(${MPI_INCLUDE_PATH})
option(MEASUREMENTS_APPEND "Use append mode for writing measurements" OFF)
option(DUMP_BUFFER "dump uses buffered writeout" OFF)
if(MEASUREMENTS_APPEND)
add_definitions(-DMCL_MEASUREMENTS_APPEND=1)
endif()
if(DUMP_BUFFER)
add_definitions(-DMCL_DUMP_BUFFER=1)
endif()
set(HDF5_USE_STATIC_LIBRARIES)
find_package(HDF5 REQUIRED)
include_directories(${HDF5_INCLUDE_DIR})
add_definitions(${HDF5_C_DEFINITIONS})
set(SRCs
dump.cpp
......@@ -33,7 +28,7 @@ set(SRCs
)
add_library(load_leveller STATIC ${SRCs})
target_link_libraries(load_leveller ${MPI_LIBRARIES})
target_link_libraries(load_leveller ${MPI_LIBRARIES} ${HDF5_C_LIBRARY_hdf5})
SET(MCPREFIX "$ENV{HOME}/mc/" CACHE PATH "Prefix prepended to
......
[requires]
jsonformoderncpp/3.5.0@vthiery/stable
fmt/5.2.1@bincrafters/stable
hdf5/1.10.2-dm2@lweber/mc
[generators]
cmake
[options]
fmt:header_only=True
hdf5:shared=False
......@@ -2,6 +2,7 @@
#include <vector>
#include <hdf5.h>
#include <string>
struct iodump_exception : public std::exception {
std::string message;
......
#pragma once
#include "merge.h"
#include "merger.h"
#include "runner.h"
#include "runner_single.h"
namespace load_leveller {
template <class mc_runner>
static int run_mc(std::function<abstract_mc * (string&)> mccreator, int argc, char **argv) {
static int run_mc(std::function<abstract_mc * (const std::string&)> mccreator, int argc, char **argv) {
if(argc < 4) {
cerr << "Usage: " << argv[0] <<" jobfile walltime checkpointtime [h/m/s]\nThe last argument sets the time unit for walltime and checkpointtime. Default is seconds."<< endl;
std::cerr << "Usage: " << argv[0] <<" jobfile walltime checkpointtime [h/m/s]\nThe last argument sets the time unit for walltime and checkpointtime. Default is seconds.\n";
return -1;
}
string jobfile = argv[1];
std::string jobfile = argv[1];
double walltime = atof(argv[2]);
double chktime = atof(argv[3]);
if(argc>4) {//default is seconds
......@@ -34,11 +34,11 @@ namespace load_leveller {
// run this function from main() in your code.
template <class mc_implementation>
int run(int argc, char **argv) {
auto mccreator = [&] (string taskfile) -> abstract_mc* {return new mc_implementation(taskfile);};
auto mccreator = [&] (const std::string& taskfile) -> abstract_mc* {return new mc_implementation(taskfile);};
if(argc > 1 && string(argv[1]) == "merge") {
return merge(mccreator, argc-1, argv+1);
} else if(argc > 1 && string(argv[1]) == "single") {
if(argc > 1 && std::string(argv[1]) == "merge") {
// return merge(mccreator, argc-1, argv+1);
} else if(argc > 1 && std::string(argv[1]) == "single") {
return run_mc<runner_single>(mccreator, argc-1, argv+1);
}
......
......@@ -22,7 +22,7 @@ protected:
virtual void init() = 0;
virtual void checkpoint_write(iodump& out) = 0;
virtual bool checkpoint_read(iodump& in) = 0;
virtual void checkpoint_read(iodump& in) = 0;
virtual void write_output(const std::string& filename) = 0;
virtual void do_update() = 0;
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment