Is there such a package providing a function like?
function mpi_map(Function, Array, MPI_COMM),
which bechaviours like
result=map(some_input_array, comm) do x
I wrote one myself based on send/recv. A manager process listens to all worker process and assign jobs. However, which is very specified only to some certain problems. Is there package that provides more general ones?
This is my own implementation.
Not exactly what you want, but there’s MPICLusterManagers.jl that has
@mpi_do that does eg.:
@mpi_do manager begin
println("Hello world, I am $(MPI.Comm_rank(comm)) of $(MPI.Comm_size(comm))")
In this case the code is executed only on the workers. Perhaps this might be used for communications?
MPIClusterManagers.jl has more than that, I think it has exactly what OP is asking for, you just need to use
julia> using MPI, MPIClusterManagers, Distributed
julia> result = pmap(1:10) do x
Note you can also use the
MPIClusterManagers.start_main_loop way of initializing MPI which lets you use
mpiexec -n with a script.