From 5594c90fceba706c856e135f931bcccd5fbc558a Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 14 Aug 2012 23:05:41 +0000 Subject: [PATCH] * Minor touch-ups to ompi/info/info.c to distinguish between keys and vals. * Note that the pre-defined Info objects don't need to have fortran indexes assigned; they should already be assigned in the constructor. So add an assert() to ensure that this really happens properly. * Add MPI_ENV_INFO to the Fortran interfaces This commit was SVN r27039. --- ompi/include/mpif-values.pl | 2 ++ ompi/info/info.c | 15 ++++++++------- ompi/mpi/fortran/base/mpi-f08-types.F90 | 2 ++ ompi/mpi/fortran/use-mpi-f08/constants.c | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ompi/include/mpif-values.pl b/ompi/include/mpif-values.pl index 0275c17421..733ac01666 100755 --- a/ompi/include/mpif-values.pl +++ b/ompi/include/mpif-values.pl @@ -185,6 +185,8 @@ $handles->{MPI_OFFSET} = 67; $handles->{MPI_MESSAGE_NO_PROC} = 1; +$handles->{MPI_INFO_ENV} = 1; + #---------------------------------------------------------------------------- my $io_handles; diff --git a/ompi/info/info.c b/ompi/info/info.c index 6f76d0ef4d..4aed46f547 100644 --- a/ompi/info/info.c +++ b/ompi/info/info.c @@ -39,6 +39,7 @@ #ifdef HAVE_SYS_UTSNAME_H #include #endif +#include #include "opal/util/argv.h" #include "opal/util/opal_getcwd.h" @@ -95,7 +96,7 @@ opal_pointer_array_t ompi_info_f_to_c_table; */ int ompi_info_init(void) { - char tmp[MPI_MAX_INFO_KEY]; + char val[MPI_MAX_INFO_VAL]; char *cptr; /* initialize table */ @@ -108,11 +109,11 @@ int ompi_info_init(void) /* Create MPI_INFO_NULL */ OBJ_CONSTRUCT(&ompi_mpi_info_null.info, ompi_info_t); - ompi_mpi_info_null.info.i_f_to_c_index = 0; + assert(ompi_mpi_info_null.info.i_f_to_c_index == 0); /* Create MPI_INFO_ENV */ OBJ_CONSTRUCT(&ompi_mpi_info_env.info, ompi_info_t); - ompi_mpi_info_env.info.i_f_to_c_index = 1; + assert(ompi_mpi_info_env.info.i_f_to_c_index == 1); /* fill the env info object */ @@ -137,8 +138,8 @@ int ompi_info_init(void) #endif /* local host name */ - gethostname(tmp, MPI_MAX_INFO_KEY); - ompi_info_set(&ompi_mpi_info_env.info, "host", tmp); + gethostname(val, MPI_MAX_INFO_VAL); + ompi_info_set(&ompi_mpi_info_env.info, "host", val); /* architecture name */ if (NULL != (cptr = getenv("OMPI_MCA_orte_cpu_type"))) { @@ -154,8 +155,8 @@ int ompi_info_init(void) #endif /* working directory of this process */ - opal_getcwd(tmp, MPI_MAX_INFO_KEY); - ompi_info_set(&ompi_mpi_info_env.info, "wdir", tmp); + opal_getcwd(val, MPI_MAX_INFO_VAL); + ompi_info_set(&ompi_mpi_info_env.info, "wdir", val); /* the number of app_contexts in this job */ if (NULL != (cptr = getenv("OMPI_NUM_APP_CTX"))) { diff --git a/ompi/mpi/fortran/base/mpi-f08-types.F90 b/ompi/mpi/fortran/base/mpi-f08-types.F90 index b3807c2330..3cc60fd85f 100644 --- a/ompi/mpi/fortran/base/mpi-f08-types.F90 +++ b/ompi/mpi/fortran/base/mpi-f08-types.F90 @@ -104,6 +104,8 @@ module mpi_f08_types type(MPI_Message), protected, bind(C, name="ompi_f08_mpi_message_no_proc") :: MPI_MESSAGE_NO_PROC + type(MPI_Info), protected, bind(C, name="ompi_f08_mpi_info_env") :: MPI_INFO_ENV + type(MPI_Op), protected, bind(C, name="ompi_f08_mpi_max" ) :: MPI_MAX type(MPI_Op), protected, bind(C, name="ompi_f08_mpi_min" ) :: MPI_MIN type(MPI_Op), protected, bind(C, name="ompi_f08_mpi_sum" ) :: MPI_SUM diff --git a/ompi/mpi/fortran/use-mpi-f08/constants.c b/ompi/mpi/fortran/use-mpi-f08/constants.c index 43e8a090ca..797c8ebf7f 100644 --- a/ompi/mpi/fortran/use-mpi-f08/constants.c +++ b/ompi/mpi/fortran/use-mpi-f08/constants.c @@ -26,6 +26,7 @@ OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_group_empty = {OMPI_MPI OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_errors_are_fatal = {OMPI_MPI_ERRORS_ARE_FATAL}; OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_errors_return = {OMPI_MPI_ERRORS_RETURN}; OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_message_no_proc = {OMPI_MPI_MESSAGE_NO_PROC}; +OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_info_env = {OMPI_MPI_INFO_ENV}; OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_max = {OMPI_MPI_MAX}; OMPI_DECLSPEC ompi_fortran_08_handle_t ompi_f08_mpi_min = {OMPI_MPI_MIN};