diff --git a/share/poet/barite/barite_het.qs2 b/share/poet/barite/barite_het.qs2 index 3e6eea061..e305b5322 100644 Binary files a/share/poet/barite/barite_het.qs2 and b/share/poet/barite/barite_het.qs2 differ diff --git a/share/poet/surfex/PoetEGU_surfex_500.qs2 b/share/poet/surfex/PoetEGU_surfex_500.qs2 index 0b92342d0..ac26c6a1b 100644 Binary files a/share/poet/surfex/PoetEGU_surfex_500.qs2 and b/share/poet/surfex/PoetEGU_surfex_500.qs2 differ diff --git a/src/Chemistry/ChemistryModule.hpp b/src/Chemistry/ChemistryModule.hpp index 777593f41..5c2618b08 100644 --- a/src/Chemistry/ChemistryModule.hpp +++ b/src/Chemistry/ChemistryModule.hpp @@ -410,8 +410,6 @@ protected: ChemBCast(&type, 1, MPI_INT); } - void PropagateControlLogic(int type, int flag); - double simtime = 0.; double idle_t = 0.; double seq_t = 0.; diff --git a/src/Chemistry/MasterFunctions.cpp b/src/Chemistry/MasterFunctions.cpp index 1b674af0f..79ad4cab8 100644 --- a/src/Chemistry/MasterFunctions.cpp +++ b/src/Chemistry/MasterFunctions.cpp @@ -232,37 +232,6 @@ inline void printProgressbar(int count_pkgs, int n_wp, int barWidth = 70) { /* end visual progress */ } -void poet::ChemistryModule::PropagateControlLogic(int type, int flag) { - /* - PropagateFunctionType(type); - - static int master_bcast_seq = 0; - int tmp = flag ? 1 : 0; - std::cerr << "[MASTER BCAST " << master_bcast_seq << "] ftype=" << type - << " flag=" << tmp << std::endl - << std::flush; - master_bcast_seq++; - ChemBCast(&tmp, 1, MPI_INT); - - switch (type) { - case CHEM_CTRL_ENABLE: - this->control_enabled = (tmp == 1); - break; - case CHEM_WARMUP_PHASE: - this->warmup_enabled = (tmp == 1); - break; - case CHEM_DHT_ENABLE: - this->dht_enabled = (tmp == 1); - break; - case CHEM_IP_ENABLE: - this->interp_enabled = (tmp == 1); - break; - default: - break; - } - */ -} - inline void poet::ChemistryModule::MasterSendPkgs( worker_list_t &w_list, workpointer_t &work_pointer, workpointer_t &sur_pointer, int &pkg_to_send, int &count_pkgs, diff --git a/src/poet.cpp b/src/poet.cpp index 8de4d0eb1..d6aecf04c 100644 --- a/src/poet.cpp +++ b/src/poet.cpp @@ -465,7 +465,7 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms, profiling["simtime"] = dSimTime; profiling["chemistry"] = chem_profiling; profiling["diffusion"] = diffusion_profiling; - //profiling["ctrl_logic"] = ctrl_profiling; + profiling["control_loop"] = ctrl_profiling; chem.MasterLoopBreak(); diff --git a/test/testStats.cpp b/test/testStats.cpp index 355d89b0c..de720308d 100644 --- a/test/testStats.cpp +++ b/test/testStats.cpp @@ -3,9 +3,9 @@ #include #include -#include +#include -TEST_CASE("Stats calculation") +TEST_CASE("Metrics calculation") { std::vector real = { @@ -27,15 +27,15 @@ TEST_CASE("Stats calculation") 2.8, 0.02, 0.7, 0.5 }; - poet::ChemistryModule::error_stats stats(6, 5); - poet::ChemistryModule::computeStats(real, pred, /*size_per_prop*/ 4, /*species_count*/ 6, stats); + poet::ControlModule::metricsHistory metrics(6, 5); + poet::ControlModule::computeSpeciesErrorMetrics(real, pred, /*size_per_prop*/ 4); SUBCASE("Non-zero values") { // species 1 is ID, should stay 0 - CHECK_EQ(stats.mape[0], 0); - CHECK_EQ(stats.rrsme[0], 0); + CHECK_EQ(metrics.mape[0], 0); + CHECK_EQ(metrics.rrsme[0], 0); /* mape species 2 @@ -49,8 +49,8 @@ TEST_CASE("Stats calculation") rrsme = sqrt(1.02040816/4) = 0.50507627 */ - CHECK_EQ(stats.mape[1], doctest::Approx(28.5714286).epsilon(1e-6)); - CHECK_EQ(stats.rrsme[1], doctest::Approx(0.50507627).epsilon(1e-6)); + CHECK_EQ(metrics.mape[1], doctest::Approx(28.5714286).epsilon(1e-6)); + CHECK_EQ(metrics.rrsme[1], doctest::Approx(0.50507627).epsilon(1e-6)); } SUBCASE("Zero-denominator case") @@ -65,8 +65,8 @@ TEST_CASE("Stats calculation") rrsme = 1 */ - CHECK_EQ(stats.mape[2], 100.0); - CHECK_EQ(stats.rrsme[2], 1.0); + CHECK_EQ(metrics.mape[2], 100.0); + CHECK_EQ(metrics.rrsme[2], 1.0); } SUBCASE("True and predicted values are zero") @@ -81,8 +81,8 @@ TEST_CASE("Stats calculation") rrsme = 0.0 */ - CHECK_EQ(stats.mape[3], 0.0); - CHECK_EQ(stats.rrsme[3], 0.0); + CHECK_EQ(metrics.mape[3], 0.0); + CHECK_EQ(metrics.rrsme[3], 0.0); } SUBCASE("Negative values") @@ -97,8 +97,8 @@ TEST_CASE("Stats calculation") rrsme = sqrt(13.6989796 / 4) = 1.85060663 */ - CHECK_EQ(stats.mape[4], doctest::Approx(183.92857143).epsilon(1e-6)); - CHECK_EQ(stats.rrsme[4], doctest::Approx(1.85060663).epsilon(1e-6)); + CHECK_EQ(metrics.mape[4], doctest::Approx(183.92857143).epsilon(1e-6)); + CHECK_EQ(metrics.rrsme[4], doctest::Approx(1.85060663).epsilon(1e-6)); } SUBCASE("Large differences") @@ -113,7 +113,7 @@ TEST_CASE("Stats calculation") rrsme = sqrt(2,12262382 / 4) = 0.72846136 */ - CHECK_EQ(stats.mape[5], doctest::Approx(62.102492).epsilon(1e-6)); - CHECK_EQ(stats.rrsme[5], doctest::Approx(0.72846136).epsilon(1e-6)); + CHECK_EQ(metrics.mape[5], doctest::Approx(62.102492).epsilon(1e-6)); + CHECK_EQ(metrics.rrsme[5], doctest::Approx(0.72846136).epsilon(1e-6)); } }