From 0138a2ee1755c8c6190442f10f135ede25059073 Mon Sep 17 00:00:00 2001 From: Ron Brightwell Date: Thu, 29 Nov 2007 17:29:46 +0000 Subject: [PATCH] Do cleanup in ompi_mtl_portals_del_procs() rather than ompi_mtl_portals_finalize(). Previous code was cleaning up Portals resources that hadn't been allocated, which caused valid handles used elsewhere to be freed, which broke cnos_barrier() for the Portals btl. This commit was SVN r16801. --- ompi/mca/mtl/portals/mtl_portals.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ompi/mca/mtl/portals/mtl_portals.c b/ompi/mca/mtl/portals/mtl_portals.c index 9cb91ef268..2393766c98 100644 --- a/ompi/mca/mtl/portals/mtl_portals.c +++ b/ompi/mca/mtl/portals/mtl_portals.c @@ -271,22 +271,9 @@ ompi_mtl_portals_del_procs(struct mca_mtl_base_module_t *mtl, } } - return OMPI_SUCCESS; -} - - -int -ompi_mtl_portals_finalize(struct mca_mtl_base_module_t *mtl) -{ - assert(mtl == &ompi_mtl_portals.base); - ompi_mtl_portals_recv_short_disable((mca_mtl_portals_module_t *) mtl); - /* Don't try to wait for things to finish if we've never initialized */ - if (PTL_INVALID_HANDLE != ompi_mtl_portals.ptl_ni_h) { - opal_progress_unregister(ompi_mtl_portals_progress); - while (0 != ompi_mtl_portals_progress()) { } - } + ompi_mtl_portals_short_cleanup(); (void)PtlMDUnlink(ompi_mtl_portals.ptl_zero_md_h); @@ -306,7 +293,20 @@ ompi_mtl_portals_finalize(struct mca_mtl_base_module_t *mtl) (void)PtlMEUnlink(ompi_mtl_portals.ptl_read_catchall_me_h); - ompi_mtl_portals_short_cleanup(); + return OMPI_SUCCESS; +} + + +int +ompi_mtl_portals_finalize(struct mca_mtl_base_module_t *mtl) +{ + assert(mtl == &ompi_mtl_portals.base); + + /* Don't try to wait for things to finish if we've never initialized */ + if (PTL_INVALID_HANDLE != ompi_mtl_portals.ptl_ni_h) { + opal_progress_unregister(ompi_mtl_portals_progress); + while (0 != ompi_mtl_portals_progress()) { } + } ompi_common_portals_ni_finalize(); ompi_common_portals_finalize();