Skip to content

Commit

Permalink
fixed mpi issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Aug 6, 2023
1 parent 3993d9a commit 0346a77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/particle.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ void reb_add(struct reb_simulation* const r, struct reb_particle pt){
int rootbox = reb_get_rootbox_for_particle(r, pt);
int root_n_per_node = r->root_n/r->mpi_num;
int proc_id = rootbox/root_n_per_node;
if (proc_id != r->mpi_id && r->N >= r->N_active){
const unsigned int N_active = (r->N_active==-1)?r->N:r->N_active;
if (proc_id != r->mpi_id && r->N >= N_active){
// Add particle to array and send them to proc_id later.
reb_communication_mpi_add_particle_to_send_queue(r,pt,proc_id);
return;
Expand Down

0 comments on commit 0346a77

Please sign in to comment.