Hello Eugene:

On Mon, Dec 08, 2008 at 11:14:10AM -0800, Eugene Loh wrote:

...<html snipped/edited>...

>> Proceeding from that, it seems that "mpi_recv" is implemented as 
>>   "poll forever until the message comes"
>> and NOT as 
>>    "sleep until the message comes" 
>> 
>> I had assumed, until now, that mpi_recv would be implemented as the
>> second.

> It isn't a binary situation.&nbsp; The first extreme you mention is "consume
> a lot of resources and spring into action as soon as there is work to
> do."&nbsp; The second extreme you mention is "don't use any extra resources,
> but take a loooong time to wake up once there is something to do".&nbsp;
> There are a bunch of alternatives in-between.&nbsp; E.g., "don't use as much
> resource and wake up kind of fast when there is something to do."<br>
> <br>
> OMPI's yield behavior is such an in-between alternative.<br>

Ah...I didn't realize there were more than two alternatives.

> I could imagine another alternative.&nbsp; Construct a wrapper function that
> intercepts MPI_Recv and turn it into something like<br>
> <br>
> PMPI_Irecv<br>
> while ( ! done ) {<br>
> &nbsp;&nbsp;&nbsp; nanosleep(short);<br>
> &nbsp;&nbsp;&nbsp; PMPI_Test(&amp;done);<br>
> }<br>
> <br>
> I don't know how useful this would be for your particular case.<br>
> <br>

Thank you for the suggestion.  I didn't know about "PMPI_Irecv" (my
question was what/where did the "P" prefix to MPI come from?) so I
went back to the MPI standard, and re-read the description of
"mpi_send" and "mpi_recv".

Based on my re-read of the MPI standard, it appears that I may have
slightly mis-stated my issue.  The spin is probably taking place in
"mpi_send".  "mpi_send", according to my understanding of the MPI
standard, may not exit until a matching "mpi_recv" has been initiated,
or completed.  At least that is the conclusion I came to.

However my complaint - sorry, I wish I could think of a better word -
remains.  It appears that openmpi spin-waits, as opposed to, say,
going to sleep and waiting for a wake-up call.  Like a semaphore - if
those things still exist.

Regards,
Douglas.
-- 
  Douglas Guptill                       
  Research Assistant, LSC 4640          email: douglas.gupt...@dal.ca
  Oceanography Department               fax:   902-494-3877
  Dalhousie University
  Halifax, NS, B3H 4J1, Canada

Reply via email to