diff --git a/confdb/aclocal_datatype.m4 b/confdb/aclocal_datatype.m4 index 883f2f12fab..774bd6b1a38 100644 --- a/confdb/aclocal_datatype.m4 +++ b/confdb/aclocal_datatype.m4 @@ -160,8 +160,8 @@ AC_DEFUN([PAC_SET_MPI_DATATYPE_ALIAS], [ dnl dnl PAC_F77_CHECK_FIXED_REAL(size) and PAC_F77_CHECK_FIXED_INTEGER(size) -dnl Map fixed-size Fortran types, e.g. REAL*4, to equivallent C types. -dnl If no equivallent C types exist, set corresponding sizeof value to 0. +dnl Map fixed-size Fortran types, e.g. REAL*4, to equivalent C types. +dnl If no equivalent C types exist, set corresponding sizeof value to 0. dnl AC_DEFUN([PAC_F77_CHECK_FIXED_REAL], [ get_c_float_type $1 @@ -183,3 +183,18 @@ AC_DEFUN([PAC_F77_CHECK_FIXED_INTEGER], [ fi ]) +dnl +dnl PAC_F77_CHECK_FIXED_LOGICAL(size) +dnl Map fixed-size Fortran LOGICAL types, e.g. LOGICAL*1, to equivalent C types. +dnl If no equivalent C types exist, set corresponding sizeof value to 0. +dnl +AC_DEFUN([PAC_F77_CHECK_FIXED_LOGICAL], [ + get_c_int_type $1 + if test "$pac_retval" = "unavailable" ; then + eval pac_cv_f77_sizeof_logical$1=0 + else + eval pac_cv_f77_sizeof_logical$1=$1 + AC_DEFINE_UNQUOTED(MPIR_LOGICAL$1_CTYPE,$pac_retval,[C type to use for MPI_LOGICAL$1]) + fi +]) + diff --git a/configure.ac b/configure.ac index 7d2a7dbf99a..bd0b340fc90 100644 --- a/configure.ac +++ b/configure.ac @@ -2998,6 +2998,26 @@ if test "$enable_f77" = yes ; then # mpir_get_fsize at run time. # For the size-defined types (e.g., integer*2), we assume that if the # compiler allows it, it has the stated size. + AC_CACHE_CHECK([whether logical*1 is supported],pac_cv_fort_logical1,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ logical*1 i])], + pac_cv_fort_logical1=yes, + pac_cv_fort_logical1=no)]) + AC_CACHE_CHECK([whether logical*2 is supported],pac_cv_fort_logical2,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ logical*2 i])], + pac_cv_fort_logical2=yes, + pac_cv_fort_logical2=no)]) + AC_CACHE_CHECK([whether logical*4 is supported],pac_cv_fort_logical4,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ logical*4 i])], + pac_cv_fort_logical4=yes, + pac_cv_fort_logical4=no)]) + AC_CACHE_CHECK([whether logical*8 is supported],pac_cv_fort_logical8,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ logical*8 i])], + pac_cv_fort_logical8=yes, + pac_cv_fort_logical8=no)]) + AC_CACHE_CHECK([whether logical*16 is supported],pac_cv_fort_logical16,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ logical*16 i])], + pac_cv_fort_logical16=yes, + pac_cv_fort_logical16=no)]) AC_CACHE_CHECK([whether integer*1 is supported],pac_cv_fort_integer1,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*1 i])], pac_cv_fort_integer1=yes, @@ -3082,6 +3102,12 @@ if test "$enable_f77" = yes ; then PAC_F77_CHECK_FIXED_INTEGER(8) PAC_F77_CHECK_FIXED_INTEGER(16) + PAC_F77_CHECK_FIXED_LOGICAL(1) + PAC_F77_CHECK_FIXED_LOGICAL(2) + PAC_F77_CHECK_FIXED_LOGICAL(4) + PAC_F77_CHECK_FIXED_LOGICAL(8) + PAC_F77_CHECK_FIXED_LOGICAL(16) + # We also need to check the size of MPI_Aint vs MPI_Fint, and # define AINT_LARGER_THAN_FINT if aint is larger (this # affects code in MPI_Address) @@ -3227,10 +3253,15 @@ else # set following sizes to 0 will disable the corresponding datatype pac_cv_f77_sizeof_character=0 + pac_cv_f77_sizeof_logical=0 pac_cv_f77_sizeof_integer=0 pac_cv_f77_sizeof_real=0 pac_cv_f77_sizeof_double_precision=0 - pac_cv_f77_sizeof_logical=0 + pac_cv_f77_sizeof_logical1=0 + pac_cv_f77_sizeof_logical2=0 + pac_cv_f77_sizeof_logical4=0 + pac_cv_f77_sizeof_logical8=0 + pac_cv_f77_sizeof_logical16=0 pac_cv_f77_sizeof_integer1=0 pac_cv_f77_sizeof_integer2=0 pac_cv_f77_sizeof_integer4=0 @@ -3568,6 +3599,11 @@ PAC_SET_MPI_TYPE(43, MPI_AINT_DATATYPE, $MPI_SIZEOF_AINT) PAC_SET_MPI_TYPE(44, MPI_OFFSET_DATATYPE, $MPI_SIZEOF_OFFSET) PAC_SET_MPI_TYPE(45, MPI_COUNT_DATATYPE, $MPI_SIZEOF_COUNT) PAC_SET_MPI_TYPE(46, MPIX_C_FLOAT16, 2) +PAC_SET_MPI_TYPE(47, MPI_LOGICAL1, $pac_cv_f77_sizeof_logical1) +PAC_SET_MPI_TYPE(48, MPI_LOGICAL2, $pac_cv_f77_sizeof_logical2) +PAC_SET_MPI_TYPE(49, MPI_LOGICAL4, $pac_cv_f77_sizeof_logical4) +PAC_SET_MPI_TYPE(4a, MPI_LOGICAL8, $pac_cv_f77_sizeof_logical8) +PAC_SET_MPI_TYPE(4b, MPI_LOGICAL16, $pac_cv_f77_sizeof_logical16) AC_MSG_RESULT([done]) # aliases diff --git a/doc/mansrc/mpiconsts.txt b/doc/mansrc/mpiconsts.txt index 62513011193..638d6559351 100644 --- a/doc/mansrc/mpiconsts.txt +++ b/doc/mansrc/mpiconsts.txt @@ -87,7 +87,12 @@ standard. - MPI_DOUBLE_COMPLEX - 'complex*16' (or 'complex*32') where supported. The following datatypes are optional -+I MPI_INTEGER1 - 'integer*1' if supported ++I MPI_LOGICAL1 - 'logical*1' if supported +. MPI_LOGICAL2 - 'logical*2' if supported +. MPI_LOGICAL4 - 'logical*4' if supported +. MPI_LOGICAL8 - 'logical*8' if supported +. MPI_LOGICAL16 - 'logical*16' if supported +. MPI_INTEGER1 - 'integer*1' if supported . MPI_INTEGER2 - 'integer*2' if supported . MPI_INTEGER4 - 'integer*4' if supported . MPI_INTEGER8 - 'integer*8' if supported diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in index dd3038ab7b1..ae01f900e42 100644 --- a/src/include/mpi.h.in +++ b/src/include/mpi.h.in @@ -223,6 +223,11 @@ typedef int MPI_Datatype; #define MPI_INTEGER4 ((MPI_Datatype)@MPI_INTEGER4@) #define MPI_INTEGER8 ((MPI_Datatype)@MPI_INTEGER8@) #define MPI_INTEGER16 ((MPI_Datatype)@MPI_INTEGER16@) +#define MPIX_LOGICAL1 ((MPI_Datatype)@MPI_LOGICAL1@) +#define MPIX_LOGICAL2 ((MPI_Datatype)@MPI_LOGICAL2@) +#define MPIX_LOGICAL4 ((MPI_Datatype)@MPI_LOGICAL4@) +#define MPIX_LOGICAL8 ((MPI_Datatype)@MPI_LOGICAL8@) +#define MPIX_LOGICAL16 ((MPI_Datatype)@MPI_LOGICAL16@) /* C99 fixed-width datatypes */ #define MPI_INT8_T ((MPI_Datatype)@MPI_INT8_T@) @@ -563,6 +568,7 @@ extern int * const MPI_WEIGHTS_EMPTY MPICH_API_PUBLIC; #define MPI_TYPECLASS_REAL 1 #define MPI_TYPECLASS_INTEGER 2 #define MPI_TYPECLASS_COMPLEX 3 +#define MPIX_TYPECLASS_LOGICAL 4 #define MPI_LOCK_EXCLUSIVE 234 #define MPI_LOCK_SHARED 235 diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h index 35e5484132a..6e9184c34ad 100644 --- a/src/include/mpiimpl.h +++ b/src/include/mpiimpl.h @@ -53,6 +53,14 @@ #include "mpl.h" #include "mpi.h" +/* TODO: remove once these become standard */ +#define MPI_LOGICAL1 MPIX_LOGICAL1 +#define MPI_LOGICAL2 MPIX_LOGICAL2 +#define MPI_LOGICAL4 MPIX_LOGICAL4 +#define MPI_LOGICAL8 MPIX_LOGICAL8 +#define MPI_LOGICAL16 MPIX_LOGICAL16 +#define MPI_TYPECLASS_LOGICAL MPIX_TYPECLASS_LOGICAL + #include #include #include diff --git a/src/include/mpir_objects.h b/src/include/mpir_objects.h index 4100b80395d..6589fc8480e 100644 --- a/src/include/mpir_objects.h +++ b/src/include/mpir_objects.h @@ -217,7 +217,7 @@ const char *MPIR_Handle_get_kind_str(int kind); #define MPIR_GROUP_PREALLOC 8 #endif -#define MPIR_DATATYPE_N_BUILTIN 71 +#define MPIR_DATATYPE_N_BUILTIN 76 #ifdef MPID_DATATYPE_PREALLOC #define MPIR_DATATYPE_PREALLOC MPID_DATATYPE_PREALLOC #else diff --git a/src/include/mpir_op_util.h b/src/include/mpir_op_util.h index db5285661dd..278cc0ca849 100644 --- a/src/include/mpir_op_util.h +++ b/src/include/mpir_op_util.h @@ -64,6 +64,11 @@ MPIR_OP_TYPE_GROUP(C_INTEGER) #define MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(mpi_type_,c_type_,type_name_) #define MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(mpi_type_,c_type_,type_name_) #define MPIR_OP_TYPE_MACRO_HAVE_FLOAT16(mpi_type_,c_type_,type_name_) +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL1_CTYPE(mpi_type_,c_type_,type_name_) +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL2_CTYPE(mpi_type_,c_type_,type_name_) +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL4_CTYPE(mpi_type_,c_type_,type_name_) +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL8_CTYPE(mpi_type_,c_type_,type_name_) +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL16_CTYPE(mpi_type_,c_type_,type_name_) #define MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(mpi_type_,c_type_,type_name_) #define MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(mpi_type_,c_type_,type_name_) #define MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(mpi_type_,c_type_,type_name_) @@ -110,6 +115,27 @@ MPIR_OP_TYPE_GROUP(C_INTEGER) #undef MPIR_OP_TYPE_MACRO_HAVE_FLOAT16 #define MPIR_OP_TYPE_MACRO_HAVE_FLOAT16(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) #endif +/* Fortran fixed width logical type support */ +#if defined(MPIR_LOGICAL1_CTYPE) +#undef MPIR_OP_TYPE_MACRO_HAVE_LOGICAL1_CTYPE +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL1_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) +#endif +#if defined(MPIR_LOGICAL2_CTYPE) +#undef MPIR_OP_TYPE_MACRO_HAVE_LOGICAL2_CTYPE +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL2_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) +#endif +#if defined(MPIR_LOGICAL4_CTYPE) +#undef MPIR_OP_TYPE_MACRO_HAVE_LOGICAL4_CTYPE +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL4_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) +#endif +#if defined(MPIR_LOGICAL8_CTYPE) +#undef MPIR_OP_TYPE_MACRO_HAVE_LOGICAL8_CTYPE +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL8_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) +#endif +#if defined(MPIR_LOGICAL16_CTYPE) +#undef MPIR_OP_TYPE_MACRO_HAVE_LOGICAL16_CTYPE +#define MPIR_OP_TYPE_MACRO_HAVE_LOGICAL16_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) +#endif /* Fortran fixed width integer type support */ #if defined(MPIR_INTEGER1_CTYPE) #undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE @@ -322,7 +348,12 @@ typedef struct { MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_LOGICAL, MPI_Fint, mpir_typename_logical) \ MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(MPI_C_BOOL, _Bool, mpir_typename_c_bool) \ MPIR_OP_TYPE_MACRO_HAVE_CXX_BOOL(MPI_CXX_BOOL, MPIR_CXX_BOOL_CTYPE, mpir_typename_cxx_bool_value) -#define MPIR_OP_TYPE_GROUP_LOGICAL_EXTRA /* empty, provided for consistency */ +#define MPIR_OP_TYPE_GROUP_LOGICAL_EXTRA \ + MPIR_OP_TYPE_MACRO_HAVE_LOGICAL1_CTYPE(MPI_LOGICAL1, MPIR_LOGICAL1_CTYPE, mpir_typename_logical1) \ + MPIR_OP_TYPE_MACRO_HAVE_LOGICAL2_CTYPE(MPI_LOGICAL2, MPIR_LOGICAL2_CTYPE, mpir_typename_logical2) \ + MPIR_OP_TYPE_MACRO_HAVE_LOGICAL4_CTYPE(MPI_LOGICAL4, MPIR_LOGICAL4_CTYPE, mpir_typename_logical4) \ + MPIR_OP_TYPE_MACRO_HAVE_LOGICAL8_CTYPE(MPI_LOGICAL8, MPIR_LOGICAL8_CTYPE, mpir_typename_logical8) \ + MPIR_OP_TYPE_MACRO_HAVE_LOGICAL16_CTYPE(MPI_LOGICAL16, MPIR_LOGICAL16_CTYPE, mpir_typename_logical16) /* complex group */ #define MPIR_OP_TYPE_GROUP_COMPLEX \ diff --git a/src/mpi/datatype/datatype_impl.c b/src/mpi/datatype/datatype_impl.c index ed348edab0f..0f243741596 100644 --- a/src/mpi/datatype/datatype_impl.c +++ b/src/mpi/datatype/datatype_impl.c @@ -334,6 +334,11 @@ int MPIR_Type_match_size_impl(int typeclass, int size, MPI_Datatype * datatype) MPI_COMPLEX, MPI_DOUBLE_COMPLEX, MPI_C_COMPLEX, MPI_C_DOUBLE_COMPLEX, MPI_C_LONG_DOUBLE_COMPLEX, }; + static MPI_Datatype bool_types[] = { + MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4, MPI_LOGICAL8, MPI_LOGICAL16, + MPI_LOGICAL, + MPI_C_BOOL, + }; MPI_Datatype matched_datatype = MPI_DATATYPE_NULL; int i; MPI_Aint tsize; @@ -402,6 +407,24 @@ int MPIR_Type_match_size_impl(int typeclass, int size, MPI_Datatype * datatype) } } break; + case MPI_TYPECLASS_LOGICAL: + { + int nBoolTypes = sizeof(bool_types) / sizeof(MPI_Datatype); +#ifdef HAVE_ERROR_CHECKING + tname = "MPI_TYPECLASS_LOGICAL"; +#endif + for (i = 0; i < nBoolTypes; i++) { + if (bool_types[i] == MPI_DATATYPE_NULL) { + continue; + } + MPIR_Datatype_get_size_macro(bool_types[i], tsize); + if (tsize == size) { + matched_datatype = bool_types[i]; + break; + } + } + } + break; default: /* --BEGIN ERROR HANDLING-- */ MPIR_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, break, "**typematchnoclass"); diff --git a/src/mpi/datatype/typerep/src/typerep_ext32.c b/src/mpi/datatype/typerep/src/typerep_ext32.c index 20acfd8412b..484585c4c7b 100644 --- a/src/mpi/datatype/typerep/src/typerep_ext32.c +++ b/src/mpi/datatype/typerep/src/typerep_ext32.c @@ -63,6 +63,12 @@ static external32_basic_size_t external32_basic_size_array[] = { {MPI_COMPLEX, 8}, {MPI_DOUBLE_COMPLEX, 16}, + {MPI_LOGICAL1, 1}, + {MPI_LOGICAL2, 2}, + {MPI_LOGICAL4, 4}, + {MPI_LOGICAL8, 8}, + {MPI_LOGICAL16, 16}, + {MPI_INTEGER1, 1}, {MPI_INTEGER2, 2}, {MPI_INTEGER4, 4}, diff --git a/src/mpi/datatype/typerep/src/typerep_yaksa_init.c b/src/mpi/datatype/typerep/src/typerep_yaksa_init.c index 2094e287570..f91309be94b 100644 --- a/src/mpi/datatype/typerep/src/typerep_yaksa_init.c +++ b/src/mpi/datatype/typerep/src/typerep_yaksa_init.c @@ -10,6 +10,7 @@ static yaksa_type_t TYPEREP_YAKSA_TYPE__REAL16; static yaksa_type_t TYPEREP_YAKSA_TYPE__COMPLEX32; static yaksa_type_t TYPEREP_YAKSA_TYPE__INTEGER16; +static yaksa_type_t TYPEREP_YAKSA_TYPE__LOGICAL16; yaksa_info_t MPII_yaksa_info_nogpu; @@ -145,8 +146,12 @@ yaksa_type_t MPII_Typerep_get_yaksa_type(MPI_Datatype type) case MPI_COUNT: case MPI_C_BOOL: #ifdef HAVE_FORTRAN_BINDING - case MPI_LOGICAL: case MPI_CHARACTER: + case MPI_LOGICAL: + case MPI_LOGICAL1: + case MPI_LOGICAL2: + case MPI_LOGICAL4: + case MPI_LOGICAL8: case MPI_INTEGER: case MPI_INTEGER1: case MPI_INTEGER2: @@ -325,6 +330,8 @@ yaksa_type_t MPII_Typerep_get_yaksa_type(MPI_Datatype type) yaksa_type = TYPEREP_YAKSA_TYPE__COMPLEX32; } else if (type == MPI_INTEGER16) { yaksa_type = TYPEREP_YAKSA_TYPE__INTEGER16; + } else if (type == MPI_LOGICAL16) { + yaksa_type = TYPEREP_YAKSA_TYPE__LOGICAL16; } else { MPIR_Datatype *typeptr; MPIR_Datatype_get_ptr(type, typeptr); @@ -425,6 +432,9 @@ void MPIR_Typerep_init(void) MPIR_Datatype_get_size_macro(MPI_INTEGER16, size); yaksa_type_create_contig(size, YAKSA_TYPE__BYTE, NULL, &TYPEREP_YAKSA_TYPE__INTEGER16); + MPIR_Datatype_get_size_macro(MPI_LOGICAL16, size); + yaksa_type_create_contig(size, YAKSA_TYPE__BYTE, NULL, &TYPEREP_YAKSA_TYPE__LOGICAL16); + MPIR_FUNC_EXIT; } diff --git a/src/mpi/datatype/typeutil.c b/src/mpi/datatype/typeutil.c index 8c06ec2532b..4bc487ad3e2 100644 --- a/src/mpi/datatype/typeutil.c +++ b/src/mpi/datatype/typeutil.c @@ -96,6 +96,11 @@ static mpi_names_t mpi_dtypes[] = { type_name_entry(MPI_INTEGER4), type_name_entry(MPI_INTEGER8), type_name_entry(MPI_INTEGER16), + type_name_entry(MPI_LOGICAL1), + type_name_entry(MPI_LOGICAL2), + type_name_entry(MPI_LOGICAL4), + type_name_entry(MPI_LOGICAL8), + type_name_entry(MPI_LOGICAL16), /* C++ types */ type_name_entry(MPI_CXX_BOOL), @@ -287,7 +292,9 @@ int MPIR_Datatype_builtintype_alignment(MPI_Datatype type) return ALIGNOF_CHAR; } else if (type == MPI_LOGICAL || type == MPI_INTEGER || type == MPI_2INTEGER || type == MPI_INTEGER1 || type == MPI_INTEGER2 || type == MPI_INTEGER4 || - type == MPI_INTEGER8 || type == MPI_INTEGER16) { + type == MPI_INTEGER8 || type == MPI_INTEGER16 || + type == MPI_LOGICAL1 || type == MPI_LOGICAL2 || type == MPI_LOGICAL4 || + type == MPI_LOGICAL8 || type == MPI_LOGICAL16) { if (size == sizeof(int8_t)) return ALIGNOF_INT8_T; else if (size == sizeof(int16_t)) diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt index 9a6235288d5..9b70437d55b 100644 --- a/src/mpi/errhan/errnames.txt +++ b/src/mpi/errhan/errnames.txt @@ -173,8 +173,9 @@ be in the range 0 to %d **recvbuf_inplace:recvbuf cannot be MPI_IN_PLACE **buf_inplace:buffer cannot be MPI_IN_PLACE **buf_inplace %s:buffer '%s' cannot be MPI_IN_PLACE -**typematchnoclass:The value of typeclass is not one of MPI_TYPECLASS_REAL, \ -MPI_TYPECLASS_INTEGER, or MPI_TYPECLASS_COMPLEX +**typematchnoclass:The value of typeclass is not one of \ +MPI_TYPECLASS_LOGICAL, MPI_TYPECLASS_INTEGER, \ +MPI_TYPECLASS_REAL, or MPI_TYPECLASS_COMPLEX **typematchsize:No MPI datatype available for the given typeclass and size **typematchsize %s %d:No MPI datatype available for typeclass %s and size %d **f90typetoomany:Too many requests for unnamed, predefined f90 types diff --git a/src/mpid/ch4/netmod/ofi/util.c b/src/mpid/ch4/netmod/ofi/util.c index cb075e25afc..17132ee7b9a 100644 --- a/src/mpid/ch4/netmod/ofi/util.c +++ b/src/mpid/ch4/netmod/ofi/util.c @@ -266,7 +266,13 @@ int MPIDI_OFI_mpi_to_ofi(MPI_Datatype dt, enum fi_datatype *fi_dt, MPI_Op op, en } else if (dt == MPI_UNSIGNED_CHAR || dt == MPI_UNSIGNED_SHORT || dt == MPI_UNSIGNED || dt == MPI_UNSIGNED_LONG || dt == MPI_UNSIGNED_LONG_LONG || dt == MPI_UINT8_T || dt == MPI_UINT16_T || dt == MPI_UINT32_T || - dt == MPI_UINT64_T || dt == MPI_C_BOOL || dt == MPI_LOGICAL) { + dt == MPI_UINT64_T || dt == MPI_C_BOOL || + /* TODO: Should MPI_LOGICAL* be handled as unsigned? + These datatypes corresponds to Fortran LOGICAL + types. Therefore it may make more sense to be + handled similarly as INTEGER in the previous branch. */ + dt == MPI_LOGICAL || dt == MPI_LOGICAL1 || dt == MPI_LOGICAL2 || + dt == MPI_LOGICAL4 || dt == MPI_LOGICAL8) { switch (dt_size) { case 1: *fi_dt = FI_UINT8;