diff --git a/opal/mca/btl/openib/btl_openib.h b/opal/mca/btl/openib/btl_openib.h index d9bcd1780e..60e990ff41 100644 --- a/opal/mca/btl/openib/btl_openib.h +++ b/opal/mca/btl/openib/btl_openib.h @@ -372,10 +372,9 @@ typedef struct mca_btl_openib_device_t { opal_mutex_t device_lock; /* device level lock */ struct ibv_context *ib_dev_context; #if HAVE_DECL_IBV_EXP_QUERY_DEVICE - struct ibv_exp_device_attr ib_dev_attr; -#else - struct ibv_device_attr ib_dev_attr; + struct ibv_exp_device_attr ib_exp_dev_attr; #endif + struct ibv_device_attr ib_dev_attr; struct ibv_pd *ib_pd; struct ibv_cq *ib_cq[2]; uint32_t cq_size[2]; diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index 3d0136a381..07e94d6390 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -826,7 +826,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device, #if HAVE_DECL_IBV_EXP_QUERY_DEVICE /* check that 8-byte atomics are supported */ - if (!(device->dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) { + if (!(device->ib_exp_dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) { openib_btl->super.btl_flags &= ~MCA_BTL_FLAGS_ATOMIC_FOPS; openib_btl->super.btl_atomic_flags = 0; openib_btl->super.btl_atomic_fop = NULL; @@ -1650,18 +1650,17 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev) goto error; } #if HAVE_DECL_IBV_EXP_QUERY_DEVICE - if(ibv_exp_query_device(device->ib_dev_context, &device->ib_dev_attr)){ - BTL_ERROR(("error obtaining device attributes for %s errno says %s", - ibv_get_device_name(device->ib_dev), strerror(errno))); - goto error; - } -#else - if(ibv_query_device(device->ib_dev_context, &device->ib_dev_attr)){ + if(ibv_exp_query_device(device->ib_dev_context, &device->ib_exp_dev_attr)){ BTL_ERROR(("error obtaining device attributes for %s errno says %s", ibv_get_device_name(device->ib_dev), strerror(errno))); goto error; } #endif + if(ibv_query_device(device->ib_dev_context, &device->ib_dev_attr)){ + BTL_ERROR(("error obtaining device attributes for %s errno says %s", + ibv_get_device_name(device->ib_dev), strerror(errno))); + goto error; + } /* If mca_btl_if_include/exclude were specified, get usable ports */ allowed_ports = (int*)malloc(device->ib_dev_attr.phys_port_cnt * sizeof(int)); if (NULL == allowed_ports) {