mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Convert synchronize_bank to C++
This commit is contained in:
parent
217f87c085
commit
02fbc1582d
10 changed files with 278 additions and 342 deletions
|
|
@ -86,8 +86,8 @@ void calculate_work()
|
|||
int64_t remainder = settings::n_particles % mpi::n_procs;
|
||||
|
||||
int64_t i_bank = 0;
|
||||
simulation::work_index.reserve(mpi::n_procs);
|
||||
simulation::work_index.push_back(0);
|
||||
simulation::work_index.resize(mpi::n_procs + 1);
|
||||
simulation::work_index[0] = 0;
|
||||
for (int i = 0; i < mpi::n_procs; ++i) {
|
||||
// Number of particles for rank i
|
||||
int64_t work_i = i < remainder ? min_work + 1 : min_work;
|
||||
|
|
@ -97,7 +97,7 @@ void calculate_work()
|
|||
|
||||
// Set index into source bank for rank i
|
||||
i_bank += work_i;
|
||||
simulation::work_index.push_back(i_bank);
|
||||
simulation::work_index[i + 1] = i_bank;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue