Skip to content

Commit

Permalink
stream-buffering is an OMPI option, so make it an MCA
Browse files Browse the repository at this point in the history
 * It looks like `--stream-buffering` CLI was copied from the OMPI schizo
   to others, but is not processed by others.
 * In OMPI make this an MCA parameter, and translate the `--stream-buffering`
   to that MCA parameter.

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
  • Loading branch information
jjhursey authored and rhc54 committed Sep 2, 2022
1 parent 30b3222 commit 1207c64
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 38 deletions.
2 changes: 2 additions & 0 deletions src/mca/schizo/ompi/help-schizo-ompi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -402,6 +403,7 @@ the output to the stdout/err streams).
#
[stream-buffering]
Adjust buffering for stdout/stderr [0 unbuffered] [1 line buffered] [2 fully buffered]
Can also be set via the MCA parameter: --mca ompi_stream_buffering VALUE
#
[stdin]
Specify procs to receive stdin [rank, "all", "none"] (default: 0, indicating rank 0)
Expand Down
31 changes: 13 additions & 18 deletions src/mca/schizo/ompi/schizo_ompi.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018-2021 IBM Corporation. All rights reserved.
* Copyright (c) 2018-2022 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* Copyright (c) 2022 Triad National Security, LLC. All rights
* reserved.
Expand Down Expand Up @@ -140,7 +140,7 @@ static struct option ompioptions[] = {

/* output options */
PMIX_OPTION_DEFINE(PRTE_CLI_OUTPUT, PMIX_ARG_REQD),
PMIX_OPTION_DEFINE(PRTE_CLI_STREAM_BUF, PMIX_ARG_REQD),
PMIX_OPTION_DEFINE("stream-buffering", PMIX_ARG_REQD),

/* input options */
PMIX_OPTION_DEFINE(PRTE_CLI_STDIN, PMIX_ARG_REQD),
Expand Down Expand Up @@ -1511,6 +1511,16 @@ static int parse_env(char **srcenv, char ***dstenv,
pmix_setenv("OMPI_MCA_ompi_display_comm", "mpi_finalize", true, dstenv);
}

if (NULL != (opt = pmix_cmd_line_get_param(results, "stream-buffering"))) {
uint16_t u16;
u16 = strtol(opt->values[0], NULL, 10);
if (0 != u16 && 1 != u16 && 2 != u16) {
/* bad value */
pmix_show_help("help-schizo-base.txt", "bad-stream-buffering-value", true, u16);
}
pmix_setenv("OMPI_MCA_ompi_stream_buffering", opt->values[0], true, dstenv);
}

/* now look for any "--mca" options - note that it is an error
* for the same MCA param to be given more than once if the
* values differ */
Expand Down Expand Up @@ -2145,20 +2155,5 @@ static int set_default_ranking(prte_job_t *jdata,
static void job_info(pmix_cli_result_t *results,
void *jobinfo)
{
pmix_cli_item_t *opt;
uint16_t u16;
pmix_status_t rc;

if (NULL != (opt = pmix_cmd_line_get_param(results, "stream-buffering"))) {
u16 = strtol(opt->values[0], NULL, 10);
if (0 != u16 && 1 != u16 && 2 != u16) {
/* bad value */
pmix_show_help("help-schizo-base.txt", "bad-stream-buffering-value", true, u16);
return;
}
PMIX_INFO_LIST_ADD(rc, jobinfo, "OMPI_STREAM_BUFFERING", &u16, PMIX_UINT16);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
}
}
;
}
5 changes: 1 addition & 4 deletions src/mca/schizo/prte/help-schizo-prte.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- text -*-
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -53,7 +54,6 @@ option to the help request as "--help <option>".
--pmixmca <arg0> <arg1> Pass PMIx MCA parameters
--prtemca <arg0> <arg1> Pass PRTE MCA parameters to the DVM
--show-progress Output a brief periodic report on DVM startup progress
--stream-buffering <arg0> Adjust buffering for stdout/stderr
-x <arg0> Export an environment variable, optionally specifying a value
--allow-run-as-root Allow execution as root (STRONGLY DISCOURAGED)
--daemonize Daemonize the DVM daemons into the background
Expand Down Expand Up @@ -183,9 +183,6 @@ Provide a hostfile (synonym for "hostfile")
[host]
#include#help-schizo-cli#dash-host
#
[stream-buffering]
#include#help-schizo-cli#stream-buffering
#
[display]
#include#help-schizo-cli#display
#
Expand Down
3 changes: 1 addition & 2 deletions src/mca/schizo/prte/help-schizo-prted.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- text -*-
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -169,8 +170,6 @@ option to the help request as "--help <option>".
--set-cwd-to-session-dir Set the working directory of the started processes to their session
directory
--show-progress Output a brief periodic report on launch progress
--stream-buffering <arg0> Adjust buffering for stdout/stderr [0 unbuffered] [1 line buffered] [2
fully buffered]
--wd <arg0> Synonym for --wdir
--wdir <arg0> Set the working directory of the started processes
-x <arg0> Export an environment variable, optionally specifying a value (e.g., "-x
Expand Down
6 changes: 1 addition & 5 deletions src/mca/schizo/prte/help-schizo-prterun.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- text -*-
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -101,8 +102,6 @@ option to the help request as "--help <option>".
--set-cwd-to-session-dir Set the working directory of the started processes to their session
directory
--show-progress Output a brief periodic report on launch progress
--stream-buffering <arg0> Adjust buffering for stdout/stderr [0 unbuffered] [1 line buffered] [2
fully buffered]
--wd <arg0> Synonym for --wdir
--wdir <arg0> Set the working directory of the started processes
-x <arg0> Export an environment variable, optionally specifying a value
Expand Down Expand Up @@ -303,9 +302,6 @@ remote process.
[output]
#include#help-schizo-cli#output
#
[stream-buffering]
#include#help-schizo-cli#stream-buffering
#
[stdin]
Specify procs to receive stdin [rank, "all", "none"] (default: 0, indicating rank 0)
#
Expand Down
3 changes: 1 addition & 2 deletions src/mca/schizo/prte/help-schizo-prun.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- text -*-
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -103,8 +104,6 @@ option to the help request as "--help <option>".
--set-cwd-to-session-dir Set the working directory of the started processes to their session
directory
--show-progress Output a brief periodic report on launch progress
--stream-buffering <arg0> Adjust buffering for stdout/stderr [0 unbuffered] [1 line buffered] [2
fully buffered]
--wd <arg0> Synonym for --wdir
--wdir <arg0> Set the working directory of the started processes
-x <arg0> Export an environment variable, optionally specifying a value (e.g., "-x
Expand Down
3 changes: 1 addition & 2 deletions src/mca/schizo/prte/help-schizo-pterm.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- text -*-
#
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
# Copyright (c) 2022 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -164,8 +165,6 @@ option to the help request as "--help <option>".
--set-cwd-to-session-dir Set the working directory of the started processes to their session
directory
--show-progress Output a brief periodic report on launch progress
--stream-buffering <arg0> Adjust buffering for stdout/stderr [0 unbuffered] [1 line buffered] [2
fully buffered]
--wd <arg0> Synonym for --wdir
--wdir <arg0> Set the working directory of the started processes
-x <arg0> Export an environment variable, optionally specifying a value (e.g., "-x
Expand Down
3 changes: 0 additions & 3 deletions src/mca/schizo/prte/schizo_prte.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ static struct option prteoptions[] = {
PMIX_OPTION_DEFINE(PRTE_CLI_RTOS, PMIX_ARG_REQD),

// output options
PMIX_OPTION_DEFINE(PRTE_CLI_STREAM_BUF, PMIX_ARG_REQD),

/* developer options */
PMIX_OPTION_DEFINE(PRTE_CLI_DISPLAY, PMIX_ARG_REQD),
Expand Down Expand Up @@ -195,7 +194,6 @@ static struct option prterunoptions[] = {

// output options
PMIX_OPTION_DEFINE(PRTE_CLI_OUTPUT, PMIX_ARG_REQD),
PMIX_OPTION_DEFINE(PRTE_CLI_STREAM_BUF, PMIX_ARG_REQD),

// input options
PMIX_OPTION_DEFINE(PRTE_CLI_STDIN, PMIX_ARG_REQD),
Expand Down Expand Up @@ -306,7 +304,6 @@ static struct option prunoptions[] = {

// output options
PMIX_OPTION_DEFINE(PRTE_CLI_OUTPUT, PMIX_ARG_REQD),
PMIX_OPTION_DEFINE(PRTE_CLI_STREAM_BUF, PMIX_ARG_REQD),

// input options
PMIX_OPTION_DEFINE(PRTE_CLI_STDIN, PMIX_ARG_REQD),
Expand Down
3 changes: 1 addition & 2 deletions src/util/prte_cmd_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017-2022 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -98,7 +98,6 @@ BEGIN_C_DECLS
#define PRTE_CLI_SHOW_PROGRESS "show-progress" // none
#define PRTE_CLI_HOSTFILE "hostfile" // required
#define PRTE_CLI_HOST "host" // required
#define PRTE_CLI_STREAM_BUF "stream-buffering" // required
#define PRTE_CLI_REPORT_CHILD_SEP "report-child-jobs-separately" // none
#define PRTE_CLI_PATH "path" // required
#define PRTE_CLI_PSET "pset" // required
Expand Down

0 comments on commit 1207c64

Please sign in to comment.