Commit 94020ebc authored by Andreas Marek's avatar Andreas Marek

ELPA_development_version_qr: Changes in OpenMP detection

The Intel Fortran compiler accepts the flag "-fopenmp" for compilation
with OpenMP. However, the Intel MPI compiler wrapper does not.
With the Intel compiler, this leads to the fact, that if ELPA is compiled
with the "-fopenmp" flag a not thread-save version of the Intel MPI
library is used and the test (with make check) fails.

Intel promised to solve this in the future.

However, for now the problem is solved in the user friendly way that no
manipulation of the MPI compiler wrappers have to be done:

For detecting the OpenMP compiler flags, instead of the predefined
macro "AC_OPENMP" of autoconf a modified macro "AX_ELPA_OPENMP"
is used, which first checks "-openmp" and only then "-fopenmp".
Thus it is ensured that the Intel compiler (and mpi compiler wrapper)
does not get confused.

This is invisible for users calling "configure" during the installation
process.
parent b34a5a9c
......@@ -149,9 +149,9 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/ax_elpa_openmp.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/fdep/fortran_dependencies.m4 \
$(top_srcdir)/m4/ax_prog_fc_mpi.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
......
......@@ -1149,6 +1149,7 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/ax_check_gnu_make.m4])
m4_include([m4/ax_elpa_openmp.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for elpa 2013.08.001.
# Generated by GNU Autoconf 2.69 for elpa 2013.08.002.
#
# 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.08.001'
PACKAGE_STRING='elpa 2013.08.001'
PACKAGE_VERSION='2013.08.002'
PACKAGE_STRING='elpa 2013.08.002'
PACKAGE_BUGREPORT='elpa-library@rzg.mpg.de'
PACKAGE_URL=''
......@@ -1393,7 +1393,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.08.001 to adapt to many kinds of systems.
\`configure' configures elpa 2013.08.002 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1463,7 +1463,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of elpa 2013.08.001:";;
short | recursive ) echo "Configuration of elpa 2013.08.002:";;
esac
cat <<\_ACEOF
......@@ -1603,7 +1603,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
elpa configure 2013.08.001
elpa configure 2013.08.002
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2086,7 +2086,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.08.001, which was
It was created by elpa $as_me 2013.08.002, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2951,7 +2951,7 @@ fi
# Define the identity of the package.
PACKAGE='elpa'
VERSION='2013.08.001'
VERSION='2013.08.002'
cat >>confdefs.h <<_ACEOF
......@@ -5918,7 +5918,7 @@ fi
ELPA_LIB_VERSION=2013.11.001
ELPA_LIB_VERSION=2013.11.002
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
......@@ -6156,38 +6156,27 @@ if test "${enable_openmp+set}" = set; then :
fi
if test "$enable_openmp" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $FC option to support OpenMP" >&5
$as_echo_n "checking for $FC option to support OpenMP... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to support OpenMP" >&5
$as_echo_n "checking for $CC option to support OpenMP... " >&6; }
if ${ac_cv_prog_fc_openmp+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.$ac_ext <<_ACEOF
program main
implicit none
!$ integer tid
tid = 42
call omp_set_num_threads(2)
call omp_get_num_threads
end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
ac_cv_prog_fc_openmp='none needed'
else
ac_cv_prog_fc_openmp='unsupported'
for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \
-Popenmp --openmp; do
for ac_option in -openmp -fopenmp -xopenmp -mp -omp -qsmp=omp; do
ac_save_FCFLAGS=$FCFLAGS
FCFLAGS="$FCFLAGS $ac_option"
cat > conftest.$ac_ext <<_ACEOF
program main
implicit none
!$ integer tid
tid = 42
call omp_set_num_threads(2)
call omp_get_num_threads
end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
ac_cv_prog_fc_openmp=$ac_option
......@@ -20825,7 +20814,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.08.001, which was
This file was extended by elpa $as_me 2013.08.002, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -20891,7 +20880,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.08.001
elpa config.status 2013.08.002
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ([2.69])
AC_INIT([elpa],[2013.08.001], elpa-library@rzg.mpg.de)
AC_INIT([elpa],[2013.08.002], elpa-library@rzg.mpg.de)
AC_CONFIG_SRCDIR([src/elpa1.F90])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
......@@ -196,7 +196,7 @@ AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
fi])
AC_SUBST([ELPA_LIB_VERSION], [2013.11.001])
AC_SUBST([ELPA_LIB_VERSION], [2013.11.002])
# 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])
......@@ -220,7 +220,7 @@ AC_ARG_WITH([openmp],
AM_CONDITIONAL([WITH_OPENMP],[test x"$with_openmp" = x"yes"])
if test "x${with_openmp}" = xyes; then
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
AC_OPENMP
AX_ELPA_OPENMP
fi
AC_MSG_CHECKING(whether QR-decomposition usage is specified)
......
# openmp.m4 serial 4
dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file can be removed once we assume autoconf >= 2.62.
# _AX_ELPA_LANG_OPENMP
# ---------------
# Expands to some language dependent source code for testing the presence of
# OpenMP.
AC_DEFUN([_AX_ELPA_LANG_OPENMP],
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
# _AC_LANG_OPENMP(C)
# ------------------
m4_define([_AX_ELPA_LANG_OPENMP(C)],
[
#ifndef _OPENMP
choke me
#endif
#include <omp.h>
int main () { return omp_get_num_threads (); }
])
# _AX_ELPA_LANG_OPENMP(C++)
# --------------------
m4_copy([_AX_ELPA_LANG_OPENMP(C)], [_AX_ELPA_LANG_OPENMP(C++)])
# _AX_ELPA_LANG_OPENMP(Fortran 77)
# ---------------------------
m4_define([_AX_ELPA_LANG_OPENMP(Fortran 77)],
[AC_LANG_FUNC_LINK_TRY([omp_get_num_threads])])
# _AX_ELPA_LANG_OPENMP(Fortran)
# ---------------------------
m4_copy([_AX_ELPA_LANG_OPENMP(Fortran 77)], [_AX_ELPA_LANG_OPENMP(Fortran)])
# AC_ELPPA_OPENMP
# ---------
# Check which options need to be passed to the C compiler to support OpenMP.
# Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these
# options.
# The options are necessary at compile time (so the #pragmas are understood)
# and at link time (so the appropriate library is linked with).
# This macro takes care to not produce redundant options if $CC $CFLAGS already
# supports OpenMP. It also is careful to not pass options to compilers that
# misinterpret them; for example, most compilers accept "-openmp" and create
# an output file called 'penmp' rather than activating OpenMP support.
AC_DEFUN([AX_ELPA_OPENMP],
[
OPENMP_[]_AC_LANG_PREFIX[]FLAGS=
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])
if test "$enable_openmp" != no; then
AC_CACHE_CHECK([for $CC option to support OpenMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
[AC_LINK_IFELSE([_AX_ELPA_LANG_OPENMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'
dnl Try these flags:
dnl GCC >= 4.2 -fopenmp
dnl SunPRO C -xopenmp
dnl Intel C -openmp
dnl SGI C, PGI C -mp
dnl Tru64 Compaq C -omp
dnl IBM C (AIX, Linux) -qsmp=omp
dnl If in this loop a compiler is passed an option that it doesn't
dnl understand or that it misinterprets, the AC_LINK_IFELSE test
dnl will fail (since we know that it failed without the option),
dnl therefore the loop will continue searching for an option, and
dnl no output file called 'penmp' or 'mp' is created.
for ac_option in -openmp -fopenmp -xopenmp -mp -omp -qsmp=omp; do
ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option"
AC_LINK_IFELSE([_AX_ELPA_LANG_OPENMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option])
_AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS
if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then
break
fi
done])])
case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #(
"none needed" | unsupported)
;; #(
*)
OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;;
esac
fi
AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS])
])
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