Based on your description, βProgram 1β is not an MPI application, and βProgram 2β is not an MPI application. The shortest solution path is likely to open a socket between two programs and send data in this way. This does not require that "Program 1" be changed as an MPI program. I will start with a socket between "Program 1" and "Program 2: Rank 0", with a rank of 0, distributing the data in the remaining rows.
A few suggestions so far have included running a heterogeneous set of executable files as one of the possible solutions. There is no requirement that all rows in the same MPI job be the same executable. This requires that both executables be "MPI programs" (for example, include at least MPI_Init and MPI_Finalize calls). The level of modification required for "Program 1", and the inability to run it outside the MPI environment, may make this option unattractive.
I would recommend that you avoid the dynamic process approach if you are not using a commercial implementation that offers support. Connect / accept support tends to be spotty in open source MPI implementations. It can βjust work,β but get technical assistance if it cannot be an open end problem.
source share