This is probably the most portable way to do it (select with a timeout
and then poll MPI). Remember that LAM may not be using file
descriptors to communicate between MPI processes -- it may be using
shared memory, gm, or Infiniband. None of these rely on file
descriptors for knowing when communications are pending.
So your best bet is this timeout select method, or perhaps have
progression handled in different threads for different entities (your
fd's in handled in one thread and MPI progression in another thread).
On Nov 15, 2004, at 10:54 AM, pavelord wrote:
> I want to write a program which at some point sleeps waiting for an
> i/o event - receiving a message through mpi OR from normal file
> descriptor (pipe for example). The question is how to do it nicely? For
> using functions such as select or poll I would have to know on which fd
> does MPI listen (maybe there is a function in mpi which returns fd?).
> On
> the other hand the MPI_Recv function doesn't return when something
> waits
> for reading in the pipe (non-mpi fd). At the moment I use select with
> a timeout, when
> it returns i check non-blocking MPI_Recv and then call select again and
> so on. But this is very ugly :(
>
> If someone knows a better solution please let me know
>
> best regards
> p.
> --
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|