Skip to content

Commit fdf60ac

Browse files
author
Burlen Loring
committed
fix MCA variable scope in coll adapt
Changes several variables scope from READONLY to ALL so that they can be set via MPI_T interface Signed-off-by: Burlen Loring <[email protected]>
1 parent 329ea0e commit fdf60ac

File tree

3 files changed

+41
-36
lines changed

3 files changed

+41
-36
lines changed

ompi/mca/coll/adapt/coll_adapt_component.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) 2014-2020 The University of Tennessee and The University
33
* of Tennessee Research Foundation. All rights
44
* reserved.
5+
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -114,39 +115,39 @@ static int adapt_register(void)
114115
we should have a high priority */
115116
cs->adapt_priority = 0;
116117
(void) mca_base_component_var_register(c, "priority", "Priority of the adapt coll component",
117-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
118+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
118119
OPAL_INFO_LVL_9,
119-
MCA_BASE_VAR_SCOPE_READONLY, &cs->adapt_priority);
120+
MCA_BASE_VAR_SCOPE_ALL, &cs->adapt_priority);
120121

121122
cs->adapt_verbose = ompi_coll_base_framework.framework_verbose;
122123
(void) mca_base_component_var_register(c, "verbose",
123124
"Verbose level (default set to the collective framework verbosity)",
124-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
125+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
125126
OPAL_INFO_LVL_9,
126-
MCA_BASE_VAR_SCOPE_READONLY, &cs->adapt_verbose);
127+
MCA_BASE_VAR_SCOPE_ALL, &cs->adapt_verbose);
127128

128129
cs->adapt_context_free_list_min = 64;
129130
(void) mca_base_component_var_register(c, "context_free_list_min",
130131
"Minimum number of segments in context free list",
131-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
132+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
132133
OPAL_INFO_LVL_9,
133-
MCA_BASE_VAR_SCOPE_READONLY,
134+
MCA_BASE_VAR_SCOPE_ALL,
134135
&cs->adapt_context_free_list_min);
135136

136137
cs->adapt_context_free_list_max = 1024;
137138
(void) mca_base_component_var_register(c, "context_free_list_max",
138139
"Maximum number of segments in context free list",
139-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
140+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
140141
OPAL_INFO_LVL_9,
141-
MCA_BASE_VAR_SCOPE_READONLY,
142+
MCA_BASE_VAR_SCOPE_ALL,
142143
&cs->adapt_context_free_list_max);
143144

144145
cs->adapt_context_free_list_inc = 32;
145146
(void) mca_base_component_var_register(c, "context_free_list_inc",
146147
"Increasement number of segments in context free list",
147-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
148+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
148149
OPAL_INFO_LVL_9,
149-
MCA_BASE_VAR_SCOPE_READONLY,
150+
MCA_BASE_VAR_SCOPE_ALL,
150151
&cs->adapt_context_free_list_inc);
151152
ompi_coll_adapt_ibcast_register();
152153
ompi_coll_adapt_ireduce_register();

ompi/mca/coll/adapt/coll_adapt_ibcast.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* of Tennessee Research Foundation. All rights
44
* reserved.
55
* Copyright (c) 2022 IBM Corporation. All rights reserved
6+
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -34,8 +35,9 @@ int ompi_coll_adapt_ibcast_register(void)
3435

3536
mca_coll_adapt_component.adapt_ibcast_algorithm = 1;
3637
mca_base_component_var_register(c, "bcast_algorithm",
37-
"Algorithm of broadcast, 0: tuned, 1: binomial, 2: in_order_binomial, 3: binary, 4: pipeline, 5: chain, 6: linear", MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
38-
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_READONLY,
38+
"Algorithm of broadcast, 0: tuned, 1: binomial, 2: in_order_binomial, 3: binary, 4: pipeline, 5: chain, 6: linear",
39+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
40+
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
3941
&mca_coll_adapt_component.adapt_ibcast_algorithm);
4042
if( (mca_coll_adapt_component.adapt_ibcast_algorithm < 0) ||
4143
(mca_coll_adapt_component.adapt_ibcast_algorithm >= OMPI_COLL_ADAPT_ALGORITHM_COUNT) ) {
@@ -45,33 +47,33 @@ int ompi_coll_adapt_ibcast_register(void)
4547
mca_coll_adapt_component.adapt_ibcast_segment_size = 0;
4648
mca_base_component_var_register(c, "bcast_segment_size",
4749
"Segment size in bytes used by default for bcast algorithms. Only has meaning if algorithm is forced and supports segmenting. 0 bytes means no segmentation.",
48-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
50+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
4951
OPAL_INFO_LVL_5,
50-
MCA_BASE_VAR_SCOPE_READONLY,
52+
MCA_BASE_VAR_SCOPE_ALL,
5153
&mca_coll_adapt_component.adapt_ibcast_segment_size);
5254

5355
mca_coll_adapt_component.adapt_ibcast_max_send_requests = 2;
5456
mca_base_component_var_register(c, "bcast_max_send_requests",
5557
"Maximum number of send requests",
56-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
58+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
5759
OPAL_INFO_LVL_5,
58-
MCA_BASE_VAR_SCOPE_READONLY,
60+
MCA_BASE_VAR_SCOPE_ALL,
5961
&mca_coll_adapt_component.adapt_ibcast_max_send_requests);
6062

6163
mca_coll_adapt_component.adapt_ibcast_max_recv_requests = 3;
6264
mca_base_component_var_register(c, "bcast_max_recv_requests",
6365
"Maximum number of receive requests",
64-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
66+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
6567
OPAL_INFO_LVL_5,
66-
MCA_BASE_VAR_SCOPE_READONLY,
68+
MCA_BASE_VAR_SCOPE_ALL,
6769
&mca_coll_adapt_component.adapt_ibcast_max_recv_requests);
6870

6971
mca_coll_adapt_component.adapt_ibcast_synchronous_send = true;
7072
(void) mca_base_component_var_register(c, "bcast_synchronous_send",
7173
"Whether to use synchronous send operations during setup of bcast operations",
72-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
74+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
7375
OPAL_INFO_LVL_9,
74-
MCA_BASE_VAR_SCOPE_READONLY,
76+
MCA_BASE_VAR_SCOPE_ALL,
7577
&mca_coll_adapt_component.adapt_ibcast_synchronous_send);
7678

7779
mca_coll_adapt_component.adapt_ibcast_context_free_list = NULL;

ompi/mca/coll/adapt/coll_adapt_ireduce.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
66
* Copyright (c) 2022 IBM Corporation. All rights reserved
77
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
8+
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
89
* $COPYRIGHT$
910
*
1011
* Additional copyrights may follow
@@ -38,8 +39,9 @@ int ompi_coll_adapt_ireduce_register(void)
3839

3940
mca_coll_adapt_component.adapt_ireduce_algorithm = 1;
4041
mca_base_component_var_register(c, "reduce_algorithm",
41-
"Algorithm of reduce, 1: binomial, 2: in_order_binomial, 3: binary, 4: pipeline, 5: chain, 6: linear", MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
42-
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_READONLY,
42+
"Algorithm of reduce, 1: binomial, 2: in_order_binomial, 3: binary, 4: pipeline, 5: chain, 6: linear",
43+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
44+
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
4345
&mca_coll_adapt_component.adapt_ireduce_algorithm);
4446
if( (mca_coll_adapt_component.adapt_ireduce_algorithm < 0) ||
4547
(mca_coll_adapt_component.adapt_ireduce_algorithm > OMPI_COLL_ADAPT_ALGORITHM_COUNT) ) {
@@ -49,58 +51,58 @@ int ompi_coll_adapt_ireduce_register(void)
4951
mca_coll_adapt_component.adapt_ireduce_segment_size = 163740;
5052
mca_base_component_var_register(c, "reduce_segment_size",
5153
"Segment size in bytes used by default for reduce algorithms. Only has meaning if algorithm is forced and supports segmenting. 0 bytes means no segmentation.",
52-
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0,
54+
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
5355
OPAL_INFO_LVL_5,
54-
MCA_BASE_VAR_SCOPE_READONLY,
56+
MCA_BASE_VAR_SCOPE_ALL,
5557
&mca_coll_adapt_component.adapt_ireduce_segment_size);
5658

5759
mca_coll_adapt_component.adapt_ireduce_max_send_requests = 2;
5860
mca_base_component_var_register(c, "reduce_max_send_requests",
5961
"Maximum number of send requests",
60-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
62+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
6163
OPAL_INFO_LVL_5,
62-
MCA_BASE_VAR_SCOPE_READONLY,
64+
MCA_BASE_VAR_SCOPE_ALL,
6365
&mca_coll_adapt_component.adapt_ireduce_max_send_requests);
6466

6567
mca_coll_adapt_component.adapt_ireduce_max_recv_requests = 3;
6668
mca_base_component_var_register(c, "reduce_max_recv_requests",
6769
"Maximum number of receive requests per peer",
68-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
70+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
6971
OPAL_INFO_LVL_5,
70-
MCA_BASE_VAR_SCOPE_READONLY,
72+
MCA_BASE_VAR_SCOPE_ALL,
7173
&mca_coll_adapt_component.adapt_ireduce_max_recv_requests);
7274

7375
mca_coll_adapt_component.adapt_inbuf_free_list_min = 10;
7476
mca_base_component_var_register(c, "inbuf_free_list_min",
7577
"Minimum number of segment in inbuf free list",
76-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
78+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
7779
OPAL_INFO_LVL_5,
78-
MCA_BASE_VAR_SCOPE_READONLY,
80+
MCA_BASE_VAR_SCOPE_ALL,
7981
&mca_coll_adapt_component.adapt_inbuf_free_list_min);
8082

8183
mca_coll_adapt_component.adapt_inbuf_free_list_max = 10000;
8284
mca_base_component_var_register(c, "inbuf_free_list_max",
8385
"Maximum number of segment in inbuf free list",
84-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
86+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
8587
OPAL_INFO_LVL_5,
86-
MCA_BASE_VAR_SCOPE_READONLY,
88+
MCA_BASE_VAR_SCOPE_ALL,
8789
&mca_coll_adapt_component.adapt_inbuf_free_list_max);
8890

8991

9092
mca_coll_adapt_component.adapt_inbuf_free_list_inc = 10;
9193
mca_base_component_var_register(c, "inbuf_free_list_inc",
9294
"Number of segments to allocate when growing the inbuf free list",
93-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
95+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
9496
OPAL_INFO_LVL_5,
95-
MCA_BASE_VAR_SCOPE_READONLY,
97+
MCA_BASE_VAR_SCOPE_ALL,
9698
&mca_coll_adapt_component.adapt_inbuf_free_list_inc);
9799

98100
mca_coll_adapt_component.adapt_ireduce_synchronous_send = true;
99101
(void) mca_base_component_var_register(c, "reduce_synchronous_send",
100102
"Whether to use synchronous send operations during setup of reduce operations",
101-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
103+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
102104
OPAL_INFO_LVL_9,
103-
MCA_BASE_VAR_SCOPE_READONLY,
105+
MCA_BASE_VAR_SCOPE_ALL,
104106
&mca_coll_adapt_component.adapt_ireduce_synchronous_send);
105107

106108
mca_coll_adapt_component.adapt_ireduce_context_free_list = NULL;

0 commit comments

Comments
 (0)