Skip to content

Commit

Permalink
fix MCA variable scope in coll adapt
Browse files Browse the repository at this point in the history
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 fdf60ac)
  • Loading branch information
Burlen Loring committed Nov 19, 2024
1 parent 5432ffe commit 8d68c1b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
21 changes: 11 additions & 10 deletions ompi/mca/coll/adapt/coll_adapt_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2014-2020 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -114,39 +115,39 @@ static int adapt_register(void)
we should have a high priority */
cs->adapt_priority = 0;
(void) mca_base_component_var_register(c, "priority", "Priority of the adapt coll component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &cs->adapt_priority);
MCA_BASE_VAR_SCOPE_ALL, &cs->adapt_priority);

cs->adapt_verbose = ompi_coll_base_framework.framework_verbose;
(void) mca_base_component_var_register(c, "verbose",
"Verbose level (default set to the collective framework verbosity)",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &cs->adapt_verbose);
MCA_BASE_VAR_SCOPE_ALL, &cs->adapt_verbose);

cs->adapt_context_free_list_min = 64;
(void) mca_base_component_var_register(c, "context_free_list_min",
"Minimum number of segments in context free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&cs->adapt_context_free_list_min);

cs->adapt_context_free_list_max = 1024;
(void) mca_base_component_var_register(c, "context_free_list_max",
"Maximum number of segments in context free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&cs->adapt_context_free_list_max);

cs->adapt_context_free_list_inc = 32;
(void) mca_base_component_var_register(c, "context_free_list_inc",
"Increasement number of segments in context free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&cs->adapt_context_free_list_inc);
ompi_coll_adapt_ibcast_register();
ompi_coll_adapt_ireduce_register();
Expand Down
22 changes: 12 additions & 10 deletions ompi/mca/coll/adapt/coll_adapt_ibcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2014-2020 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -33,8 +34,9 @@ int ompi_coll_adapt_ibcast_register(void)

mca_coll_adapt_component.adapt_ibcast_algorithm = 1;
mca_base_component_var_register(c, "bcast_algorithm",
"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,
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_READONLY,
"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, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ibcast_algorithm);
if( (mca_coll_adapt_component.adapt_ibcast_algorithm < 0) ||
(mca_coll_adapt_component.adapt_ibcast_algorithm >= OMPI_COLL_ADAPT_ALGORITHM_COUNT) ) {
Expand All @@ -44,33 +46,33 @@ int ompi_coll_adapt_ibcast_register(void)
mca_coll_adapt_component.adapt_ibcast_segment_size = 0;
mca_base_component_var_register(c, "bcast_segment_size",
"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.",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ibcast_segment_size);

mca_coll_adapt_component.adapt_ibcast_max_send_requests = 2;
mca_base_component_var_register(c, "bcast_max_send_requests",
"Maximum number of send requests",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ibcast_max_send_requests);

mca_coll_adapt_component.adapt_ibcast_max_recv_requests = 3;
mca_base_component_var_register(c, "bcast_max_recv_requests",
"Maximum number of receive requests",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ibcast_max_recv_requests);

mca_coll_adapt_component.adapt_ibcast_synchronous_send = true;
(void) mca_base_component_var_register(c, "bcast_synchronous_send",
"Whether to use synchronous send operations during setup of bcast operations",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ibcast_synchronous_send);

mca_coll_adapt_component.adapt_ibcast_context_free_list = NULL;
Expand Down
34 changes: 18 additions & 16 deletions ompi/mca/coll/adapt/coll_adapt_ireduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -36,8 +37,9 @@ int ompi_coll_adapt_ireduce_register(void)

mca_coll_adapt_component.adapt_ireduce_algorithm = 1;
mca_base_component_var_register(c, "reduce_algorithm",
"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,
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_READONLY,
"Algorithm of reduce, 1: binomial, 2: in_order_binomial, 3: binary, 4: pipeline, 5: chain, 6: linear",
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ireduce_algorithm);
if( (mca_coll_adapt_component.adapt_ireduce_algorithm < 0) ||
(mca_coll_adapt_component.adapt_ireduce_algorithm > OMPI_COLL_ADAPT_ALGORITHM_COUNT) ) {
Expand All @@ -47,58 +49,58 @@ int ompi_coll_adapt_ireduce_register(void)
mca_coll_adapt_component.adapt_ireduce_segment_size = 163740;
mca_base_component_var_register(c, "reduce_segment_size",
"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.",
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0,
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ireduce_segment_size);

mca_coll_adapt_component.adapt_ireduce_max_send_requests = 2;
mca_base_component_var_register(c, "reduce_max_send_requests",
"Maximum number of send requests",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ireduce_max_send_requests);

mca_coll_adapt_component.adapt_ireduce_max_recv_requests = 3;
mca_base_component_var_register(c, "reduce_max_recv_requests",
"Maximum number of receive requests per peer",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ireduce_max_recv_requests);

mca_coll_adapt_component.adapt_inbuf_free_list_min = 10;
mca_base_component_var_register(c, "inbuf_free_list_min",
"Minimum number of segment in inbuf free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_inbuf_free_list_min);

mca_coll_adapt_component.adapt_inbuf_free_list_max = 10000;
mca_base_component_var_register(c, "inbuf_free_list_max",
"Maximum number of segment in inbuf free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_inbuf_free_list_max);


mca_coll_adapt_component.adapt_inbuf_free_list_inc = 10;
mca_base_component_var_register(c, "inbuf_free_list_inc",
"Number of segments to allocate when growing the inbuf free list",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_inbuf_free_list_inc);

mca_coll_adapt_component.adapt_ireduce_synchronous_send = true;
(void) mca_base_component_var_register(c, "reduce_synchronous_send",
"Whether to use synchronous send operations during setup of reduce operations",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
MCA_BASE_VAR_SCOPE_ALL,
&mca_coll_adapt_component.adapt_ireduce_synchronous_send);

mca_coll_adapt_component.adapt_ireduce_context_free_list = NULL;
Expand Down

0 comments on commit 8d68c1b

Please sign in to comment.