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

MPI Dynamic Process Management

Tomoya_Shinoda
Beginner
535 Views
Hi, I have several questions about dynamic process managemnt in MPI.
1. For example I have application a.out. If I execute mpirun twice (mpirun -n 1 a.out) Can I make the a.out to communicate each other?
I clearly understand that mpirun -n 2 a.out creates two process that can communicate each other over MPI_COMM_WORLD, but I want to know if I run mpirun -n 1 a.out twice they have two different MPI_COMM_WORLD, is there a way to unite two MPI_COMM_WORLDs?
2. If I create process using MPI_Comm_spawn, but after some time the parent process has died, what will happen to the child process?
3. If some process A, create process B, that process B create process C, and C create D, (all processes use using MPI_Comm_spawn)etc... can I make these A, B, C, D process to communicate each other using one common communicator?
Thanks,
0 Kudos
3 Replies
James_T_Intel
Moderator
535 Views
Hi,

If you run two separate instances of mpirun, by default the two will not communicate with each other. You can use MPI_Open_port and MPI_Comm_accept in one application to allow it to receive connections (server) and MPI_Comm_connect to connect to that port (client). In this case, you would run each application separately:

[plain]mpirun -n 1 ./server mpirun -n 1 ./client[/plain]
This will not change MPI_COMM_WORLD in either application, but will create new communicators that can be used to send messages between the two.

If the parent process ends early, all of the processes in that MPI_COMM_WORLD will end. However, the spawned processes do not share the same MPI_COMM_WORLD and will continue. There will be an error at MPI_Finalize(), since it will attempt to communicate with the parent.

You can chain process spawning and merging, using MPI_Intercomm_merge. This will allow a single communicator to be created that will contain all of the processes.

Sincerely,
James Tullos
Technical Consulting Engineer
Intel Cluster Tools
0 Kudos
Tomoya_Shinoda
Beginner
535 Views
Thanks for your reply,
So, If I say that I am going to implement services that manages cluster nodes (than could be dynamicaly added or removed), mpi jobs, it won't be a good idea? MPI is best using just in general computation, but in client/server, or management software.
0 Kudos
James_T_Intel
Moderator
535 Views
Hi,

Correct. MPI is generally intended for dividing a large computation into manageable pieces. You can use it for server/client capabilities, or in management software, but that is not its primary purpose.

Sincerely,
James Tullos
Technical Consulting Engineer
Intel Cluster Tools
0 Kudos
Reply