|
1 | 1 | /*
|
2 | 2 | * Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
|
3 |
| - * Copyright (c) 2021 Triad National Security, LLC. All rights |
| 3 | + * Copyright (c) 2021-2022 Triad National Security, LLC. All rights |
4 | 4 | * reserved.
|
5 | 5 | *
|
6 | 6 | * $COPYRIGHT$
|
@@ -362,31 +362,34 @@ ompi_mtl_ofi_del_procs(struct mca_mtl_base_module_t *mtl,
|
362 | 362 | int ompi_mtl_ofi_add_comm(struct mca_mtl_base_module_t *mtl,
|
363 | 363 | struct ompi_communicator_t *comm)
|
364 | 364 | {
|
365 |
| - int ret; |
| 365 | + int ret = OMPI_SUCCESS; |
366 | 366 | uint32_t comm_size;
|
367 |
| - mca_mtl_comm_t* mtl_comm = OBJ_NEW(mca_mtl_comm_t); |
| 367 | + mca_mtl_comm_t* mtl_comm; |
368 | 368 |
|
369 | 369 | mca_mtl_ofi_ep_type ep_type = (0 == ompi_mtl_ofi.enable_sep) ?
|
370 | 370 | OFI_REGULAR_EP : OFI_SCALABLE_EP;
|
371 | 371 |
|
372 | 372 | if (!OMPI_COMM_IS_GLOBAL_INDEX(comm)) {
|
| 373 | + mtl_comm = OBJ_NEW(mca_mtl_comm_t); |
| 374 | + |
373 | 375 | if (OMPI_COMM_IS_INTER(comm)) {
|
374 | 376 | comm_size = ompi_comm_remote_size(comm);
|
375 | 377 | } else {
|
376 | 378 | comm_size = ompi_comm_size(comm);
|
377 | 379 | }
|
378 | 380 | mtl_comm->c_index_vec = (c_index_vec_t *)malloc(sizeof(c_index_vec_t) * comm_size);
|
379 | 381 | if (NULL == mtl_comm->c_index_vec) {
|
| 382 | + ret = OMPI_ERR_OUT_OF_RESOURCE; |
380 | 383 | OBJ_RELEASE(mtl_comm);
|
381 | 384 | goto error;
|
382 | 385 | } else {
|
383 | 386 | for (uint32_t i=0; i < comm_size; i++) {
|
384 |
| - mtl_comm->c_index_vec[i].c_index_state = 2; |
| 387 | + mtl_comm->c_index_vec[i].c_index_state = MCA_MTL_OFI_CID_NOT_EXCHANGED; |
385 | 388 | }
|
386 | 389 | }
|
387 | 390 | if (OMPI_COMM_IS_INTRA(comm)) {
|
388 | 391 | mtl_comm->c_index_vec[comm->c_my_rank].c_index = comm->c_index;
|
389 |
| - mtl_comm->c_index_vec[comm->c_my_rank].c_index_state = 0; |
| 392 | + mtl_comm->c_index_vec[comm->c_my_rank].c_index_state = MCA_MTL_OFI_CID_EXCHANGED; |
390 | 393 | }
|
391 | 394 |
|
392 | 395 | comm->c_mtl_comm = mtl_comm;
|
@@ -415,10 +418,8 @@ int ompi_mtl_ofi_add_comm(struct mca_mtl_base_module_t *mtl,
|
415 | 418 | }
|
416 | 419 | }
|
417 | 420 |
|
418 |
| - return OMPI_SUCCESS; |
419 |
| - |
420 | 421 | error:
|
421 |
| - return OMPI_ERROR; |
| 422 | + return ret; |
422 | 423 | }
|
423 | 424 |
|
424 | 425 | int ompi_mtl_ofi_del_comm(struct mca_mtl_base_module_t *mtl,
|
|
0 commit comments