Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] MPI_Comm_spawn and exit of parent process.
From: TERRY DONTJE (terry.dontje_at_[hidden])
Date: 2012-06-18 06:27:55

On 6/16/2012 8:03 AM, Roland Schulz wrote:
> Hi,
> I would like to start a single process without mpirun and then use
> MPI_Comm_spawn to start up as many processes as required. I don't want
> the parent process to take up any resources, so I tried to disconnect
> the inter communicator and then finalize mpi and exit the parent. But
> as soon as I do that the children exit too. Why is that? Can I somehow
> change that behavior? Or can I wait on the children to exit without
> the waiting taking up CPU time?
> The reason I don't need the parent as soon as the children are
> spawned, is that I need one intra-communicator over all processes. And
> as far as I know I cannot join the parent and children to one
> intra-communicator.
You could use MPI_Intercomm_merge to create an intra-communicator out of
the groups in an inter-communicator and pass the inter-communicator you
get back from the MPI_Comm_spawn call.

> The purpose of the whole exercise is that I want that my program to
> use all cores of a node by default when executed without mpirun.
> I have tested this with OpenMPI 1.4.5. A sample program is here:
> . "Child finalized" is only printed with
> the sleep(2) in the parent not commented out.
> Roland
> --
> ORNL/UT Center for Molecular Biophysics <>
> 865-241-1537, ORNL PO BOX 2008 MS6309
> _______________________________________________
> users mailing list
> users_at_[hidden]

Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle *- Performance Technologies*
95 Network Drive, Burlington, MA 01803
Email terry.dontje_at_[hidden] <mailto:terry.dontje_at_[hidden]>