Skip to content

Commit 7da6b79

Browse files
committed
ofi/mtl: put back in manual excid management
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 6b7f4a1 commit 7da6b79

File tree

2 files changed

+411
-11
lines changed

2 files changed

+411
-11
lines changed

ompi/mca/mtl/ofi/mtl_ofi.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
3-
* Copyright (c) 2021-2024 Triad National Security, LLC. All rights
3+
* Copyright (c) 2021-2022 Triad National Security, LLC. All rights
44
* reserved.
55
*
66
* $COPYRIGHT$
@@ -14,6 +14,8 @@
1414

1515
OMPI_DECLSPEC extern mca_mtl_ofi_component_t mca_mtl_ofi_component;
1616

17+
OBJ_CLASS_INSTANCE(mca_mtl_comm_t, opal_object_t, NULL, NULL);
18+
1719
mca_mtl_ofi_module_t ompi_mtl_ofi = {
1820
{
1921
(int)((1ULL << MTL_OFI_CID_BIT_COUNT_1) - 1), /* max cid */
@@ -344,10 +346,43 @@ int ompi_mtl_ofi_add_comm(struct mca_mtl_base_module_t *mtl,
344346
struct ompi_communicator_t *comm)
345347
{
346348
int ret = OMPI_SUCCESS;
349+
uint32_t comm_size;
350+
mca_mtl_comm_t* mtl_comm;
347351

348352
mca_mtl_ofi_ep_type ep_type = (0 == ompi_mtl_ofi.enable_sep) ?
349353
OFI_REGULAR_EP : OFI_SCALABLE_EP;
350354

355+
if (!OMPI_COMM_IS_GLOBAL_INDEX(comm)) {
356+
mtl_comm = OBJ_NEW(mca_mtl_comm_t);
357+
358+
if (OMPI_COMM_IS_INTER(comm)) {
359+
comm_size = ompi_comm_remote_size(comm);
360+
} else {
361+
comm_size = ompi_comm_size(comm);
362+
}
363+
mtl_comm->c_index_vec = (c_index_vec_t *)malloc(sizeof(c_index_vec_t) * comm_size);
364+
if (NULL == mtl_comm->c_index_vec) {
365+
ret = OMPI_ERR_OUT_OF_RESOURCE;
366+
OBJ_RELEASE(mtl_comm);
367+
goto error;
368+
} else {
369+
for (uint32_t i=0; i < comm_size; i++) {
370+
mtl_comm->c_index_vec[i].c_index_state = MCA_MTL_OFI_CID_NOT_EXCHANGED;
371+
}
372+
}
373+
if (OMPI_COMM_IS_INTRA(comm)) {
374+
mtl_comm->c_index_vec[comm->c_my_rank].c_index = comm->c_index;
375+
mtl_comm->c_index_vec[comm->c_my_rank].c_index_state = MCA_MTL_OFI_CID_EXCHANGED;
376+
}
377+
378+
comm->c_mtl_comm = mtl_comm;
379+
380+
} else {
381+
382+
comm->c_mtl_comm = NULL;
383+
384+
}
385+
351386
/*
352387
* If thread grouping enabled, add new OFI context for each communicator
353388
* other than MPI_COMM_SELF.
@@ -377,6 +412,12 @@ int ompi_mtl_ofi_del_comm(struct mca_mtl_base_module_t *mtl,
377412
mca_mtl_ofi_ep_type ep_type = (0 == ompi_mtl_ofi.enable_sep) ?
378413
OFI_REGULAR_EP : OFI_SCALABLE_EP;
379414

415+
if(NULL != comm->c_mtl_comm) {
416+
free(comm->c_mtl_comm->c_index_vec);
417+
OBJ_RELEASE(comm->c_mtl_comm);
418+
comm->c_mtl_comm = NULL;
419+
}
420+
380421
/*
381422
* Clean up OFI contexts information.
382423
*/

0 commit comments

Comments
 (0)