Lisandro, You rely on a feature clearly prohibited by the MPI standard. Please read the entire section I pinpointed you to (8.7.1).
There are 2 key sentences in the section. 1. When MPI_FINALIZE is called, it will first execute the equivalent of an MPI_COMM_FREE on MPI_COMM_SELF. 2. The freeing of MPI_COMM_SELF occurs before any other parts of MPI are affected. Thus, for example, calling MPI_FINALIZED will return false in any of these callback functions. Once done with MPI_COMM_SELF, the order and rest of the actions taken by MPI_FINALIZE is not specified. Thus when MPI is calling the equivalent of MPI_COMM_FREE on your communicator, it is too late the MPI is already considered as finalized. Moreover, relying on MPI to cleanup your communicators is already bad habit, which is rightfully punished by Open MPI. George. On Tue, Aug 26, 2014 at 3:01 PM, Lisandro Dalcin <dalc...@gmail.com> wrote: > On 26 August 2014 21:29, George Bosilca <bosi...@icl.utk.edu> wrote: > > The MPI standard clearly states (in 8.7.1 Allowing User Functions at > Process > > Termination) that the mechanism you describe is only allowed on > > MPI_COMM_SELF. The most relevant part starts at line 14. > > > > IMHO, you are misinterpreting the standard. Please note that the > "callbacks" I'm talking about are the ones registered for freeing > cached attributes, their invocation is tied to the lifetime of the MPI > handle. The callbacks you are talking about are different kind of > beasts, they are callbacks you what to run specifically at > MPI_Finalize(). > > Caching duplicated communicators is a key feature in many libraries. > How do you propose to handle the deallocation of the duped > communicators when COMM_WORLD is involved? > > > > > -- > Lisandro Dalcin > ============ > Research Scientist > Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) > Numerical Porous Media Center (NumPor) > King Abdullah University of Science and Technology (KAUST) > http://numpor.kaust.edu.sa/ > > 4700 King Abdullah University of Science and Technology > al-Khawarizmi Bldg (Bldg 1), Office # 4332 > Thuwal 23955-6900, Kingdom of Saudi Arabia > http://www.kaust.edu.sa > > Office Phone: +966 12 808-0459 > _______________________________________________ > devel mailing list > de...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel > Link to this post: > http://www.open-mpi.org/community/lists/devel/2014/08/15718.php >