|
26 | 26 | * Copyright (c) 2021 Nanook Consulting. All rights reserved. |
27 | 27 | * Copyright (c) 2018-2024 Triad National Security, LLC. All rights |
28 | 28 | * reserved. |
29 | | - * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. |
| 29 | + * Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. |
30 | 30 | * $COPYRIGHT$ |
31 | 31 | * |
32 | 32 | * Additional copyrights may follow |
|
56 | 56 | #include "ompi/communicator/communicator.h" |
57 | 57 | #include "ompi/mca/pml/pml.h" |
58 | 58 | #include "ompi/request/request.h" |
| 59 | +#include "ompi/info/info_memkind.h" |
59 | 60 |
|
60 | 61 | #include "ompi/runtime/params.h" |
61 | 62 |
|
@@ -447,6 +448,7 @@ int ompi_comm_create_w_info (ompi_communicator_t *comm, ompi_group_t *group, opa |
447 | 448 | if (info) { |
448 | 449 | opal_info_dup(info, &(newcomp->super.s_info)); |
449 | 450 | } |
| 451 | + ompi_info_memkind_copy_or_set (&comm->instance->super, &newcomp->super, info); |
450 | 452 |
|
451 | 453 | /* Set name for debugging purposes */ |
452 | 454 | snprintf(newcomp->c_name, MPI_MAX_OBJECT_NAME, "MPI COMMUNICATOR %s CREATE FROM %s", |
@@ -699,10 +701,11 @@ int ompi_comm_split_with_info( ompi_communicator_t* comm, int color, int key, |
699 | 701 | ompi_comm_print_cid (newcomp), ompi_comm_print_cid (comm)); |
700 | 702 |
|
701 | 703 | /* Copy info if there is one */ |
| 704 | + newcomp->super.s_info = OBJ_NEW(opal_info_t); |
702 | 705 | if (info) { |
703 | | - newcomp->super.s_info = OBJ_NEW(opal_info_t); |
704 | 706 | opal_info_dup(info, &(newcomp->super.s_info)); |
705 | 707 | } |
| 708 | + ompi_info_memkind_copy_or_set (&comm->instance->super, &newcomp->super, info); |
706 | 709 |
|
707 | 710 | /* Activate the communicator and init coll-component */ |
708 | 711 | rc = ompi_comm_activate (&newcomp, comm, NULL, NULL, NULL, false, mode); |
@@ -994,6 +997,7 @@ static int ompi_comm_split_type_core(ompi_communicator_t *comm, |
994 | 997 | if (info) { |
995 | 998 | opal_infosubscribe_change_info(&newcomp->super, info); |
996 | 999 | } |
| 1000 | + ompi_info_memkind_copy_or_set (&comm->instance->super, &newcomp->super, info); |
997 | 1001 |
|
998 | 1002 | /* Activate the communicator and init coll-component */ |
999 | 1003 | rc = ompi_comm_activate (&newcomp, comm, NULL, NULL, NULL, false, mode); |
@@ -1347,6 +1351,7 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, omp |
1347 | 1351 | if (info) { |
1348 | 1352 | opal_infosubscribe_change_info(&newcomp->super, info); |
1349 | 1353 | } |
| 1354 | + ompi_info_memkind_copy_or_set (&comm->instance->super, &newcomp->super, info); |
1350 | 1355 |
|
1351 | 1356 | /* activate communicator and init coll-module */ |
1352 | 1357 | rc = ompi_comm_activate (&newcomp, comm, NULL, NULL, NULL, false, mode); |
@@ -1437,6 +1442,7 @@ static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *gro |
1437 | 1442 | if (info) { |
1438 | 1443 | opal_info_dup(info, &(newcomp->super.s_info)); |
1439 | 1444 | } |
| 1445 | + ompi_info_memkind_copy_or_set (&comm->super, &newcomp->super, info); |
1440 | 1446 | } |
1441 | 1447 |
|
1442 | 1448 | ompi_comm_request_schedule_append (request, ompi_comm_idup_getcid, subreq, subreq[0] ? 1 : 0); |
@@ -1588,6 +1594,7 @@ int ompi_comm_create_from_group (ompi_group_t *group, const char *tag, opal_info |
1588 | 1594 | if (NULL == newcomp->super.s_info) { |
1589 | 1595 | return OMPI_ERR_OUT_OF_RESOURCE; |
1590 | 1596 | } |
| 1597 | + ompi_info_memkind_copy_or_set (&group->grp_instance->super, &newcomp->super, info); |
1591 | 1598 |
|
1592 | 1599 | /* activate communicator and init coll-module. use the group allreduce implementation as |
1593 | 1600 | * no collective module has yet been selected. the tag does not matter as any tag will |
@@ -1727,6 +1734,10 @@ int ompi_intercomm_create (ompi_communicator_t *local_comm, int local_leader, om |
1727 | 1734 | return rc; |
1728 | 1735 | } |
1729 | 1736 |
|
| 1737 | + // Copy info if there is one. |
| 1738 | + newcomp->super.s_info = OBJ_NEW(opal_info_t); |
| 1739 | + ompi_info_memkind_copy_or_set (&local_comm->instance->super, &newcomp->super, &ompi_mpi_info_null.info.super); |
| 1740 | + |
1730 | 1741 | *newintercomm = newcomp; |
1731 | 1742 |
|
1732 | 1743 | return OMPI_SUCCESS; |
@@ -1791,6 +1802,7 @@ int ompi_intercomm_create_from_groups (ompi_group_t *local_group, int local_lead |
1791 | 1802 | ompi_comm_free (&local_comm); |
1792 | 1803 | return OMPI_ERR_OUT_OF_RESOURCE; |
1793 | 1804 | } |
| 1805 | + leader_group->grp_instance = local_group->grp_instance; |
1794 | 1806 |
|
1795 | 1807 | /* create a unique tag for allocating the leader communicator. we can eliminate this step |
1796 | 1808 | * if we take a CID from the newly allocated block belonging to local_comm. this is |
@@ -1888,6 +1900,7 @@ int ompi_intercomm_create_from_groups (ompi_group_t *local_group, int local_lead |
1888 | 1900 | if (info) { |
1889 | 1901 | opal_info_dup(info, &(newcomp->super.s_info)); |
1890 | 1902 | } |
| 1903 | + ompi_info_memkind_copy_or_set (&local_group->grp_instance->super, &newcomp->super, info); |
1891 | 1904 |
|
1892 | 1905 | /* activate communicator and init coll-module */ |
1893 | 1906 | rc = ompi_comm_activate (&newcomp, local_comm, leader_comm, &local_leader, &leader_comm_remote_leader, |
|
0 commit comments