Skip to content

Commit 7ef15a1

Browse files
committed
mpirun: add cli option to turn off gpu support
idea is that maybe one might want to build open mpi with gpu support, but there may be performance benefit of disabling all gpu related paths when using this library on systems without accelerators. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 30cadc6 commit 7ef15a1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/mca/schizo/ompi/schizo-ompi-cli.rstxt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ MPI Options
163163
attached to predefined communicators during the first MPI call.
164164
* ``--memory-alloc-kinds``: Value is a comma separated list of
165165
memory allocation kinds.
166+
* ``--disable-gpu-support``: Specify to disable any accelerator support
167+
built in to the Open MPI installation at run time.
166168
* ``--display-comm``: Display table of communication methods between
167169
MPI_COMM_WORLD ranks during MPI_Init
168170
* ``--display-comm-finalize``: Display table of communication methods

src/mca/schizo/ompi/schizo_ompi.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* and Technology (RIST). All rights reserved.
2020
* Copyright (c) 2018-2022 IBM Corporation. All rights reserved.
2121
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
22-
* Copyright (c) 2022-2024 Triad National Security, LLC. All rights
22+
* Copyright (c) 2022-2025 Triad National Security, LLC. All rights
2323
* reserved.
2424
* $COPYRIGHT$
2525
*
@@ -194,6 +194,7 @@ static struct option ompioptions[] = {
194194
PMIX_OPTION_DEFINE(PRTE_CLI_DISABLE_RECOVERY, PMIX_ARG_NONE),
195195
PMIX_OPTION_DEFINE(PRTE_CLI_CONTINUOUS, PMIX_ARG_NONE),
196196
PMIX_OPTION_DEFINE("with-ft", PMIX_ARG_REQD),
197+
PMIX_OPTION_DEFINE("disable-gpu-support", PMIX_ARG_NONE),
197198

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

1616+
if (NULL != (opt = pmix_cmd_line_get_param(results, "disable-gpu-support"))) {
1617+
rc = check_cache(&cache, &cachevals, "disable_gpu_support", "true");
1618+
if (PRTE_SUCCESS != rc) {
1619+
PMIX_ARGV_FREE_COMPAT(cache);
1620+
PMIX_ARGV_FREE_COMPAT(cachevals);
1621+
return rc;
1622+
}
1623+
}
1624+
16151625
if (pmix_cmd_line_is_taken(results, "display-comm") &&
16161626
pmix_cmd_line_is_taken(results, "display-comm-finalize")) {
16171627
PMIX_SETENV_COMPAT("OMPI_MCA_ompi_display_comm", "mpi_init,mpi_finalize", true, dstenv);

0 commit comments

Comments
 (0)