LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2005-12-13 13:57:42


On Dec 13, 2005, at 11:47 AM, angel friki wrote:

> Hi, i´m trying to use mpi with signals.
> I have a proccess (0) stopped in a mpi_recv, and i want if a
> timeout is
> complete the proccess exits from de mpi_recv.
>
> I´ve tried with this code but i get bad results :( :
>
> alarm(3);
> return=MPI_Recv(&bloque,
> 1,MPI_BLOQUE,MPI_ANY_SOURCE,MPI_ANY_TAG,MPI_COMM_WORLD,&estado);
> if(return!=0) //alarm received
> {
> .....
> }
>
>
> What can i do?? Thanks ;)

The MPI standard doesn't permit you to do anything. An MPI function
can not be interrupted once it has been called. It might be possible
to find an MPI implementation that is signal safe (so you could send
a message to complete the receive), but I doubt it. LAM certainly
does not meet the requirements necessary for being signal safe and I
would be surprised if other MPI implementations do so. Your best bet
is to switch to using MPI_Irecv and MPI_Test.

Brian

-- 
   Brian Barrett
   LAM/MPI developer and all around nice guy
   Have a LAM/MPI day: http://www.lam-mpi.org/