From 329c6f6a757eef6ebd0d3de1c9013aa0723a18b6 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Fri, 13 Sep 2024 12:09:51 -0700 Subject: [PATCH 1/8] coll tuned dynamic rules file alltoall_algorithm_max_requests Teach the dynamic rules file reader to look for the alltoall_algorithm_max_requests tuning parameter. To keep the dynamic rules file format backward compatible the alltoall_algorithm_max_requests is optional. When not present in the rule definition the value of the corresponding MCA variable is used instead. Resolves #12589 Signed-off-by: Burlen Loring (cherry picked from commit 33f8c74114b1e04c32552a74841f19d177f35852) --- ompi/mca/coll/base/coll_base_util.c | 21 +++ ompi/mca/coll/base/coll_base_util.h | 2 + ompi/mca/coll/tuned/coll_tuned_dynamic_file.c | 123 ++++++++++++------ 3 files changed, 105 insertions(+), 41 deletions(-) diff --git a/ompi/mca/coll/base/coll_base_util.c b/ompi/mca/coll/base/coll_base_util.c index c45f10024d1..2433de10d34 100644 --- a/ompi/mca/coll/base/coll_base_util.c +++ b/ompi/mca/coll/base/coll_base_util.c @@ -11,6 +11,7 @@ * All rights reserved. * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -437,6 +438,26 @@ int ompi_coll_base_file_peek_next_char_is(FILE *fptr, int *fileline, int expecte } while (1); } +/** + * return non-zero if the next non-space to read on the current line is a digit. + * otherwise return 0. + */ +int ompi_coll_base_file_peek_next_char_isdigit(FILE *fptr) +{ + do { + int next = fgetc(fptr); + + if ((' ' == next) || ('\t' == next)) { + continue; /* discard space and tab. keep everything else */ + } + + ungetc(next, fptr); /* put the char back into the stream */ + + return isdigit(next); /* report back whether or not next is a digit */ + + } while (1); +} + /** * There are certainly simpler implementation for this function when performance * is not a critical point. But, as this function is used during the collective diff --git a/ompi/mca/coll/base/coll_base_util.h b/ompi/mca/coll/base/coll_base_util.h index 46c95153469..a4004da9534 100644 --- a/ompi/mca/coll/base/coll_base_util.h +++ b/ompi/mca/coll/base/coll_base_util.h @@ -11,6 +11,7 @@ * All rights reserved. * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -185,6 +186,7 @@ int ompi_coll_base_file_getnext_string(FILE *fptr, int *fileline, char** val); * eat the value, otherwise put it back into the file. */ int ompi_coll_base_file_peek_next_char_is(FILE *fptr, int *fileline, int expected); +int ompi_coll_base_file_peek_next_char_isdigit(FILE *fptr); /* Miscelaneous function */ const char* mca_coll_base_colltype_to_str(int collid); diff --git a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c index a259c789ac2..4a96c0c49da 100644 --- a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c +++ b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c @@ -11,6 +11,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -41,13 +42,24 @@ static int fileline=0; /* used for verbose error messages */ #define getnext(fptr, pval) ompi_coll_base_file_getnext_long(fptr, &fileline, pval) +#define isnext_digit(fptr) ompi_coll_base_file_peek_next_char_isdigit(fptr) /* * Reads a rule file called fname - * Builds the algorithm rule table for a max of n_collectives + * The rule file defines a set of sets of rules. The outer set is keyed on + * communicator size while the inner set is keyed on message size. When a + * communicator is constructed its size is used to look up the nested set of + * message size keyed rules. When a collective is called the message size + * determined from its call arguments are used to lookup a specific rule in the + * inner set. + * + * Rules for communicator and message sizes 0 and N (where N is the larger than + * largest key you provide) can be specified to fall back to the fixed decision + * framework above and below the communicator and message size ranges of + * interest. * * If an error occurs it removes rule table and then exits with a very verbose - * error message (this stops the user using a half baked rule table + * error message. this stops the user using a half baked rule table. * * Returns the number of actual collectives that a rule exists for * (note 0 is NOT an error) @@ -56,7 +68,16 @@ static int fileline=0; /* used for verbose error messages */ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** rules, int n_collectives) { - long CI, NCS, CS, ALG, NMS, FANINOUT, X, MS, SS; + long NCOL = 0, /* number of collectives for which rules are provided */ + COLID = 0, /* identifies the collective type to associate the rules with */ + NCOMSIZES = 0, /* number of sets of message size rules. the key is communicator size */ + COMSIZE = 0, /* communicator size, the key identifying a specific set of message size rules. */ + NMSGSIZES = 0, /* number of message size rules in the set. */ + MSGSIZE = 0, /* message size, the key identifying a specific rule in the set. */ + ALG = 0, /* the collective specific algorithm to use */ + FANINOUT = 0, /* algorithm specific tuning parameter */ + SEGSIZE = 0, /* algorithm specific tuning parameter */ + MAXREQ = 0; /* algorithm specific tuning parameter */ FILE *fptr = (FILE*) NULL; int x, ncs, nms; @@ -100,68 +121,73 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** goto on_file_error; } - if( (getnext(fptr, &X) < 0) || (X < 0) ) { + /* get the number of collectives for which rules are provided in the file */ + if( (getnext(fptr, &NCOL) < 0) || (NCOL < 0) ) { OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read number of collectives in configuration file around line %d\n", fileline)); goto on_file_error; } - if (X>n_collectives) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Number of collectives in configuration file %ld is greater than number of MPI collectives possible %d ??? error around line %d\n", X, n_collectives, fileline)); + if (NCOL>n_collectives) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Number of collectives in configuration file %ld is greater than number of MPI collectives possible %d ??? error around line %d\n", NCOL, n_collectives, fileline)); goto on_file_error; } - for (x=0;x=n_collectives) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Collective id in configuration file %ld is greater than MPI collectives possible %d. Error around line %d\n", CI, n_collectives, fileline)); + if (COLID>=n_collectives) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Collective id in configuration file %ld is greater than MPI collectives possible %d. Error around line %d\n", COLID, n_collectives, fileline)); goto on_file_error; } - if (alg_rules[CI].alg_rule_id != CI) { - OPAL_OUTPUT((ompi_coll_tuned_stream, "Internal error in handling collective ID %ld\n", CI)); + if (alg_rules[COLID].alg_rule_id != COLID) { + OPAL_OUTPUT((ompi_coll_tuned_stream, "Internal error in handling collective ID %ld\n", COLID)); goto on_file_error; } - OPAL_OUTPUT((ompi_coll_tuned_stream, "Reading dynamic rule for collective ID %ld\n", CI)); - alg_p = &alg_rules[CI]; + OPAL_OUTPUT((ompi_coll_tuned_stream, "Reading dynamic rule for collective ID %ld\n", COLID)); + alg_p = &alg_rules[COLID]; - alg_p->alg_rule_id = CI; + alg_p->alg_rule_id = COLID; alg_p->n_com_sizes = 0; alg_p->com_rules = (ompi_coll_com_rule_t *) NULL; - if( (getnext (fptr, &NCS) < 0) || (NCS < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read count of communicators for collective ID %ld at around line %d\n", CI, fileline)); + /* get the number of communicator sizes for which a set of rules are to be provided */ + if( (getnext (fptr, &NCOMSIZES) < 0) || (NCOMSIZES < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read count of communicators for collective ID %ld at around line %d\n", COLID, fileline)); goto on_file_error; } - OPAL_OUTPUT((ompi_coll_tuned_stream, "Read communicator count %ld for dynamic rule for collective ID %ld\n", NCS, CI)); - alg_p->n_com_sizes = NCS; - alg_p->com_rules = ompi_coll_tuned_mk_com_rules (NCS, CI); + OPAL_OUTPUT((ompi_coll_tuned_stream, "Read communicator count %ld for dynamic rule for collective ID %ld\n", NCOMSIZES, COLID)); + alg_p->n_com_sizes = NCOMSIZES; + alg_p->com_rules = ompi_coll_tuned_mk_com_rules (NCOMSIZES, COLID); if (NULL == alg_p->com_rules) { OPAL_OUTPUT((ompi_coll_tuned_stream,"Cannot allocate com rules for file [%s]\n", fname)); goto on_file_error; } - for (ncs=0;ncscom_rules[ncs]); - if( (getnext (fptr, &CS) < 0) || (CS < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read communicator size for collective ID %ld com rule %d at around line %d\n", CI, ncs, fileline)); + /* get the communicator size to associate the set of rules with */ + if( (getnext (fptr, &COMSIZE) < 0) || (COMSIZE < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read communicator size for collective ID %ld com rule %d at around line %d\n", COLID, ncs, fileline)); goto on_file_error; } - com_p->mpi_comsize = CS; + com_p->mpi_comsize = COMSIZE; - if( (getnext (fptr, &NMS) < 0) || (NMS < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read number of message sizes for collective ID %ld com rule %d at around line %d\n", CI, ncs, fileline)); + /* get the number of message sizes to specify rules for. inner set size */ + if( (getnext (fptr, &NMSGSIZES) < 0) || (NMSGSIZES < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read number of message sizes for collective ID %ld com rule %d at around line %d\n", COLID, ncs, fileline)); goto on_file_error; } OPAL_OUTPUT((ompi_coll_tuned_stream, "Read message count %ld for dynamic rule for collective ID %ld and comm size %ld\n", - NMS, CI, CS)); - com_p->n_msg_sizes = NMS; - com_p->msg_rules = ompi_coll_tuned_mk_msg_rules (NMS, CI, ncs, CS); + NMSGSIZES, COLID, COMSIZE)); + com_p->n_msg_sizes = NMSGSIZES; + com_p->msg_rules = ompi_coll_tuned_mk_msg_rules (NMSGSIZES, COLID, ncs, COMSIZE); if (NULL == com_p->msg_rules) { OPAL_OUTPUT((ompi_coll_tuned_stream,"Cannot allocate msg rules for file [%s]\n", fname)); goto on_file_error; @@ -169,37 +195,52 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** msg_p = com_p->msg_rules; - for (nms=0;nmsmsg_rules[nms]); - if( (getnext (fptr, &MS) < 0) || (MS < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read message size for collective ID %ld com rule %d msg rule %d at around line %d\n", CI, ncs, nms, fileline)); + /* read the message size to associate the rule with */ + if( (getnext (fptr, &MSGSIZE) < 0) || (MSGSIZE < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read message size for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); goto on_file_error; } - msg_p->msg_size = (size_t)MS; + msg_p->msg_size = (size_t)MSGSIZE; + /* read the collective specific algorithm identifier */ if( (getnext (fptr, &ALG) < 0) || (ALG < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read target algorithm method for collective ID %ld com rule %d msg rule %d at around line %d\n", CI, ncs, nms, fileline)); + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read target algorithm method for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); goto on_file_error; } msg_p->result_alg = ALG; + /* read faninout tuning parameter. required */ if( (getnext (fptr, &FANINOUT) < 0) || (FANINOUT < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read fan in/out topo for collective ID %ld com rule %d msg rule %d at around line %d\n", CI, ncs, nms, fileline)); + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read fan in/out topo for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); goto on_file_error; } msg_p->result_topo_faninout = FANINOUT; - if( (getnext (fptr, &SS) < 0) || (SS < 0) ) { - OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read target segment size for collective ID %ld com rule %d msg rule %d at around line %d\n", CI, ncs, nms, fileline)); + /* read segsize tuning parameter. required */ + if( (getnext (fptr, &SEGSIZE) < 0) || (SEGSIZE < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read target segment size for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); goto on_file_error; } - msg_p->result_segsize = SS; + msg_p->result_segsize = SEGSIZE; + + /* read the max requests tuning parameter. optional */ + msg_p->result_max_requests = ompi_coll_tuned_alltoall_max_requests; + if( isnext_digit(fptr) ) { + if( (getnext (fptr, &MAXREQ) < 0) || (MAXREQ < 0) ) { + OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read max requests for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); + goto on_file_error; + } + msg_p->result_max_requests = MAXREQ; + } - if (!nms && MS) { + /* check the first rule is for 0 size. look-up depends on this */ + if (!nms && MSGSIZE) { OPAL_OUTPUT((ompi_coll_tuned_stream,"All algorithms must specify a rule for message size of zero upwards always first!\n")); - OPAL_OUTPUT((ompi_coll_tuned_stream,"Message size was %lu for collective ID %ld com rule %d msg rule %d at around line %d\n", MS, CI, ncs, nms, fileline)); + OPAL_OUTPUT((ompi_coll_tuned_stream,"Message size was %lu for collective ID %ld com rule %d msg rule %d at around line %d\n", MSGSIZE, COLID, ncs, nms, fileline)); goto on_file_error; } @@ -212,7 +253,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** } /* comm size */ total_alg_count++; - OPAL_OUTPUT((ompi_coll_tuned_stream, "Done reading dynamic rule for collective ID %ld\n", CI)); + OPAL_OUTPUT((ompi_coll_tuned_stream, "Done reading dynamic rule for collective ID %ld\n", COLID)); } /* per collective */ From 1b1c67b827541e7f78123ddd3339faffd3df5187 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Sat, 2 Nov 2024 15:18:45 -0500 Subject: [PATCH 2/8] coll tuned add version identifier to the rules file the version identifier is optional but when provided it must have the following format and must appear on the first line.`rule-file-version-N` where N is an unsigned integer. Older versions of the parser will fall back to fixed decision mechanism when this line is present. Version 1 is the original format, Version 2 has support for optional coll_tuned_alltoall_algorithm_max_requests specification. Signed-off-by: Burlen Loring (cherry picked from commit f6387a4a9ee61e6c0f01a12fa1f204aa99ec4f34) --- ompi/mca/coll/tuned/coll_tuned_dynamic_file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c index 4a96c0c49da..2292f1f05be 100644 --- a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c +++ b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.c @@ -79,7 +79,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** SEGSIZE = 0, /* algorithm specific tuning parameter */ MAXREQ = 0; /* algorithm specific tuning parameter */ FILE *fptr = (FILE*) NULL; - int x, ncs, nms; + int x, ncs, nms, version; ompi_coll_alg_rule_t *alg_rules = (ompi_coll_alg_rule_t*) NULL; /* complete table of rules */ @@ -121,6 +121,11 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** goto on_file_error; } + /* consume the optional version identifier */ + if (0 == fscanf(fptr, "rule-file-version-%u", &version)) { + version = 1; + } + /* get the number of collectives for which rules are provided in the file */ if( (getnext(fptr, &NCOL) < 0) || (NCOL < 0) ) { OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read number of collectives in configuration file around line %d\n", fileline)); @@ -229,7 +234,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** /* read the max requests tuning parameter. optional */ msg_p->result_max_requests = ompi_coll_tuned_alltoall_max_requests; - if( isnext_digit(fptr) ) { + if( (version > 1) && isnext_digit(fptr) ) { if( (getnext (fptr, &MAXREQ) < 0) || (MAXREQ < 0) ) { OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read max requests for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline)); goto on_file_error; @@ -260,6 +265,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** fclose (fptr); OPAL_OUTPUT((ompi_coll_tuned_stream,"\nConfigure file Stats\n")); + OPAL_OUTPUT((ompi_coll_tuned_stream,"Version\t\t\t\t\t: %5u\n", version)); OPAL_OUTPUT((ompi_coll_tuned_stream,"Collectives with rules\t\t\t: %5d\n", total_alg_count)); OPAL_OUTPUT((ompi_coll_tuned_stream,"Communicator sizes with rules\t\t: %5d\n", total_com_count)); OPAL_OUTPUT((ompi_coll_tuned_stream,"Message sizes with rules\t\t: %5d\n", total_msg_count)); From 715aa6552558cf2d3300a152207a72052e6fe676 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 12:49:44 -0700 Subject: [PATCH 3/8] fix MCA variable scope in coll ucc Changes several variables scope from READONLY to ALL so that they can be set via MPI_T interface Signed-off-by: Burlen Loring (cherry picked from commit 617e89d3bd8a758d0a8edbfc5dae213bea847f56) --- ompi/mca/coll/ucc/coll_ucc_component.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ompi/mca/coll/ucc/coll_ucc_component.c b/ompi/mca/coll/ucc/coll_ucc_component.c index a42341ca769..b6511209460 100644 --- a/ompi/mca/coll/ucc/coll_ucc_component.c +++ b/ompi/mca/coll/ucc/coll_ucc_component.c @@ -1,6 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2021 Mellanox Technologies. All rights reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,24 +60,24 @@ static int mca_coll_ucc_register(void) mca_coll_ucc_component_t *cm = &mca_coll_ucc_component; mca_base_component_t *c = &cm->super.collm_version; mca_base_component_var_register(c, "priority", "Priority of the UCC 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, &cm->ucc_priority); + MCA_BASE_VAR_SCOPE_ALL, &cm->ucc_priority); mca_base_component_var_register(c, "verbose", "Verbose level of the UCC 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, &cm->ucc_verbose); + MCA_BASE_VAR_SCOPE_ALL, &cm->ucc_verbose); mca_base_component_var_register(c, "enable", "[0|1] Enable/Disable the UCC 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, &cm->ucc_enable); + MCA_BASE_VAR_SCOPE_ALL, &cm->ucc_enable); mca_base_component_var_register(c, "np", "Minimal communicator size for the UCC 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, &cm->ucc_np); + MCA_BASE_VAR_SCOPE_ALL, &cm->ucc_np); mca_base_component_var_register(c, MCA_COMPILETIME_VER, "Version of the libucc library with which Open MPI was compiled", @@ -92,13 +93,13 @@ static int mca_coll_ucc_register(void) mca_base_component_var_register(c, "cls", "Comma separated list of UCC CLS to be used for team creation", - MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, - OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_READONLY, &cm->cls); + MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, + OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_ALL, &cm->cls); mca_base_component_var_register(c, "cts", "Comma separated list of UCC coll types to be enabled", - MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, - OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_READONLY, &cm->cts); + MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, + OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_ALL, &cm->cts); return OMPI_SUCCESS; } From df3dbeb13a2cdbe1052898430d8dc35a87ec8f5c Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 18:15:55 -0700 Subject: [PATCH 4/8] 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 (cherry picked from commit 329ea0ef0a8d2b07161795096947881a44a8653d) --- ompi/mca/coll/han/coll_han_component.c | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/ompi/mca/coll/han/coll_han_component.c b/ompi/mca/coll/han/coll_han_component.c index 09be6480ca8..fdcaaf40f9f 100644 --- a/ompi/mca/coll/han/coll_han_component.c +++ b/ompi/mca/coll/han/coll_han_component.c @@ -3,6 +3,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2020 Bull S.A.S. All rights reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -148,6 +149,7 @@ const char* mca_coll_han_topo_lvl_to_str(TOPO_LVL_T topo_lvl) } + /* * Register MCA params */ @@ -165,16 +167,16 @@ static int han_register(void) cs->han_priority = 0; (void) mca_base_component_var_register(c, "priority", "Priority of the HAN 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->han_priority); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_priority); cs->han_bcast_segsize = 65536; (void) mca_base_component_var_register(c, "bcast_segsize", "segment size for bcast", - 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->han_bcast_segsize); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_bcast_segsize); cs->han_bcast_up_module = 0; (void) mca_base_component_var_register(c, "bcast_up_module", @@ -193,9 +195,9 @@ static int han_register(void) cs->han_reduce_segsize = 65536; (void) mca_base_component_var_register(c, "reduce_segsize", "segment size for reduce", - 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->han_reduce_segsize); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_reduce_segsize); cs->han_reduce_up_module = 0; (void) mca_base_component_var_register(c, "reduce_up_module", @@ -213,9 +215,9 @@ static int han_register(void) cs->han_allreduce_segsize = 65536; (void) mca_base_component_var_register(c, "allreduce_segsize", "segment size for allreduce", - 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->han_allreduce_segsize); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_allreduce_segsize); cs->han_allreduce_up_module = 0; (void) mca_base_component_var_register(c, "allreduce_up_module", @@ -269,18 +271,18 @@ static int han_register(void) cs->han_scatter_low_module = 0; (void) mca_base_component_var_register(c, "scatter_low_module", "low level module for scatter, 0 tuned, 1 sm", - 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->han_scatter_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_scatter_low_module); cs->han_reproducible = 0; (void) mca_base_component_var_register(c, "reproducible", "whether we need reproducible results " "(enabling this disables optimisations using topology)" "0 disable 1 enable, default 0", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3, - MCA_BASE_VAR_SCOPE_READONLY, &cs->han_reproducible); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_reproducible); /* * Simple algorithms MCA parameters : @@ -354,9 +356,9 @@ static int han_register(void) } mca_base_component_var_register(c, param_name, param_desc, - 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->mca_rules[coll][topo_lvl])); } } @@ -366,27 +368,27 @@ static int han_register(void) (void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version, "use_dynamic_file_rules", "Enable the dynamic selection provided via the dynamic_rules_filename MCA", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_6, - MCA_BASE_VAR_SCOPE_READONLY, + MCA_BASE_VAR_SCOPE_ALL, &(cs->use_dynamic_file_rules)); cs->dynamic_rules_filename = NULL; (void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version, "dynamic_rules_filename", "Configuration file containing the dynamic selection rules", - MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, + MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_6, - MCA_BASE_VAR_SCOPE_READONLY, + MCA_BASE_VAR_SCOPE_ALL, &(cs->dynamic_rules_filename)); cs->dump_dynamic_rules = false; (void) mca_base_component_var_register(&mca_coll_han_component.super.collm_version, "dump_dynamic_rules", "Switch used to decide if we dump dynamic rules provided by configuration file", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_6, - MCA_BASE_VAR_SCOPE_READONLY, + MCA_BASE_VAR_SCOPE_ALL, &(cs->dump_dynamic_rules)); if((cs->dump_dynamic_rules || NULL != cs->dynamic_rules_filename) @@ -403,9 +405,9 @@ static int han_register(void) "errors printed on rank 0 " "with a 0 verbosity." "Useless if coll_base_verbose is 30 or more.", - MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_6, - MCA_BASE_VAR_SCOPE_READONLY, + MCA_BASE_VAR_SCOPE_ALL, &(cs->max_dynamic_errors)); From 7ba2c43331280f2611f18e9d20d5141f02debd38 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 18:32:58 -0700 Subject: [PATCH 5/8] 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 (cherry picked from commit fdf60aca4d98f668e20996378ed0ef3d972eecc7) --- ompi/mca/coll/adapt/coll_adapt_component.c | 21 ++++++------- ompi/mca/coll/adapt/coll_adapt_ibcast.c | 22 +++++++------- ompi/mca/coll/adapt/coll_adapt_ireduce.c | 34 ++++++++++++---------- 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/ompi/mca/coll/adapt/coll_adapt_component.c b/ompi/mca/coll/adapt/coll_adapt_component.c index 6ec9964e902..3cce1398c0c 100644 --- a/ompi/mca/coll/adapt/coll_adapt_component.c +++ b/ompi/mca/coll/adapt/coll_adapt_component.c @@ -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 @@ -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(); diff --git a/ompi/mca/coll/adapt/coll_adapt_ibcast.c b/ompi/mca/coll/adapt/coll_adapt_ibcast.c index 0f212d11ecb..932beb8f0c7 100644 --- a/ompi/mca/coll/adapt/coll_adapt_ibcast.c +++ b/ompi/mca/coll/adapt/coll_adapt_ibcast.c @@ -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 @@ -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) ) { @@ -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; diff --git a/ompi/mca/coll/adapt/coll_adapt_ireduce.c b/ompi/mca/coll/adapt/coll_adapt_ireduce.c index 4423114bfab..499ea7e99eb 100644 --- a/ompi/mca/coll/adapt/coll_adapt_ireduce.c +++ b/ompi/mca/coll/adapt/coll_adapt_ireduce.c @@ -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 @@ -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) ) { @@ -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; From 30e6b1c430c54f83e9b73ecd0297d5e80b6ae5ed Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 18:38:23 -0700 Subject: [PATCH 6/8] fix MCA variable scope in coll basic Changes several variables scope from READONLY to ALL so that they can be set via MPI_T interface Signed-off-by: Burlen Loring (cherry picked from commit 44e04364bf4367993d4896334ae87a49fed2705f) --- ompi/mca/coll/basic/coll_basic_component.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ompi/mca/coll/basic/coll_basic_component.c b/ompi/mca/coll/basic/coll_basic_component.c index 2aeb5d26298..17d3eb619de 100644 --- a/ompi/mca/coll/basic/coll_basic_component.c +++ b/ompi/mca/coll/basic/coll_basic_component.c @@ -13,6 +13,7 @@ * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -91,16 +92,16 @@ basic_register(void) mca_coll_basic_priority = 10; (void) mca_base_component_var_register(&mca_coll_basic_component.collm_version, "priority", "Priority of the basic 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, + MCA_BASE_VAR_SCOPE_ALL, &mca_coll_basic_priority); mca_coll_basic_crossover = 4; (void) mca_base_component_var_register(&mca_coll_basic_component.collm_version, "crossover", "Minimum number of processes in a communicator before using the logarithmic algorithms", - 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, &mca_coll_basic_crossover); return OMPI_SUCCESS; From 7a52e295281085e8448fcb0c6edb81ad004e5341 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 18:39:17 -0700 Subject: [PATCH 7/8] fix MCA variable scope in coll hcoll Changes several variables scope from READONLY to ALL so that they can be set via MPI_T interface Signed-off-by: Burlen Loring (cherry picked from commit 75befb892f6f107996bf29ed00444754329fcb5e) --- ompi/mca/coll/hcoll/coll_hcoll_component.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ompi/mca/coll/hcoll/coll_hcoll_component.c b/ompi/mca/coll/hcoll/coll_hcoll_component.c index a7a79286a3f..97473df6e35 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_component.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_component.c @@ -3,6 +3,7 @@ * Copyright (c) 2011 Mellanox Technologies. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -107,8 +108,8 @@ static int reg_int(const char* param_name, index = mca_base_component_var_register( &mca_coll_hcoll_component.super.collm_version, param_name, param_desc, MCA_BASE_VAR_TYPE_INT, - NULL, 0, 0,OPAL_INFO_LVL_9, - MCA_BASE_VAR_SCOPE_READONLY, storage); + NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_ALL, storage); if (NULL != deprecated_param_name) { (void) mca_base_var_register_synonym(index, "ompi", "coll", "hcoll", deprecated_param_name, From f7011c6ef18137d117b629bcf012fd924a92b232 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 30 Oct 2024 18:39:17 -0700 Subject: [PATCH 8/8] 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. Picks up a few instances that were not in main. bot:notacherrypick Signed-off-by: bloring --- ompi/mca/coll/han/coll_han_component.c | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ompi/mca/coll/han/coll_han_component.c b/ompi/mca/coll/han/coll_han_component.c index fdcaaf40f9f..9df76ce8e17 100644 --- a/ompi/mca/coll/han/coll_han_component.c +++ b/ompi/mca/coll/han/coll_han_component.c @@ -181,16 +181,16 @@ static int han_register(void) cs->han_bcast_up_module = 0; (void) mca_base_component_var_register(c, "bcast_up_module", "up level module for bcast, 0 libnbc, 1 adapt", - 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->han_bcast_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_bcast_up_module); cs->han_bcast_low_module = 0; (void) mca_base_component_var_register(c, "bcast_low_module", "low level module for bcast, 0 tuned, 1 sm", - 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->han_bcast_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_bcast_low_module); cs->han_reduce_segsize = 65536; (void) mca_base_component_var_register(c, "reduce_segsize", @@ -202,16 +202,16 @@ static int han_register(void) cs->han_reduce_up_module = 0; (void) mca_base_component_var_register(c, "reduce_up_module", "up level module for allreduce, 0 libnbc, 1 adapt", - 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->han_reduce_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_reduce_up_module); cs->han_reduce_low_module = 0; (void) mca_base_component_var_register(c, "reduce_low_module", "low level module for allreduce, 0 tuned, 1 sm", - 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->han_reduce_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_reduce_low_module); cs->han_allreduce_segsize = 65536; (void) mca_base_component_var_register(c, "allreduce_segsize", "segment size for allreduce", @@ -222,51 +222,51 @@ static int han_register(void) cs->han_allreduce_up_module = 0; (void) mca_base_component_var_register(c, "allreduce_up_module", "up level module for allreduce, 0 libnbc, 1 adapt", - 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->han_allreduce_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_allreduce_up_module); cs->han_allreduce_low_module = 0; (void) mca_base_component_var_register(c, "allreduce_low_module", "low level module for allreduce, 0 tuned, 1 sm", - 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->han_allreduce_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_allreduce_low_module); cs->han_allgather_up_module = 0; (void) mca_base_component_var_register(c, "allgather_up_module", "up level module for allgather, 0 libnbc, 1 adapt", - 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->han_allgather_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_allgather_up_module); cs->han_allgather_low_module = 0; (void) mca_base_component_var_register(c, "allgather_low_module", "low level module for allgather, 0 tuned, 1 sm", - 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->han_allgather_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_allgather_low_module); cs->han_gather_up_module = 0; (void) mca_base_component_var_register(c, "gather_up_module", "up level module for gather, 0 libnbc, 1 adapt", - 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->han_gather_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_gather_up_module); cs->han_gather_low_module = 0; (void) mca_base_component_var_register(c, "gather_low_module", "low level module for gather, 0 tuned, 1 sm", - 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->han_gather_low_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_gather_low_module); cs->han_scatter_up_module = 0; (void) mca_base_component_var_register(c, "scatter_up_module", "up level module for scatter, 0 libnbc, 1 adapt", - 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->han_scatter_up_module); + MCA_BASE_VAR_SCOPE_ALL, &cs->han_scatter_up_module); cs->han_scatter_low_module = 0; (void) mca_base_component_var_register(c, "scatter_low_module", @@ -299,9 +299,9 @@ static int han_register(void) mca_coll_base_colltype_to_str(coll)); mca_base_component_var_register(c, param_name, param_desc, - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5, - MCA_BASE_VAR_SCOPE_READONLY, + MCA_BASE_VAR_SCOPE_ALL, &(cs->use_simple_algorithm[coll])); } }