Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When not to use MPI

This is not a question on specific technical coding aspect of MPI. I am NEW to MPI, and not wanting to make a fool of myself of using the library in a wrong way, thus posting the question here.

As far as I understand, MPI is a environment for building parallel application on a distributed memory model.

I have a system that's interconnected with Infiniband, for the sole purpose of doing some very time consuming operations. I've already broke out the algorithm to do it in parallel, so I am really only using MPI to transmit data (results of the intermediate steps) between multiple nodes over Infiniband, which I believe one can simply use OpenIB to do.

Am I using MPI the right way? Or am I bending the original intention of the system?

like image 383
code monkey Avatar asked Jan 18 '23 16:01

code monkey


2 Answers

Its fine to use just MPI_Send & MPI_Recv in your algorithm. As your algorithm evolves, you gain more experience, etc. you may find use for the more "advanced" MPI features such as barrier & collective communication such as Gather, Reduce, etc.

like image 60
jman Avatar answered Apr 28 '23 14:04

jman


The fewer and simpler the MPI constructs you need to use to get your work done, the better MPI is a match to your problem -- you can say that about most libraries and lanaguages, as a practical matter and argualbly an matter of abstractions.

Yes, you could write raw OpenIB calls to do your work too, but what happens when you need to move to an ethernet cluster, or huge shared-memory machine, or whatever the next big interconnect is? MPI is middleware, and as such, one of its big selling points is that you don't have to spend time writing network-level code.

like image 28
Jonathan Dursi Avatar answered Apr 28 '23 13:04

Jonathan Dursi