added O(n) fission bank sorting implementation

This commit is contained in:
John Tramm 2020-01-16 22:35:32 +00:00
parent 47cfc9cbf1
commit 03397cab26
7 changed files with 56 additions and 2 deletions

View file

@ -398,8 +398,9 @@ void finalize_generation()
// so as to allow for reproducibility regardless of which order particles
// are run in.
#ifdef _OPENMP
std::stable_sort(simulation::fission_bank,
simulation::fission_bank + simulation::fission_bank_length);
//std::stable_sort(simulation::fission_bank,
// simulation::fission_bank + simulation::fission_bank_length);
sort_fission_bank();
#endif
// Distribute fission bank across processors evenly
@ -434,6 +435,9 @@ void initialize_history(Particle* p, int64_t index_source)
// set identifier for particle
p->id_ = simulation::work_index[mpi::rank] + index_source;
// set progeny count to zero
p->n_progeny_ = 0;
// set random number seed
int64_t particle_seed = (simulation::total_gen + overall_generation() - 1)
* settings::n_particles + p->id_;