Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 54ae604

Browse files
committed
btl/openib: fix check for exp verbs struct members
This commit fixes a compilation issue with some versions of exp verbs. In some cases struct ibv_exp_device_attr does not have either the exp_atom or exp_atomic_cap fields. It is fine to drop one check and fall back to the non-exp attribute check on the other. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from open-mpi/ompi@a65af6d) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent e911391 commit 54ae604

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

config/opal_check_openfabrics.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ AC_DEFUN([OPAL_CHECK_EXP_VERBS],[
400400
AC_DEFINE_UNQUOTED([HAVE_EXP_VERBS], [$have_struct_ibv_exp_send_wr], [Experimental verbs])
401401
AC_CHECK_DECLS([IBV_EXP_ATOMIC_HCA_REPLY_BE, IBV_EXP_QP_CREATE_ATOMIC_BE_REPLY, ibv_exp_create_qp, ibv_exp_query_device],
402402
[], [], [#include <infiniband/verbs_exp.h>])
403+
AC_CHECK_MEMBERS([struct ibv_exp_device_attr.ext_atom, struct ibv_exp_device_attr.ext_atomic_cap], [], [],
404+
[[#include <infiniband/verbs_exp.h>]])
403405
AS_IF([test '$have_struct_ibv_exp_send_wr' = 1], [$1], [$2])
404406
OPAL_VAR_SCOPE_POP
405407
])dnl

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
780780
#if HAVE_DECL_IBV_ATOMIC_HCA
781781
openib_btl->atomic_ops_be = false;
782782

783-
#if HAVE_DECL_IBV_EXP_QUERY_DEVICE
783+
#if HAVE_STRUCT_IBV_EXP_DEVICE_ATTR_EXT_ATOM
784784
/* check that 8-byte atomics are supported */
785785
if (!(device->ib_exp_dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) {
786786
openib_btl->super.btl_flags &= ~MCA_BTL_FLAGS_ATOMIC_FOPS;
@@ -790,7 +790,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
790790
}
791791
#endif
792792

793-
#if HAVE_DECL_IBV_EXP_QUERY_DEVICE
793+
#if HAVE_STRUCT_IBV_EXP_DEVICE_ATTR_EXT_ATOMIC_CAP
794794
switch (openib_btl->device->ib_exp_dev_attr.exp_atomic_cap)
795795
#else
796796
switch (openib_btl->device->ib_dev_attr.atomic_cap)

0 commit comments

Comments
 (0)