Newsgroups: comp.parallel.pvm
From: manchek@rudolph.cs.utk.edu (Bob Manchek)
Subject: Re: Need help with PVM_GETFDS
Organization: Computer Science Dept, University of Tennessee, Knoxville
Date: 8 May 1996 15:24:55 GMT
Message-ID: <4mqec7INNjr2@CS.UTK.EDU>

In article <4mo4a5$3m2@llnews.ll.mit.edu>, Michael Whitmore <whitmore@ll.mit.edu> writes:

|> I'm trying to use pvm_getfds along with 'select' on an SGI and I'm 
|> having some trouble. I'm using the example found in the man pages for 
|> pvm_getfds. I created a parent task which spawns a child task and sends 
|> it a message. I implemented pvm_getfds and select in the child task. I 
|> can tell that the child task has a message waiting for it by using XPVM, 
|> but, the select call never seems to see it. Has anyone had similar 
|> problems or have any suggestions?

You may be seeing a bug that's currently in PVM - or rather a complication
with using getfds when tracing is enabled.

[ If the problem occurs without tracing or XPVM, then it's not this... ]

The assumptions about using getfds are usually:

 * If select reports that an fd is ready, you may have messages waiting.
 * Calling nrecv repeatedly will accept and clear out any waiting messages.

Here is the problem.  Libpvm uses regular messages to send trace
events.  And sending a message can cause any messages waiting on
sockets to get copied in.  So the timeline looks something like
this:

   pvm_nrecv(-1, -1)
      send entering-nrecv trace message
      no messages waiting, result = 0
      send exiting-nrecv trace message
         enter mxfer
            message arrives and gets copied in
      return 0
   problem: message has been copied in but not received, socket no longer ready

I remember this used to be easy to demonstrate; run xep and turn on
tracing and it would stall.

I'm working on a solution to this, but the bug is still in 3.3.10.
-b

-- 
/ Robert Manchek                University of Tennessee     /
/                               Computer Science Department /
/ (423)974-8295 / fax -8296     Ayres Hall #104             /
/ manchek@CS.UTK.EDU.           Knoxville TN  37996-1301    /
/     http://www.netlib.org/utk/people/BobManchek.html      /


