[MPICH] ensuring progress .... Get_status vs. Test

Rajeev Thakur thakur at mcs.anl.gov
Fri Jan 19 16:49:31 CST 2007


Robert,
       Yes, we missed that one. MPICH2 should cause progress in
MPI_Request_get_status. We will fix it in the next release. Thanks for
catching it.

Rajeev
 

> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov 
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of 
> Harrison, Robert J.
> Sent: Friday, January 19, 2007 10:18 AM
> To: mpich-discuss at mcs.anl.gov
> Subject: [MPICH] ensuring progress .... Get_status vs. Test
> 
> With mpich2-1.0.3 on Cygwin I am finding that calling 
> Get_status() does not make progress on non-blocking 
> operations whereas Test() does.  An example program
> is provided below.
> 
> Could a kind reader let me know if this is an error
> in my example, or if the behaviour is MPI draft-standard 
> compliant, or just a feature of the current implementation?
> 
> Thanks and best wishes to all,
> 
>   Robert
> 
> 
> Robert J. Harrison - (865) 274-8544
> 
> 
> #include <mpi.h>
> #include <iostream>
> 
> using namespace std;
> 
> int main(int argc, char** argv) {
>     MPI::Init(argc, argv);
>     int np = MPI::COMM_WORLD.Get_size();
>     if (np != 2) throw "2 only";
>     
>     int me = MPI::COMM_WORLD.Get_rank();
>     int other = me? 0 : 1;
> 
>     int a=0, b=-1;
>     MPI::Request rsend = MPI::COMM_WORLD.Isend(&a, sizeof(a), 
> MPI::BYTE,
> other, 1);
>     MPI::Request rrecv = MPI::COMM_WORLD.Irecv(&b, sizeof(b), 
> MPI::BYTE,
> other, 1);
> 
>     MPI::Status status;
> 
>     while (!rsend.Get_status(status));
>     while (!rrecv.Get_status(status));
>     rsend.Test(status);
>     rrecv.Test(status);
>     
>     //while (!rsend.Test(status)) ;
>     //while (!rrecv.Test(status)) ;
> 
>     cout << me << " got " << b << endl;
> 
>     MPI::Finalize();
>     return 0;
> }
> 




More information about the mpich-discuss mailing list