On Aug 12, 2005, at 11:22 AM, Michael Lees wrote:
>>> I have a thread for performing asynchronous sending and receiving,
>>> something along the lines of...
>>>
>>> while(running){
>>> MPI_IRecv(&request)
>>> While(recvflag ==0){
>>> MPI_Test(request,recvflag)
>>> MPI_Send()
>>> yield()
>>> }
>>> yield()
>>> }
>>
>>
>> Wow, that's a lot of sending. :-)
>
> Is it though? As far as I understand it the blocking send will wait
> until a matching receive is posted? Am I wrong? So they'll only be one
> send per receive?
No, not necessarily. Check out the sidebar entitled "To block or not
to block" in this column for an explanation:
http://cw.squyres.com/columns/2004-02-CW-MPI-Mechanic.pdf
Short version: if you are sending a short message, you may actually be
sending many times before your receive completes (it's a parallel race
condition). If you're trying to simply match a single send and a
single receive, you might want to use MPI_SENDRECV or a pattern similar
to:
MPI_Irecv(...)
MPI_Isend(...);
MPI_Waitall(...);
> The setup is 10 or so slave nodes sending 8000 messages each to a
> single
> master node which processes the messages and may send responses to the
> slaves. I figured the above design for send/receive thread was general
> enough for both types of node? Each slave delays for approximately 100
> miliseconds every 16 events which should give time for the master to
> process the events.
I can't really say -- I'm not familiar with the internals of your app.
For example:
- Do the slaves know if the message they send is going to generate a
response from the master?
- Does the slave need to block while waiting for that ack, or can it
continue to do other work?
> It seems my application has odd behaviour - it starts quickly and
> midway
> through starts to slow down. It doesn't seem to be a memory problem -
> from ps the processes are about 5megs each (4 per node) resulting in
> 20meg on a 1gb node? The CPU usage is low too, around 8%.
> If you have any other ideas what might be slowing things down it's much
> appreciated.
Check for other OS kinds of slowness -- are you overloading nodes (more
processes than processors)? Are you doing significant I/O? Is there a
lot of message passing traffic? And so on.
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|