diff --git a/include/openmc/bank.h b/include/openmc/bank.h index b05922627..60d664638 100644 --- a/include/openmc/bank.h +++ b/include/openmc/bank.h @@ -37,7 +37,6 @@ extern int shared_fission_bank_max; void free_memory_bank(); void init_shared_fission_bank(int max); -void free_shared_fission_bank(void); } // namespace openmc diff --git a/src/bank.cpp b/src/bank.cpp index 677645d10..3bff63d30 100644 --- a/src/bank.cpp +++ b/src/bank.cpp @@ -33,6 +33,8 @@ void free_memory_bank() { simulation::source_bank.clear(); simulation::fission_bank.clear(); + delete[] simulation::shared_fission_bank; + simulation::shared_fission_bank_length = 0; } void init_shared_fission_bank(int max) @@ -42,12 +44,6 @@ void init_shared_fission_bank(int max) simulation::shared_fission_bank_length = 0; } -void free_shared_fission_bank(void) -{ - delete[] simulation::shared_fission_bank; - simulation::shared_fission_bank_length = 0; -} - //============================================================================== // C API //============================================================================== diff --git a/src/simulation.cpp b/src/simulation.cpp index 9bab85902..5bccdd060 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -108,7 +108,6 @@ int openmc_simulation_init() // Allocate source bank, and for eigenvalue simulations also allocate the // fission bank allocate_banks(); - init_shared_fission_bank(simulation::work_per_rank * 3); // Allocate tally results arrays if they're not allocated yet for (auto& t : model::tallies) { @@ -192,8 +191,6 @@ int openmc_simulation_finalize() } if (settings::check_overlaps) print_overlap_check(); - free_shared_fission_bank(); - // Reset flags simulation::need_depletion_rx = false; simulation::initialized = false; @@ -302,6 +299,9 @@ void allocate_banks() if (settings::run_mode == RUN_MODE_EIGENVALUE) { simulation::fission_bank.reserve(3*simulation::work_per_rank); } + + // Allocate shared bank + init_shared_fission_bank(simulation::work_per_rank * 3); } void initialize_batch() diff --git a/tests/regression_tests/dagmc/legacy/test.py b/tests/regression_tests/dagmc/legacy/test.py index 638fc7d79..5af18e5c8 100644 --- a/tests/regression_tests/dagmc/legacy/test.py +++ b/tests/regression_tests/dagmc/legacy/test.py @@ -50,8 +50,6 @@ def model(): return model -import pytest -@pytest.mark.skip(reason="DAGMC not planned for GPU support.") def test_dagmc(model): harness = PyAPITestHarness('statepoint.5.h5', model) harness.main() diff --git a/tests/regression_tests/dagmc/refl/test.py b/tests/regression_tests/dagmc/refl/test.py index 14d2f387d..c451b6125 100644 --- a/tests/regression_tests/dagmc/refl/test.py +++ b/tests/regression_tests/dagmc/refl/test.py @@ -35,7 +35,6 @@ class UWUWTest(PyAPITestHarness): model.tallies.export_to_xml() -@pytest.mark.skip(reason="DAGMC not planned for GPU support.") def test_refl(): harness = UWUWTest('statepoint.5.h5') harness.main() diff --git a/tests/regression_tests/dagmc/uwuw/test.py b/tests/regression_tests/dagmc/uwuw/test.py index 07d41c07a..b4391d8e7 100644 --- a/tests/regression_tests/dagmc/uwuw/test.py +++ b/tests/regression_tests/dagmc/uwuw/test.py @@ -35,7 +35,6 @@ class UWUWTest(PyAPITestHarness): model.tallies.export_to_xml() -@pytest.mark.skip(reason="DAGMC not planned for GPU support.") def test_uwuw(): harness = UWUWTest('statepoint.5.h5') harness.main()