Skip to content

Commit 114e293

Browse files
committed
TYPE_RESOURCE_GUIDED: add minimal support
Add minimal support for MPI_COMM_TYPE_RESOURCE_GUIDED. It can support all of the mpi_hw_resource_type values supported by MPI_COMM_TYPE_HW_GUIDED. No support is provided in this PR for mpi_pset_name info key. Related to #12077 Signed-off-by: Howard Pritchard <[email protected]>
1 parent e2a2583 commit 114e293

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

docs/man-openmpi/man3/MPI_Comm_split_type.3.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ MPI_COMM_TYPE_SHARED
4646
This type splits the communicator into subcommunicators, each of
4747
which can create a shared memory region.
4848

49+
MPI_COMM_TYPE_HW_GUIDED
50+
This type splits the communicator into subcommunicators according
51+
to the resource type specified by the ``mpi_hw_resource_type``
52+
info key.
53+
54+
MPI_COMM_TYPE_RESOURCE_GUIDED
55+
This type splits the communicator into subcommunicators according
56+
to the resource type specified by the ``mpi_hw_resource_type``
57+
or ``mpi_pset_name`` info key.
58+
4959
OMPI_COMM_TYPE_NODE
5060
Synonym for MPI_COMM_TYPE_SHARED.
5161

ompi/communicator/comm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
2525
* Copyright (c) 2017-2022 IBM Corporation. All rights reserved.
2626
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
27-
* Copyright (c) 2018-2024 Triad National Security, LLC. All rights
27+
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
2828
* reserved.
2929
* Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3030
* $COPYRIGHT$
@@ -1186,7 +1186,8 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
11861186
inter = OMPI_COMM_IS_INTER(comm);
11871187

11881188
/* Step 0: Convert MPI_COMM_TYPE_HW_GUIDED to the internal type */
1189-
if (MPI_COMM_TYPE_HW_GUIDED == split_type) {
1189+
if ((MPI_COMM_TYPE_HW_GUIDED == split_type) ||
1190+
(MPI_COMM_TYPE_RESOURCE_GUIDED == split_type)) {
11901191
opal_info_get(info, "mpi_hw_resource_type", &value, &flag);
11911192
/* If key is not in the 'info', then return MPI_COMM_NULL.
11921193
* This is caught at the MPI interface level, but it doesn't hurt to

ompi/include/mpi.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ enum {
862862
OMPI_COMM_TYPE_CU,
863863
OMPI_COMM_TYPE_CLUSTER,
864864
MPI_COMM_TYPE_HW_UNGUIDED,
865-
MPI_COMM_TYPE_HW_GUIDED
865+
MPI_COMM_TYPE_HW_GUIDED,
866+
MPI_COMM_TYPE_RESOURCE_GUIDED
866867
};
867868
#define OMPI_COMM_TYPE_NODE MPI_COMM_TYPE_SHARED
868869

ompi/include/mpif-values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@
338338
'OMPI_COMM_TYPE_CLUSTER': 11,
339339
'MPI_COMM_TYPE_HW_UNGUIDED': 12,
340340
'MPI_COMM_TYPE_HW_GUIDED': 13,
341+
'MPI_COMM_TYPE_RESOURCE_GUIDED': 14,
341342
}
342343

343344
# IO Constants

ompi/mpi/bindings/ompi_bindings/consts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Triad National Security, LLC. All rights
1+
# Copyright (c) 2024-2025 Triad National Security, LLC. All rights
22
# reserved.
33
#
44
# $COPYRIGHT$
@@ -157,6 +157,7 @@
157157
'MPI_COMM_TYPE_SHARED',
158158
'MPI_COMM_TYPE_HW_UNGUIDED',
159159
'MPI_COMM_TYPE_HW_GUIDED',
160+
'MPI_COMM_TYPE_RESOURCE_GUIDED',
160161
]
161162

162163
RESERVED_WINDOWS = [

ompi/mpi/c/comm_split_type.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2017-2022 IBM Corporation. All rights reserved.
18-
* Copyright (c) 2024 Triad National Security, LLC. All rights
18+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1919
* reserved.
2020
* $COPYRIGHT$
2121
*
@@ -59,6 +59,7 @@ PROTOTYPE ERROR_CLASS comm_split_type(COMM comm, INT split_type, INT key,
5959
if ( MPI_COMM_TYPE_SHARED != split_type && // Same as OMPI_COMM_TYPE_NODE
6060
MPI_COMM_TYPE_HW_UNGUIDED != split_type &&
6161
MPI_COMM_TYPE_HW_GUIDED != split_type &&
62+
MPI_COMM_TYPE_RESOURCE_GUIDED != split_type &&
6263
OMPI_COMM_TYPE_CLUSTER != split_type &&
6364
OMPI_COMM_TYPE_CU != split_type &&
6465
OMPI_COMM_TYPE_HOST != split_type &&

0 commit comments

Comments
 (0)