Very simple MPI implementation question

I’m trying to do some simple MPI calculations but have had some difficulty finding good tutorials online. For this implementation we cannot use threading, because of some interface issues with other codes (most advice I see appears to be, just use threading for problems like this).

Ok, how exactly do I do a simple calculation with mpi, preferably using scatter, and gather.

I have an array of inputs, we’ll call A and an array of outputs which I’ll call B
and a function f that takes an input A and provides an output B.

I want to parallelize over the input array A.

This is probably the easiest MPI implementation I can think of, yet I’ve had difficulty figuring out how to implement it. I couldn’t even find any simple example implementation of mpi_scatter and mpi_gather online.

Thanks for any advice.

Have you looked at MPI.jl? It contains examples that might be helpful.

Also note that Julia has its own multi-process parallelisation implementation, i.e. as an alternative to MPI.

Yes, I read the documentation on MPI.jl. I did not find any example usages for mpi_gather or mpi_scatter. TBH I didn’t find the given examples very enlightening.

And yes, i realize that Julia has it’s own implementation, but we cannot use it in this case b/c of the need to interface with codes in other languages.

Hello @abader Maybe you could join the Openmpi mailing list adn ask for advice? It is quite friendly over there