1
1

mtl-portals4: don't finalize flow control if Portals4 was not initialized

This commit fixes a segfault in mtl-portals4 finalize().  The segfault
occurs if finalize() is called without any calls to add_procs().  This
commit resolves the segfault by skipping the flow control fini() call if
Portals4 was not initialized.

Signed-off-by: Todd Kordenbrock <thkgcode@gmail.com>
Этот коммит содержится в:
Todd Kordenbrock 2019-10-09 17:07:50 -05:00
родитель ea7e1ea859
Коммит e7b867c044

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2010-2015 Sandia National Laboratories. All rights reserved. * Copyright (c) 2010-2019 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -551,12 +551,12 @@ ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl)
if (0 == ompi_mtl_portals4.need_init) { if (0 == ompi_mtl_portals4.need_init) {
opal_progress_unregister(ompi_mtl_portals4_progress); opal_progress_unregister(ompi_mtl_portals4_progress);
while (0 != ompi_mtl_portals4_progress()) { } while (0 != ompi_mtl_portals4_progress()) { }
}
#if OMPI_MTL_PORTALS4_FLOW_CONTROL #if OMPI_MTL_PORTALS4_FLOW_CONTROL
ompi_mtl_portals4_flowctl_fini(); ompi_mtl_portals4_flowctl_fini();
#endif #endif
ompi_mtl_portals4_recv_short_fini(); ompi_mtl_portals4_recv_short_fini();
}
if (!PtlHandleIsEqual(ompi_mtl_portals4.long_overflow_me_h, PTL_INVALID_HANDLE)) { if (!PtlHandleIsEqual(ompi_mtl_portals4.long_overflow_me_h, PTL_INVALID_HANDLE)) {
PtlMEUnlink(ompi_mtl_portals4.long_overflow_me_h); PtlMEUnlink(ompi_mtl_portals4.long_overflow_me_h);