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
|