Skip to content

Commit

Permalink
Merge pull request #1060 from rhc54/cmr20/gen
Browse files Browse the repository at this point in the history
Error out if generic MCA param is unknown
  • Loading branch information
rhc54 authored Jul 27, 2021
2 parents 83309ba + 2e01450 commit 79d80ea
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/mca/schizo/base/help-schizo-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,16 @@ ERROR: %s was unable to identify the proxy for your command.

Please specify a personality or ask the library developer's to address
the problem.
#
[unrecog-generic-param]
The command line contains a generic MCA param that is not
recognized by either the default or active personalities:

Param name: %s
Param value: %s

Please modify the command line to either specify the personality
this parameter belongs to (e.g., "--prtemca" for a PRRTE param,
"--pmixmca" for a PMIx param, "--omca" for an OMPI param) or
ensure that the generic param is correct and known to the active
personality.
8 changes: 8 additions & 0 deletions src/mca/schizo/base/schizo_base_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ int prte_schizo_base_parse_prte(int argc, int start, char **argv, char ***target
}
}
if (!ignore) {
/* replace the generic directive with a PRRTE specific
* one so we know this has been processed */
free(argv[i]);
argv[i] = strdup("--prtemca");
if (NULL == target) {
/* push it into our environment */
asprintf(&param, "PRTE_MCA_%s", p1);
Expand Down Expand Up @@ -525,6 +529,10 @@ int prte_schizo_base_parse_pmix(int argc, int start, char **argv, char ***target
}
}
if (!ignore) {
/* replace the generic directive with a PRRTE specific
* one so we know this has been processed */
free(argv[i]);
argv[i] = strdup("--pmixmca");
if (NULL == target) {
/* push it into our environment */
asprintf(&param, "PMIX_MCA_%s", p1);
Expand Down
7 changes: 7 additions & 0 deletions src/mca/schizo/ompi/schizo_ompi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,13 @@ static int parse_cli(int argc, int start, char **argv, char ***target)
free(p2);
i += 2;
continue;
} else {
/* this is an unrecognized generic param */
prte_show_help("help-schizo-base.txt", "unrecog-generic-param",
true, p1, p2);
free(p1);
free(p2);
return PRTE_ERR_SILENT;
}
}
if (0 == strcmp("--map-by", argv[i])) {
Expand Down
12 changes: 11 additions & 1 deletion src/mca/schizo/prte/schizo_prte.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,20 @@ static int define_cli(prte_cmd_line_t *cli)

static int parse_cli(int argc, int start, char **argv, char ***target)
{
int i;

prte_output_verbose(1, prte_schizo_base_framework.framework_output, "%s schizo:prte: parse_cli",
PRTE_NAME_PRINT(PRTE_PROC_MY_NAME));

/* we already did this in the tool */
for (i = 0; i < (argc - start); ++i) {
if (0 == strcmp("--mca", argv[i])) {
/* this is an unrecognized generic param */
prte_show_help("help-schizo-base.txt", "unrecog-generic-param",
true, argv[i+1], argv[i+2]);
return PRTE_ERR_SILENT;
}
}

return PRTE_SUCCESS;
}

Expand Down

0 comments on commit 79d80ea

Please sign in to comment.