Dick Treumann - MPI Team
IBM Systems & Technology Group
Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
Tele (845) 433-7846 Fax (845) 433-8363

users-bounces@open-mpi.org wrote on 05/25/2010 12:03:11 AM:

> [image removed]

> [OMPI users] About the necessity of cancelation of pending
> communication and the use of buffer

> Yves Caniou

> to:

> Open MPI Users

> 05/25/2010 12:04 AM

> Sent by:

> users-bounces@open-mpi.org

> Please respond to yves.caniou, Open MPI Users

> Dear All,
> I have 2 questions on the use of the MPI API:
> 1 ** Do I have to cancel Irecv() and Isend() operations before calling
> MPI_Finalize() in the case of when MPI_Finalize() is called, I know for sure
> that the application has finished to compute the result, and must exit?
> A silly example would be an iterative code that Isends() a value given a
> proba, and checks if it receives a value given another proba. At the end,
> each prints a value. There's no synchronization. Do I have to track all
> Isend() and cancel them before calling MPI_Finalize()?

The MPI Standard requires that all posted communications be locally complete before a call to MPI_Finalize. That means every non blocking send or receive must be MPI_WAITed (or successful TESTed).  If the matching operation will never be posted because the program has done all it needs to, then you must both MPI_CANCEL those operations and MPI_WAIT them.

This is what the standard requires but that does not mean a particular MPI implementation will fail if you ignore the rule. If you want to write portable MPI code, obey the rule.

> 2 ** When I use a Isend() operation, the manpage says that I can't use the
> buffer until the operation completes.
> What happens if I use an Isend() operation in a function, with a buffer
> declared inside the function?
> Do I have to Wait() for the communication to finish before returning, or to
> declare the buffer as a global variable?

I see somebody answered this part.
> Thank you!
> .Yves.
> --
> Yves Caniou
> Associate Professor at Université Lyon 1,
> Member of the team project INRIA GRAAL in the LIP ENS-Lyon,
> Délégation CNRS in Japan French Laboratory of Informatics (JFLI),
>   * in Information Technology Center, The University of Tokyo,
>     2-11-16 Yayoi, Bunkyo-ku, Tokyo 113-8658, Japan
>     tel: +81-3-5841-0540
>   * in National Institute of Informatics
>     2-1-2 Hitotsubashi, Chiyoda-ku, Tokyo 101-8430, Japan
>     tel: +81-3-4212-2412
> http://graal.ens-lyon.fr/~ycaniou/
> _______________________________________________
> users mailing list
> users@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users