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, caller uses CPU while waiting for spawned processes
From: Nicolas Bock (nicolasbock_at_[hidden])
Date: 2009-12-04 12:58:11

On Fri, Dec 4, 2009 at 10:29, Eugene Loh <Eugene.Loh_at_[hidden]> wrote:

> Nicolas Bock wrote:
> On Fri, Dec 4, 2009 at 10:10, Eugene Loh <Eugene.Loh_at_[hidden]> wrote:
>> Yield helped, but not as effectively as one might have imagined.
> Yes, that's the impression I get as well, the master process might be
> yielding, but it doesn't appear to be a lot. Maybe I should do this
> differently to avoid this CPU usage in master. All I really want is to
> execute another process somewhere on a free node in my MPI universe, wait
> for it to be done and go on. From my limited understanding of MPI,
> MPI_Comm_spawn() and MPI_Barrier() seemed just like what I needed, but as I
> said, maybe there are other ways to do this.
> I think you might observe a world of difference if the master issued some
> non-blocking call and then intermixed MPI_Test calls with sleep calls. You
> should see *much* more subservient behavior. As I remember, putting such
> passivity into OMPI is on somebody's to-do list, but just not very high.

Hi Eugene,

could you give me more details? I can't figure out how to do this. I could
see that one way to implement what you are describing is:

in slave.c:
MPI_Send() to rank 0

in master.c
MPI_IRecv() from the spawned processes
while (1) { MPI_Test(); }

I can't figure out how to find the ranks that MPI_Comm_spawn() used. What's
the source argument in MPI_IRecv() supposed to be?

Thanks, nick