diff --git a/tests/test_cases/simulation/test_mpi_ensemble.cu b/tests/test_cases/simulation/test_mpi_ensemble.cu index 1bd0b7091..01cb57c50 100644 --- a/tests/test_cases/simulation/test_mpi_ensemble.cu +++ b/tests/test_cases/simulation/test_mpi_ensemble.cu @@ -1,14 +1,14 @@ -#include "flamegpu/flamegpu.h" - #ifdef FLAMEGPU_ENABLE_MPI #include #endif -#include "gtest/gtest.h" - #include #include +#include "flamegpu/flamegpu.h" +#include "gtest/gtest.h" + + namespace flamegpu { namespace tests { namespace test_mpi_ensemble { @@ -68,7 +68,7 @@ class TestMPIEnsemble : public testing::Test { void TearDown() override { if (exit_log_cfg) delete exit_log_cfg; if (plans) delete plans; - if (model) delete model; + if (model) delete model; } void initModel() { model = new flamegpu::ModelDescription("MPITest"); @@ -80,16 +80,16 @@ class TestMPIEnsemble : public testing::Test { void initPlans() { // 100 runs, each 10 steps which take >100ms each, // therefore each sim will take >1 second. - // Estimate 30 seconds for full test across 4 threads + // Estimate 30 seconds for full test across 4 threads plans = new flamegpu::RunPlanVector(*model, 100); plans->setSteps(10); - plans->setPropertyLerpRange("counter", 0, 99); - plans->setPropertyLerpRange("counter_init", 0, 99); + plans->setPropertyLerpRange("counter", 0, 99); + plans->setPropertyLerpRange("counter_init", 0, 99); } void initExitLoggingConfig() { exit_log_cfg = new flamegpu::LoggingConfig(*model); - exit_log_cfg->logEnvironment("counter"); - exit_log_cfg->logEnvironment("counter_init"); + exit_log_cfg->logEnvironment("counter"); + exit_log_cfg->logEnvironment("counter_init"); } int world_rank = -1; int group_size = -1; @@ -120,22 +120,21 @@ TEST_F(TestMPIEnsemble, local) { ensemble.setExitLog(*exit_log_cfg); ensemble.simulate(*plans); - + // Validate results // @note Best we can currently do is check logs of each runner have correct results // @note Ideally we'd validate between nodes to ensure all runs have been completed const std::vector logs = ensemble.getLogs(); - printf("Log size: %u\n", (unsigned int)logs.size()); - for (const auto &log:logs) { + for (const auto &log : logs) { const ExitLogFrame& exit_log = log.getExitLog(); - //EXPECT_EQ(exit_log.getStepCount(), 10); - if (exit_log.getStepCount()){ // Temp, currently every runner gets all logs but unhandled ones are empty + // EXPECT_EQ(exit_log.getStepCount(), 10); + if (exit_log.getStepCount()) { // Temp, currently every runner gets all logs but unhandled ones are empty // Get a logged environment property const int counter = exit_log.getEnvironmentProperty("counter"); const int counter_init = exit_log.getEnvironmentProperty("counter_init"); // @todo Can't access run index via RunLog EXPECT_EQ(counter, counter_init + 10); - } - } + } + } } TEST_F(TestMPIEnsemble, multi) { if (world_size < 1) return; @@ -152,6 +151,6 @@ TEST(TestMPIEnsemble, DISABLED_local_test) { } TEST(TestMPIEnsemble, DISABLED_multi_test) { } #endif -} // namespace test_cuda_ensemble +} // namespace test_mpi_ensemble } // namespace tests } // namespace flamegpu