Newsgroups: comp.parallel.pvm
From: john@elroy.jpl.nasa.gov (John Wright)
Subject: ??? send/recv vs psend/precv question?
Organization: Image Analysis Systems Group, JPL
Date: 1 Nov 1994 15:40:49 GMT
Message-ID: <395ni2$m2l@elroy.jpl.nasa.gov>

I have a question regarding the difference between using send/recv
and psend/precv.  I have been doing some experimentation using a
parent task which spawns 30 subtasks and sends and receives
messages.  The subtasks basically do a recv followed by a send
(there's some unpacking and packing also to test that) then a
precv followed by a psend.  The parent task spawns the 30 children,
then does 30 sends followed by 30 recvs followed by 30 psends then
30 precvs.  When doing the recvs and precvs I specify the task id
of the child to receive from.

When receiving the 30 recvs, they are all received and I print a
message for each one.  However, when I do the 30 precvs, the
parent will receive and print a few (1-15) and then hang up.  If
I do a sleep after each psend to a child, it receives all 30 no
problem.  If I do a psend followed by a precv 30 times it gets all
30 no problem.  My suspicion is that the message queue (assuming
there is one here) for send and recv properly allow the user
to look up the first message in the queue for the specified task id
but that psend and precv do not and that the hangup occurs when
the head of the precv queue is from a task other than the task id
specified.  Assuming they use the same queue (which I think is the
case as the user guide specifies that recv can be used to receive
a message sent by psend) then the precv code may not be correct.
The problem arises because the 30 precv messages may not come back
in the same order as the 30 psends went out because they go to 30
different subtasks.

These are only tests so I don't need a workaround...just to know
if my experience matches anyone else's and if this is a known
problem or only a problem with something I've set up.  I am using
version 3.3.3.  Also, all machines in the hostfile I use are the
same architecture so I expect no formatting problems.  Does anyone
have any suggestions as to what's going on or what I've done wrong?
Thanks for any enlightenment you can shed.

John



