diff --git a/docs/man-openmpi/man3/MPI_Info_create_env.3.rst b/docs/man-openmpi/man3/MPI_Info_create_env.3.rst new file mode 100644 index 00000000000..045e92dc3b1 --- /dev/null +++ b/docs/man-openmpi/man3/MPI_Info_create_env.3.rst @@ -0,0 +1,80 @@ +.. _mpi_info_create_env: + + +MPI_Info_create_env +=================== + +.. include_body + +:ref:`MPI_Info_create_env` - Creates a new info object with the same construction as MPI_INFO_ENV as created during :ref:`MPI_Init` or :ref:`MPI_Init_thread` when the same arguments +are used. + + +SYNTAX +------ + + +C Syntax +^^^^^^^^ + +.. code-block:: c + + #include + + int MPI_Info_create_env(int argc, char *argv[], MPI_Info *info) + + +Fortran Syntax +^^^^^^^^^^^^^^ + +.. code-block:: fortran + + USE MPI + ! or the older form: INCLUDE 'mpif.h' + MPI_INFO_CREATE_ENV(INFO, IERROR) + INTEGER INFO, IERROR + + +Fortran 2008 Syntax +^^^^^^^^^^^^^^^^^^^ + +.. code-block:: fortran + + USE mpi_f08 + MPI_Info_create_env(info, ierror) + TYPE(MPI_Info), INTENT(OUT) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + + +OUTPUT PARAMETERS +----------------- +* ``info``: Info object created (handle). +* ``IERROR``: Fortran only: Error status (integer). + +DESCRIPTION +----------- + +:ref:`MPI_Info_create_env` creates a new info object and populates it with the same key/value pairs as are present in MPI_INFO_ENV. + +Note +---- + +:ref:`MPI_Info_create_env` is one of the few functions that can be called +before :ref:`MPI_Init` and after :ref:`MPI_Finalize`. + +ERRORS +------ + +Almost all MPI routines return an error value; C routines as the value +of the function and Fortran routines in the last argument. + +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for +I/O function errors. The error handler may be changed with +:ref:`MPI_Comm_set_errhandler`; the predefined error handler MPI_ERRORS_RETURN +may be used to cause error values to be returned. Note that MPI does not +guarantee that an MPI program can continue past an error. + + +.. seealso:: + :ref:`MPI_Info_delete` :ref:`MPI_Info_dup` :ref:`MPI_Info_free` :ref:`MPI_Info_get` :ref:`MPI_Info_set` diff --git a/docs/man-openmpi/man3/index.rst b/docs/man-openmpi/man3/index.rst index 183c2e00144..1964e57ce49 100644 --- a/docs/man-openmpi/man3/index.rst +++ b/docs/man-openmpi/man3/index.rst @@ -221,6 +221,7 @@ MPI API manual pages (section 3) MPI_Ineighbor_alltoallw.3.rst MPI_Info_c2f.3.rst MPI_Info_create.3.rst + MPI_Info_create_env.3.rst MPI_Info_delete.3.rst MPI_Info_dup.3.rst MPI_Info_env.3.rst diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 2d3e3d7d6a2..75c56878c7f 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1747,6 +1747,7 @@ OMPI_DECLSPEC int MPI_Imrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Request *request); OMPI_DECLSPEC MPI_Fint MPI_Info_c2f(MPI_Info info); OMPI_DECLSPEC int MPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int MPI_Info_create_env(int argc, char *argv[], MPI_Info *info); OMPI_DECLSPEC int MPI_Info_delete(MPI_Info info, const char *key); OMPI_DECLSPEC int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); OMPI_DECLSPEC MPI_Info MPI_Info_f2c(MPI_Fint info); @@ -2507,6 +2508,7 @@ OMPI_DECLSPEC int PMPI_Imrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Request *request); OMPI_DECLSPEC MPI_Fint PMPI_Info_c2f(MPI_Info info); OMPI_DECLSPEC int PMPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int PMPI_Info_create_env(int argc, char **argv, MPI_Info *info); OMPI_DECLSPEC int PMPI_Info_delete(MPI_Info info, const char *key); OMPI_DECLSPEC int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo); OMPI_DECLSPEC MPI_Info PMPI_Info_f2c(MPI_Fint info); diff --git a/ompi/info/info.c b/ompi/info/info.c index 4116142a8c8..8dc5d86ff36 100644 --- a/ompi/info/info.c +++ b/ompi/info/info.c @@ -116,59 +116,74 @@ int ompi_mpiinfo_init(void) return OMPI_SUCCESS; } -/* - * Fill in the MPI_INFO_ENV if using MPI3 initialization +/** + * Fill in an info object with ENV info. Used for setting + * MPI_INFO_ENV and by invocation of MPI_Info_create_env. */ -int ompi_mpiinfo_init_mpi3(void) + +int ompi_mpiinfo_init_env(int argc, char **argv, ompi_info_t *info) { - char *cptr, **tmp; + char *cptr = NULL, **tmp = NULL; /* fill the env info object */ /* command for this app_context */ - if (NULL != ompi_process_info.command) { + if (NULL != argv) { + tmp = argv; + } else if (NULL != ompi_process_info.command) { tmp = opal_argv_split(ompi_process_info.command, ' '); - opal_info_set(&ompi_mpi_info_env.info.super, "command", tmp[0]); + } + + if (NULL != tmp) { + if (NULL != tmp[0]) { + opal_info_set(&info->super, "command", tmp[0]); + } /* space-separated list of argv for this command */ if (1 < opal_argv_count(tmp)) { cptr = opal_argv_join(&tmp[1], ' '); } else { - cptr = strdup(tmp[0]); + if (NULL != tmp[0]) { + cptr = strdup(tmp[0]); + } + } + if (NULL == argv) { + opal_argv_free(tmp); + } + opal_info_set(&info->super, "argv", cptr); + if (NULL != cptr) { + free(cptr); } - opal_argv_free(tmp); - opal_info_set(&ompi_mpi_info_env.info.super, "argv", cptr); - free(cptr); } /* max procs for the entire job */ opal_asprintf(&cptr, "%u", ompi_process_info.num_procs); - opal_info_set(&ompi_mpi_info_env.info.super, "maxprocs", cptr); + opal_info_set(&info->super, "maxprocs", cptr); /* Open MPI does not support the "soft" option, so set it to maxprocs */ - opal_info_set(&ompi_mpi_info_env.info.super, "soft", cptr); + opal_info_set(&info->super, "soft", cptr); free(cptr); /* the initial error handler, set it as requested (nothing if not * requested) */ if (NULL != ompi_process_info.initial_errhandler) { - opal_info_set(&ompi_mpi_info_env.info.super, "mpi_initial_errhandler", ompi_process_info.initial_errhandler); + opal_info_set(&info->super, "mpi_initial_errhandler", ompi_process_info.initial_errhandler); } /* local host name */ - opal_info_set(&ompi_mpi_info_env.info.super, "host", ompi_process_info.nodename); + opal_info_set(&info->super, "host", ompi_process_info.nodename); #ifdef HAVE_SYS_UTSNAME_H { struct utsname sysname; uname(&sysname); cptr = sysname.machine; - opal_info_set(&ompi_mpi_info_env.info.super, "arch", cptr); + opal_info_set(&info->super, "arch", cptr); } #endif /* initial working dir of this process, if provided */ if (NULL != ompi_process_info.initial_wdir) { - opal_info_set(&ompi_mpi_info_env.info.super, "wdir", ompi_process_info.initial_wdir); + opal_info_set(&info->super, "wdir", ompi_process_info.initial_wdir); } /* provide the REQUESTED thread level - may be different @@ -176,16 +191,16 @@ int ompi_mpiinfo_init_mpi3(void) * ugly, but have to do a switch to find the string representation */ switch (ompi_mpi_thread_requested) { case MPI_THREAD_SINGLE: - opal_info_set(&ompi_mpi_info_env.info.super, "thread_level", "MPI_THREAD_SINGLE"); + opal_info_set(&info->super, "thread_level", "MPI_THREAD_SINGLE"); break; case MPI_THREAD_FUNNELED: - opal_info_set(&ompi_mpi_info_env.info.super, "thread_level", "MPI_THREAD_FUNNELED"); + opal_info_set(&info->super, "thread_level", "MPI_THREAD_FUNNELED"); break; case MPI_THREAD_SERIALIZED: - opal_info_set(&ompi_mpi_info_env.info.super, "thread_level", "MPI_THREAD_SERIALIZED"); + opal_info_set(&info->super, "thread_level", "MPI_THREAD_SERIALIZED"); break; case MPI_THREAD_MULTIPLE: - opal_info_set(&ompi_mpi_info_env.info.super, "thread_level", "MPI_THREAD_MULTIPLE"); + opal_info_set(&info->super, "thread_level", "MPI_THREAD_MULTIPLE"); break; default: /* do nothing - don't know the value */ @@ -196,24 +211,24 @@ int ompi_mpiinfo_init_mpi3(void) /* the number of app_contexts in this job */ opal_asprintf(&cptr, "%u", ompi_process_info.num_apps); - opal_info_set(&ompi_mpi_info_env.info.super, "ompi_num_apps", cptr); + opal_info_set(&info->super, "ompi_num_apps", cptr); free(cptr); /* space-separated list of first MPI rank of each app_context */ if (NULL != ompi_process_info.app_ldrs) { - opal_info_set(&ompi_mpi_info_env.info.super, "ompi_first_rank", ompi_process_info.app_ldrs); + opal_info_set(&info->super, "ompi_first_rank", ompi_process_info.app_ldrs); } /* space-separated list of num procs for each app_context */ if (NULL != ompi_process_info.app_sizes) { - opal_info_set(&ompi_mpi_info_env.info.super, "ompi_np", ompi_process_info.app_sizes); + opal_info_set(&info->super, "ompi_np", ompi_process_info.app_sizes); } /* location of the directory containing any prepositioned files * the user may have requested */ if (NULL != ompi_process_info.proc_session_dir) { - opal_info_set(&ompi_mpi_info_env.info.super, "ompi_positioned_file_dir", ompi_process_info.proc_session_dir); + opal_info_set(&info->super, "ompi_positioned_file_dir", ompi_process_info.proc_session_dir); } /* All done */ diff --git a/ompi/info/info.h b/ompi/info/info.h index 3c83c8d500c..71563eb4e68 100644 --- a/ompi/info/info.h +++ b/ompi/info/info.h @@ -92,10 +92,10 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_t); int ompi_mpiinfo_init(void); /** - * This function is invoked during ompi_mpi_init() and sets up - * the MPI_INFO_ENV object + * Fill in an info object with ENV info. Used for setting + * MPI_INFO_ENV and by invocation of MPI_Info_create_env. */ -int ompi_mpiinfo_init_mpi3(void); +int ompi_mpiinfo_init_env(int argc, char *argv[], ompi_info_t *info); /** * This function is used to free a ompi level info diff --git a/ompi/instance/instance.c b/ompi/instance/instance.c index cad4d31cf1c..a5d7b90093d 100644 --- a/ompi/instance/instance.c +++ b/ompi/instance/instance.c @@ -448,9 +448,9 @@ static int ompi_mpi_instance_init_common (int argc, char **argv) return ret; } - /* initialize info */ - if (OMPI_SUCCESS != (ret = ompi_mpiinfo_init_mpi3())) { - return ompi_instance_print_error ("ompi_info_init_mpi3() failed", ret); + /* initialize MPI_INFO_ENV */ + if (OMPI_SUCCESS != (ret = ompi_mpiinfo_init_env(0, NULL, &ompi_mpi_info_env.info))) { + return ompi_instance_print_error ("ompi_info_init_env() failed", ret); } /* declare our presence for interlib coordination, and diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 784923a7d22..8e7487a31a2 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -266,6 +266,7 @@ interface_profile_sources = \ imrecv.c \ info_c2f.c \ info_create.c \ + info_create_env.c \ info_delete.c \ info_dup.c \ info_f2c.c \ diff --git a/ompi/mpi/c/info_create_env.c b/ompi/mpi/c/info_create_env.c new file mode 100644 index 00000000000..68f7ffca99c --- /dev/null +++ b/ompi/mpi/c/info_create_env.c @@ -0,0 +1,79 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2020 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/info/info.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Info_create_env = PMPI_Info_create_env +#endif +#define MPI_Info_create_env PMPI_Info_create_env +#endif + +static const char FUNC_NAME[] = "MPI_Info_create_env"; + +/** + * Returns an info object with the same construction as MPI_INFO_ENV as created + * during MPI_INIT or MPI_INIT_THREAD when the same arguments are used. + * + * @param argc number or arguments (Integer) + * @param argv Pointer to array of arguments + * @param info Pointer to the MPI_Info handle + * + * @retval MPI_SUCCESS + * @retval MPI_ERR_INFO + * @retval MPI_ERR_NO_MEM + * + * When an MPI_Info object is not being used, it should be freed using + * MPI_Info_free + */ +int MPI_Info_create_env(int argc, char *argv[], MPI_Info *info) +{ + int rc; + ompi_info_t *the_info; + + if (MPI_PARAM_CHECK) { + if (NULL == info) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_INFO, + FUNC_NAME); + } + } + + the_info = ompi_info_allocate (); + if (NULL == the_info) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + } + + *info = the_info; + + rc = ompi_mpiinfo_init_env(argc, argv, the_info); + OMPI_ERRHANDLER_NOHANDLE_CHECK(rc, rc, FUNC_NAME); + return MPI_SUCCESS; +} diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am index e2fc6465bfe..ecbf93a9d43 100644 --- a/ompi/mpi/fortran/mpif-h/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/Makefile.am @@ -18,7 +18,7 @@ # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -# Copyright (c) 2021 Triad National Security, LLC. All rights +# Copyright (c) 2021-2022 Triad National Security, LLC. All rights # reserved. # # $COPYRIGHT$ @@ -334,6 +334,7 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \ ineighbor_alltoallv_f.c \ ineighbor_alltoallw_f.c \ info_create_f.c \ + info_create_env_f.c \ info_delete_f.c \ info_dup_f.c \ info_free_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/info_create_env_f.c b/ompi/mpi/fortran/mpif-h/info_create_env_f.c new file mode 100644 index 00000000000..e138d73a28e --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/info_create_env_f.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_INFO_CREATE_ENV = ompi_info_create_env_f +#pragma weak pmpi_info_create_env = ompi_info_create_env_f +#pragma weak pmpi_info_create_env_ = ompi_info_create_env_f +#pragma weak pmpi_info_create_env__ = ompi_info_create_env_f + +#pragma weak PMPI_Info_create_f = ompi_info_create_env_f +#pragma weak PMPI_Info_create_f08 = ompi_info_create_env_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_INFO_CREATE_ENV, + pmpi_info_create_env, + pmpi_info_create_env_, + pmpi_info_create_env__, + pompi_info_create_env_f, + (MPI_Fint *info, MPI_Fint *ierr), + (info, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_INFO_CREATE_ENV = ompi_info_create_env_f +#pragma weak mpi_info_create_env = ompi_info_create_env_f +#pragma weak mpi_info_create_env_ = ompi_info_create_env_f +#pragma weak mpi_info_create_env__ = ompi_info_create_env_f + +#pragma weak MPI_Info_create_f = ompi_info_create_env_f +#pragma weak MPI_Info_create_f08 = ompi_info_create_env_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_INFO_CREATE_ENV, + mpi_info_create_env, + mpi_info_create_env_, + mpi_info_create_env__, + ompi_info_create_env_f, + (MPI_Fint *info, MPI_Fint *ierr), + (info, ierr) ) +#else +#define ompi_info_create_env_f pompi_info_create_env_f +#endif +#endif + + +void ompi_info_create_env_f(MPI_Fint *info, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Info c_info; + + c_ierr = PMPI_Info_create_env(0, NULL, &c_info); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *info = PMPI_Info_c2f(c_info); + } +} diff --git a/ompi/mpi/fortran/mpif-h/profile/Makefile.am b/ompi/mpi/fortran/mpif-h/profile/Makefile.am index 3d0a56bd9cc..6957518a71c 100644 --- a/ompi/mpi/fortran/mpif-h/profile/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/profile/Makefile.am @@ -18,7 +18,7 @@ # Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -# Copyright (c) 2019 Triad National Security, LLC. All rights +# Copyright (c) 2019-2022 Triad National Security, LLC. All rights # reserved. # $COPYRIGHT$ # @@ -246,6 +246,7 @@ linked_files = \ pineighbor_alltoallv_f.c \ pineighbor_alltoallw_f.c \ pinfo_create_f.c \ + pinfo_create_env_f.c \ pinfo_delete_f.c \ pinfo_dup_f.c \ pinfo_free_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h index 6e9201458ad..f5d06f85592 100644 --- a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h +++ b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h @@ -16,7 +16,7 @@ * reserved. * Copyright (c) 2016-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2019 Triad National Security, LLC. All rights + * Copyright (c) 2019-2022 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2021 Bull S.A.S. All rights reserved. * $COPYRIGHT$ @@ -303,6 +303,7 @@ PN2(void, MPI_Iscan, mpi_iscan, MPI_ISCAN, (char *sendbuf, char *recvbuf, MPI_Fi PN2(void, MPI_Iscatter, mpi_iscatter, MPI_ISCATTER, (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)); PN2(void, MPI_Iscatterv, mpi_iscatterv, MPI_ISCATTERV, (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *displs, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)); PN2(void, MPI_Info_create, mpi_info_create, MPI_INFO_CREATE, (MPI_Fint *info, MPI_Fint *ierr)); +PN2(void, MPI_Info_create_env, mpi_info_create_env, MPI_INFO_CREATE_ENV, (MPI_Fint *info, MPI_Fint *ierr)); PN2(void, MPI_Info_delete, mpi_info_delete, MPI_INFO_DELETE, (MPI_Fint *info, char *key, MPI_Fint *ierr, int key_len)); PN2(void, MPI_Info_dup, mpi_info_dup, MPI_INFO_DUP, (MPI_Fint *info, MPI_Fint *newinfo, MPI_Fint *ierr)); PN2(void, MPI_Info_free, mpi_info_free, MPI_INFO_FREE, (MPI_Fint *info, MPI_Fint *ierr)); diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index d66be96efc3..d788d56c2da 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -11,7 +11,7 @@ # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. -# Copyright (c) 2019 Triad National Security, LLC. All rights +# Copyright (c) 2019-2022 Triad National Security, LLC. All rights # reserved. # Copyright (c) 2020 Sandia National Laboratories. All rights reserved. # Copyright (c) 2022 IBM Corporation. All rights reserved. @@ -317,6 +317,7 @@ mpi_api_files = \ ineighbor_alltoallv_f08.F90 \ ineighbor_alltoallw_f08.F90 \ info_create_f08.F90 \ + info_create_env_f08.F90 \ info_delete_f08.F90 \ info_dup_f08.F90 \ info_free_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h index 9a7d390d37d..54efadf95c1 100644 --- a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h @@ -12,7 +12,7 @@ ! Copyright (c) 2019 Triad National Security, LLC. All rights ! reserved. ! Copyright (c) 2021 Bull S.A.S. All rights reserved. -! Copyright (c) 2021 Triad National Security, LLC. All rights +! Copyright (c) 2021-2022 Triad National Security, LLC. All rights ! reserved. ! $COPYRIGHT$ ! @@ -2441,6 +2441,13 @@ subroutine ompi_info_create_f(info,ierror) & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_info_create_f +subroutine ompi_info_create_env_f(info,ierror) & + BIND(C, name="ompi_info_create_env_f") + implicit none + INTEGER, INTENT(OUT) :: info + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_info_create_env_f + subroutine ompi_info_delete_f(info,key,ierror,key_len) & BIND(C, name="ompi_info_delete_f") use, intrinsic :: ISO_C_BINDING, only : C_CHAR diff --git a/ompi/mpi/fortran/use-mpi-f08/info_create_env_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/info_create_env_f08.F90 new file mode 100644 index 00000000000..64716269061 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/info_create_env_f08.F90 @@ -0,0 +1,23 @@ +! -*- f90 -*- +! +! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All Rights reserved. +! Copyright (c) 2018-2020 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! $COPYRIGHT$ + +#include "mpi-f08-rename.h" + +subroutine MPI_Info_create_env_f08(info,ierror) + use :: mpi_f08_types, only : MPI_Info + use :: ompi_mpifh_bindings, only : ompi_info_create_env_f + implicit none + TYPE(MPI_Info), INTENT(OUT) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_info_create_env_f(info%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Info_create_env_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in index 85af0ea64e3..c08b211c95c 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in @@ -10,7 +10,7 @@ ! Copyright (c) 2015-2020 Research Organization for Information Science ! and Technology (RIST). All rights reserved. ! Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. -! Copyright (c) 2021 Triad National Security, LLC. All rights +! Copyright (c) 2021-2022 Triad National Security, LLC. All rights ! reserved. ! $COPYRIGHT$ ! @@ -3061,6 +3061,15 @@ subroutine MPI_Info_create_f08(info,ierror) end subroutine MPI_Info_create_f08 end interface MPI_Info_create +interface MPI_Info_create_env +subroutine MPI_Info_create_env_f08(info,ierror) + use :: mpi_f08_types, only : MPI_Info + implicit none + TYPE(MPI_Info), INTENT(OUT) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Info_create_env_f08 +end interface MPI_Info_create_env + interface MPI_Info_delete subroutine MPI_Info_delete_f08(info,key,ierror) use :: mpi_f08_types, only : MPI_Info diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h index 57792e04ba9..41e747e975c 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h @@ -506,6 +506,8 @@ #define MPI_Win_set_errhandler_f08 PMPI_Win_set_errhandler_f08 #define MPI_Info_create PMPI_Info_create #define MPI_Info_create_f08 PMPI_Info_create_f08 +#define MPI_Info_create_env PMPI_Info_create_env +#define MPI_Info_create_env_f08 PMPI_Info_create_env_f08 #define MPI_Info_delete PMPI_Info_delete #define MPI_Info_delete_f08 PMPI_Info_delete_f08 #define MPI_Info_dup PMPI_Info_dup diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am index 47179817979..6a244187dd9 100644 --- a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am @@ -19,6 +19,8 @@ # reserved. # Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2022 Triad National Security, LLC. All rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -255,6 +257,7 @@ pmpi_api_files = \ pineighbor_alltoallv_f08.F90 \ pineighbor_alltoallw_f08.F90 \ pinfo_create_f08.F90 \ + pinfo_create_env_f08.F90 \ pinfo_delete_f08.F90 \ pinfo_dup_f08.F90 \ pinfo_free_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in index 22fa630feb8..2bb80eec208 100644 --- a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in @@ -11,7 +11,7 @@ ! reserved. ! Copyright (c) 2015-2020 Research Organization for Information Science ! and Technology (RIST). All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights +! Copyright (c) 2019-2022 Triad National Security, LLC. All rights ! reserved. ! Copyright (c) 2021 Bull S.A.S. All rights reserved. ! Copyright (c) 2021 IBM Corporation. All rights reserved. @@ -2162,6 +2162,14 @@ end subroutine MPI_Info_create end interface +interface + +subroutine MPI_Info_create_env(info, ierror) + integer, intent(out) :: info + integer, intent(out) :: ierror +end subroutine MPI_Info_create_env + +end interface interface diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h b/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h index e72bf8b8f6b..f27471b9580 100644 --- a/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h @@ -154,6 +154,7 @@ #define MPI_Ineighbor_alltoallv PMPI_Ineighbor_alltoallv #define MPI_Ineighbor_alltoallw PMPI_Ineighbor_alltoallw #define MPI_Info_create PMPI_Info_create +#define MPI_Info_create_env PMPI_Info_create_env #define MPI_Info_delete PMPI_Info_delete #define MPI_Info_dup PMPI_Info_dup #define MPI_Info_free PMPI_Info_free diff --git a/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h b/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h index fde5d972a95..c59ca473a6b 100644 --- a/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h @@ -13,7 +13,7 @@ ! Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved ! Copyright (c) 2016-2018 Research Organization for Information Science ! and Technology (RIST). All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights +! Copyright (c) 2019-2022 Triad National Security, LLC. All rights ! reserved. ! Copyright (c) 2021 Sandia National Laboratories. All rights reserved. ! Copyright (c) 2021 IBM Corporation. All rights reserved. @@ -998,6 +998,15 @@ end subroutine MPI_Info_delete end interface +interface + +subroutine MPI_Info_create_env(info, ierror) + integer, intent(out) :: info + integer, intent(out) :: ierror +end subroutine MPI_Info_create_env + +end interface + interface subroutine MPI_Info_dup(info, newinfo, ierror) diff --git a/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h b/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h index 0e32fe69990..0c990f824b5 100644 --- a/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h @@ -91,6 +91,7 @@ #define MPI_Group_translate_ranks PMPI_Group_translate_ranks #define MPI_Group_union PMPI_Group_union #define MPI_Info_create PMPI_Info_create +#define MPI_Info_create_env PMPI_Info_create_env #define MPI_Info_delete PMPI_Info_delete #define MPI_Info_dup PMPI_Info_dup #define MPI_Info_free PMPI_Info_free