Difference between running a program with and without mpirun

前端 未结 1 1695
慢半拍i
慢半拍i 2020-12-17 20:13

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

r         


        
相关标签:
1条回答
  • 2020-12-17 21:15

    Running without mpirun/mpiexec is called "singleton MPI_INIT" and is part of the MPI recommendations for high quality implementations, found under §10.5.2 in the latest MPI standard document:

    A high-quality implementation will allow any process (including those not started with a "parallel application" mechanism) to become an MPI process by calling MPI_INIT. Such a process can then connect to other MPI processes using the MPI_COMM_ACCEPT and MPI_COMM_CONNECT routines, or spawn other MPI processes. MPI does not mandate this behavior, but strongly encourages it where technically feasible.

    If a process enters MPI_INIT and determines that no special steps were taken (i.e., it has not been given the information to form an MPI_COMM_WORLD with other processes) it succeeds and forms a singleton MPI program, that is, one in which MPI_COMM_WORLD has size 1.

    Using mpirun in your case is the "parallel application" mechanism, mentioned in the standard text. It provides MPI_INIT with the information necessary to establish MPI_COMM_WORLD over all started processes. Without the information from mpirun processes can only run as singleton MPI instances and hence all of them have rank 0 (which is OK, since each MPI_COMM_WORLD is a separate one).

    0 讨论(0)
提交回复
热议问题