Hi all, I am trying to evaluate the time taken for MPI_Comm_spawn operation in the latest version of OpenMPI. Here a parent communicator (all processes, not just the root) spawns one new child process (separate executable). The code I¹m executing is
main(){ { Š.. // MPI initialization Š.. start1 = MPI_Wtime(); MPI_Comm_spawn(³./child", MPI_ARGV_NULL,1, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &inter_communicator, MPI_ERRCODES_IGNORE ); End = MPI_Wtime(); printf(³ spawn time: %f², (end-start)); MPI_Barrier(inter_communicator); // spawn is collective, but still want to ensure it using a barrier .. .. // MPI finalize } In child.c main(){ { Š.. // MPI initialization Š.. MPI_Comm_get_parent(&parentcomm); // gets the inter-communicator MPI_Barrier(parentcomm); .. .. // MPI finalize } My observation is that the spawn time is very high (almost 80% of the total program execution time). It increases exponentially with the number of processes in the parent communicator. Is this method correct, and is the MPI_Comm_spawn operation expensive. I have also tried MPI_Comm_spawn_multiple but it still measures the same time. Could kindly someone guide me in this issue. Thanks, Murali