Finish the rest of r9698:
- Add a lengthy comment explaining why we don't get F90 data type alignments - Remove config/f90_check.m4 and its entry in acinclude.m4 This commit was SVN r9707. The following SVN revision numbers were found above: r9698 --> open-mpi/ompi@e57300da4c
Этот коммит содержится в:
родитель
3e968d4f63
Коммит
c6a753f41b
@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|||||||
dnl University of Stuttgart. All rights reserved.
|
dnl University of Stuttgart. All rights reserved.
|
||||||
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
dnl All rights reserved.
|
dnl All rights reserved.
|
||||||
|
dnl Copyright (c) 2006 Cisco Systems, Inc.
|
||||||
dnl $COPYRIGHT$
|
dnl $COPYRIGHT$
|
||||||
dnl
|
dnl
|
||||||
dnl Additional copyrights may follow
|
dnl Additional copyrights may follow
|
||||||
@ -43,7 +44,6 @@ m4_include(config/f77_purge_unsupported_kind.m4)
|
|||||||
m4_include(config/f90_check.m4)
|
m4_include(config/f90_check.m4)
|
||||||
m4_include(config/f90_check_type.m4)
|
m4_include(config/f90_check_type.m4)
|
||||||
m4_include(config/f90_find_module_include_flag.m4)
|
m4_include(config/f90_find_module_include_flag.m4)
|
||||||
m4_include(config/f90_get_alignment.m4)
|
|
||||||
m4_include(config/f90_get_precision.m4)
|
m4_include(config/f90_get_precision.m4)
|
||||||
m4_include(config/f90_get_range.m4)
|
m4_include(config/f90_get_range.m4)
|
||||||
m4_include(config/f90_get_sizeof.m4)
|
m4_include(config/f90_get_sizeof.m4)
|
||||||
|
@ -26,7 +26,44 @@ dnl
|
|||||||
# - equal to expected size
|
# - equal to expected size
|
||||||
# - range (optional)
|
# - range (optional)
|
||||||
# - precision (optional)
|
# - precision (optional)
|
||||||
#
|
|
||||||
|
# Note that we do *not* check for the alignment here. This is a long,
|
||||||
|
# sordid tale.
|
||||||
|
|
||||||
|
# We have been unable to devise a F90 test that will result in a
|
||||||
|
# consistent answer. Specifically, our prior tests have been similar
|
||||||
|
# to the f77 test -- have a small chunk of f90 code compiled with the
|
||||||
|
# C code to actually compute the offsets. The f90 code was a
|
||||||
|
# struct-like entity (a "type") with multiple members -- on a
|
||||||
|
# character and the other of the target type. The C code measured the
|
||||||
|
# distance between them. But even if you use the keyword to ensure
|
||||||
|
# that the F90 compiler does not re-order this struct, you may still
|
||||||
|
# get a different alignment answer than the F77 test (!). This is
|
||||||
|
# apparently because F90 allows compilers to align types differently
|
||||||
|
# according to use (in common blocks, as standalone variables, and as
|
||||||
|
# a member of a struct). Hence, the alignment can be different
|
||||||
|
# depending on how to measure (and use) it. This was confirmed by
|
||||||
|
# various members of the Fortran committee and several Fortran
|
||||||
|
# compiler vendors.
|
||||||
|
|
||||||
|
# We check the F77 alignment based on common block usage, but this is
|
||||||
|
# only one of the available types for F90. Hence, we may actually get
|
||||||
|
# a different answer between f77 and f90 in the same compiler series
|
||||||
|
# (and some compilers do! E.g., g95 gives different answers even when
|
||||||
|
# "g95" itself is used as both the f77 and f90 compiler).
|
||||||
|
|
||||||
|
# So we gave up.
|
||||||
|
|
||||||
|
# Additionally, this was really only a sanity check anyway, because
|
||||||
|
# the way out F90 MPI layer is organized, there is no translation
|
||||||
|
# between the data and datatypes performed -- we simply invoke the F77
|
||||||
|
# layer from the F90 layer. Hence, we make no distinction between
|
||||||
|
# them, and therefore the OMPI DDT engine uses only the F77 sizes and
|
||||||
|
# alignments. So rather than display a warning to the user for a test
|
||||||
|
# that was questionable at best, we just eliminated the F90 alignment
|
||||||
|
# test, corresponding F77 comparison, and ensuring warning -- because
|
||||||
|
# it really didn't mean anything anyway.
|
||||||
|
|
||||||
# types to search is a comma-seperated list of values
|
# types to search is a comma-seperated list of values
|
||||||
AC_DEFUN([OMPI_F90_CHECK], [
|
AC_DEFUN([OMPI_F90_CHECK], [
|
||||||
ofc_fortran_type="$1"
|
ofc_fortran_type="$1"
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
dnl -*- shell-script -*-
|
|
||||||
dnl
|
|
||||||
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
|
||||||
dnl University Research and Technology
|
|
||||||
dnl Corporation. All rights reserved.
|
|
||||||
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
dnl of Tennessee Research Foundation. All rights
|
|
||||||
dnl reserved.
|
|
||||||
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
dnl University of Stuttgart. All rights reserved.
|
|
||||||
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
dnl All rights reserved.
|
|
||||||
dnl $COPYRIGHT$
|
|
||||||
dnl
|
|
||||||
dnl Additional copyrights may follow
|
|
||||||
dnl
|
|
||||||
dnl $HEADER$
|
|
||||||
dnl
|
|
||||||
|
|
||||||
# OMPI_F90_GET_ALIGNMENT(type, shell variable to set)
|
|
||||||
# ---------------------------------------------------
|
|
||||||
AC_DEFUN([OMPI_F90_GET_ALIGNMENT],[
|
|
||||||
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_alignment_$1])
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([alignment of Fortran 90 $1], type_var,
|
|
||||||
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_align_fn], [align])
|
|
||||||
# Fortran module
|
|
||||||
cat > conftestf.f90 <<EOF
|
|
||||||
program f90align
|
|
||||||
type TestAlign
|
|
||||||
character a
|
|
||||||
$1 :: x
|
|
||||||
end type
|
|
||||||
external align
|
|
||||||
type(TestAlign) :: a
|
|
||||||
call align(a%a, a%x)
|
|
||||||
end program
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# C module
|
|
||||||
if test -f conftest.h; then
|
|
||||||
ompi_conftest_h="#include \"conftest.h\""
|
|
||||||
else
|
|
||||||
ompi_conftest_h=""
|
|
||||||
fi
|
|
||||||
cat > conftest.c <<EOF
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
$conftest
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
void $ompi_ac_align_fn(char *a, char *x);
|
|
||||||
void $ompi_ac_align_fn(char *a, char *x)
|
|
||||||
{ int diff;
|
|
||||||
FILE *f=fopen("conftestval", "w");
|
|
||||||
if (!f) exit(1);
|
|
||||||
diff = a - x;
|
|
||||||
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
EOF
|
|
||||||
|
|
||||||
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
|
||||||
[OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftestf.f90 conftest.o -o conftest $LDFLAGS $LIBS],
|
|
||||||
[happy="yes"], [happy="no"])], [happy="no"])
|
|
||||||
|
|
||||||
if test "$happy" = "no" ; then
|
|
||||||
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
|
|
||||||
OMPI_LOG_FILE([conftestf.f90])
|
|
||||||
AC_MSG_WARN([Could not determine alignment of $1])
|
|
||||||
AC_MSG_WARN([See config.log for details])
|
|
||||||
AC_MSG_ERROR([Cannot continue])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_IF([test "$cross_compiling" = "yes"],
|
|
||||||
[AC_MSG_ERROR([Can not determine alignment of $1 when cross-compiling])],
|
|
||||||
[OMPI_LOG_COMMAND([./conftest],
|
|
||||||
[AS_VAR_SET(type_var, [`cat conftestval`])],
|
|
||||||
[AC_MSG_ERROR([Could not determine alignment of $1])])])
|
|
||||||
|
|
||||||
unset happy ompi_conf
|
|
||||||
rm -f conftest*])
|
|
||||||
|
|
||||||
$2=AS_VAR_GET([type_var])
|
|
||||||
AS_VAR_POPDEF([type_var])dnl
|
|
||||||
])
|
|
Загрузка…
Ссылка в новой задаче
Block a user