Skip to content

Commit

Permalink
mpirun: add cli option to turn off gpu support
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hppritcha committed Feb 5, 2025
1 parent 30cadc6 commit 7ef15a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 7ef15a1

Please sign in to comment.