diff --git a/config/ompi_fortran_check_iso_fortran_env_real16.m4 b/config/ompi_fortran_check_iso_fortran_env_real16.m4 new file mode 100644 index 00000000000..9089098a1f6 --- /dev/null +++ b/config/ompi_fortran_check_iso_fortran_env_real16.m4 @@ -0,0 +1,34 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2021 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# Check whether or not the Fortran compiler supports the non standard +# iso_fortran_env:real16 or not +# +# OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16([action if found], [action if not found]) +# ---------------------------------------------------- +AC_DEFUN([OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16],[ + AS_VAR_PUSHDEF([iso_fortran_env_var_real16], [ompi_cv_fortran_have_iso_fortran_env_real16]) + + AC_CACHE_CHECK([if Fortran compiler supports ISO_FORTRAN_ENV:REAL16], iso_fortran_env_var_real16, + [AC_LANG_PUSH([Fortran]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_iso_fortran_env_real16 + use, intrinsic :: iso_fortran_env + real(REAL16) :: var + var = 12.34 +end program]])], + [AS_VAR_SET(iso_fortran_env_var_real16, yes)], + [AS_VAR_SET(iso_fortran_env_var_real16, no)]) + AC_LANG_POP([Fortran]) + ]) + + AS_VAR_IF(iso_fortran_env_var_real16, [yes], [$1], [$2]) + AS_VAR_POPDEF([iso_fortran_env_var_real16]) +]) diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index fbfd9c5fcf1..703aa72d8bc 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -15,7 +15,7 @@ dnl Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2014-2020 Research Organization for Information Science +dnl Copyright (c) 2014-2021 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. @@ -328,6 +328,13 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ [OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV=0])]) AC_SUBST(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV) + # The non standard iso_fortran_env:real16 can be used for MPI_SIZEOF + OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16=0 + AS_IF([test $ompi_fortran_happy -eq 1], + [OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16( + [OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16=1])]) + AC_SUBST(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) + # Ensure that the fortran compiler supports STORAGE_SIZE for # enough relevant types. AS_IF([test $ompi_fortran_happy -eq 1], diff --git a/ompi/include/Makefile.am b/ompi/include/Makefile.am index 8384b864bef..dcb55c27730 100644 --- a/ompi/include/Makefile.am +++ b/ompi/include/Makefile.am @@ -11,8 +11,8 @@ # All rights reserved. # Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved. -# Copyright (c) 2014-2015 Research Organization for Information Science -# and Technology (RIST). All rights reserved. +# Copyright (c) 2014-2021 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. # $COPYRIGHT$ # @@ -88,6 +88,7 @@ mpif-sizeof.h: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) diff --git a/ompi/mpi/fortran/base/gen-mpi-sizeof.pl b/ompi/mpi/fortran/base/gen-mpi-sizeof.pl index 194e7b0e7f6..30b1d3446c1 100755 --- a/ompi/mpi/fortran/base/gen-mpi-sizeof.pl +++ b/ompi/mpi/fortran/base/gen-mpi-sizeof.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl # # Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2018 Research Organization for Information Science +# Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # $COPYRIGHT$ # @@ -33,6 +33,7 @@ my $generate_arg; my $mpi_arg; my $mpi_real2; +my $mpi_iso_real16; my $mpi_real16; my $mpi_complex4; my $mpi_complex32; @@ -51,6 +52,7 @@ "pmpi" => \$pmpi_arg, "real16=i" => \$mpi_real16, "real2=i" => \$mpi_real2, + "iso_real16=i" => \$mpi_iso_real16, "help|h" => \$help_arg); die "Must specify header and/or impl filenames to output" @@ -64,8 +66,8 @@ die "Must specify --pmpi and/or --mpi if --impl is specified" if (defined($generate_arg) && $generate_arg && (defined($impl_arg) && !defined($mpi_arg) && !defined($pmpi_arg))); -die "Must specify real2, real16, complex4, and complex32" - if (!defined($mpi_real2) || !defined($mpi_real16) || +die "Must specify real2, iso_real16, real16, complex4, and complex32" + if (!defined($mpi_real2) || !defined($mpi_iso_real16) || !defined($mpi_real16) || !defined($mpi_complex4) || !defined($mpi_complex32)); ############################################################################# @@ -154,15 +156,19 @@ sub generate { queue_sub("integer(int${size})", "int${size}", "int${size}"); } for my $size (qw/16 32 64 128/) { - if (!($size == 16 && $mpi_real2 == 0) && - !($size == 128 &&$mpi_real16 == 0)) { + if (!($size == 16 && $mpi_real2 == 0 && $mpi_iso_real16 == 0) && + !($size == 128 && $mpi_real16 == 0)) { queue_sub("real(real${size})", "real${size}", "real${size}"); } - if (!($size == 16 && $mpi_complex4 == 0) && + if (!($size == 16 && $mpi_complex4 == 0 && $mpi_iso_real16 == 0) && !($size == 128 && $mpi_complex32 == 0)) { queue_sub("complex(real${size})", "complex${size}", "real${size}"); } } +if ($mpi_real2 == 1 && $mpi_iso_real16 == 0) { + queue_sub("real*2", "real16"); + queue_sub("complex*4", "complex16"); +} queue_sub("character", "character"); queue_sub("logical", "logical"); diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am index b8225bf889d..954d9009cfc 100644 --- a/ompi/mpi/fortran/mpif-h/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/Makefile.am @@ -14,7 +14,7 @@ # Copyright (c) 2011-2013 Universite Bordeaux 1 # Copyright (c) 2013-2018 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2015-2020 Research Organization for Information Science +# Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. @@ -122,6 +122,7 @@ sizeof_f.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) diff --git a/ompi/mpi/fortran/mpif-h/profile/Makefile.am b/ompi/mpi/fortran/mpif-h/profile/Makefile.am index 9d183297df8..4b375b7993c 100644 --- a/ompi/mpi/fortran/mpif-h/profile/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/profile/Makefile.am @@ -15,7 +15,7 @@ # Copyright (c) 2011-2013 Universite Bordeaux 1 # Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2015-2020 Research Organization for Information Science +# Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. # $COPYRIGHT$ @@ -446,6 +446,7 @@ psizeof_f.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 5ba1c4da486..4cf4be9b710 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -7,7 +7,7 @@ # Copyright (c) 2012-2013 Inria. All rights reserved. # Copyright (c) 2013-2018 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2015-2020 Research Organization for Information Science +# Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. @@ -75,6 +75,7 @@ sizeof_f08.h: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) @@ -87,6 +88,7 @@ sizeof_f08.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) @@ -99,6 +101,7 @@ profile/psizeof_f08.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am b/ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am index 3916b159949..0667ecc9b93 100644 --- a/ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am @@ -1,7 +1,7 @@ # -*- makefile -*- # # Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2020 Research Organization for Information Science +# Copyright (c) 2015-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # @@ -102,6 +102,7 @@ mpi-ignore-tkr-sizeof.h: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) @@ -114,6 +115,7 @@ mpi-ignore-tkr-sizeof.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) diff --git a/ompi/mpi/fortran/use-mpi-tkr/Makefile.am b/ompi/mpi/fortran/use-mpi-tkr/Makefile.am index ce5c8a295d0..9d642895d0f 100644 --- a/ompi/mpi/fortran/use-mpi-tkr/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-tkr/Makefile.am @@ -13,7 +13,7 @@ # Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved # Copyright (c) 2007 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2014-2020 Research Organization for Information Science +# Copyright (c) 2014-2021 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. @@ -138,6 +138,7 @@ mpi-tkr-sizeof.h: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) @@ -150,6 +151,7 @@ mpi-tkr-sizeof.f90: --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ --generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \ --real2=$(OMPI_HAVE_FORTRAN_REAL2) \ + --iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \ --real16=$(OMPI_HAVE_FORTRAN_REAL16) \ --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32)