Skip to content

Commit

Permalink
Fix anyv MPI.Bcast() calls in fokker_plack
Browse files Browse the repository at this point in the history
Need to skip the `Bcast()` if `comm_anyv_subblock[]` is a null
communicator (indicating that the process is not part of an anyv
subblock).
  • Loading branch information
johnomotani committed Jun 10, 2024
1 parent 23372f5 commit f57f3a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moment_kinetics/src/fokker_planck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,9 @@ function conserving_corrections!(CC,pdf_in,vpa,vperp,dummy_vpavperp)

# Broadcast x0, x1, x2 to all processes in the 'anyv' subblock
param_vec = [x0, x1, x2, upar]
MPI.Bcast!(param_vec, 0, comm_anyv_subblock[])
if comm_anyv_subblock[] != MPI.COMM_NULL
MPI.Bcast!(param_vec, 0, comm_anyv_subblock[])
end
(x0, x1, x2, upar) = param_vec

# correct CC
Expand Down Expand Up @@ -695,7 +697,9 @@ function density_conserving_correction!(CC,pdf_in,vpa,vperp,dummy_vpavperp)

# Broadcast x0 to all processes in the 'anyv' subblock
param_vec = [x0]
MPI.Bcast!(param_vec, 0, comm_anyv_subblock[])
if comm_anyv_subblock[] != MPI.COMM_NULL
MPI.Bcast!(param_vec, 0, comm_anyv_subblock[])
end
x0 = param_vec[1]

# correct CC
Expand Down

0 comments on commit f57f3a7

Please sign in to comment.