Newsgroups: comp.parallel.pvm
From: weber@hamburg.baw.de (Alexander Weber)
Subject: Re: Asynchronous Messaging in PVM
Organization: Deutsches Klimarechenzentrum, Hamburg
Date: Fri, 4 Jul 1997 10:45:41 -400
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <5pid5j$e5h$1@alster.dkrz.de>

In article <33BBBF8B.5652@cs.tamu.edu>
jobell@cs.tamu.edu <jobell@cs.tamu.edu> wrote:
> Hi.
> 
> To handle asynchronous messaging between a parent and its spawned 
> children I'm writing a simple event loop that polls for messages using 
> pvm_nrecv.  On the parent, however, I'm also polling for input on STDIN, 
> so I have to add a select call.  Unfortunately, I can't make a blocking 
> call on either one because they may starve each other.  Is it possible 
> to use pvm_getfds to do a blocking select on all of pvms fds plus 
> STDIN_FILENO, and then when select pops to check the fds and call 
> pvm_nrecv if any fds other than STDIN_FILENO are set?
> 
> Many thanks,
> 

> Joseph Bell
> 


Hi Joseph,

I had the same problem two weeks ago: a process had to choose from
different communication channels, pvm and pipes. But the select with
the filedescriptors from pvm_getfd didn't work as expected. The select
didn't catch all incoming pvm-messages. I wrote a tiny test programm,
consisting of two processes, one uses a pvm_send/pvm_recv pair, the 
other uses select/pvm_recv/pvm_send . After some messages they just
stop.
So I decided to do it this way:
   - only the pipes in the select
   - timeout to 0, select returns immediately
   - if no fdset is modified, do pvm_trecv for 200ms or so ...

Not very nice, but it worked for me.
Let me know, if you are interested in the pvm_getfds-test.

Regards,
  Alex


