From 9fff01704fbb64ebf3612f34ec2bcb24d8cbddf0 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 10 Aug 2010 20:33:50 +0000 Subject: [PATCH] - Add on to r23580: we do check for F90's DOUBLE COMPLEX, but do not do so for F77. The DDT-engine is taken care of, it maps to C's dblcplx accordingly. Manually added to CMR: This commit was SVN r23586. The following SVN revision numbers were found above: r23580 --> open-mpi/ompi@16bf3c2f3047f0c281b16ec855c719c3ca882625 --- ompi/config/ompi_setup_mpi_fortran.m4 | 3 +++ ompi/datatype/ompi_datatype_module.c | 4 ++-- ompi/tools/ompi_info/param.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ompi/config/ompi_setup_mpi_fortran.m4 b/ompi/config/ompi_setup_mpi_fortran.m4 index bdb5622f9e..0b2eca3e3f 100644 --- a/ompi/config/ompi_setup_mpi_fortran.m4 +++ b/ompi/config/ompi_setup_mpi_fortran.m4 @@ -85,6 +85,9 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ [float, double, long double], [-1]) OMPI_F77_CHECK([COMPLEX], [yes], [], [-1]) + # Double precision complex types are not standard, but many compilers support it. + # Code should be wrapped with #ifdef OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX + OMPI_F77_CHECK([DOUBLE COMPLEX], [yes], [], [-1]) # 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 diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index d573abc95f..59b4f6b008 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -132,7 +132,7 @@ ompi_predefined_datatype_t ompi_mpi_integer = OMPI_DATATYPE_INIT_PREDEFIN ompi_predefined_datatype_t ompi_mpi_real = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (FLOAT, REAL, OMPI_SIZEOF_FORTRAN_REAL, OMPI_ALIGNMENT_FORTRAN_REAL, OMPI_DATATYPE_FLAG_DATA_FLOAT ); ompi_predefined_datatype_t ompi_mpi_dblprec = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (FLOAT, DOUBLE_PRECISION, OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION, OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION, OMPI_DATATYPE_FLAG_DATA_FLOAT ); ompi_predefined_datatype_t ompi_mpi_cplex = OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); -#if OMPI_HAVE_F90_DOUBLE_COMPLEX +#if OMPI_HAVE_F90_DOUBLE_COMPLEX || OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX /* We do not configure-check for alignment of F90 types ... Alignment of F77 OMPI_ALIGNMENT_FORTRAN_COMPLEX has to suffice */ ompi_predefined_datatype_t ompi_mpi_dblcplex = OMPI_DATATYPE_INIT_DEFER (DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); #else @@ -140,7 +140,7 @@ ompi_predefined_datatype_t ompi_mpi_dblcplex = OMPI_DATATYPE_INIT_UNAVAILA #endif /* In Fortran, there does not exist a type LONG DOUBLE COMPLEX, but DOUBLE COMPLEX(KIND=8) may require this */ -#if HAVE_LONG_DOUBLE && OMPI_HAVE_F90_DOUBLE_COMPLEX +#if HAVE_LONG_DOUBLE && ( OMPI_HAVE_F90_DOUBLE_COMPLEX || OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ) /* We do not configure-check for alignment of F90 types ... Alignment of F77 OMPI_ALIGNMENT_FORTRAN_COMPLEX has to suffice */ ompi_predefined_datatype_t ompi_mpi_ldblcplex = OMPI_DATATYPE_INIT_DEFER (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX ); #else diff --git a/ompi/tools/ompi_info/param.c b/ompi/tools/ompi_info/param.c index 7971071422..b30741f7e7 100644 --- a/ompi/tools/ompi_info/param.c +++ b/ompi/tools/ompi_info/param.c @@ -713,7 +713,7 @@ void ompi_info_do_config(bool want_all) OMPI_SIZEOF_FORTRAN_COMPLEX); ompi_info_out_int("Fort dbl cplx size", "compiler:fortran:sizeof:double_complex", - OMPI_SIZEOF_FORTRAN_COMPLEX * 2); + OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_SIZEOF_FORTRAN_DOUBLE_COMPLEX : -1); ompi_info_out_int("Fort cplx8 size", "compiler:fortran:sizeof:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_SIZEOF_FORTRAN_COMPLEX8 : -1); ompi_info_out_int("Fort cplx16 size", "compiler:fortran:sizeof:complex16", @@ -751,7 +751,7 @@ void ompi_info_do_config(bool want_all) OMPI_ALIGNMENT_FORTRAN_COMPLEX); ompi_info_out_int("Fort dbl cplx align", "compiler:fortran:align:double_complex", - OMPI_ALIGNMENT_FORTRAN_COMPLEX); + OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_ALIGNMENT_FORTRAN_DOUBLE_COMPLEX : -1); ompi_info_out_int("Fort cplx8 align", "compiler:fortran:align:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX8 : -1); ompi_info_out_int("Fort cplx16 align", "compiler:fortran:align:complex16",