You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be causing issues for people when they don't explicitly request MPI (and it automatically gets scooped up). I think it might be less surprising if we change
functioncontext_type()
name =get(ENV, "CLIMACOMMS_CONTEXT", nothing)
if!isnothing(name)
if name =="MPI"return:MPICommsContextelseif name =="SINGLETON"return:SingletonCommsContextelseerror("Invalid context: $name")
endend# detect common environment variables used by MPI launchers# PMI_RANK appears to be used by MPICH and srun# OMPI_COMM_WORLD_RANK appears to be used by OpenMPIifhaskey(ENV, "PMI_RANK") ||haskey(ENV, "OMPI_COMM_WORLD_RANK")
return:MPICommsContextelsereturn:SingletonCommsContextendend
to
functioncontext_type()
name =get(ENV, "CLIMACOMMS_CONTEXT", nothing)
if!isnothing(name)
if name =="MPI"return:MPICommsContextelseif name =="SINGLETON"return:SingletonCommsContextelseerror("Invalid context: $name")
endelsereturn:SingletonCommsContextendend
The text was updated successfully, but these errors were encountered:
I support this change, using both the CLIMACOMMS_CONTEXT and the MPI variables leads to unexpected behavior, we should improve this check or just use the CLIMACOMMS_CONTEXT to set the context.
The main issue I have run into is that srun sets PMI_RANK, so we should change this variable check to something like MPICH_VERSION, or cast a wider net of variable checks to be safer.
This seems to be causing issues for people when they don't explicitly request MPI (and it automatically gets scooped up). I think it might be less surprising if we change
to
The text was updated successfully, but these errors were encountered: