Skip to content

Commit 97c3d02

Browse files
author
Burlen Loring
committed
fix MCA variable scope in coll han
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]> (cherry picked from commit 329ea0e)
1 parent 0ad887b commit 97c3d02

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

ompi/mca/coll/han/coll_han_component.c

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* reserved.
55
* Copyright (c) 2022 IBM Corporation. All rights reserved
66
* Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
7+
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
78
* $COPYRIGHT$
89
*
910
* Additional copyrights may follow
@@ -221,9 +222,9 @@ mca_coll_han_query_module_from_mca(mca_base_component_t* c,
221222
*storage = ompi_coll_han_available_components[mod_id].component_name;
222223

223224
(void) mca_base_component_var_register(c, param_name, param_doc,
224-
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
225+
MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
225226
info_level,
226-
MCA_BASE_VAR_SCOPE_READONLY, storage);
227+
MCA_BASE_VAR_SCOPE_ALL, storage);
227228
module_name = *storage;
228229
mod_id = strtol(module_name, &endptr, 10);
229230
if( module_name == endptr ) { /* no conversion, maybe we got a module name instead */
@@ -252,22 +253,22 @@ static int han_register(void)
252253
COMPONENT_T component;
253254

254255
(void) mca_base_component_var_register(c, "priority", "Priority of the HAN coll component",
255-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
256+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
256257
OPAL_INFO_LVL_9,
257-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_priority);
258+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_priority);
258259

259260
cs->han_output_verbose = 0;
260261
(void) mca_base_component_var_register(c, "verbose", "Verbosity of the HAN coll component (use coll base verbosity if not set)",
261-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
262+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
262263
OPAL_INFO_LVL_9,
263-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_output_verbose);
264+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_output_verbose);
264265

265266
cs->han_bcast_segsize = 65536;
266267
(void) mca_base_component_var_register(c, "bcast_segsize",
267268
"segment size for bcast",
268-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
269+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
269270
OPAL_INFO_LVL_9,
270-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_bcast_segsize);
271+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_bcast_segsize);
271272

272273
cs->han_bcast_up_module = 0;
273274
(void) mca_coll_han_query_module_from_mca(c, "bcast_up_module",
@@ -285,9 +286,9 @@ static int han_register(void)
285286
cs->han_reduce_segsize = 65536;
286287
(void) mca_base_component_var_register(c, "reduce_segsize",
287288
"segment size for reduce",
288-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
289+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
289290
OPAL_INFO_LVL_9,
290-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_reduce_segsize);
291+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_reduce_segsize);
291292

292293
cs->han_reduce_up_module = 0;
293294
(void) mca_coll_han_query_module_from_mca(c, "reduce_up_module",
@@ -304,9 +305,9 @@ static int han_register(void)
304305
cs->han_allreduce_segsize = 65536;
305306
(void) mca_base_component_var_register(c, "allreduce_segsize",
306307
"segment size for allreduce",
307-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
308+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
308309
OPAL_INFO_LVL_9,
309-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_allreduce_segsize);
310+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_allreduce_segsize);
310311

311312
cs->han_allreduce_up_module = 0;
312313
(void) mca_coll_han_query_module_from_mca(c, "allreduce_up_module",
@@ -361,9 +362,9 @@ static int han_register(void)
361362
"whether we need reproducible results "
362363
"(enabling this disables optimisations using topology)"
363364
"0 disable 1 enable, default 0",
364-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
365+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
365366
OPAL_INFO_LVL_3,
366-
MCA_BASE_VAR_SCOPE_READONLY, &cs->han_reproducible);
367+
MCA_BASE_VAR_SCOPE_ALL, &cs->han_reproducible);
367368
/*
368369
* Han algorithms MCA parameters for each collective.
369370
* Shows algorithms thanks to enumerator
@@ -476,9 +477,9 @@ static int han_register(void)
476477
}
477478

478479
mca_base_component_var_register(c, param_name, param_desc,
479-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
480+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
480481
OPAL_INFO_LVL_9,
481-
MCA_BASE_VAR_SCOPE_READONLY,
482+
MCA_BASE_VAR_SCOPE_ALL,
482483
&(cs->mca_sub_components[coll][topo_lvl]));
483484
}
484485
}
@@ -488,27 +489,27 @@ static int han_register(void)
488489
(void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version,
489490
"use_dynamic_file_rules",
490491
"Enable the dynamic selection provided via the dynamic_rules_filename MCA",
491-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
492+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
492493
OPAL_INFO_LVL_6,
493-
MCA_BASE_VAR_SCOPE_READONLY,
494+
MCA_BASE_VAR_SCOPE_ALL,
494495
&(cs->use_dynamic_file_rules));
495496

496497
cs->dynamic_rules_filename = NULL;
497498
(void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version,
498499
"dynamic_rules_filename",
499500
"Configuration file containing the dynamic selection rules",
500-
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
501+
MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
501502
OPAL_INFO_LVL_6,
502-
MCA_BASE_VAR_SCOPE_READONLY,
503+
MCA_BASE_VAR_SCOPE_ALL,
503504
&(cs->dynamic_rules_filename));
504505

505506
cs->dump_dynamic_rules = false;
506507
(void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version,
507508
"dump_dynamic_rules",
508509
"Switch used to decide if we dump dynamic rules provided by configuration file",
509-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
510+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
510511
OPAL_INFO_LVL_6,
511-
MCA_BASE_VAR_SCOPE_READONLY,
512+
MCA_BASE_VAR_SCOPE_ALL,
512513
&(cs->dump_dynamic_rules));
513514

514515
if((cs->dump_dynamic_rules || NULL != cs->dynamic_rules_filename)
@@ -525,9 +526,9 @@ static int han_register(void)
525526
"errors printed on rank 0 "
526527
"with a 0 verbosity."
527528
"Useless if coll_base_verbose is 30 or more.",
528-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
529+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
529530
OPAL_INFO_LVL_6,
530-
MCA_BASE_VAR_SCOPE_READONLY,
531+
MCA_BASE_VAR_SCOPE_ALL,
531532
&(cs->max_dynamic_errors));
532533

533534

0 commit comments

Comments
 (0)