Skip to content

Commit

Permalink
Minor tweaks of cmd line processing
Browse files Browse the repository at this point in the history
Stop at the '--' delineator when searching for MCA params
and in the OMPI translation loop

Signed-off-by: Ralph Castain <[email protected]>
(cherry picked from commit 71063fc)
  • Loading branch information
rhc54 committed Dec 8, 2023
1 parent 4eb6ab0 commit 3becd9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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 @@ -269,6 +269,10 @@ int prte_schizo_base_parse_prte(int argc, int start, char **argv, char ***target
char *p1, *p2, *param;

for (i = 0; i < (argc - start); ++i) {
if (0 == strcmp("--", argv[i])) {
// quit processing
return PRTE_SUCCESS;
}
if (0 == strcmp("--prtemca", argv[i])) {
if (NULL == argv[i + 1] || NULL == argv[i + 2]) {
/* this is an error */
Expand Down Expand Up @@ -409,6 +413,10 @@ int prte_schizo_base_parse_pmix(int argc, int start, char **argv, char ***target
char *p1, *p2, *param;

for (i = 0; i < (argc - start); ++i) {
if (0 == strcmp("--", argv[i])) {
// quit processing
return PRTE_SUCCESS;
}
if (0 == strcmp("--pmixmca", argv[i]) || 0 == strcmp("--gpmixmca", argv[i])) {
if (NULL == argv[i + 1] || NULL == argv[i + 2]) {
/* this is an error */
Expand Down
4 changes: 4 additions & 0 deletions src/mca/schizo/ompi/schizo_ompi.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ static int parse_cli(char **argv, pmix_cli_result_t *results,

/* Convert single dashes to multi-dashes. */
for (n=1; NULL != pargv[n]; n++) {
if (0 == strcmp("--", pargv[n])) {
// quit processing
break;
}
/* check for option */
if ('-' != pargv[n][0]) {
continue;
Expand Down

0 comments on commit 3becd9d

Please sign in to comment.