@@ -387,15 +387,14 @@ static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, s
387
387
}
388
388
#endif /* OPAL_CUDA_SUPPORT */
389
389
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 ;
396
395
}
397
396
398
- return -1 ;
397
+ return OMPI_SUCCESS ; ;
399
398
}
400
399
401
400
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
914
913
mca_btl_base_selected_module_t * item ;
915
914
int ret ;
916
915
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 );
924
917
925
918
module -> btls_in_use = 0 ;
926
919
@@ -988,9 +981,6 @@ static bool ompi_osc_rdma_check_accelerated_btl(struct mca_btl_base_module_t *bt
988
981
* Testing (1) is expensive, so as an optimization, the
989
982
* ompi_osc_rdma_full_connectivity_btls list contains the list of BTL
990
983
* 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().
994
984
*/
995
985
static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t * comm , ompi_osc_rdma_module_t * module )
996
986
{
@@ -999,11 +989,11 @@ static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi
999
989
mca_bml_base_endpoint_t * base_endpoint ;
1000
990
char * * btls_to_use ;
1001
991
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;
1007
997
1008
998
/* Check for BTLs in the list of BTLs we know can reach all peers
1009
999
in general usage. */
@@ -1116,11 +1106,9 @@ static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi
1116
1106
}
1117
1107
1118
1108
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 ;
1124
1112
1125
1113
opal_output_verbose (MCA_BASE_VERBOSE_INFO , ompi_osc_base_framework .framework_output ,
1126
1114
"accelerated_query: selected btl: %s" ,
0 commit comments