mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Fixed MPI by changing the indexing scheme for reading from the source bank. Previously, it was doing index_source -1, with index source starting at 0, which was causing undefined behavior. Now, it uses index_source properly. This may have been an artifact from Fortran days?
This commit is contained in:
parent
d99e2d27c1
commit
c7399d0d1d
1 changed files with 3 additions and 1 deletions
|
|
@ -1106,8 +1106,10 @@ void finalize_generation()
|
|||
|
||||
void initialize_history(Particle* p, int64_t index_source)
|
||||
{
|
||||
//assert(index_source - 1 >= 0 );
|
||||
// set defaults
|
||||
p->from_source(&simulation::source_bank[index_source - 1]);
|
||||
//p->from_source(&simulation::source_bank[index_source - 1]);
|
||||
p->from_source(&simulation::source_bank[index_source]);
|
||||
|
||||
// set identifier for particle
|
||||
p->id_ = simulation::work_index[mpi::rank] + index_source;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue