Commit 54d12975 authored by Andreas Marek's avatar Andreas Marek

Merge branch 'master_pre_stage' of https://gitlab.mpcdf.mpg.de/elpa/elpa into master_pre_stage

parents 50a8623c 734ab46b
#
# spec file for package elpa
#
# Copyright (c) 2015 Lorenz Hüdepohl
# Copyright (c) 2015 Lorenz Huedepohl
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
......@@ -15,21 +15,8 @@
%define so_version 8
# OpenMP support requires an MPI implementation with MPI_THREAD_MULTIPLE support,
# which is only available for a sufficiently configured openmpi >= 1.8
# Set to 0 to disable
%define with_openmp 1
# Logic to figure out if we are on SLES-11-SP4, which need special
# treatment (custom compiler package name, old RPM macros)
%if 0%{suse_version} > 0
%if 0%{suse_version} <= 1110
%define sle_11_sp4 1
%else
%define sle_11_sp4 0
%endif
%else
%define sle_11_sp4 0
%endif
# which is currently not provided at OpenSUSE
%define with_openmp 0
Name: elpa
Version: 2017.11.001.rc1
......@@ -40,12 +27,7 @@ Group: System/Libraries
Url: https://elpa.rzg.mpg.de/
Source0: https://elpa.mpcdf.mpg.de/html/Releases/%{version}/%{name}-%{version}.tar.gz
BuildRequires: c_compiler
# For SLE_11_SP4:
%if %{sle_11_sp4} == 1
BuildRequires: gcc48-fortran
%else
BuildRequires: gcc-fortran >= 4.8
%endif
BuildRequires: openmpi-devel
Requires: openmpi
BuildRequires: blas-devel
......@@ -191,6 +173,10 @@ that use %{name}_openmp.
%if %{defined fedora}
module load mpi/openmpi-%{_arch}
%endif
%if %{defined suse_version}
. %{_libdir}/mpi/gcc/openmpi/bin/mpivars.sh
%endif
if [ ! -e configure ] ; then
# It is possible to use the Open Build Server to automatically
# checkout from git directly, extract this spec file and set the
......@@ -204,35 +190,16 @@ if [ ! -e configure ] ; then
./autogen.sh
fi
# Set-up compilers for SLE_11_SP4
%if %{sle_11_sp4} == 1
mkdir compilers
pushd compilers
ln -s /usr/bin/gfortran-4.8 gfortran
ln -s /usr/bin/gcc-4.8 gcc
export PATH=$PWD:$PATH
pushd
%endif
# Normal build
mkdir build
pushd build
%define _configure ../configure
# ancient SLE_11_SP4 cannot deal with configure in sub-directory
# via _configure macro
%if %{sle_11_sp4} == 1
ln -s ../configure .
%endif
%configure \
%ifarch i386 i486 i586 i686 x86_64
CFLAGS="$CFLAGS -msse4.2" \
FCFLAGS="$FFLAGS $FCFLAGS -msse4.2" \
%endif
%if %{sle_11_sp4} == 1
--disable-mpi-module \
%endif
%ifnarch i386 i486 i586 i686 x86_64
--disable-sse \
--disable-sse-assembly \
......@@ -251,20 +218,11 @@ popd
mkdir build_openmp
pushd build_openmp
# ancient SLE_11_SP4 cannot deal with configure in sub-directory
# via _configure macro
%if %{?suse_version:%{suse_version}}%{!?suse_version:1200} <= 1110
ln -s ../configure .
%endif
%configure \
%ifarch i386 i486 i586 i686 x86_64
CFLAGS="$CFLAGS -msse4.2" \
FCFLAGS="$FFLAGS $FCFLAGS -msse4.2" \
%endif
%if %{sle_11_sp4} == 1
--disable-mpi-module \
%endif
%ifnarch i386 i486 i586 i686 x86_64
--disable-sse \
--disable-sse-assembly \
......@@ -285,6 +243,9 @@ popd
%if %{defined fedora}
module load mpi/openmpi-%{_arch}
%endif
%if %{defined suse_version}
. %{_libdir}/mpi/gcc/openmpi/bin/mpivars.sh
%endif
pushd build
make check TEST_FLAGS="1500 50 16" || { echo "Tests failed: Content of ./test-suite.log:"; cat ./test-suite.log; echo; exit 1; }
......
......@@ -2605,10 +2605,10 @@ module elpa_impl
!> \brief function to setup the ELPA autotuning and create the autotune object
!> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object
!> \param self the allocated ELPA object
!> \param level integer: the "thoroughness" of the planed autotuning
!> \param domain integer: the domain (real/complex) which should be tuned
!> \result tune_state class(elpa_autotune_t): the created autotuning object
!> \result tune_state the created autotuning object
function elpa_autotune_setup(self, level, domain, error) result(tune_state)
class(elpa_impl_t), intent(inout), target :: self
integer, intent(in) :: level, domain
......@@ -2677,18 +2677,15 @@ module elpa_impl
integer(kind=c_int) , intent(in) :: error
#endif
print *,"Calling c_f_pointer handle"
call c_f_pointer(handle, self)
print *,"Calling setup"
print *,level,domain
tune_state => self%autotune_setup(level, domain, error)
print *,"After setup"
select type(tune_state)
class is (elpa_autotune_impl_t)
type is (elpa_autotune_impl_t)
obj => tune_state
class default
print *, "This should not happen"
stop
end select
ptr = c_loc(obj)
......@@ -2710,7 +2707,7 @@ module elpa_impl
real(kind=C_DOUBLE) :: time_spent
select type(tune_state)
class is (elpa_autotune_impl_t)
type is (elpa_autotune_impl_t)
ts_impl => tune_state
class default
print *, "This should not happen"
......@@ -2780,7 +2777,7 @@ module elpa_impl
type(elpa_autotune_impl_t), pointer :: ts_impl
select type(tune_state)
class is (elpa_autotune_impl_t)
type is (elpa_autotune_impl_t)
ts_impl => tune_state
class default
print *, "This should not happen"
......
......@@ -95,6 +95,7 @@ int main(int argc, char** argv) {
int np_cols, np_rows;
int my_prow, my_pcol;
int mpi_comm;
int provided_mpi_thread_level;
/* blacs */
int my_blacs_ctxt, sc_desc[9], info;
......@@ -109,9 +110,21 @@ int main(int argc, char** argv) {
int value;
#ifdef WITH_MPI
#ifndef WITH_OPENMP
MPI_Init(&argc, &argv);
#else
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided_mpi_thread_level);
if (provided_mpi_thread_level != MPI_THREAD_MULTIPLE) {
fprintf(stderr, "MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system\n");
MPI_Finalize();
exit(77);
}
#endif
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
#else
nprocs = 1;
myid = 0;
......
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