Skip to content

Commit 278712f

Browse files
committed
btl/openib: fix compile problems when using experimental verbs
(cherry picked from commit open-mpi/ompi@191aebb) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent e2efaf1 commit 278712f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

opal/mca/btl/openib/btl_openib.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,9 @@ typedef struct mca_btl_openib_device_t {
372372
opal_mutex_t device_lock; /* device level lock */
373373
struct ibv_context *ib_dev_context;
374374
#if HAVE_DECL_IBV_EXP_QUERY_DEVICE
375-
struct ibv_exp_device_attr ib_dev_attr;
376-
#else
377-
struct ibv_device_attr ib_dev_attr;
375+
struct ibv_exp_device_attr ib_exp_dev_attr;
378376
#endif
377+
struct ibv_device_attr ib_dev_attr;
379378
struct ibv_pd *ib_pd;
380379
struct ibv_cq *ib_cq[2];
381380
uint32_t cq_size[2];

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
826826

827827
#if HAVE_DECL_IBV_EXP_QUERY_DEVICE
828828
/* check that 8-byte atomics are supported */
829-
if (!(device->dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) {
829+
if (!(device->ib_exp_dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) {
830830
openib_btl->super.btl_flags &= ~MCA_BTL_FLAGS_ATOMIC_FOPS;
831831
openib_btl->super.btl_atomic_flags = 0;
832832
openib_btl->super.btl_atomic_fop = NULL;
@@ -1654,18 +1654,17 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
16541654
goto error;
16551655
}
16561656
#if HAVE_DECL_IBV_EXP_QUERY_DEVICE
1657-
if(ibv_exp_query_device(device->ib_dev_context, &device->ib_dev_attr)){
1657+
if(ibv_exp_query_device(device->ib_dev_context, &device->ib_exp_dev_attr)){
16581658
BTL_ERROR(("error obtaining device attributes for %s errno says %s",
16591659
ibv_get_device_name(device->ib_dev), strerror(errno)));
16601660
goto error;
16611661
}
1662-
#else
1662+
#endif
16631663
if(ibv_query_device(device->ib_dev_context, &device->ib_dev_attr)){
16641664
BTL_ERROR(("error obtaining device attributes for %s errno says %s",
16651665
ibv_get_device_name(device->ib_dev), strerror(errno)));
16661666
goto error;
16671667
}
1668-
#endif
16691668
/* If mca_btl_if_include/exclude were specified, get usable ports */
16701669
allowed_ports = (int*)malloc(device->ib_dev_attr.phys_port_cnt * sizeof(int));
16711670
if (NULL == allowed_ports) {

0 commit comments

Comments
 (0)