From decc968188e1ab87c9e376890e2cdd533b8e6960 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Thu, 26 Sep 2024 11:25:15 -0400 Subject: [PATCH] fix: set concurrency model in C++ examples not bothering with Python examples yet, since we need to work on the bindings... --- examples/iguana_ex_cpp_01_action_functions.cc | 4 ++++ src/iguana/algorithms/Algorithm.h | 1 + src/iguana/tests/include/TestAlgorithm.h | 1 - src/iguana/tests/include/TestMultithreading.h | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/iguana_ex_cpp_01_action_functions.cc b/examples/iguana_ex_cpp_01_action_functions.cc index d334e54b..57e2094a 100644 --- a/examples/iguana_ex_cpp_01_action_functions.cc +++ b/examples/iguana_ex_cpp_01_action_functions.cc @@ -33,6 +33,10 @@ int main(int argc, char** argv) enum banks_enum { b_particle, b_config }; // TODO: users shouldn't have to do this + // set the concurrency model to single-threaded, since this example is single-threaded; + // not doing this will use the thread-safe model, `"memoize"` + iguana::GlobalConcurrencyModel = "single"; + // create the algorithms iguana::clas12::EventBuilderFilter algo_eventbuilder_filter; iguana::clas12::MomentumCorrection algo_momentum_correction; diff --git a/src/iguana/algorithms/Algorithm.h b/src/iguana/algorithms/Algorithm.h index e341365c..845d49d4 100644 --- a/src/iguana/algorithms/Algorithm.h +++ b/src/iguana/algorithms/Algorithm.h @@ -9,6 +9,7 @@ #include "iguana/algorithms/AlgorithmBoilerplate.h" #include "iguana/services/YAMLReader.h" +#include namespace iguana { diff --git a/src/iguana/tests/include/TestAlgorithm.h b/src/iguana/tests/include/TestAlgorithm.h index 43e4de02..1ccd7f06 100644 --- a/src/iguana/tests/include/TestAlgorithm.h +++ b/src/iguana/tests/include/TestAlgorithm.h @@ -2,7 +2,6 @@ #include #include -#include inline int TestAlgorithm( std::string command, diff --git a/src/iguana/tests/include/TestMultithreading.h b/src/iguana/tests/include/TestMultithreading.h index f821b1d9..b518aceb 100644 --- a/src/iguana/tests/include/TestMultithreading.h +++ b/src/iguana/tests/include/TestMultithreading.h @@ -2,7 +2,6 @@ #include #include -#include inline int TestMultithreading( std::string const command,