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 15:04:49


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

> Nicolas Bock wrote:
>
> On Fri, Dec 4, 2009 at 10:29, Eugene Loh <Eugene.Loh_at_[hidden]> wrote:
>
>> 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.
>>
>
> could you give me more details?
>
> Nope, sorry. I'm going to drop out here. The basic idea was something
> like:
>
> MPI_Irecv();
> while ( !flag ) {
> nanosleep(...);
> MPI_Test(...&flag...);
> }
>
> but I was hoping to "leave the rest to the reader".
>
>
HI Eugene,

thanks for the help. I think I got it now:

master.c:

MPI_Irecv(buffer+buffer_index, 1, MPI_CHAR, MPI_ANY_SOURCE, 0, spawn,
request+buffer_index);

and slave.c

MPI_Send(&buffer, 1, MPI_CHAR, 0, 0, spawn);

That seems to do the trick. Since our "slave" processes are expected to have
rather long runtimes, the sleep statement in master is simply

sleep(2);

to sleep 2 seconds. The load on the master process is basically zero now.

Thanks again for your help,

nick