From 38e961193074d382983d000e68adb721aaf3df7d Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Tue, 4 Nov 2014 14:25:02 -0700 Subject: [PATCH] btl/openib: fix recieve queue source detection --- opal/mca/btl/openib/btl_openib.c | 72 +++++++++++----------- opal/mca/btl/openib/btl_openib.h | 5 +- opal/mca/btl/openib/btl_openib_component.c | 6 +- 3 files changed, 39 insertions(+), 44 deletions(-) diff --git a/opal/mca/btl/openib/btl_openib.c b/opal/mca/btl/openib/btl_openib.c index 88eb31f466..243afb8d21 100644 --- a/opal/mca/btl/openib/btl_openib.c +++ b/opal/mca/btl/openib/btl_openib.c @@ -520,10 +520,12 @@ static int mca_btl_openib_tune_endpoint(mca_btl_openib_module_t* openib_btl, if a user distributes different INI files or parameters for different node/procs, it is on his own responsibility */ switch(mca_btl_openib_component.receive_queues_source) { - case MCA_BASE_VAR_SOURCE_COMMAND_LINE: - case MCA_BASE_VAR_SOURCE_ENV: - case MCA_BASE_VAR_SOURCE_MAX: - break; + case MCA_BASE_VAR_SOURCE_COMMAND_LINE: + case MCA_BASE_VAR_SOURCE_ENV: + case MCA_BASE_VAR_SOURCE_FILE: + case MCA_BASE_VAR_SOURCE_SET: + case MCA_BASE_VAR_SOURCE_OVERRIDE: + break; /* If the queues configuration was set from command line (with --mca btl_openib_receive_queues parameter) => both sides have a same configuration */ @@ -532,40 +534,38 @@ static int mca_btl_openib_tune_endpoint(mca_btl_openib_module_t* openib_btl, not possible that remote side got its queues configuration from command line => (by prio) the configuration was set from INI file or (if not configure) by default queues configuration */ - case MCA_BASE_VAR_SOURCE_FILE: - case MCA_BASE_VAR_SOURCE_SET: - case MCA_BASE_VAR_SOURCE_OVERRIDE: - if(NULL != values.receive_queues) { - recv_qps = values.receive_queues; - } else { - recv_qps = mca_btl_openib_component.default_recv_qps; - } + case BTL_OPENIB_RQ_SOURCE_DEVICE_INI: + if(NULL != values.receive_queues) { + recv_qps = values.receive_queues; + } else { + recv_qps = mca_btl_openib_component.default_recv_qps; + } - if(0 != strcmp(mca_btl_openib_component.receive_queues, - recv_qps)) { - opal_show_help("help-mpi-btl-openib.txt", - "unsupported queues configuration", true, - opal_process_info.nodename, - ibv_get_device_name(openib_btl->device->ib_dev), - (openib_btl->device->ib_dev_attr).vendor_id, - (openib_btl->device->ib_dev_attr).vendor_part_id, - mca_btl_openib_component.receive_queues, - opal_get_proc_hostname(endpoint->endpoint_proc->proc_opal), - endpoint->rem_info.rem_vendor_id, - endpoint->rem_info.rem_vendor_part_id, - recv_qps); + if(0 != strcmp(mca_btl_openib_component.receive_queues, + recv_qps)) { + opal_show_help("help-mpi-btl-openib.txt", + "unsupported queues configuration", true, + opal_process_info.nodename, + ibv_get_device_name(openib_btl->device->ib_dev), + (openib_btl->device->ib_dev_attr).vendor_id, + (openib_btl->device->ib_dev_attr).vendor_part_id, + mca_btl_openib_component.receive_queues, + opal_get_proc_hostname(endpoint->endpoint_proc->proc_opal), + endpoint->rem_info.rem_vendor_id, + endpoint->rem_info.rem_vendor_part_id, + recv_qps); - return OPAL_ERROR; - } - break; + return OPAL_ERROR; + } + break; /* If the local queues configuration was set by default queues => check all possible cases for remote side and compare */ - case MCA_BASE_VAR_SOURCE_DEFAULT: - if(NULL != values.receive_queues) { - if(0 != strcmp(mca_btl_openib_component.receive_queues, - values.receive_queues)) { - opal_show_help("help-mpi-btl-openib.txt", + case MCA_BASE_VAR_SOURCE_DEFAULT: + if(NULL != values.receive_queues) { + if(0 != strcmp(mca_btl_openib_component.receive_queues, + values.receive_queues)) { + opal_show_help("help-mpi-btl-openib.txt", "unsupported queues configuration", true, opal_process_info.nodename, ibv_get_device_name(openib_btl->device->ib_dev), @@ -577,10 +577,10 @@ static int mca_btl_openib_tune_endpoint(mca_btl_openib_module_t* openib_btl, endpoint->rem_info.rem_vendor_part_id, values.receive_queues); - return OPAL_ERROR; - } + return OPAL_ERROR; } - break; + } + break; } return OPAL_SUCCESS; diff --git a/opal/mca/btl/openib/btl_openib.h b/opal/mca/btl/openib/btl_openib.h index 77da695f99..928a364fb8 100644 --- a/opal/mca/btl/openib/btl_openib.h +++ b/opal/mca/btl/openib/btl_openib.h @@ -126,10 +126,7 @@ struct mca_btl_openib_qp_info_t { (BTL_OPENIB_QP_TYPE(Q) == MCA_BTL_OPENIB_XRC_QP) typedef enum { - BTL_OPENIB_RQ_SOURCE_DEFAULT, - BTL_OPENIB_RQ_SOURCE_MCA, - BTL_OPENIB_RQ_SOURCE_DEVICE_INI, - BTL_OPENIB_RQ_SOURCE_MAX + BTL_OPENIB_RQ_SOURCE_DEVICE_INI = MCA_BASE_VAR_SOURCE_MAX, } btl_openib_receive_queues_source_t; typedef enum { diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index 85c1c42d3e..57d22005cf 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -1975,9 +1975,7 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev) } /* If the MCA param was specified, skip all the checks */ - if ( MCA_BASE_VAR_SOURCE_COMMAND_LINE || - MCA_BASE_VAR_SOURCE_ENV == - mca_btl_openib_component.receive_queues_source) { + if (MCA_BASE_VAR_SOURCE_DEFAULT != mca_btl_openib_component.receive_queues_source) { goto good; } @@ -1995,7 +1993,7 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev) mca_btl_openib_component.receive_queues = strdup(values.receive_queues); mca_btl_openib_component.receive_queues_source = - MCA_BASE_VAR_SOURCE_FILE; + BTL_OPENIB_RQ_SOURCE_DEVICE_INI; } }