Switch surf_src_bank from vector to SharedArray

This commit is contained in:
YoungHui Park 2020-04-14 02:09:49 -05:00
parent c362ba5ef4
commit d849014391
4 changed files with 11 additions and 4 deletions

View file

@ -17,7 +17,7 @@ namespace simulation {
std::vector<Particle::Bank> source_bank;
std::vector<Particle::Bank> surf_src_bank;
SharedArray<Particle::Bank> surf_src_bank;
// The fission bank is allocated as a SharedArray, rather than a vector, as it will
// be shared by all threads in the simulation. It will be allocated to a fixed
@ -44,6 +44,11 @@ void free_memory_bank()
simulation::progeny_per_particle.clear();
}
void init_surf_src_bank(int64_t max)
{
simulation::surf_src_bank.reserve(max);
}
void init_fission_bank(int64_t max)
{
simulation::fission_bank.reserve(max);