The difference between starting the program with and without mpirun

I implemented peer-to-peer connection in MPI using MPI_Open_port and MPI_Comm_accept . I start the server and client program using

 rafael@server1:~$ mpirun server rafael@server2:~$ mpirun client 

on different computers. I noticed that

 rafael@server1:~$ ./server rafael@server2:~$ ./client 

also works great. Do you know if there is a difference between running the MPI executable with and without mpirun ?

Of course, I can’t give additional parameters (for example, mpirun --mca btl self,openib ), and the rank of all processes is 0, which is absolutely normal. But is there something less obvious?

+7
mpi openmpi
source share
1 answer

Working without mpirun / mpiexec is called "singleton MPI_INIT " and is part of the MPI guidelines for high-quality implementations found in section 10.5.2 in the latest MPI standard document:

A high-quality implementation will allow any process (including one not running with the "parallel application" mechanism) to become an MPI process by calling MPI_INIT . Such a process can then be connected to other MPI processes using the MPI_COMM_ACCEPT and MPI_COMM_CONNECT routines or create other MPI processes. MPI does not provide this behavior, but strongly recommends it where it is technically possible.

If a process enters MPI_INIT and determines that no special steps have been taken (i.e. it has not been provided with information to form MPI_COMM_WORLD with other processes), it succeeds and forms a single-user MPI program, one in which MPI_COMM_WORLD has a size one.

Using mpirun in your case is the "parallel application" mechanism mentioned in the standard text. It provides MPI_INIT information necessary to set MPI_COMM_WORLD for all running processes. Without information from mpirun processes can only be executed as single MPI instances and, therefore, they all have a rank of 0 (this is normal, since each MPI_COMM_WORLD is separate).

+15
source share

All Articles