Skip to content

Commit e93f041

Browse files
committed
osc/rdma: Simplify query logic
With the change to load all btls in the alternate case and the removal of the logic to change priority based on alternate or accelerated btls, there's no point in running the full btl query in osc_rdma_component_query(). Instead, just verify that there is some number of BTLs available, which is the extent of testing in the alternate case. Signed-off-by: Brian Barrett <[email protected]>
1 parent 61aca9e commit e93f041

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,14 @@ static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, s
387387
}
388388
#endif /* OPAL_CUDA_SUPPORT */
389389

390-
if (OMPI_SUCCESS == ompi_osc_rdma_query_accelerated_btls (comm, NULL)) {
391-
return mca_osc_rdma_component.priority;
392-
}
393-
394-
if (OMPI_SUCCESS == ompi_osc_rdma_query_alternate_btls (comm, NULL)) {
395-
return mca_osc_rdma_component.priority;
390+
/* verify if we have any btls available. Since we do not verify
391+
* connectivity across all btls in the alternate case, this is as
392+
* good a test as we are going to have for success. */
393+
if (opal_list_is_empty(&mca_btl_base_modules_initialized)) {
394+
return -1;
396395
}
397396

398-
return -1;
397+
return OMPI_SUCCESS;;
399398
}
400399

401400
static int ompi_osc_rdma_initialize_region (ompi_osc_rdma_module_t *module, void **base, size_t size) {
@@ -914,13 +913,7 @@ static int ompi_osc_rdma_query_alternate_btls (ompi_communicator_t *comm, ompi_o
914913
mca_btl_base_selected_module_t *item;
915914
int ret;
916915

917-
/* shortcut the trivial query case */
918-
if (NULL == module) {
919-
if (opal_list_is_empty(&mca_btl_base_modules_initialized)) {
920-
return OMPI_ERR_UNREACH;
921-
}
922-
return OMPI_SUCCESS;
923-
}
916+
assert(NULL != module);
924917

925918
module->btls_in_use = 0;
926919

@@ -988,9 +981,6 @@ static bool ompi_osc_rdma_check_accelerated_btl(struct mca_btl_base_module_t *bt
988981
* Testing (1) is expensive, so as an optimization, the
989982
* ompi_osc_rdma_full_connectivity_btls list contains the list of BTL
990983
* components we know can achieve (1) in almost all usage scenarios.
991-
*
992-
* If module is NULL, the code acts as a query mechanism to find any
993-
* potential BTLs, and is used to implement osc_rdma_query().
994984
*/
995985
static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi_osc_rdma_module_t *module)
996986
{
@@ -999,11 +989,11 @@ static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi
999989
mca_bml_base_endpoint_t *base_endpoint;
1000990
char **btls_to_use;
1001991

1002-
if (module) {
1003-
ompi_osc_rdma_selected_btl_insert(module, NULL, 0);
1004-
module->btls_in_use = 0;
1005-
module->use_memory_registration = false;
1006-
}
992+
assert(NULL != module);
993+
994+
ompi_osc_rdma_selected_btl_insert(module, NULL, 0);
995+
module->btls_in_use = 0;
996+
module->use_memory_registration = false;
1007997

1008998
/* Check for BTLs in the list of BTLs we know can reach all peers
1009999
in general usage. */
@@ -1116,11 +1106,9 @@ static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi
11161106
}
11171107

11181108
btl_selection_complete:
1119-
if (module) {
1120-
ompi_osc_rdma_selected_btl_insert(module, selected_btl, 0);
1121-
module->btls_in_use = 1;
1122-
module->use_memory_registration = selected_btl->btl_register_mem != NULL;
1123-
}
1109+
ompi_osc_rdma_selected_btl_insert(module, selected_btl, 0);
1110+
module->btls_in_use = 1;
1111+
module->use_memory_registration = selected_btl->btl_register_mem != NULL;
11241112

11251113
opal_output_verbose(MCA_BASE_VERBOSE_INFO, ompi_osc_base_framework.framework_output,
11261114
"accelerated_query: selected btl: %s",

0 commit comments

Comments
 (0)