Skip to content

Commit

Permalink
MPI 4.1: add support for memory-alloc-kinds
Browse files Browse the repository at this point in the history
Changes will need to be made to Open MPI to parse the contents of
the OMPI_MCA_mpi_memory_alloc_kinds environment variable to
determine how to use the user supplied memory-alloc-kinds information.

See section 11.4.3 of the MPI 4.1 standard.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit c5953e1)
  • Loading branch information
hppritcha committed Jul 11, 2024
1 parent f0bc7f2 commit 8ee4753
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/mca/schizo/ompi/schizo-ompi-cli.rstxt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2022 IBM Corporation. All rights reserved.
Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
Copyright (c) 2024 Triad National Security, LLC. All rights reserved.
$COPYRIGHT$
Additional copyrights may follow
Expand Down Expand Up @@ -159,6 +161,8 @@ MPI Options

* ``--initial-errhandler``: Specify the initial error handler that is
attached to predefined communicators during the first MPI call.
* ``--memory-alloc-kinds``: Value is a comma separated list of
memory allocation kinds.
* ``--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
15 changes: 13 additions & 2 deletions 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 Triad National Security, LLC. All rights
* Copyright (c) 2022-2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -194,8 +194,10 @@ static struct option ompioptions[] = {
PMIX_OPTION_DEFINE(PRTE_CLI_CONTINUOUS, PMIX_ARG_NONE),
PMIX_OPTION_DEFINE("with-ft", PMIX_ARG_REQD),

/* mpiexec mandated form launch key parameters */
/* mpiexec mandated form launch key parameters - MPI 4.0 */
PMIX_OPTION_DEFINE("initial-errhandler", PMIX_ARG_REQD),
/* mpiexec mandated form launch key parameters - MPI 4.1*/
PMIX_OPTION_DEFINE("memory-alloc-kinds", PMIX_ARG_REQD),

/* Display Commumication Protocol : MPI_Init */
PMIX_OPTION_DEFINE("display-comm", PMIX_ARG_NONE),
Expand Down Expand Up @@ -1575,6 +1577,15 @@ static int parse_env(char **srcenv, char ***dstenv,
}
}

if (NULL != (opt = pmix_cmd_line_get_param(results, "memory-alloc-kinds"))) {
rc = check_cache(&cache, &cachevals, "mpi_memory_alloc_kinds", opt->values[0]);
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 8ee4753

Please sign in to comment.