Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ ompi/mpiext/pcollreq/mpif-h/profile/pscan_init_f.c
ompi/mpiext/pcollreq/mpif-h/profile/pscatter_init_f.c
ompi/mpiext/pcollreq/mpif-h/profile/pscatterv_init_f.c

ompi/mpiext/shortfloat/c/mpiext_shortfloat_c.h
ompi/mpiext/shortfloat/mpif-h/mpiext_shortfloat_mpifh.h
ompi/mpiext/shortfloat/use-mpi-f08/mpiext_shortfloat_usempif08.h

ompi/tools/mpisync/mpisync
ompi/tools/mpisync/mpirun_prof
ompi/tools/mpisync/ompi_timing_post
Expand Down
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,10 @@ Open MPI Extensions
because they are not standardized yet. Future versions of Open MPI
will switch to the MPI_ prefix once the MPI Standard which includes
this feature is published. See their man page for more details.
- shortfloat: Provides MPI datatypes MPIX_C_FLOAT16, MPIX_SHORT_FLOAT,
MPIX_SHORT_FLOAT, and MPIX_CXX_SHORT_FLOAT_COMPLEX if corresponding
language types are available. See ompi/mpiext/shortfloat/README.txt
for details.
- affinity: Provides the OMPI_Affinity_str() routine on retrieving
a string that contains what resources a process is bound to. See
its man page for more details.
Expand Down
9 changes: 7 additions & 2 deletions config/ompi_fortran_check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ AC_DEFUN([OMPI_FORTRAN_CHECK], [
long*double) ofc_type_kind=C_LONG_DOUBLE ;;
long*long) ofc_type_kind=C_LONG_LONG ;;
short) ofc_type_kind=C_SHORT ;;
short*float) ofc_type_kind=C_SHORT_FLOAT ;;
short*float*_Complex) ofc_type_kind=C_SHORT_FLOAT_COMPLEX ;;
float*_Complex) ofc_type_kind=C_FLOAT_COMPLEX ;;
double*_Complex) ofc_type_kind=C_DOUBLE_COMPLEX ;;
long*double*_Complex) ofc_type_kind=C_LONG_DOUBLE_COMPLEX ;;
opal_short_float_t) ofc_type_kind=C_SHORT_FLOAT ;;
opal_short_float_complex_t) ofc_type_kind=C_SHORT_FLOAT_COMPLEX ;;
*)
# Skip types like "DOUBLE PRECISION"
;;
Expand All @@ -142,8 +146,9 @@ AC_DEFUN([OMPI_FORTRAN_CHECK], [

# See if the value is -1. If so, then just say we don't
# have a match. If the compiler doesn't support
# ISO_C_BINDING, then we'll just fall back to a default
# kind and hope for the best. :-\
# ISO_C_BINDING, C_SHORT_FLOAT, or C_SHORT_FLOAT_COMPLEX,
# then we'll just fall back to a default kind and hope
# for the best. :-\
OMPI_FORTRAN_GET_KIND_VALUE([$ofc_type_kind], 4, [ofc_type_kind_value])
AS_IF([test $ofc_type_kind_value -le 0],
[ofc_have_type=0
Expand Down
35 changes: 23 additions & 12 deletions config/ompi_setup_mpi_fortran.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2014-2017 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -168,25 +169,33 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
[int, int64_t, long long, long], [16], [yes])

OMPI_FORTRAN_CHECK([REAL], [yes],
[float, double, long double], [-1], [yes])
[short float, float, double, long double, opal_short_float_t],
[-1], [yes])
OMPI_FORTRAN_CHECK([REAL*2], [no],
[float, double, long double], [2], [yes])
[short float, float, double, long double, opal_short_float_t],
[2], [yes])
OMPI_FORTRAN_CHECK([REAL*4], [no],
[float, double, long double], [4], [yes])
[short float, float, double, long double, opal_short_float_t],
[4], [yes])
OMPI_FORTRAN_CHECK([REAL*8], [no],
[float, double, long double], [8], [yes])
[short float, float, double, long double, opal_short_float_t],
[8], [yes])
OMPI_FORTRAN_CHECK([REAL*16], [no],
[float, double, long double], [16], [yes])
[short float, float, double, long double, opal_short_float_t],
[16], [yes])

# In some compilers, the bit representation of REAL*16 is not the same
# as the C counterpart that we found. If this is the case, then we
# want to disable reduction support for MPI_REAL16 (per ticket #1603).
OMPI_FORTRAN_CHECK_REAL16_C_EQUIV

OMPI_FORTRAN_CHECK([DOUBLE PRECISION], [yes],
[float, double, long double], [-1], [yes])
[short float, float, double, long double, opal_short_float_t],
[-1], [yes])

OMPI_FORTRAN_CHECK([COMPLEX], [yes], [float _Complex, double _Complex], [-1], [no])
OMPI_FORTRAN_CHECK([COMPLEX], [yes],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[-1], [no])

# The complex*N tests are a bit different (note: the complex tests are
# the same as all the rest, because complex is a composite of two
Expand All @@ -199,21 +208,23 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
# have a back-end C type for it)
# b) compiler supports complex*N

OMPI_FORTRAN_CHECK([COMPLEX*4], [no], [float _Complex], [4], [no])
OMPI_FORTRAN_CHECK([COMPLEX*4], [no],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[4], [no])
OMPI_FORTRAN_CHECK([COMPLEX*8], [no],
[float _Complex, double _Complex, long double _Complex],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[8], [no])
OMPI_FORTRAN_CHECK([COMPLEX*16], [no],
[float _Complex, double _Complex, long double _Complex],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[16], [no])
OMPI_FORTRAN_CHECK([COMPLEX*32], [no],
[float _Complex, double _Complex, long double _Complex],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[32], [no])
# Double precision complex types are not standard, but many
# compilers support it. Code should be wrapped with #ifdef
# OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
OMPI_FORTRAN_CHECK([DOUBLE COMPLEX], [no],
[float _Complex, double _Complex, long double _Complex],
[short float _Complex, float _Complex, double _Complex, long double _Complex, opal_short_float_complex_t],
[-1], [no])

# Regardless of whether we have fortran bindings, or even a
Expand Down
55 changes: 55 additions & 0 deletions config/opal_check_alt_short_float.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl

# Check whether the user wants to use an alternate type of C 'short float'.

# OPAL_CHECK_ALT_SHORT_FLOAT
# ------------------------------------------------------------
AC_DEFUN([OPAL_CHECK_ALT_SHORT_FLOAT], [
AC_CHECK_TYPES(_Float16)
AC_MSG_CHECKING([if want alternate C type of short float])
AC_ARG_ENABLE(alt-short-float,
AC_HELP_STRING([--enable-alt-short-float=TYPE],
[Use an alternate C type TYPE of 'short float' if 'short float' is not available on the C compiler. 'short float' is a new C type proposed for the next C language standard in ISO/IEC JTC 1/SC 22 WG 14 (C WG). (default: "_Float16" if available, disabled otherwise)]))
if test "$enable_alt_short_float" = "yes"; then
AC_MSG_ERROR([--enable-alt-short-float must have an argument.])
elif test "$enable_alt_short_float" = "no"; then
:
elif test "$enable_alt_short_float" != ""; then
opal_short_float_type="$enable_alt_short_float"
opal_short_float_complex_type="$enable_alt_short_float [[2]]"
elif test "$ac_cv_type_short_float" = "yes" && \
test "$ac_cv_type_short_float__Complex" = "yes"; then
opal_short_float_type="short float"
opal_short_float_complex_type="short float _Complex"
elif test "$ac_cv_type__Float16" = "yes"; then
opal_short_float_type="_Float16"
opal_short_float_complex_type="_Float16 [[2]]"
fi
if test "$opal_short_float_type" != ""; then
AC_MSG_RESULT([yes ($opal_short_float_type)])
AC_CHECK_TYPES($opal_short_float_type, [opal_enable_short_float=1], [opal_enable_short_float=0])
if test "$opal_enable_short_float" = 1; then
AC_DEFINE_UNQUOTED(opal_short_float_t, [[$opal_short_float_type]],
[User-selected alternate C type of short float])
AC_DEFINE_UNQUOTED(opal_short_float_complex_t, [[$opal_short_float_complex_type]],
[User-selected alternate C type of short float _Complex])
AC_CHECK_TYPES(opal_short_float_t)
AC_CHECK_TYPES(opal_short_float_complex_t)
AC_CHECK_SIZEOF(opal_short_float_t)
AC_CHECK_SIZEOF(opal_short_float_complex_t)
OPAL_C_GET_ALIGNMENT(opal_short_float_t, OPAL_ALIGNMENT_OPAL_SHORT_FLOAT_T)
elif test "$enable_alt_short_float" != ""; then
AC_MSG_ERROR([Alternate C type of short float $opal_short_float_type requested but not available. Aborting])
fi
else
AC_MSG_RESULT([no])
fi
])
42 changes: 42 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
# Copyright (c) 2018 Amazon.com, Inc. or its affiliates.
# All Rights reserved.
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -373,6 +374,27 @@ OPAL_CHECK_IDENT([CC], [CFLAGS], [c], [C])
# Check for some types
#

# 'short float' support of the Intel C++ Compiler (group of C and C++
# compilers), at least versions 18.0 and 19.0, is half-baked. It can
# compile declarations of 'short float' variables and expressions of
# 'sizeof(short float)' but cannot compile casts and operations of
# 'short float' variables. In this situation, 'AC_CHECK_TYPES(short float)'
# defines 'HAVE_SHORT_FLOAT' as 1 and compilation errors occur in
# ompi/mca/op/base/op_base_functions.c. To avoid this error, check it
# using 'AC_COMPILE_IFELSE' and set Autoconf cache variables before
# 'AC_CHECK_TYPES(short float)'. This check can be removed when all
# OMPI-supported Intel C++ Compilers support 'short float' completely
# (or drop it completely).
if test "$opal_cv_c_compiler_vendor" = "intel"; then
AC_MSG_CHECKING([if Intel compiler supports "short float" properly])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([float f(short float a, short float b) { return (float)(a + b); }])],
[AC_MSG_RESULT([yes])],
[ac_cv_type_short_float="no"
ac_cv_type_short_float__Complex="no"]
AC_MSG_RESULT([no]))
fi

AC_CHECK_TYPES(int8_t)
AC_CHECK_TYPES(uint8_t)
AC_CHECK_TYPES(int16_t)
Expand All @@ -387,10 +409,12 @@ AC_CHECK_TYPES(uint128_t)
AC_CHECK_TYPES(long long)

AC_CHECK_TYPES(__float128)
AC_CHECK_TYPES(short float)
AC_CHECK_TYPES(long double)
# We only need these types if we're building the OMPI project, but
# OPAL currently doesn't protect for their lack of presence well.
AC_CHECK_HEADERS(complex.h)
AC_CHECK_TYPES(short float _Complex)
AC_CHECK_TYPES(float _Complex)
AC_CHECK_TYPES(double _Complex)
AC_CHECK_TYPES(long double _Complex)
Expand All @@ -411,6 +435,9 @@ AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
if test "$ac_cv_type_short_float" = yes; then
AC_CHECK_SIZEOF(short float)
fi
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long double)
Expand All @@ -419,6 +446,9 @@ if test "$ac_cv_type___float128" = yes; then
fi
# We only need these types if we're building the OMPI project, but
# OPAL currently doesn't protect for their lack of presence well.
if test "$ac_cv_type_short_float__Complex" = yes; then
AC_CHECK_SIZEOF(short float _Complex)
fi
AC_CHECK_SIZEOF(float _Complex)
AC_CHECK_SIZEOF(double _Complex)
AC_CHECK_SIZEOF(long double _Complex)
Expand Down Expand Up @@ -461,6 +491,9 @@ OPAL_C_GET_ALIGNMENT(wchar_t, OPAL_ALIGNMENT_WCHAR)
OPAL_C_GET_ALIGNMENT(int, OPAL_ALIGNMENT_INT)
OPAL_C_GET_ALIGNMENT(long, OPAL_ALIGNMENT_LONG)
OPAL_C_GET_ALIGNMENT(long long, OPAL_ALIGNMENT_LONG_LONG)
if test "$ac_cv_type_short_float" = yes; then
OPAL_C_GET_ALIGNMENT(short float, OPAL_ALIGNMENT_SHORT_FLOAT)
fi
OPAL_C_GET_ALIGNMENT(float, OPAL_ALIGNMENT_FLOAT)
OPAL_C_GET_ALIGNMENT(double, OPAL_ALIGNMENT_DOUBLE)
OPAL_C_GET_ALIGNMENT(long double, OPAL_ALIGNMENT_LONG_DOUBLE)
Expand All @@ -471,13 +504,22 @@ fi

# We only need these types if we're building the OMPI project, but
# OPAL currently doesn't protect for their lack of presence well.
if test "$ac_cv_type_short_float__Complex" = yes; then
OPAL_C_GET_ALIGNMENT(short float _Complex, OPAL_ALIGNMENT_SHORT_FLOAT_COMPLEX)
fi
OPAL_C_GET_ALIGNMENT(float _Complex, OPAL_ALIGNMENT_FLOAT_COMPLEX)
OPAL_C_GET_ALIGNMENT(double _Complex, OPAL_ALIGNMENT_DOUBLE_COMPLEX)
OPAL_C_GET_ALIGNMENT(long double _Complex, OPAL_ALIGNMENT_LONG_DOUBLE_COMPLEX)

OPAL_C_GET_ALIGNMENT(void *, OPAL_ALIGNMENT_VOID_P)
OPAL_C_GET_ALIGNMENT(size_t, OPAL_ALIGNMENT_SIZE_T)

#
# Check for an alternate type of C 'short float'
#

OPAL_CHECK_ALT_SHORT_FLOAT

#
# Check for other compiler characteristics
#
Expand Down
3 changes: 2 additions & 1 deletion ompi/datatype/ompi_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -57,7 +58,7 @@ BEGIN_C_DECLS
#define OMPI_DATATYPE_FLAG_DATA_FORTRAN 0xC000
#define OMPI_DATATYPE_FLAG_DATA_LANGUAGE 0xC000

#define OMPI_DATATYPE_MAX_PREDEFINED 47
#define OMPI_DATATYPE_MAX_PREDEFINED 50

#if OMPI_DATATYPE_MAX_PREDEFINED > OPAL_DATATYPE_MAX_SUPPORTED
#error Need to increase the number of supported dataypes by OPAL (value OPAL_DATATYPE_MAX_SUPPORTED).
Expand Down
Loading