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
Presumably we should never write scripts that make assumptions about the communicator (and we should strongly discourage users from doing so). So first of all the validation scripts must be changed.
Secondly, I think something that could encouarge clean and good practices would be to extend functions like Comm_rank to arch::Distributed and possibly to the grid as well, so that we can call:
We'd have the option of throwing an error when non-distributed, or returning some sensible fallback like Comm_rank(arch) = 0 and Comm_size(arch) = 1.
Alternatively, we can develop our own API, since the MPI-based one is rather irregular and abbreviated, thus difficult for newbies to understand (I've been in this boat...)
For example, perhaps simply Base.size and rank would suffice:
In all the scripts I found on distributed simulations, we seem to query the MPI state using
COMM_WORLD
, eg:Oceananigans.jl/validation/distributed_simulations/mpi_nonhydrostatic_two_dimensional_turbulence.jl
Line 74 in 5dd96cf
and
Oceananigans.jl/validation/distributed_simulations/mpi_nonhydrostatic_two_dimensional_turbulence.jl
Lines 59 to 60 in 5dd96cf
But
Distributed
allows thecommunicator
to be set, soarch.communicator
can be something other thanCOMM_WORLD
, egOceananigans.jl/src/DistributedComputations/distributed_architectures.jl
Lines 60 to 66 in 5dd96cf
Presumably we should never write scripts that make assumptions about the communicator (and we should strongly discourage users from doing so). So first of all the validation scripts must be changed.
Secondly, I think something that could encouarge clean and good practices would be to extend functions like
Comm_rank
toarch::Distributed
and possibly to thegrid
as well, so that we can call:We'd have the option of throwing an error when non-distributed, or returning some sensible fallback like
Comm_rank(arch) = 0
andComm_size(arch) = 1
.Alternatively, we can develop our own API, since the MPI-based one is rather irregular and abbreviated, thus difficult for newbies to understand (I've been in this boat...)
For example, perhaps simply
Base.size
andrank
would suffice:The text was updated successfully, but these errors were encountered: