15
15
* Copyright (c) 2018 Research Organization for Information Science
16
16
* and Technology (RIST). All rights reserved.
17
17
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
18
- * Copyright (c) 2018 Triad National Security, LLC. All rights
18
+ * Copyright (c) 2018-2024 Triad National Security, LLC. All rights
19
19
* reserved.
20
20
* Copyright (c) 2019-2021 Google, LLC. All rights reserved.
21
21
* Copyright (c) 2019 Intel, Inc. All rights reserved.
@@ -348,6 +348,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc,
348
348
bool found = false;
349
349
unsigned num_tls ;
350
350
char * tmp ;
351
+ ucs_status_t ucs_status ;
351
352
352
353
if (MCA_BTL_UCT_MAX_MODULES == mca_btl_uct_component .module_count ) {
353
354
BTL_VERBOSE (("created the maximum number of allowable modules" ));
@@ -372,16 +373,40 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc,
372
373
md = OBJ_NEW (mca_btl_uct_md_t );
373
374
374
375
#if UCT_API >= UCT_VERSION (1 , 7 )
375
- uct_md_config_read (component , NULL , NULL , & uct_config );
376
- uct_md_open (component , md_desc -> md_name , uct_config , & md -> uct_md );
376
+ ucs_status = uct_md_config_read (component , NULL , NULL , & uct_config );
377
+ if (UCS_OK != ucs_status ) {
378
+ BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
379
+ return OPAL_ERR_NOT_AVAILABLE ;
380
+ }
381
+ ucs_status = uct_md_open (component , md_desc -> md_name , uct_config , & md -> uct_md );
382
+ if (UCS_OK != ucs_status ) {
383
+ BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
384
+ return OPAL_ERR_NOT_AVAILABLE ;
385
+ }
377
386
#else
378
- uct_md_config_read (md_desc -> md_name , NULL , NULL , & uct_config );
379
- uct_md_open (md_desc -> md_name , uct_config , & md -> uct_md );
387
+ ucs_status = uct_md_config_read (md_desc -> md_name , NULL , NULL , & uct_config );
388
+ if (UCS_OK != ucs_status ) {
389
+ BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
390
+ return OPAL_ERR_NOT_AVAILABLE ;
391
+ }
392
+ ucs_status = uct_md_open (md_desc -> md_name , uct_config , & md -> uct_md );
393
+ if (UCS_OK != ucs_status ) {
394
+ BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
395
+ return OPAL_ERR_NOT_AVAILABLE ;
396
+ }
380
397
#endif
381
398
uct_config_release (uct_config );
382
399
383
- uct_md_query (md -> uct_md , & md_attr );
384
- uct_md_query_tl_resources (md -> uct_md , & tl_desc , & num_tls );
400
+ ucs_status = uct_md_query (md -> uct_md , & md_attr );
401
+ if (UCS_OK != ucs_status ) {
402
+ BTL_VERBOSE (("uct_config_release failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
403
+ return OPAL_ERR_NOT_AVAILABLE ;
404
+ }
405
+ ucs_status = uct_md_query_tl_resources (md -> uct_md , & tl_desc , & num_tls );
406
+ if (UCS_OK != ucs_status ) {
407
+ BTL_VERBOSE (("uct_config_release failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
408
+ return OPAL_ERR_NOT_AVAILABLE ;
409
+ }
385
410
386
411
module = mca_btl_uct_alloc_module (md_desc -> md_name , md , md_attr .rkey_packed_size );
387
412
if (NULL == module ) {
0 commit comments