From ad3b5901725a7a0180def6f91bb47d17fd19211f Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 2 Aug 2016 13:10:44 +0900 Subject: [PATCH 1/4] fortran: Add missing `MPI_NO_OP` and `MPI_WIN_*` named constants. --- ompi/include/mpif-values.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ompi/include/mpif-values.pl b/ompi/include/mpif-values.pl index 94da49ac4fc..fdea9123217 100755 --- a/ompi/include/mpif-values.pl +++ b/ompi/include/mpif-values.pl @@ -3,6 +3,7 @@ # Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2016 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2016 FUJITSU LIMITED. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -105,6 +106,7 @@ sub write_file { $handles->{MPI_MAXLOC} = 11; $handles->{MPI_MINLOC} = 12; $handles->{MPI_REPLACE} = 13; +$handles->{MPI_NO_OP} = 14; $handles->{MPI_COMM_NULL} = 2; $handles->{MPI_DATATYPE_NULL} = 0; @@ -235,6 +237,8 @@ sub write_file { $constants->{MPI_WIN_FLAVOR_ALLOCATE} = 2; $constants->{MPI_WIN_FLAVOR_DYNAMIC} = 3; $constants->{MPI_WIN_FLAVOR_SHARED} = 4; +$constants->{MPI_WIN_UNIFIED} = 0; +$constants->{MPI_WIN_SEPARATE} = 1; $constants->{MPI_BSEND_OVERHEAD} = 128; $constants->{MPI_ORDER_C} = 0; From 0cb5dfe18dc22a70c3faee2b46759b51af969062 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 2 Aug 2016 13:12:22 +0900 Subject: [PATCH 2/4] fortran: Correct predefined datatype named constants. --- ompi/include/mpif-values.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ompi/include/mpif-values.pl b/ompi/include/mpif-values.pl index fdea9123217..bd6940b9d09 100755 --- a/ompi/include/mpif-values.pl +++ b/ompi/include/mpif-values.pl @@ -168,14 +168,14 @@ sub write_file { $handles->{MPI_LONG_DOUBLE} = 47; $handles->{MPI_FLOAT_INT} = 48; $handles->{MPI_DOUBLE_INT} = 49; -$handles->{MPI_LONGDBL_INT} = 50; +$handles->{MPI_LONG_DOUBLE_INT} = 50; $handles->{MPI_LONG_INT} = 51; $handles->{MPI_2INT} = 52; $handles->{MPI_SHORT_INT} = 53; $handles->{MPI_CXX_BOOL} = 54; -$handles->{MPI_CXX_CPLEX} = 55; -$handles->{MPI_CXX_DBLCPLEX} = 56; -$handles->{MPI_CXX_LDBLCPLEX} = 57; +$handles->{MPI_CXX_COMPLEX} = 55; +$handles->{MPI_CXX_DOUBLE_COMPLEX} = 56; +$handles->{MPI_CXX_LONG_DOUBLE_COMPLEX} = 57; $handles->{MPI_INT8_T} = 58; $handles->{MPI_UINT8_T} = 59; $handles->{MPI_INT16_T} = 60; From 5383003eab165af4716ee0b62367264178df2e6a Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 2 Aug 2016 22:36:41 +0900 Subject: [PATCH 3/4] fortran: Add missing predefined datatype named constants. This commit add the following Fortran named constants which are defined in the MPI standard but are missing in Open MPI. - `MPI_LONG_LONG` (defined as a synonym of `MPI_LONG_LONG_INT`) - `MPI_CXX_FLOAT_COMPLEX` - `MPI_C_BOOL` And this commit also changes the value of the following Fortran named constant for consistency. - `MPI_C_COMPLEX` `(MPI_C_FLOAT_COMPLEX` is defined as a synonym of this) Each needs a different solution described below. For `MPI_LONG_LONG`: The value of `MPI_LONG_LONG` is defined to have a same value as `MPI_LONG_LONG_INT` because of the following reasons. 1. It is defined as a synonym of `MPI_LONG_LONG_INT` in the MPI standard. 2. `MPI_LONG_LONG_INT` and `MPI_LONG_LONG` has a same value for C in `mpi.h`. 3. `ompi_mpi_long_long` is not defined in `ompi/datatype/ompi_datatype_module.c`. For `MPI_CXX_FLOAT_COMPLEX`: Existing `MPI_CXX_COMPLEX` is replaced with `MPI_CXX_FLOAT_COMPLEX` bacause `MPI_CXX_FLOAT_COMPLEX` is the right name defined in MPI-3.1 and `MPI_CXX_COMPLEX` is not defined in MPI-3.1 (nor older). But for compatibility, `MPI_CXX_COMPLEX` is treated as a synonym of `MPI_CXX_FLOAT_COMPLEX` on Open MPI. For `MPI_C_BOOL`: `MPI_C_BOOL` is newly added. The value which `MPI_C_COMPLEX` had used (68) is assinged for it because the value becomes no longer in use (described later) and it is a suited position as a datatype added on MPI-2.2. For `MPI_C_COMPLEX`: Existing `MPI_C_FLOAT_COMPLEX` is replaced with `MPI_C_COMPLEX` and `MPI_C_FLOAT_COMPLEX` is changed to have the same value. In other words, make `MPI_C_COMPLEX` the canonical name and make `MPI_C_FLOAT_COMPLEX` an alias of it. This is bacause the relation of these datatypes is same as the relation of `MPI_LONG_LONG_INT` and `MPI_LONG_LONG`, and `MPI_LONG_LONG_INT` and `MPI_LONG_LONG` are implemented like that. But in the datatype engine, we use `ompi_mpi_c_float_complex` instead of `ompi_mpi_c_complex` as a variable name to keep the consistency with the other similar types such as `ompi_mpi_c_double_complex` (see George's comment in open-mpi/ompi#1927). We don't delete `ompi_mpi_c_complex` now because it is used in some other places in Open MPI code. It may be cleand up in the future. In addition, `MPI_CXX_COMPLEX`, which was defined only in the Open MPI Fortran binding, is added to `mpi.h` for the C binding. This commit breaks binary compatibility of Fortran `MPI_C_COMPLEX`. When this commit is merged into v2.x branch, the change of `MPI_C_COMPLEX` should be excluded. --- ompi/datatype/ompi_datatype_module.c | 6 +++--- ompi/include/mpi.h.in | 4 ++-- ompi/include/mpif-values.pl | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index f9e16305328..9c00d06d1b1 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -109,7 +109,7 @@ ompi_predefined_datatype_t ompi_mpi_cxx_bool = OMPI_DATATYPE_INIT_PREDEFIN /* * Complex datatypes for C (base types), C++, and fortran */ -ompi_predefined_datatype_t ompi_mpi_c_float_complex = OMPI_DATATYPE_INIT_PREDEFINED (C_FLOAT_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); +ompi_predefined_datatype_t ompi_mpi_c_float_complex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_FLOAT_COMPLEX, C_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); ompi_predefined_datatype_t ompi_mpi_c_complex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_FLOAT_COMPLEX, C_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); ompi_predefined_datatype_t ompi_mpi_c_double_complex = OMPI_DATATYPE_INIT_PREDEFINED (C_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); #if HAVE_LONG_DOUBLE @@ -533,7 +533,7 @@ int32_t ompi_datatype_init( void ) } /* - * This MUST match the order of ompi/include/mpif-common.h + * This MUST match the order of ompi/include/mpif-values.pl * Any change will break binary compatibility of Fortran programs. */ MOOG(datatype_null, 0); @@ -614,7 +614,7 @@ int32_t ompi_datatype_init( void ) MOOG(uint64_t, 65); MOOG(aint, 66); MOOG(offset, 67); - MOOG(c_complex, 68); + MOOG(c_bool, 68); MOOG(c_float_complex, 69); MOOG(c_double_complex, 70); MOOG(c_long_double_complex, 71); diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 1cc1569a4c6..a9f266942b4 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1006,7 +1006,6 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_aint; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_offset; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_count; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_c_bool; -OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_c_complex; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_c_float_complex; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_c_double_complex; OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_c_long_double_complex; @@ -1153,7 +1152,7 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; #define MPI_OFFSET OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_offset) #define MPI_C_BOOL OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_bool) #if HAVE_FLOAT__COMPLEX -#define MPI_C_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_complex) +#define MPI_C_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_float_complex) #define MPI_C_FLOAT_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_float_complex) #endif #if HAVE_DOUBLE__COMPLEX @@ -1163,6 +1162,7 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; #define MPI_C_LONG_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_long_double_complex) #endif #define MPI_CXX_BOOL OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_bool) +#define MPI_CXX_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_cplex) #define MPI_CXX_FLOAT_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_cplex) #define MPI_CXX_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_dblcplex) #define MPI_CXX_LONG_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_ldblcplex) diff --git a/ompi/include/mpif-values.pl b/ompi/include/mpif-values.pl index bd6940b9d09..b4a9841b34b 100755 --- a/ompi/include/mpif-values.pl +++ b/ompi/include/mpif-values.pl @@ -162,6 +162,7 @@ sub write_file { $handles->{MPI_LONG} = 41; $handles->{MPI_UNSIGNED_LONG} = 42; $handles->{MPI_LONG_LONG_INT} = 43; +$handles->{MPI_LONG_LONG} = $handles->{MPI_LONG_LONG_INT}; $handles->{MPI_UNSIGNED_LONG_LONG} = 44; $handles->{MPI_FLOAT} = 45; $handles->{MPI_DOUBLE} = 46; @@ -173,7 +174,8 @@ sub write_file { $handles->{MPI_2INT} = 52; $handles->{MPI_SHORT_INT} = 53; $handles->{MPI_CXX_BOOL} = 54; -$handles->{MPI_CXX_COMPLEX} = 55; +$handles->{MPI_CXX_FLOAT_COMPLEX} = 55; +$handles->{MPI_CXX_COMPLEX} = $handles->{MPI_CXX_FLOAT_COMPLEX}; $handles->{MPI_CXX_DOUBLE_COMPLEX} = 56; $handles->{MPI_CXX_LONG_DOUBLE_COMPLEX} = 57; $handles->{MPI_INT8_T} = 58; @@ -186,8 +188,9 @@ sub write_file { $handles->{MPI_UINT64_T} = 65; $handles->{MPI_AINT} = 66; $handles->{MPI_OFFSET} = 67; -$handles->{MPI_C_COMPLEX} = 68; -$handles->{MPI_C_FLOAT_COMPLEX} = 69; +$handles->{MPI_C_BOOL} = 68; +$handles->{MPI_C_COMPLEX} = 69; +$handles->{MPI_C_FLOAT_COMPLEX} = $handles->{MPI_C_COMPLEX}; $handles->{MPI_C_DOUBLE_COMPLEX} = 70; $handles->{MPI_C_LONG_DOUBLE_COMPLEX} = 71; $handles->{MPI_COUNT} = 72; From 722e898e8e75aacf5a06d8a7a425ac008f017234 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 2 Aug 2016 22:37:58 +0900 Subject: [PATCH 4/4] fortran: Correct the name of `MPI_INTEGER16`. The name of `MPI_INTEGER16` obtained using `MPI_TYPE_GET_NAME` from Fortran program was incorrect (`MPI_INTEGER8` was obtained) when `INTEGER*16` is not supported by a compiler. This bug affects only the Fortran binding because `MPI_INTEGER16` is not defined in `mpi.h` if a compiler does not support it. --- ompi/datatype/ompi_datatype_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index 9c00d06d1b1..fb5a09e9072 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -255,7 +255,7 @@ ompi_predefined_datatype_t ompi_mpi_integer8 = OMPI_DATATYPE_INIT_UNAVAILA #if OMPI_HAVE_FORTRAN_INTEGER16 ompi_predefined_datatype_t ompi_mpi_integer16 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (INT, INTEGER16, OMPI_SIZEOF_FORTRAN_INTEGER16, OMPI_ALIGNMENT_FORTRAN_INTEGER16, OMPI_DATATYPE_FLAG_DATA_INT); #else -ompi_predefined_datatype_t ompi_mpi_integer16 = OMPI_DATATYPE_INIT_UNAVAILABLE (INTEGER8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_INT); +ompi_predefined_datatype_t ompi_mpi_integer16 = OMPI_DATATYPE_INIT_UNAVAILABLE (INTEGER16, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_INT); #endif /*