Commit c090a89f authored by Andreas Marek's avatar Andreas Marek

Prepare 2014.06.000: check for Fortran environment

Configure checks whether the Fortran environment module
is available. If yes, the library is build such, that all
messages (from within the library) are printed at the correct
stderr unit. If not, then the stderr unit is set to unit=6
parent b3d47d1e
......@@ -6,6 +6,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* can use module iso_fortran_env */
#undef HAVE_ISO_FORTRAN_ENV
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for elpa 2013.11.008.
# Generated by GNU Autoconf 2.69 for elpa 2014.06.000.
#
# Report bugs to <elpa-library@rzg.mpg.de>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='elpa'
PACKAGE_TARNAME='elpa'
PACKAGE_VERSION='2013.11.008'
PACKAGE_STRING='elpa 2013.11.008'
PACKAGE_VERSION='2014.06.000'
PACKAGE_STRING='elpa 2014.06.000'
PACKAGE_BUGREPORT='elpa-library@rzg.mpg.de'
PACKAGE_URL=''
......@@ -678,8 +678,6 @@ WITH_OPENMP_TRUE
FC_MODOUT
ac_empty
FC_MODINC
ELPA_SO_VERSION
ELPA_LIB_VERSION
FCFLAGS
ac_ct_FC
FC
......@@ -740,6 +738,8 @@ CC
FORTRAN_MODULE_DEPS
CPP_FOUND
ifGNUmake
ELPA_SO_VERSION
ELPA_LIB_VERSION
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
......@@ -1390,7 +1390,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures elpa 2013.11.008 to adapt to many kinds of systems.
\`configure' configures elpa 2014.06.000 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1460,7 +1460,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of elpa 2013.11.008:";;
short | recursive ) echo "Configuration of elpa 2014.06.000:";;
esac
cat <<\_ACEOF
......@@ -1599,7 +1599,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
elpa configure 2013.11.008
elpa configure 2014.06.000
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2082,7 +2082,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by elpa $as_me 2013.11.008, which was
It was created by elpa $as_me 2014.06.000, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2947,7 +2947,7 @@ fi
# Define the identity of the package.
PACKAGE='elpa'
VERSION='2013.11.008'
VERSION='2014.06.000'
cat >>confdefs.h <<_ACEOF
......@@ -3041,6 +3041,13 @@ fi
AM_BACKSLASH='\'
ELPA_LIB_VERSION=2014.06.000
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
ELPA_SO_VERSION=0:0:0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5
$as_echo_n "checking for GNU make... " >&6; }
if ${_cv_gnu_make_command+:} false; then :
......@@ -5913,14 +5920,6 @@ fi
ELPA_LIB_VERSION=2013.11.006
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
ELPA_SO_VERSION=0:0:0
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
......@@ -6213,6 +6212,27 @@ save_LDFLAGS=$LDFLAGS
FCFLAGS="$FCFLAGS $BLACS_FCFLAGS"
LDFLAGS="$LDFLAGS $BLACS_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Fortran module iso_fortran_env is available" >&5
$as_echo_n "checking whether Fortran module iso_fortran_env is available... " >&6; }
cat > conftest.$ac_ext <<_ACEOF
program test_error_unit
use ISO_FORTRAN_ENV, only : error_unit
implicit none
write(error_unit,*) "error_unit is defined"
end program
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
can_use_iso_fortran_env=yes
else
can_use_iso_fortran_env=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile a Fortran program using MKL" >&5
$as_echo_n "checking whether we can compile a Fortran program using MKL... " >&6; }
......@@ -6545,6 +6565,12 @@ FCFLAGS=$save_FCFLAGS
LDFLAGS=$save_LDFLAGS
if test "x${can_use_iso_fortran_env}" = "xyes" ; then
$as_echo "#define HAVE_ISO_FORTRAN_ENV 1" >>confdefs.h
fi
case `pwd` in
*\ * | *\ *)
......@@ -20809,7 +20835,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by elpa $as_me 2013.11.008, which was
This file was extended by elpa $as_me 2014.06.000, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -20875,7 +20901,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
elpa config.status 2013.11.008
elpa config.status 2014.06.000
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ([2.69])
AC_INIT([elpa],[2013.11.008], elpa-library@rzg.mpg.de)
AC_INIT([elpa],[2014.06.000], elpa-library@rzg.mpg.de)
AC_CONFIG_SRCDIR([src/elpa1.F90])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
......@@ -7,6 +7,11 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
AC_SUBST([ELPA_LIB_VERSION], [2014.06.000])
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
AC_SUBST([ELPA_SO_VERSION], [0:0:0])
AX_CHECK_GNU_MAKE()
if test x$_cv_gnu_make_command = x ; then
AC_MSG_ERROR([Need GNU Make])
......@@ -195,12 +200,6 @@ AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
AC_MSG_ERROR([no mpi found])
fi])
AC_SUBST([ELPA_LIB_VERSION], [2013.11.006])
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
AC_SUBST([ELPA_SO_VERSION], [0:0:0])
AC_FC_FREEFORM
AC_FC_MODULE_FLAG
AC_FC_MODULE_OUTPUT_FLAG
......@@ -235,6 +234,21 @@ save_LDFLAGS=$LDFLAGS
FCFLAGS="$FCFLAGS $BLACS_FCFLAGS"
LDFLAGS="$LDFLAGS $BLACS_LDFLAGS"
dnl check wheter fortran error_unit is defined
AC_MSG_CHECKING([whether Fortran module iso_fortran_env is available])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_error_unit
use ISO_FORTRAN_ENV, only : error_unit
implicit none
write(error_unit,*) "error_unit is defined"
end program
])],
[can_use_iso_fortran_env=yes],
[can_use_iso_fortran_env=no]
)
dnl check whether one can link with specified MKL (desired method)
AC_MSG_CHECKING([whether we can compile a Fortran program using MKL])
......@@ -331,6 +345,11 @@ FCFLAGS=$save_FCFLAGS
LDFLAGS=$save_LDFLAGS
dnl set the conditionals according to the previous tests
if test "x${can_use_iso_fortran_env}" = "xyes" ; then
AC_DEFINE([HAVE_ISO_FORTRAN_ENV],[1],[can use module iso_fortran_env])
fi
LT_INIT
......
......@@ -50,7 +50,9 @@
module ELPA1
! Version 1.1.2, 2011-02-21
#ifdef HAVE_ISO_FORTRAN_ENV
use iso_fortran_env, only : error_unit
#endif
implicit none
......@@ -85,6 +87,10 @@ module ELPA1
public :: hh_transform_real
public :: hh_transform_complex
#ifndef HAVE_ISO_FORTRAN_ENV
integer, parameter :: error_unit = 6
#endif
!-------------------------------------------------------------------------------
! Timing results, set by every call to solve_evp_xxx
......@@ -199,19 +205,19 @@ subroutine solve_evp_real(na, nev, a, lda, ev, q, ldq, nblk, mpi_comm_rows, mpi_
ttt0 = MPI_Wtime()
call tridiag_real(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols, ev, e, tau)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time tridiag_real :',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time tridiag_real :',ttt1-ttt0
time_evp_fwd = ttt1-ttt0
ttt0 = MPI_Wtime()
call solve_tridi(na, nev, ev, e, q, ldq, nblk, mpi_comm_rows, mpi_comm_cols)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time solve_tridi :',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time solve_tridi :',ttt1-ttt0
time_evp_solve = ttt1-ttt0
ttt0 = MPI_Wtime()
call trans_ev_real(na, nev, a, lda, tau, q, ldq, nblk, mpi_comm_rows, mpi_comm_cols)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time trans_ev_real:',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time trans_ev_real:',ttt1-ttt0
time_evp_back = ttt1-ttt0
deallocate(e, tau)
......@@ -285,13 +291,13 @@ subroutine solve_evp_complex(na, nev, a, lda, ev, q, ldq, nblk, mpi_comm_rows, m
ttt0 = MPI_Wtime()
call tridiag_complex(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols, ev, e, tau)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time tridiag_complex :',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time tridiag_complex :',ttt1-ttt0
time_evp_fwd = ttt1-ttt0
ttt0 = MPI_Wtime()
call solve_tridi(na, nev, ev, e, q_real, l_rows, nblk, mpi_comm_rows, mpi_comm_cols)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time solve_tridi :',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time solve_tridi :',ttt1-ttt0
time_evp_solve = ttt1-ttt0
ttt0 = MPI_Wtime()
......@@ -299,7 +305,7 @@ subroutine solve_evp_complex(na, nev, a, lda, ev, q, ldq, nblk, mpi_comm_rows, m
call trans_ev_complex(na, nev, a, lda, tau, q, ldq, nblk, mpi_comm_rows, mpi_comm_cols)
ttt1 = MPI_Wtime()
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) print *,'Time trans_ev_complex:',ttt1-ttt0
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time trans_ev_complex:',ttt1-ttt0
time_evp_back = ttt1-ttt0
deallocate(q_real)
......@@ -1800,7 +1806,7 @@ subroutine solve_tridi( na, nev, d, e, q, ldq, nblk, mpi_comm_rows, mpi_comm_col
! Scalapack supports it but delivers no results for these columns,
! which is rather annoying
if(nc==0) then
print *,'ERROR: Problem contains processor column with zero width'
write(error_unit,*) 'ERROR: Problem contains processor column with zero width'
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -1888,7 +1894,7 @@ recursive subroutine merge_recursive(np_off, nprocs)
if(nprocs<=1) then
! Safety check only
print *,"INTERNAL error merge_recursive: nprocs=",nprocs
write(error_unit,*) "INTERNAL error merge_recursive: nprocs=",nprocs
call mpi_abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -2144,7 +2150,7 @@ subroutine solve_tridi_single(nlen, d, e, q, ldq)
! DSTEDC failed, try DSTEQR. The workspace is enough for DSTEQR.
print '(a,i8,a)','Warning: Lapack routine DSTEDC failed, info= ',info,', Trying DSTEQR!'
write(error_unit,'(a,i8,a)') 'Warning: Lapack routine DSTEDC failed, info= ',info,', Trying DSTEQR!'
d(:) = ds(:)
e(:) = es(:)
......@@ -2152,7 +2158,7 @@ subroutine solve_tridi_single(nlen, d, e, q, ldq)
! If DSTEQR fails also, we don't know what to do further ...
if(info /= 0) then
print '(a,i8,a)','ERROR: Lapack routine DSTEQR failed, info= ',info,', Aborting!'
write(error_unit,'(a,i8,a)') 'ERROR: Lapack routine DSTEQR failed, info= ',info,', Aborting!'
call mpi_abort(mpi_comm_world,0,mpierr)
endif
......@@ -2166,12 +2172,12 @@ subroutine solve_tridi_single(nlen, d, e, q, ldq)
do i=1,nlen-1
if(d(i+1)<d(i)) then
if (abs(d(i+1) - d(i)) / abs(d(i+1) + d(i)) > 1d-14) then
print '(a,i8,2g25.16)','***WARNING: Monotony error dste**:',i+1,d(i),d(i+1)
write(error_unit,'(a,i8,2g25.16)') '***WARNING: Monotony error dste**:',i+1,d(i),d(i+1)
else
print '(a,i8,2g25.16)','Info: Monotony error dste{dc,qr}:',i+1,d(i),d(i+1)
print '(a)', 'The eigenvalues from a lapack call are not sorted to machine precision.'
print '(a)', 'In this extent, this is completely harmless.'
print '(a)', 'Still, we keep this info message just in case.'
write(error_unit,'(a,i8,2g25.16)') 'Info: Monotony error dste{dc,qr}:',i+1,d(i),d(i+1)
write(error_unit,'(a)') 'The eigenvalues from a lapack call are not sorted to machine precision.'
write(error_unit,'(a)') 'In this extent, this is completely harmless.'
write(error_unit,'(a)') 'Still, we keep this info message just in case.'
end if
allocate(qtmp(nlen))
dtmp = d(i+1)
......@@ -3016,7 +3022,7 @@ subroutine check_monotony(n,d,text)
do i=1,n-1
if(d(i+1)<d(i)) then
print '(a,a,i8,2g25.17)','Monotony error on ',text,i,d(i),d(i+1)
write(error_unit,'(a,a,i8,2g25.17)') 'Monotony error on ',text,i,d(i),d(i+1)
call mpi_abort(mpi_comm_world,0,mpierr)
endif
enddo
......@@ -3353,7 +3359,7 @@ subroutine cholesky_real(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call dpotrf('U',na-n+1,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in dpotrf"
write(error_unit,*) "Error in dpotrf"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -3373,7 +3379,7 @@ subroutine cholesky_real(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call dpotrf('U',nblk,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in dpotrf"
write(error_unit,*) "Error in dpotrf"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -3518,7 +3524,7 @@ subroutine invert_trm_real(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call DTRTRI('U','N',nb,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in DTRTRI"
write(error_unit,*) "Error in DTRTRI"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -3663,7 +3669,7 @@ subroutine cholesky_complex(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call zpotrf('U',na-n+1,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in zpotrf"
write(error_unit,*) "Error in zpotrf"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -3683,7 +3689,7 @@ subroutine cholesky_complex(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call zpotrf('U',nblk,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in zpotrf"
write(error_unit,*) "Error in zpotrf"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......@@ -3829,7 +3835,7 @@ subroutine invert_trm_complex(na, a, lda, nblk, mpi_comm_rows, mpi_comm_cols)
call ZTRTRI('U','N',nb,a(l_row1,l_col1),lda,info)
if(info/=0) then
print *,"Error in ZTRTRI"
write(error_unit,*) "Error in ZTRTRI"
call MPI_Abort(MPI_COMM_WORLD,1,mpierr)
endif
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment