diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 6da3b2ca40..ea4b8f1708 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1294,6 +1294,7 @@ OMPI_DECLSPEC int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *outneighbors, int *weighted); OMPI_DECLSPEC int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used); OMPI_DECLSPEC int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); OMPI_DECLSPEC int MPI_Comm_get_parent(MPI_Comm *parent); OMPI_DECLSPEC int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); @@ -1303,6 +1304,7 @@ OMPI_DECLSPEC int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); OMPI_DECLSPEC int MPI_Comm_remote_size(MPI_Comm comm, int *size); OMPI_DECLSPEC int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); OMPI_DECLSPEC int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info); OMPI_DECLSPEC int MPI_Comm_set_name(MPI_Comm comm, const char *comm_name); OMPI_DECLSPEC int MPI_Comm_size(MPI_Comm comm, int *size); OMPI_DECLSPEC int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info info, @@ -1984,6 +1986,7 @@ OMPI_DECLSPEC int PMPI_Comm_free(MPI_Comm *comm); OMPI_DECLSPEC int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag); OMPI_DECLSPEC int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int PMPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used); OMPI_DECLSPEC int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); OMPI_DECLSPEC int PMPI_Comm_get_parent(MPI_Comm *parent); OMPI_DECLSPEC int PMPI_Comm_group(MPI_Comm comm, MPI_Group *group); @@ -1993,6 +1996,7 @@ OMPI_DECLSPEC int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); OMPI_DECLSPEC int PMPI_Comm_remote_size(MPI_Comm comm, int *size); OMPI_DECLSPEC int PMPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); OMPI_DECLSPEC int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Comm_set_info(MPI_Comm comm, MPI_Info info); OMPI_DECLSPEC int PMPI_Comm_set_name(MPI_Comm comm, const char *comm_name); OMPI_DECLSPEC int PMPI_Comm_size(MPI_Comm comm, int *size); OMPI_DECLSPEC int PMPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info info, diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index fafe2eaa04..c8bdc97eb0 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -9,7 +9,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011 Sandia National Laboratories. All rights reserved. # Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved. # Copyright (c) 2013 Los Alamos National Security, LLC. All rights @@ -120,6 +120,7 @@ libmpi_c_mpi_la_SOURCES = \ comm_free_keyval.c \ comm_get_attr.c \ comm_get_errhandler.c \ + comm_get_info.c \ comm_get_name.c \ comm_get_parent.c \ comm_group.c \ @@ -128,6 +129,7 @@ libmpi_c_mpi_la_SOURCES = \ comm_remote_group.c \ comm_remote_size.c \ comm_set_attr.c \ + comm_set_info.c \ dist_graph_create.c \ dist_graph_create_adjacent.c \ dist_graph_neighbors.c \ diff --git a/ompi/mpi/c/comm_get_info.c b/ompi/mpi/c/comm_get_info.c new file mode 100644 index 0000000000..7ce4ef2c50 --- /dev/null +++ b/ompi/mpi/c/comm_get_info.c @@ -0,0 +1,57 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2014 Cisco Systems, Inc. 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" +#include +#include + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_Comm_get_info = PMPI_Comm_get_info +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_Comm_get_info"; + + +int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used) +{ + OPAL_CR_NOOP_PROGRESS(); + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info_used) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + if (ompi_comm_invalid(comm)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, + FUNC_NAME); + } + } + + /* At the moment, we do not support any communicator hints. So + just return a new, empty info obect handle. */ + (*info_used) = OBJ_NEW(ompi_info_t); + if (NULL == (*info_used)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, + FUNC_NAME); + } + + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/comm_set_info.c b/ompi/mpi/c/comm_set_info.c new file mode 100644 index 0000000000..cf02e66ec2 --- /dev/null +++ b/ompi/mpi/c/comm_set_info.c @@ -0,0 +1,52 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2014 Cisco Systems, Inc. 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" +#include +#include + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_Comm_set_info = PMPI_Comm_set_info +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_Comm_set_info"; + + +int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info) +{ + OPAL_CR_NOOP_PROGRESS(); + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info || + ompi_info_is_freed(info)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + if (ompi_comm_invalid(comm)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, + FUNC_NAME); + } + } + + /* At the moment, we do not support any communicator hints. + So... do nothing */ + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/profile/Makefile.am b/ompi/mpi/c/profile/Makefile.am index 0105b3f490..de3c8dfcaa 100644 --- a/ompi/mpi/c/profile/Makefile.am +++ b/ompi/mpi/c/profile/Makefile.am @@ -10,7 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011 Sandia National Laboratories. All rights reserved. # Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved. # Copyright (c) 2013 Los Alamos National Security, LLC. All rights @@ -102,6 +102,7 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pcomm_free_keyval.c \ pcomm_get_attr.c \ pcomm_get_errhandler.c \ + pcomm_get_info.c \ pcomm_get_name.c \ pcomm_get_parent.c \ pcomm_group.c \ @@ -110,6 +111,7 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pcomm_remote_group.c \ pcomm_remote_size.c \ pcomm_set_attr.c \ + pcomm_set_info.c \ pdist_graph_create.c \ pdist_graph_create_adjacent.c \ pdist_graph_neighbors.c \ diff --git a/ompi/mpi/c/profile/defines.h b/ompi/mpi/c/profile/defines.h index 478fc7cb69..9d83610def 100644 --- a/ompi/mpi/c/profile/defines.h +++ b/ompi/mpi/c/profile/defines.h @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. * Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights @@ -88,6 +88,7 @@ #define MPI_Comm_free PMPI_Comm_free #define MPI_Comm_get_attr PMPI_Comm_get_attr #define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler +#define MPI_Comm_get_info PMPI_Comm_get_info #define MPI_Comm_get_name PMPI_Comm_get_name #define MPI_Comm_get_parent PMPI_Comm_get_parent #define MPI_Comm_group PMPI_Comm_group @@ -101,6 +102,7 @@ #define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors #define MPI_Dist_graph_neighbors_count PMPI_Dist_graph_neighbors_count #define MPI_Comm_set_errhandler PMPI_Comm_set_errhandler +#define MPI_Comm_set_info PMPI_Comm_set_info #define MPI_Comm_set_name PMPI_Comm_set_name #define MPI_Comm_size PMPI_Comm_size #define MPI_Comm_spawn PMPI_Comm_spawn diff --git a/ompi/mpi/fortran/base/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/base/mpi-f08-interfaces.F90 index 351194561b..48e8ad591b 100644 --- a/ompi/mpi/fortran/base/mpi-f08-interfaces.F90 +++ b/ompi/mpi/fortran/base/mpi-f08-interfaces.F90 @@ -1755,6 +1755,16 @@ subroutine MPI_Comm_get_attr_f08(comm,comm_keyval,attribute_val,flag,ierror) end subroutine MPI_Comm_get_attr_f08 end interface MPI_Comm_get_attr +interface MPI_Comm_get_info +subroutine MPI_Comm_get_info_f08(comm,info_used,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(OUT) :: info_used + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Comm_get_info_f08 +end interface MPI_Comm_get_info + interface MPI_Comm_get_name subroutine MPI_Comm_get_name_f08(comm,comm_name,resultlen,ierror) use :: mpi_f08_types, only : MPI_Comm, MPI_MAX_OBJECT_NAME @@ -1817,6 +1827,16 @@ subroutine MPI_Comm_set_attr_f08(comm,comm_keyval,attribute_val,ierror) end subroutine MPI_Comm_set_attr_f08 end interface MPI_Comm_set_attr +interface MPI_Comm_set_info +subroutine MPI_Comm_set_info_f08(comm,info,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Comm_set_info_f08 +end interface MPI_Comm_set_info + interface MPI_Comm_set_name subroutine MPI_Comm_set_name_f08(comm,comm_name,ierror) use :: mpi_f08_types, only : MPI_Comm diff --git a/ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 b/ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 index c67cab12cc..0beb3c6383 100644 --- a/ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 +++ b/ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 @@ -1755,6 +1755,16 @@ subroutine PMPI_Comm_get_attr_f08(comm,comm_keyval,attribute_val,flag,ierror) end subroutine PMPI_Comm_get_attr_f08 end interface PMPI_Comm_get_attr +interface PMPI_Comm_get_info +subroutine PMPI_Comm_get_info_f08(comm,info_used,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Comm), INTENT(OUT) :: info_used + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Comm_get_info_f08 +end interface PMPI_Comm_get_info + interface PMPI_Comm_get_name subroutine PMPI_Comm_get_name_f08(comm,comm_name,resultlen,ierror) use :: mpi_f08_types, only : MPI_Comm, MPI_MAX_OBJECT_NAME @@ -1817,6 +1827,16 @@ subroutine PMPI_Comm_set_attr_f08(comm,comm_keyval,attribute_val,ierror) end subroutine PMPI_Comm_set_attr_f08 end interface PMPI_Comm_set_attr +interface PMPI_Comm_set_info +subroutine PMPI_Comm_set_info_f08(comm,info,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Comm_set_info_f08 +end interface PMPI_Comm_set_info + interface PMPI_Comm_set_name subroutine PMPI_Comm_set_name_f08(comm,comm_name,ierror) use :: mpi_f08_types, only : MPI_Comm diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am index 6fb9189994..4cebe25fa2 100644 --- a/ompi/mpi/fortran/mpif-h/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/Makefile.am @@ -9,7 +9,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2012 Inria. All rights reserved. # Copyright (c) 2011-2012 Universite Bordeaux 1 # Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights @@ -125,6 +125,7 @@ libmpi_mpifh_la_SOURCES += \ comm_free_keyval_f.c \ comm_get_attr_f.c \ comm_get_errhandler_f.c \ + comm_get_info_f.c \ comm_get_name_f.c \ comm_get_parent_f.c \ comm_group_f.c \ @@ -134,6 +135,7 @@ libmpi_mpifh_la_SOURCES += \ comm_remote_size_f.c \ comm_set_attr_f.c \ comm_set_errhandler_f.c \ + comm_set_info_f.c \ comm_set_name_f.c \ comm_size_f.c \ comm_spawn_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/comm_get_info_f.c b/ompi/mpi/fortran/mpif-h/comm_get_info_f.c new file mode 100644 index 0000000000..1cfd8bde3a --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/comm_get_info_f.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/attribute/attribute.h" +#include "ompi/communicator/communicator.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER +#pragma weak PMPI_COMM_GET_INFO = ompi_comm_get_info_f +#pragma weak pmpi_comm_get_info = ompi_comm_get_info_f +#pragma weak pmpi_comm_get_info_ = ompi_comm_get_info_f +#pragma weak pmpi_comm_get_info__ = ompi_comm_get_info_f + +#pragma weak PMPI_Comm_get_info_f = ompi_comm_get_info_f +#pragma weak PMPI_Comm_get_info_f08 = ompi_comm_get_info_f +#elif OMPI_PROFILE_LAYER +OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_GET_INFO, + pmpi_comm_get_info, + pmpi_comm_get_info_, + pmpi_comm_get_info__, + pompi_comm_get_info_f, + (MPI_Fint *comm, MPI_Fint *info_used, MPI_Fint *ierr), + (comm, info_used, ierr) ) +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_COMM_GET_INFO = ompi_comm_get_info_f +#pragma weak mpi_comm_get_info = ompi_comm_get_info_f +#pragma weak mpi_comm_get_info_ = ompi_comm_get_info_f +#pragma weak mpi_comm_get_info__ = ompi_comm_get_info_f + +#pragma weak MPI_Comm_get_info_f = ompi_comm_get_info_f +#pragma weak MPI_Comm_get_info_f08 = ompi_comm_get_info_f +#endif + +#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER +OMPI_GENERATE_F77_BINDINGS (MPI_COMM_GET_INFO, + mpi_comm_get_info, + mpi_comm_get_info_, + mpi_comm_get_info__, + ompi_comm_get_info_f, + (MPI_Fint *comm, MPI_Fint *info_used, MPI_Fint *ierr), + (comm, info_used, ierr) ) +#endif + + +#if OMPI_PROFILE_LAYER && ! OPAL_HAVE_WEAK_SYMBOLS +#include "ompi/mpi/fortran/mpif-h/profile/defines.h" +#endif + +void ompi_comm_get_info_f(MPI_Fint *comm, MPI_Fint *info_used, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Comm c_comm = MPI_Comm_f2c(*comm); + MPI_Info c_info; + + c_ierr = MPI_Comm_get_info(c_comm, &c_info); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *info_used = MPI_Info_c2f(c_info); + } +} diff --git a/ompi/mpi/fortran/mpif-h/comm_set_info_f.c b/ompi/mpi/fortran/mpif-h/comm_set_info_f.c new file mode 100644 index 0000000000..550f17c564 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/comm_set_info_f.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/attribute/attribute.h" +#include "ompi/communicator/communicator.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER +#pragma weak PMPI_COMM_SET_INFO = ompi_comm_set_info_f +#pragma weak pmpi_comm_set_info = ompi_comm_set_info_f +#pragma weak pmpi_comm_set_info_ = ompi_comm_set_info_f +#pragma weak pmpi_comm_set_info__ = ompi_comm_set_info_f + +#pragma weak PMPI_Comm_set_info_f = ompi_comm_set_info_f +#pragma weak PMPI_Comm_set_info_f08 = ompi_comm_set_info_f +#elif OMPI_PROFILE_LAYER +OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_SET_INFO, + pmpi_comm_set_info, + pmpi_comm_set_info_, + pmpi_comm_set_info__, + pompi_comm_set_info_f, + (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr), + (comm, info, ierr) ) +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_COMM_SET_INFO = ompi_comm_set_info_f +#pragma weak mpi_comm_set_info = ompi_comm_set_info_f +#pragma weak mpi_comm_set_info_ = ompi_comm_set_info_f +#pragma weak mpi_comm_set_info__ = ompi_comm_set_info_f + +#pragma weak MPI_Comm_set_info_f = ompi_comm_set_info_f +#pragma weak MPI_Comm_set_info_f08 = ompi_comm_set_info_f +#endif + +#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER +OMPI_GENERATE_F77_BINDINGS (MPI_COMM_SET_INFO, + mpi_comm_set_info, + mpi_comm_set_info_, + mpi_comm_set_info__, + ompi_comm_set_info_f, + (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr), + (comm, info, ierr) ) +#endif + + +#if OMPI_PROFILE_LAYER && ! OPAL_HAVE_WEAK_SYMBOLS +#include "ompi/mpi/fortran/mpif-h/profile/defines.h" +#endif + +void ompi_comm_set_info_f(MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Comm c_comm = MPI_Comm_f2c(*comm); + MPI_Info c_info = MPI_Info_f2c(*info); + + c_ierr = MPI_Comm_set_info(c_comm, c_info); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/mpif-h/profile/Makefile.am b/ompi/mpi/fortran/mpif-h/profile/Makefile.am index 9c8d6b9c48..49a032f1ba 100644 --- a/ompi/mpi/fortran/mpif-h/profile/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/profile/Makefile.am @@ -10,7 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2012 Inria. All rights reserved. # Copyright (c) 2011-2012 Universite Bordeaux 1 # Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights @@ -95,6 +95,7 @@ nodist_libmpi_mpifh_pmpi_la_SOURCES = \ pcomm_free_keyval_f.c \ pcomm_get_attr_f.c \ pcomm_get_errhandler_f.c \ + pcomm_get_info_f.c \ pcomm_get_name_f.c \ pcomm_get_parent_f.c \ pcomm_group_f.c \ @@ -104,6 +105,7 @@ nodist_libmpi_mpifh_pmpi_la_SOURCES = \ pcomm_remote_size_f.c \ pcomm_set_attr_f.c \ pcomm_set_errhandler_f.c \ + pcomm_set_info_f.c \ pcomm_set_name_f.c \ pcomm_size_f.c \ pcomm_spawn_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/profile/defines.h b/ompi/mpi/fortran/mpif-h/profile/defines.h index f91e2decf7..5e59d53e39 100644 --- a/ompi/mpi/fortran/mpif-h/profile/defines.h +++ b/ompi/mpi/fortran/mpif-h/profile/defines.h @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Inria. All rights reserved. * Copyright (c) 2011 Universite Bordeaux 1 * Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights @@ -71,6 +71,7 @@ #define ompi_comm_free_keyval_f pompi_comm_free_keyval_f #define ompi_comm_free_f pompi_comm_free_f #define ompi_comm_get_attr_f pompi_comm_get_attr_f +#define ompi_comm_get_info_f pompi_comm_get_info_f #define ompi_comm_get_errhandler_f pompi_comm_get_errhandler_f #define ompi_comm_get_name_f pompi_comm_get_name_f #define ompi_comm_get_parent_f pompi_comm_get_parent_f @@ -80,6 +81,7 @@ #define ompi_comm_remote_group_f pompi_comm_remote_group_f #define ompi_comm_remote_size_f pompi_comm_remote_size_f #define ompi_comm_set_attr_f pompi_comm_set_attr_f +#define ompi_comm_set_info_f pompi_comm_set_info_f #define ompi_comm_set_errhandler_f pompi_comm_set_errhandler_f #define ompi_comm_set_name_f pompi_comm_set_name_f #define ompi_comm_size_f pompi_comm_size_f diff --git a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h index 204df55b9f..2ab6786f07 100644 --- a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h +++ b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Inria. All rights reserved. * Copyright (c) 2011-2012 Universite Bordeaux 1 * Copyright (c) 2013 Los Alamos National Security, LLC. All rights @@ -129,6 +129,7 @@ PN2(void, MPI_Comm_idup, mpi_comm_idup, MPI_COMM_IDUP, (MPI_Fint *comm, MPI_Fint PN2(void, MPI_Comm_free_keyval, mpi_comm_free_keyval, MPI_COMM_FREE_KEYVAL, (MPI_Fint *comm_keyval, MPI_Fint *ierr)); PN2(void, MPI_Comm_free, mpi_comm_free, MPI_COMM_FREE, (MPI_Fint *comm, MPI_Fint *ierr)); PN2(void, MPI_Comm_get_attr, mpi_comm_get_attr, MPI_COMM_GET_ATTR, (MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Aint *attribute_val, ompi_fortran_logical_t *flag, MPI_Fint *ierr)); +PN2(void, MPI_Comm_get_info, mpi_comm_get_info, MPI_COMM_GET_INFO, (MPI_Fint *comm, MPI_Fint *info_user, MPI_Fint *ierr)); PN2(void, MPI_Comm_get_errhandler, mpi_comm_get_errhandler, MPI_COMM_GET_ERRHANDLER, (MPI_Fint *comm, MPI_Fint *erhandler, MPI_Fint *ierr)); PN2(void, MPI_Comm_get_name, mpi_comm_get_name, MPI_COMM_GET_NAME, (MPI_Fint *comm, char *comm_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len)); PN2(void, MPI_Comm_get_parent, mpi_comm_get_parent, MPI_COMM_GET_PARENT, (MPI_Fint *parent, MPI_Fint *ierr)); @@ -138,6 +139,7 @@ PN2(void, MPI_Comm_rank, mpi_comm_rank, MPI_COMM_RANK, (MPI_Fint *comm, MPI_Fint PN2(void, MPI_Comm_remote_group, mpi_comm_remote_group, MPI_COMM_REMOTE_GROUP, (MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr)); PN2(void, MPI_Comm_remote_size, mpi_comm_remote_size, MPI_COMM_REMOTE_SIZE, (MPI_Fint *comm, MPI_Fint *size, MPI_Fint *ierr)); PN2(void, MPI_Comm_set_attr, mpi_comm_set_attr, MPI_COMM_SET_ATTR, (MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Aint *attribute_val, MPI_Fint *ierr)); +PN2(void, MPI_Comm_set_info, mpi_comm_set_info, MPI_COMM_SET_INFO, (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr)); PN2(void, MPI_Comm_set_errhandler, mpi_comm_set_errhandler, MPI_COMM_SET_ERRHANDLER, (MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr)); PN2(void, MPI_Comm_set_name, mpi_comm_set_name, MPI_COMM_SET_NAME, (MPI_Fint *comm, char *comm_name, MPI_Fint *ierr, int name_len)); PN2(void, MPI_Comm_size, mpi_comm_size, MPI_COMM_SIZE, (MPI_Fint *comm, MPI_Fint *size, MPI_Fint *ierr)); diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 6f29e39d3f..8e7ec6f7aa 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -73,6 +73,7 @@ mpi_api_files = \ comm_free_keyval_f08.F90 \ comm_get_attr_f08.F90 \ comm_get_errhandler_f08.F90 \ + comm_get_info_f08.F90 \ comm_get_name_f08.F90 \ comm_get_parent_f08.F90 \ comm_group_f08.F90 \ @@ -82,6 +83,7 @@ mpi_api_files = \ comm_remote_size_f08.F90 \ comm_set_attr_f08.F90 \ comm_set_errhandler_f08.F90 \ + comm_set_info_f08.F90 \ comm_set_name_f08.F90 \ comm_size_f08.F90 \ comm_spawn_f08.F90 \ @@ -411,6 +413,7 @@ pmpi_api_files = \ profile/pcomm_free_keyval_f08.F90 \ profile/pcomm_get_attr_f08.F90 \ profile/pcomm_get_errhandler_f08.F90 \ + profile/pcomm_get_info_f08.F90 \ profile/pcomm_get_name_f08.F90 \ profile/pcomm_get_parent_f08.F90 \ profile/pcomm_group_f08.F90 \ @@ -420,6 +423,7 @@ pmpi_api_files = \ profile/pcomm_remote_size_f08.F90 \ profile/pcomm_set_attr_f08.F90 \ profile/pcomm_set_errhandler_f08.F90 \ + profile/pcomm_set_info_f08.F90 \ profile/pcomm_set_name_f08.F90 \ profile/pcomm_size_f08.F90 \ profile/pcomm_spawn_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/comm_get_info_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/comm_get_info_f08.F90 new file mode 100644 index 0000000000..734b2493a9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/comm_get_info_f08.F90 @@ -0,0 +1,20 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! $COPYRIGHT$ + +subroutine MPI_Comm_get_info_f08(comm,info_used,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + use :: mpi_f08, only : ompi_comm_get_info_f + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(OUT) :: info_used + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_comm_get_info_f(comm%MPI_VAL,info_used%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Comm_get_info_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/comm_set_info_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/comm_set_info_f08.F90 new file mode 100644 index 0000000000..e70f544aa0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/comm_set_info_f08.F90 @@ -0,0 +1,20 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! $COPYRIGHT$ + +subroutine MPI_Comm_set_info_f08(comm,info,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + use :: mpi_f08, only : ompi_comm_set_info_f + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_comm_set_info_f(comm%MPI_VAL,info%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Comm_set_info_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h index 15bc1010c4..3c3372b2ad 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h @@ -1292,6 +1292,14 @@ subroutine ompi_comm_free_keyval_f(comm_keyval,ierror) & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_comm_free_keyval_f +subroutine ompi_comm_get_info_f(comm,info_used,ierror) & + BIND(C, name="ompi_comm_get_info_f") + implicit none + INTEGER, INTENT(IN) :: comm + INTEGER, INTENT(OUT) :: info_used + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_comm_get_info_f + subroutine ompi_comm_get_name_f(comm,comm_name,resultlen,ierror,comm_name_len) & BIND(C, name="ompi_comm_get_name_f") use, intrinsic :: ISO_C_BINDING, only : C_CHAR @@ -1354,6 +1362,14 @@ subroutine ompi_comm_set_attr_f(comm,comm_keyval,attribute_val,ierror) & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_comm_set_attr_f +subroutine ompi_comm_set_info_f(comm,info,ierror) & + BIND(C, name="ompi_comm_get_info_f") + implicit none + INTEGER, INTENT(IN) :: comm + INTEGER, INTENT(IN) :: info + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_comm_set_info_f + subroutine ompi_comm_set_name_f(comm,comm_name,ierror,comm_name_len) & BIND(C, name="ompi_comm_set_name_f") use, intrinsic :: ISO_C_BINDING, only : C_CHAR diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_get_info_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_get_info_f08.F90 new file mode 100644 index 0000000000..11e58ed802 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_get_info_f08.F90 @@ -0,0 +1,20 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! $COPYRIGHT$ + +subroutine PMPI_Comm_get_info_f08(comm,info_used,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + use :: mpi_f08, only : ompi_comm_get_info_f + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(OUT) :: info_used + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_comm_get_info_f(comm%MPI_VAL,info_used%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_Comm_get_info_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_set_info_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_set_info_f08.F90 new file mode 100644 index 0000000000..9ddc643ad4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_set_info_f08.F90 @@ -0,0 +1,20 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! $COPYRIGHT$ + +subroutine PMPI_Comm_set_info_f08(comm,info,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info + use :: mpi_f08, only : ompi_comm_set_info_f + implicit none + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_comm_set_info_f(comm%MPI_VAL,info%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_Comm_set_info_f08 diff --git a/ompi/mpi/fortran/use-mpi-tkr/scripts/mpi-f90-interfaces.h.sh b/ompi/mpi/fortran/use-mpi-tkr/scripts/mpi-f90-interfaces.h.sh index a7ea04308d..b2197409ae 100755 --- a/ompi/mpi/fortran/use-mpi-tkr/scripts/mpi-f90-interfaces.h.sh +++ b/ompi/mpi/fortran/use-mpi-tkr/scripts/mpi-f90-interfaces.h.sh @@ -2228,6 +2228,30 @@ end MPI_Comm_free_keyval #------------------------------------------------------------------------ +output_41a() { + if test "$output" = "0"; then + return 0 + fi + + procedure=$1 + cat < +int MPI_Comm_get_info(MPI_Comm \fIcomm\fP, MPI_Info \fI*info_used\fP) +. +.fi +.SH Fortran Syntax +.nf +INCLUDE 'mpif.h' +MPI_COMM_GET_INFO(\fICOMM, INFO_USED, IERROR\fP) + INTEGER \fICOMM, INFO_USED, IERROR \fP +. +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +comm +Communicator from which to receive active info hints +. +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +info_used +New info object returned with all active hints on this communicator. +.TP 1i +IERROR +Fortran only: Error status (integer). +. +.SH DESCRIPTION +.ft R +MPI_Comm_get_info returns a new info object containing the hints of +the communicator associated with +.IR comm . +The current setting of all hints actually used by the system related +to this communicator is returned in +.IR info_used . +If no such hints exist, a handle to a newly created info object is +returned that contains no key/value pair. The user is responsible for +freeing info_used via MPI_Info_free. +. +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value +of the function and Fortran routines in the last argument. +.sp +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 +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. +. +.SH SEE ALSO +MPI_Comm_get_info, +MPI_Info_free diff --git a/ompi/mpi/man/man3/MPI_Comm_set_info.3in b/ompi/mpi/man/man3/MPI_Comm_set_info.3in new file mode 100644 index 0000000000..6d12f79aeb --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Comm_set_info.3in @@ -0,0 +1,66 @@ +.\" Copyright 2010 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines +.TH MPI_Comm_set_info 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Comm_set_info\fP \- Set communicator info hints +. +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Comm_set_info(MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP) +. +.fi +.SH Fortran Syntax +.nf +INCLUDE 'mpif.h' +MPI_COMM_SET_INFO(\fICOMM, INFO, IERROR\fP) + INTEGER \fICOMM, INFO, IERROR \fP +. +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +comm +Communicator on which to set info hints +.TP 1i +info +Info object containing hints to be set on +.I comm +. +.SH OUTPUT PARAMETERS +.TP 1i +IERROR +Fortran only: Error status (integer). +. +.SH DESCRIPTION +.ft R +MPI_COMM_SET_INFO sets new values for the hints of the communicator +associated with +.IR comm . +MPI_COMM_SET_INFO is a collective routine. The info object may be +different on each process, but any info entries that an implementation +requires to be the same on all processes must appear with the same +value in each process's +.I info +object. +. +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value +of the function and Fortran routines in the last argument. +.sp +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 +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. +. +.SH SEE ALSO +MPI_Comm_get_info, +MPI_Info_create, +MPI_Info_set, +MPI_Info_free diff --git a/ompi/mpi/man/man3/Makefile.extra b/ompi/mpi/man/man3/Makefile.extra index edf56a7142..e2c78e4b28 100644 --- a/ompi/mpi/man/man3/Makefile.extra +++ b/ompi/mpi/man/man3/Makefile.extra @@ -1,5 +1,5 @@ # -*- makefile -*- -# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. # Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights reserved. # $COPYRIGHT$ @@ -71,6 +71,7 @@ mpi_api_man_pages = \ mpi/man/man3/MPI_Comm_free_keyval.3 \ mpi/man/man3/MPI_Comm_get_attr.3 \ mpi/man/man3/MPI_Comm_get_errhandler.3 \ + mpi/man/man3/MPI_Comm_get_info.3 \ mpi/man/man3/MPI_Comm_get_name.3 \ mpi/man/man3/MPI_Comm_get_parent.3 \ mpi/man/man3/MPI_Comm_group.3 \ @@ -80,6 +81,7 @@ mpi_api_man_pages = \ mpi/man/man3/MPI_Comm_remote_size.3 \ mpi/man/man3/MPI_Comm_set_attr.3 \ mpi/man/man3/MPI_Comm_set_errhandler.3 \ + mpi/man/man3/MPI_Comm_set_info.3 \ mpi/man/man3/MPI_Comm_set_name.3 \ mpi/man/man3/MPI_Comm_size.3 \ mpi/man/man3/MPI_Comm_spawn.3 \