Skip to content

Commit

Permalink
Merge pull request #195 from mabarnes/mpi-init-only-once
Browse files Browse the repository at this point in the history
Make sure MPI.Init() is only ever called once
  • Loading branch information
johnomotani authored Mar 23, 2024
2 parents 4a9d188 + c7141bd commit fbf7f9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion moment_kinetics/src/communication.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ const global_Win_store = Vector{MPI.Win}(undef, 0)
"""
"""
function __init__()
MPI.Init()
if !MPI.Initialized()
MPI.Init()
end

comm_world.val = MPI.COMM_WORLD.val

Expand Down

0 comments on commit fbf7f9d

Please sign in to comment.