Skip to content

732 benchmarks for abm model #733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 119 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
b9345b1
openmp in abm
dabele Mar 16, 2023
a9e9695
skeleton for counter based rng
dabele May 4, 2023
ceec6ea
include random123 library
dabele May 5, 2023
51dba61
rng for parameter studies
dabele May 12, 2023
989d4f8
ctr based rng and omp for ABM
dabele May 12, 2023
0f2f6f2
global distribution adapter instances
dabele May 12, 2023
8d5a88d
fix warnings in examples
dabele May 12, 2023
efb2c8e
change mocking of rng
dabele May 12, 2023
252c652
full openmp and rng for ABM
dabele May 12, 2023
cb29891
clean up logging of rng seeds in tests and sims
dabele May 12, 2023
4b4c9db
fix build
dabele May 12, 2023
6e9ad90
fix build
dabele May 12, 2023
8edc609
fix build
dabele May 12, 2023
e5036d9
documentation and naming of new RNG
dabele May 12, 2023
47ffc4a
fix build
dabele May 12, 2023
c04ebb4
fix build
dabele May 12, 2023
ec87579
fix race conditions in dampings
dabele May 19, 2023
3d4bcc5
avoid copy of testingstrategy
dabele May 26, 2023
bbe472a
parallel store_result_at
dabele May 26, 2023
fa14ce5
avoid copy of infection
dabele May 26, 2023
18a245d
move update testingstrategy to begin_step
dabele May 26, 2023
2b92902
log abm and world seeds in abm simulation
dabele Jun 9, 2023
6726e13
improve documentation of counter based rngs
dabele Aug 4, 2023
f18bff9
extend unittests for counter based rngs
dabele Aug 4, 2023
516f31f
references to Person::RandomNUmberGenerator
dabele Aug 4, 2023
ab6b1f5
review: consistent cmake args
dabele Aug 4, 2023
98b71d8
review: fix unwrapped pragma omp
dabele Aug 4, 2023
4342ad7
review: comment for manual openmp reduction
dabele Aug 4, 2023
40795fe
review: document openmp pragma macro
dabele Aug 4, 2023
17d5e73
review: further improved doc of cRNG
dabele Aug 4, 2023
41ea105
review: doc of Person::RandomNumberGenerator
dabele Aug 4, 2023
660d1fd
review: consistent order of arguments
dabele Aug 4, 2023
28840c5
review: rename variable in unitest
dabele Aug 4, 2023
6063600
review: comment for rng handling in parameterstudies
dabele Aug 4, 2023
4fc4608
fix build and test issues due to rebase
dabele Aug 4, 2023
77ad862
handle empty base optimization in MSVC
dabele Aug 4, 2023
4b7ab90
sanity check for empty base...
dabele Aug 5, 2023
07971c6
fix copying and moving of Range in python bindings
dabele Aug 6, 2023
a56c535
some performance and scaling improvements
dabele Aug 11, 2023
1efa4ea
test2.0
BenoBurth Aug 15, 2023
2cfe7cc
test3.0
BenoBurth Aug 15, 2023
46be0e6
reverse test
BenoBurth Aug 15, 2023
af89886
Merge branch 'main' into 629-prallelize-abm
dabele Aug 24, 2023
d3bd8fb
replace Dampings::finalize() with set_automatic_cache_update()
dabele Sep 1, 2023
3bc302c
Merge branch '629-parallelize-abm-performance-hacks' into 732-benchma…
BenoBurth Sep 11, 2023
9724e43
test branch connection
Sep 11, 2023
ac0a032
mal wieder ein test
BenoBurth Sep 11, 2023
c70c2fd
loop main methods of seir and secir examples
alexgit0 Sep 11, 2023
bff6411
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
alexgit0 Sep 11, 2023
0929a3f
cmakelist with marker api for abm minimal
BenoBurth Sep 11, 2023
76e5899
cmakelist update
BenoBurth Sep 11, 2023
f90639b
remove errors
BenoBurth Sep 11, 2023
7c12d6c
marker region renamed
BenoBurth Sep 11, 2023
85b0e4d
remove console outputs
BenoBurth Sep 11, 2023
5d70309
abm_minimal_example marker api
BenoBurth Sep 11, 2023
bfb1a1c
marker api in abm_minimal_example
BenoBurth Sep 11, 2023
571654e
increase loop iterations
BenoBurth Sep 11, 2023
4700f79
add parallelization tests
BenoBurth Sep 12, 2023
5681e97
increase vector size
BenoBurth Sep 12, 2023
a4645bb
decrease vector size
BenoBurth Sep 12, 2023
0ef3dbd
decrease loop iterations in abm_minimal_example
BenoBurth Sep 13, 2023
ce12880
decrease abm_minimal main iterations
BenoBurth Sep 14, 2023
409ed72
changed names of the marker api regions in abm_minimal
BenoBurth Sep 14, 2023
50f6add
loop in marker api
BenoBurth Sep 14, 2023
7c1fdbd
reset loop
BenoBurth Sep 14, 2023
9042ecf
increase outer loop interations
BenoBurth Sep 14, 2023
ab7e169
added marker api
BenoBurth Sep 14, 2023
6434f8e
fix bugs in marker api
BenoBurth Sep 14, 2023
11a6285
add another marker api for testing
BenoBurth Sep 15, 2023
dd77af3
remove two marker api
BenoBurth Sep 15, 2023
4249cb2
add marker regions to seir example
alexgit0 Sep 18, 2023
d7d6ea5
add initialization marker api in abm_minimal
BenoBurth Sep 18, 2023
44263bc
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
BenoBurth Sep 18, 2023
0456905
add marker regions for secir and secirvvs
alexgit0 Sep 18, 2023
c279c03
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
alexgit0 Sep 18, 2023
9dea763
add another marker api
BenoBurth Sep 18, 2023
cf2f702
fix bugs in marker api
BenoBurth Sep 18, 2023
8124033
adjust cmakelist to support marker api for ode ex.
alexgit0 Sep 18, 2023
9819ce8
add likwid marker api to abm simulation
BenoBurth Sep 19, 2023
1e782c8
remove console outputs in examples for likwid
alexgit0 Sep 19, 2023
12372b5
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
alexgit0 Sep 19, 2023
c666f41
change position of likwid marker close
BenoBurth Sep 19, 2023
2d1af7b
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
BenoBurth Sep 19, 2023
6d134e3
change simulation cmake list
BenoBurth Sep 19, 2023
af3a7d3
change position of likwid marker close again
BenoBurth Sep 19, 2023
e32de01
remove loops to increase flops
alexgit0 Sep 19, 2023
d281b5a
remove main loop in seir example
alexgit0 Sep 19, 2023
f4e161c
add likwid region to odesecir simulation
alexgit0 Sep 19, 2023
d74a930
modify simulation cmakelist with likwid libary
BenoBurth Sep 19, 2023
895f8ec
bug fixes in simulation camkelist
BenoBurth Sep 19, 2023
e7b270e
enable marker api for ode simualtions in cmakelist
alexgit0 Sep 19, 2023
d6a4065
enable OPENMP
BenoBurth Sep 19, 2023
e291d0d
add loops for normal likwid measurements on exmp
alexgit0 Sep 20, 2023
339817b
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
alexgit0 Sep 20, 2023
8bc1cf1
modify abm_minimal likwid marker api
BenoBurth Sep 20, 2023
81ced20
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
BenoBurth Sep 20, 2023
a523229
add loop for secir example
alexgit0 Sep 20, 2023
59d45a6
switch to euler integrator for measurements
alexgit0 Sep 20, 2023
d0739c8
fix bug in seir example
alexgit0 Sep 20, 2023
46fa35e
test cmake simulation
BenoBurth Sep 20, 2023
3c8870c
changed cmakelist in all simulations
BenoBurth Sep 20, 2023
ed27257
change integrator in secir example to euler
alexgit0 Sep 20, 2023
f39b165
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
alexgit0 Sep 20, 2023
4c69aec
change integraotr in secirvvs ex to euler
alexgit0 Sep 20, 2023
04b521c
undo previous changes in secirvvs ex
alexgit0 Sep 20, 2023
47da602
compare with previous euler results
alexgit0 Sep 20, 2023
8a8453a
add likwid marker api to cmakelist simulations
BenoBurth Sep 21, 2023
c0c4e27
Merge branch '732-benchmarks-for-abm-model' of github.com:DLR-SC/memi…
BenoBurth Sep 21, 2023
79af74b
fix bugs in cmakelist simulation
BenoBurth Sep 21, 2023
70f37b2
comment errors from cmakelist
BenoBurth Sep 21, 2023
7ad5c31
change abm simulation und cmakelist simulations
BenoBurth Sep 21, 2023
f4f0464
merge 629 parallelize finalize
BenoBurth Sep 26, 2023
b61d134
adjust main loops
alexgit0 Sep 28, 2023
0b3e4db
Merge branch '732-benchmarks-for-abm-model' of https://github.com/DLR…
alexgit0 Sep 28, 2023
3f96aa9
add changes for likwid marker api in abm and cmake
BenoBurth Sep 28, 2023
0127c1f
final measurement changes
alexgit0 Sep 29, 2023
86601cc
remeasure for testing purposes
alexgit0 Sep 29, 2023
b779535
add final changes
BenoBurth Oct 5, 2023
ff00466
Merge branch '732-benchmarks-for-abm-model' of https://github.com/DLR…
BenoBurth Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ option(MEMILIO_SANITIZE_UNDEFINED "Enable undefined behavior sanitizer." OFF)
option(MEMILIO_BUILD_SHARED_LIBS "Build memilio as a shared library." ON)
option(MEMILIO_BUILD_STATIC_LIBS "Build memilio as a static library." ON)
option(MEMILIO_ENABLE_MPI "Build memilio with MPI." OFF)
option(MEMILIO_ENABLE_OPENMP "Enable Multithreading with OpenMP." ON)

mark_as_advanced(MEMILIO_USE_BUNDLED_SPDLOG MEMILIO_SANITIZE_ADDRESS MEMILIO_SANITIZE_UNDEFINED)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# needed for likwid marker api
find_package(LIKWID REQUIRED)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Please choose Release or Debug. Default is Release." FORCE)
endif()
Expand Down Expand Up @@ -100,8 +104,8 @@ endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND(CMAKE_CXX_COMPILER_VERSION VERS
# define flags to enable most warnings and treat them as errors for different compilers
# add flags to each target separately instead of globally so users have the choice to use their own flags
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS
"-Wno-unknown-warning;-Wno-pragmas;-Wall;-Wextra;-Werror;-Wshadow;--pedantic-errors;-Wno-deprecated-copy")
#set(MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS
# "-Wno-unknown-warning;-Wno-pragmas;-Wall;-Wextra;-Werror;-Wshadow;--pedantic-errors;-Wno-deprecated-copy;-Wno-expansion-to-defined")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS
"-Wno-unknown-warning-option;-Wall;-Wextra;-Werror;-Wshadow;--pedantic-errors;-Wno-deprecated;-Wno-gnu-zero-variadic-macro-arguments")
Expand Down
40 changes: 34 additions & 6 deletions cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,96 @@ configure_file(data_dir.h.in data_dir.h)

add_executable(euler_example euler_test.cpp)
target_link_libraries(euler_example PRIVATE memilio)
target_compile_options(euler_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(ode_secir_parameter_sampling_example ode_secir_parameter_sampling.cpp)
target_link_libraries(ode_secir_parameter_sampling_example PRIVATE memilio ode_secir)
target_compile_options(ode_secir_parameter_sampling_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(adapt_rk_example adapt_rk_test.cpp)
target_link_libraries(adapt_rk_example PRIVATE memilio)
target_compile_options(adapt_rk_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(ode_seir_example ode_seir.cpp)
target_link_libraries(ode_seir_example PRIVATE memilio ode_seir)
target_include_directories(ode_seir_example PRIVATE ${LIKWID_INCLUDE_DIRS})
target_link_libraries(ode_seir_example PRIVATE memilio ode_seir ${LIKWID_LIBRARIES})
target_compile_options(ode_seir_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
target_compile_definitions(ode_seir_example PRIVATE "-DLIKWID_PERFMON")

add_executable(ode_secir_example ode_secir.cpp)
target_link_libraries(ode_secir_example PRIVATE memilio ode_secir)
target_include_directories(ode_secir_example PRIVATE ${LIKWID_INCLUDE_DIRS})
target_link_libraries(ode_secir_example PRIVATE memilio ode_secir ${LIKWID_LIBRARIES})
target_compile_options(ode_secir_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
target_compile_definitions(ode_secir_example PRIVATE "-DLIKWID_PERFMON")

add_executable(ode_secirvvs_example ode_secirvvs.cpp)
target_link_libraries(ode_secirvvs_example PRIVATE memilio ode_secirvvs)
target_include_directories(ode_secirvvs_example PRIVATE ${LIKWID_INCLUDE_DIRS})
target_link_libraries(ode_secirvvs_example PRIVATE memilio ode_secirvvs ${LIKWID_LIBRARIES})
target_compile_options(ode_secirvvs_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
target_compile_definitions(ode_secirvvs_example PRIVATE "-DLIKWID_PERFMON")

add_executable(ode_secir_ageres_example ode_secir_ageres.cpp)
target_link_libraries(ode_secir_ageres_example PRIVATE memilio ode_secir)
target_compile_options(ode_secir_ageres_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(graph_example graph.cpp)
target_link_libraries(graph_example PRIVATE memilio ode_seir)
target_compile_options(graph_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(graph_stochastic_mobility_example graph_stochastic_mobility.cpp)
target_link_libraries(graph_stochastic_mobility_example PRIVATE memilio ode_secir)
target_compile_options(graph_stochastic_mobility_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(abm_minimal_example abm_minimal.cpp)
target_link_libraries(abm_minimal_example PRIVATE memilio abm)
target_include_directories(abm_minimal_example PRIVATE ${LIKWID_INCLUDE_DIRS})
target_link_libraries(abm_minimal_example PRIVATE memilio abm ${LIKWID_LIBRARIES})
target_compile_options(abm_minimal_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
target_compile_definitions(abm_minimal_example PRIVATE "-DLIKWID_PERFMON")


add_executable(abm_history_example abm_history_object.cpp)
target_link_libraries(abm_history_example PRIVATE memilio abm)
target_compile_options(abm_history_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(twitter_migration_example twitter_migration.cpp)
target_link_libraries(twitter_migration_example PRIVATE memilio ode_secir)
target_compile_options(twitter_migration_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(ide_seir_example ide_seir.cpp)
target_link_libraries(ide_seir_example PRIVATE memilio ide_seir)
target_compile_options(ide_seir_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

add_executable(ide_secir_example ide_secir.cpp)
target_link_libraries(ide_secir_example PRIVATE memilio ide_secir)
target_compile_options(ide_secir_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})

if(MEMILIO_HAS_JSONCPP)
add_executable(ode_secir_read_graph_example ode_secir_read_graph.cpp)
target_link_libraries(ode_secir_read_graph_example PRIVATE memilio ode_secir)
target_include_directories(ode_secir_read_graph_example PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # configured headers
target_compile_options(ode_secir_read_graph_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
endif()

if(MEMILIO_HAS_HDF5 AND MEMILIO_HAS_JSONCPP)
add_executable(ode_secir_parameter_study_example ode_secir_parameter_study.cpp)
target_link_libraries(ode_secir_parameter_study_example PRIVATE memilio ode_secir)
target_compile_options(ode_secir_parameter_study_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
endif()

if(MEMILIO_HAS_JSONCPP)
add_executable(cli_example cli.cpp)
target_link_libraries(cli_example PRIVATE memilio)
target_compile_options(cli_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
endif()

if(MEMILIO_HAS_JSONCPP)
add_executable(serialize_example serialize.cpp)
target_link_libraries(serialize_example PRIVATE memilio)
target_compile_options(serialize_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
endif()

if(MEMILIO_HAS_HDF5)
add_executable(ode_secir_save_results ode_secir_save_results.cpp)
target_link_libraries(ode_secir_save_results PRIVATE memilio ode_secir)
add_executable(ode_secir_save_results_example ode_secir_save_results.cpp)
target_link_libraries(ode_secir_save_results_example PRIVATE memilio ode_secir)
target_compile_options(ode_secir_save_results_example PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS})
endif()
11 changes: 6 additions & 5 deletions cpp/examples/abm_history_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ void write_log_to_file(const T& history)
std::string input;
std::ofstream myfile("test_output.txt");
myfile << "Locations as numbers:\n";
for (auto loc_id_index = 0; loc_id_index < loc_id[0].size(); ++loc_id_index) {
myfile << convert_loc_id_to_string(loc_id[0][loc_id_index]) << "\n";
for (auto&& id : loc_id[0]) {
myfile << convert_loc_id_to_string(id) << "\n";
}
myfile << "Timepoints:\n";

for (int t = 0; t < time_points.size(); ++t) {
input += std::to_string(time_points[t]) + " ";
for (auto&& t : time_points) {
input += std::to_string(t) + " ";
}
myfile << input << "\n";

Expand Down Expand Up @@ -132,10 +132,11 @@ int main()
// The infection states are chosen randomly.
auto persons = world.get_persons();
for (auto& person : persons) {
auto rng = mio::abm::Person::RandomNumberGenerator(world.get_rng(), person);
mio::abm::InfectionState infection_state =
(mio::abm::InfectionState)(rand() % ((uint32_t)mio::abm::InfectionState::Count - 1));
if (infection_state != mio::abm::InfectionState::Susceptible)
person.add_new_infection(mio::abm::Infection(mio::abm::VirusVariant::Wildtype, person.get_age(),
person.add_new_infection(mio::abm::Infection(rng, mio::abm::VirusVariant::Wildtype, person.get_age(),
world.get_global_infection_parameters(), start_date,
infection_state));
}
Expand Down
Loading