diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 0718fc589..d86afd3cf 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -221,11 +221,6 @@ contains ! Get proper XMLNode type given pointer root % ptr = root_ptr - if (run_mode == MODE_EIGENVALUE) then - ! Preallocate space for keff and entropy by generation - call k_generation_reserve(n_max_batches*gen_per_batch) - end if - ! Particle tracks if (check_for_node(root, "track")) then ! Make sure that there are three values per particle diff --git a/src/settings.cpp b/src/settings.cpp index bf97e44b8..556fbd24d 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -12,6 +12,7 @@ #include "openmc/distribution.h" #include "openmc/distribution_multi.h" #include "openmc/distribution_spatial.h" +#include "openmc/eigenvalue.h" #include "openmc/error.h" #include "openmc/file_utils.h" #include "openmc/mesh.h" @@ -141,7 +142,10 @@ void get_run_parameters(pugi::xml_node node_base) gen_per_batch = std::stoi(get_node_value(node_base, "generations_per_batch")); } - // TODO: Preallocate space for keff and entropy by generation + // Preallocate space for keff and entropy by generation + int m = settings::n_max_batches * settings::gen_per_batch; + simulation::k_generation.reserve(m); + entropy.reserve(m); // Get the trigger information for keff if (check_for_node(node_base, "keff_trigger")) { diff --git a/src/simulation_header.F90 b/src/simulation_header.F90 index 288a8422c..e16b93432 100644 --- a/src/simulation_header.F90 +++ b/src/simulation_header.F90 @@ -84,11 +84,6 @@ module simulation_header subroutine k_generation_clear() bind(C) end subroutine - subroutine k_generation_reserve(i) bind(C) - import C_INT - integer(C_INT), value :: i - end subroutine - function work_index(rank) result(i) bind(C) import C_INT, C_INT64_T integer(C_INT), value :: rank