Skip to content

mpirun: add cli option to turn off gpu support #51

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions src/mca/schizo/ompi/schizo-ompi-cli.rstxt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ MPI Options
attached to predefined communicators during the first MPI call.
* ``--memory-alloc-kinds``: Value is a comma separated list of
memory allocation kinds.
* ``--disable-gpu-support``: Specify to disable any accelerator support
built in to the Open MPI installation at run time.
* ``--display-comm``: Display table of communication methods between
MPI_COMM_WORLD ranks during MPI_Init
* ``--display-comm-finalize``: Display table of communication methods
Expand Down
12 changes: 11 additions & 1 deletion src/mca/schizo/ompi/schizo_ompi.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018-2022 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
* Copyright (c) 2022-2024 Triad National Security, LLC. All rights
* Copyright (c) 2022-2025 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -194,6 +194,7 @@ static struct option ompioptions[] = {
PMIX_OPTION_DEFINE(PRTE_CLI_DISABLE_RECOVERY, PMIX_ARG_NONE),
PMIX_OPTION_DEFINE(PRTE_CLI_CONTINUOUS, PMIX_ARG_NONE),
PMIX_OPTION_DEFINE("with-ft", PMIX_ARG_REQD),
PMIX_OPTION_DEFINE("disable-gpu-support", PMIX_ARG_NONE),

/* mpiexec mandated form launch key parameters - MPI 4.0 */
PMIX_OPTION_DEFINE("initial-errhandler", PMIX_ARG_REQD),
Expand Down Expand Up @@ -1612,6 +1613,15 @@ static int parse_env(char **srcenv, char ***dstenv,
}
}

if (NULL != (opt = pmix_cmd_line_get_param(results, "disable-gpu-support"))) {
rc = check_cache(&cache, &cachevals, "disable_gpu_support", "true");
if (PRTE_SUCCESS != rc) {
PMIX_ARGV_FREE_COMPAT(cache);
PMIX_ARGV_FREE_COMPAT(cachevals);
return rc;
}
}

if (pmix_cmd_line_is_taken(results, "display-comm") &&
pmix_cmd_line_is_taken(results, "display-comm-finalize")) {
PMIX_SETENV_COMPAT("OMPI_MCA_ompi_display_comm", "mpi_init,mpi_finalize", true, dstenv);
Expand Down
Loading