Skip to content

Commit 7f507df

Browse files
committed
Fix deprecation warnings for ppr on socket objects
We have deprecated the "socket" object in favor of "package", so we need to extend that treatment to the resource qualifier in the `--map-by ppr` directive. Detect both "socket" and the "skt" shorthand for backward-compatibility reasons. Signed-off-by: Ralph Castain <[email protected]>
1 parent 28432ed commit 7f507df

File tree

5 files changed

+56
-3
lines changed

5 files changed

+56
-3
lines changed

src/mca/rmaps/base/rmaps_base_frame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int prte_rmaps_base_register(pmix_mca_base_register_flag_t flags)
8181
(void) pmix_mca_base_var_register("prte", "rmaps", "default", "mapping_policy",
8282
"Default mapping Policy [slot | hwthread | core | l1cache | "
8383
"l2cache | l3cache | numa | package | node | seq | dist | ppr | "
84-
"rankfile | likwid | pe-list=a,b (comma-delimited ranges of cpus to use for this job)],"
84+
"rankfile | pe-list=a,b (comma-delimited ranges of cpus to use for this job)],"
8585
" with supported colon-delimited modifiers: PE=y (for multiple cpus/proc), "
8686
"SPAN, OVERSUBSCRIBE, NOOVERSUBSCRIBE, NOLOCAL, HWTCPUS, CORECPUS, "
8787
"DEVICE=dev (for dist policy), INHERIT, NOINHERIT, ORDERED, FILE=%s (path to file containing sequential "

src/mca/rmaps/base/rmaps_base_map_job.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata)
388388
options.maptype = HWLOC_OBJ_CORE;
389389
options.mapdepth = PRTE_BIND_TO_CORE;
390390
} else if (0 == strncasecmp(ck[1], "package", len) ||
391-
0 == strncasecmp(ck[1], "skt", len)) {
391+
0 == strncasecmp(ck[1], "skt", len) ||
392+
0 == strncasecmp(ck[1], "socket", len)) {
392393
options.maptype = HWLOC_OBJ_PACKAGE;
393394
options.mapdepth = PRTE_BIND_TO_PACKAGE;
394395
} else if (0 == strncasecmp(ck[1], "numa", len) ||

src/mca/schizo/base/schizo_base_frame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2015-2019 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
55
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved
6-
* Copyright (c) 2021-2023 Nanook Consulting. All rights reserved.
6+
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
77
* $COPYRIGHT$
88
*
99
* Additional copyrights may follow
@@ -140,6 +140,8 @@ bool prte_schizo_base_check_directives(char *directive,
140140
PRTE_CLI_L3CACHE,
141141
PRTE_CLI_NUMA,
142142
PRTE_CLI_PACKAGE,
143+
"socket", // dealt with elsewhere
144+
"skt", // dealt with elsewhere
143145
PRTE_CLI_NODE,
144146
NULL
145147
};

src/mca/schizo/ompi/schizo_ompi.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,31 @@ static int convert_deprecated_cli(pmix_cli_result_t *results,
929929
free(p1);
930930
free(opt->values[0]);
931931
opt->values[0] = tmp;
932+
} else if (0 == strncasecmp(opt->values[0], "ppr", strlen("ppr"))) {
933+
// see if they specified "socket" as the resource
934+
p1 = strdup(opt->values[0]);
935+
p2 = strrchr(p1, ':');
936+
++p2;
937+
if (0 == strncasecmp(p2, "socket", strlen("socket")) ||
938+
0 == strncasecmp(p2, "skt", strlen("skt"))) {
939+
*p2 = '\0';
940+
pmix_asprintf(&p2, "%spackage", p1);
941+
if (warn) {
942+
pmix_asprintf(&tmp, "%s %s", option, opt->values[0]);
943+
pmix_asprintf(&tmp2, "%s %s", option, p2);
944+
/* can't just call show_help as we want every instance to be reported */
945+
output = pmix_show_help_string("help-schizo-base.txt",
946+
"deprecated-converted", true,
947+
tmp, tmp2);
948+
fprintf(stderr, "%s\n", output);
949+
free(output);
950+
free(tmp);
951+
free(tmp2);
952+
}
953+
free(opt->values[0]);
954+
opt->values[0] = p2;
955+
}
956+
free(p1);
932957
}
933958
}
934959
/* --rank-by socket -> --rank-by package */

src/mca/schizo/prte/schizo_prte.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,31 @@ static int convert_deprecated_cli(pmix_cli_result_t *results,
821821
free(p1);
822822
free(opt->values[0]);
823823
opt->values[0] = tmp;
824+
} else if (0 == strncasecmp(opt->values[0], "ppr", strlen("ppr"))) {
825+
// see if they specified "socket" as the resource
826+
p1 = strdup(opt->values[0]);
827+
p2 = strrchr(p1, ':');
828+
++p2;
829+
if (0 == strncasecmp(p2, "socket", strlen("socket")) ||
830+
0 == strncasecmp(p2, "skt", strlen("skt"))) {
831+
*p2 = '\0';
832+
pmix_asprintf(&p2, "%spackage", p1);
833+
if (warn) {
834+
pmix_asprintf(&tmp, "%s %s", option, opt->values[0]);
835+
pmix_asprintf(&tmp2, "%s %s", option, p2);
836+
/* can't just call show_help as we want every instance to be reported */
837+
output = pmix_show_help_string("help-schizo-base.txt",
838+
"deprecated-converted", true,
839+
tmp, tmp2);
840+
fprintf(stderr, "%s\n", output);
841+
free(output);
842+
free(tmp);
843+
free(tmp2);
844+
}
845+
free(opt->values[0]);
846+
opt->values[0] = p2;
847+
}
848+
free(p1);
824849
}
825850
}
826851
/* --rank-by */

0 commit comments

Comments
 (0)