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
function context_type()
name = get(ENV, "CLIMACOMMS_CONTEXT", nothing)
if !isnothing(name)
if name == "MPI"
return :MPICommsContext
elseif name == "SINGLETON"
return :SingletonCommsContext
else
error("Invalid context: $name")
end
end
# 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 OpenMPI
if haskey(ENV, "PMI_RANK") || haskey(ENV, "OMPI_COMM_WORLD_RANK")
return :MPICommsContext
else
return :SingletonCommsContext
end
end
to
function context_type()
name = get(ENV, "CLIMACOMMS_CONTEXT", nothing)
if !isnothing(name)
if name == "MPI"
return :MPICommsContext
elseif name == "SINGLETON"
return :SingletonCommsContext
else
error("Invalid context: $name")
end
else
return :SingletonCommsContext
end
end
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