Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream-buffering is an OMPI option, so make it an MCA #1489

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 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 @@ -136,8 +137,6 @@ Initiate an instance of the PMIx Reference RTE (PRRTE) DVM
--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 Expand Up @@ -402,6 +401,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
37 changes: 19 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,6 @@ 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),

/* input options */
PMIX_OPTION_DEFINE(PRTE_CLI_STDIN, PMIX_ARG_REQD),
Expand Down Expand Up @@ -235,6 +234,7 @@ static struct option ompioptions[] = {
PMIX_OPTION_DEFINE("rankfile", PMIX_ARG_REQD),
PMIX_OPTION_DEFINE("output-proctable", PMIX_ARG_REQD),
PMIX_OPTION_DEFINE("debug", PMIX_ARG_NONE),
PMIX_OPTION_DEFINE("stream-buffering", PMIX_ARG_REQD),

PMIX_OPTION_END
};
Expand Down Expand Up @@ -1511,6 +1511,22 @@ static int parse_env(char **srcenv, char ***dstenv,
pmix_setenv("OMPI_MCA_ompi_display_comm", "mpi_finalize", true, dstenv);
}

/* --stream-buffering will be deprecated starting with Open MPI v5 */
if (NULL != (opt = pmix_cmd_line_get_param(results, "stream-buffering"))) {
uint16_t u16;
if (prte_schizo_ompi_component.warn_deprecations) {
pmix_show_help("help-schizo-base.txt", "deprecated-inform", true, "stream-buffering",
"This CLI option will be deprecated starting in Open MPI v5. "
"If you need this functionality use the Open MPI MCA option: ompi_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);
}
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 +2161,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 @@ -51,7 +52,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 @@ -181,9 +181,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 @@ -136,8 +137,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 @@ -120,7 +120,6 @@ static struct option prteoptions[] = {
PMIX_OPTION_DEFINE(PRTE_CLI_EXEC_AGENT, 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 @@ -194,7 +193,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 @@ -303,7 +301,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