From 1f5a79bbd4ac8edc959473dd9132204e67ad9bf2 Mon Sep 17 00:00:00 2001 From: Todd Kordenbrock Date: Wed, 9 Oct 2019 17:07:50 -0500 Subject: [PATCH 1/2] 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 (cherry picked from commit e7b867c044f8b776b75f3c6d917745c06237743e) --- ompi/mca/mtl/portals4/mtl_portals4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ompi/mca/mtl/portals4/mtl_portals4.c b/ompi/mca/mtl/portals4/mtl_portals4.c index 5371a8be4dc..6d2dc9498da 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4.c +++ b/ompi/mca/mtl/portals4/mtl_portals4.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * 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$ * @@ -551,12 +551,12 @@ ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl) if (0 == ompi_mtl_portals4.need_init) { opal_progress_unregister(ompi_mtl_portals4_progress); while (0 != ompi_mtl_portals4_progress()) { } - } #if OMPI_MTL_PORTALS4_FLOW_CONTROL - ompi_mtl_portals4_flowctl_fini(); + ompi_mtl_portals4_flowctl_fini(); #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)) { PtlMEUnlink(ompi_mtl_portals4.long_overflow_me_h); From 2c082b6c7cd7bcb7d206f4a41abc638b7dcad09e Mon Sep 17 00:00:00 2001 From: Todd Kordenbrock Date: Wed, 9 Oct 2019 17:12:56 -0500 Subject: [PATCH 2/2] btl-portals4: fix a flow control configure bug This commit fixes a configure bug that caused flow control to be disabled regardless of the configure options used. Signed-off-by: Todd Kordenbrock (cherry picked from commit f7e74b6a3d19cd6e3edc3364783311e595f81b3d) --- opal/mca/btl/portals4/configure.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opal/mca/btl/portals4/configure.m4 b/opal/mca/btl/portals4/configure.m4 index cc7c0dbda2c..1b62c0da1f3 100644 --- a/opal/mca/btl/portals4/configure.m4 +++ b/opal/mca/btl/portals4/configure.m4 @@ -11,7 +11,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2010 Sandia National Laboratories. All rights reserved. +# Copyright (c) 2010-2019 Sandia National Laboratories. All rights reserved. # Copyright (c) 2014 Bull SAS. All rights reserved. # $COPYRIGHT$ # @@ -44,9 +44,9 @@ AC_DEFUN([MCA_opal_btl_portals4_CONFIG],[ [AC_HELP_STRING([--enable-btl-portals4-flow-control], [enable flow control for Portals 4 BTL (default: disabled)])]) AC_MSG_CHECKING([whether to enable flow control]) - if test "$enable_btl_portals4_flow_control" != "yes"; then - AC_MSG_RESULT([no]) - btl_portals4_flow_control_enabled=0 + if test "$enable_btl_portals4_flow_control" != "no"; then + AC_MSG_RESULT([yes]) + btl_portals4_flow_control_enabled=1 else AC_MSG_RESULT([no]) btl_portals4_flow_control_enabled=0