Is there a MPI-based map package?

MPIClusterManagers.jl has more than that, I think it has exactly what OP is asking for, you just need to use Distributed.pmap, e.g:

julia> using MPI, MPIClusterManagers, Distributed

julia> addprocs(MPIManager(np=4))

julia> result = pmap(1:10) do x
           MPI.Comm_rank(MPI.COMM_WORLD)
       end
10-element Array{Int64,1}:
 0
 1
 3
 2
 3
 0
 1
 2
 3
 0

Note you can also use the MPIClusterManagers.start_main_loop way of initializing MPI which lets you use mpiexec -n with a script.

3 Likes