Skip to content

Commit f10305a

Browse files
author
Michael Heinz
committed
Add check for PSM2 reference counting to PSM2 MTL #7721
As discussed, a feature is being added to libpsm2 to correctly handle the case where the library is opened by multiple OMPI transports in the same process. (For example, the OFI BTL and the PSM2 MTL). * Improved error message to indicate required libpsm2 version. * Adds a test at autogen/configure time for the existence of PSM2_LIB_REFCOUNT_CAP. Signed-off-by: Jeff Squyres <jsquyres@cisco.com> Signed-off-by: Michael Heinz <michael.william.heinz@intel.com>
1 parent dbbdb8f commit f10305a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

config/ompi_check_psm2.m4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ AC_DEFUN([OMPI_CHECK_PSM2],[
7676
[AC_MSG_WARN([glob.h not found. Can not build component.])
7777
ompi_check_psm2_happy="no"])])
7878

79-
OPAL_SUMMARY_ADD([[Transports]],[[Intel Omnipath (PSM2)]],[$1],[$ompi_check_psm2_happy])
79+
AS_IF([test "$ompi_check_psm2_happy" = "yes"],
80+
[AC_CHECK_DECL([PSM2_LIB_REFCOUNT_CAP],
81+
[],
82+
[AC_MSG_WARN([PSM2 needs to be version 11.2.173 or later. Disabling MTL.])
83+
ompi_check_psm2_happy="no"],
84+
[#include <psm2.h>])
85+
])
86+
87+
OPAL_SUMMARY_ADD([[Transports]],[[Intel Omnipath (PSM2)]],[$1],[$ompi_check_psm2_happy])
8088
fi
8189

8290
AS_IF([test "$ompi_check_psm2_happy" = "yes"],

ompi/mca/mtl/psm2/mtl_psm2_component.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,18 @@ ompi_mtl_psm2_component_open(void)
323323
static int
324324
ompi_mtl_psm2_component_query(mca_base_module_t **module, int *priority)
325325
{
326+
327+
/*
328+
* Mixing the PSM2 MTL with the OFI BTL (using PSM2)
329+
* can cause an issue when they both call psm2_finalize
330+
* in older versions of libpsm2.
331+
*/
332+
if (!psm2_get_capability_mask(PSM2_LIB_REFCOUNT_CAP)) {
333+
opal_output_verbose(2, ompi_mtl_base_framework.framework_output,
334+
"This version of the PSM2 MTL needs version 11.2.173 or later of the libpsm2 library for correct operation.\n");
335+
return OMPI_ERR_FATAL;
336+
}
337+
326338
/*
327339
* if we get here it means that PSM2 is available so give high priority
328340
*/

0 commit comments

Comments
 (0)