Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Dynamic MPI connections

mattipaljakka
Beginner
379 Views

I am attempting to parallelize a part of a large legacy software product using MPI.

I would like to start up a number of processes just as they are started now, and use one of them as a master taking care of the overall execution and the rest as workers each doing its share of the parallel part.

Hence the MPI connections should be established on the fly. The processes can be running on the same computer or on different blades. Theycan communicate through sockets, too. The solution should work on Windows platforms.

I have tried to find a sample for doing this but have not found one.
Can someone help me.
Thanks,

Matti

0 Kudos
2 Replies
Dmitry_K_Intel2
Employee
379 Views
Hi Matti,

I'm not sure that I understood the question but I'll try to answer.
If you need dynamic processe you can take look at the example here: http://www.open-mpi.org/community/lists/users/att-16709/spawn-example.c_

Are you sure that you need dynamic processes? It's not so easy to work with them. It seems to me that much easier to work in regular way:
if (rank == 0){
Do preparation or whatever you need
}
else {
All other mpi processes will execute this code - doesn't matter how many processes you'll start
}

I think you can find a lot of examples on the Internet.

Regards!
Dmitry
0 Kudos
mattipaljakka
Beginner
379 Views

I am not willing to spawn the processes thenormal MPI way, as the software is currently started up in a manner which has quite a few historical details, which I am reluctant to change. There are other processes attached etc. This applies both to the start-up of the master and the workers.

What Ihave inmindis that the master somehow publishes an interface (MPI_OPEN_PORT?) to which the workers register. Each time when the execution of the master comes to the beginning of the parallel region, the master sees how many workers there are and distributes the work accordingly.

Maybe at a later stage if the results are good we will design and implement specific workers which will be spawned by the master. However ifthe above ideaworks, itwill give us a quick start with minimal changes in the code.

Matti

0 Kudos
Reply