Commit 3e42d4be authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Working version of ELPA with new API

Still missing is the compatibility layer, currently it only compiles
when configure is called with

  --disable-legacy

Also, a more general solution to parameter passing via environment
variables would be nice.
parent 341f75d6
This diff is collapsed.
......@@ -4,7 +4,7 @@ AC_PREREQ([2.69])
AC_INIT([elpa],m4_esyscmd_s([awk '/^ *Version:/ {print $2;}' elpa.spec]), [elpa-library@mpcdf.mpg.de])
AC_SUBST([PACKAGE_VERSION])
AC_CONFIG_SRCDIR([src/elpa_t.F90])
AC_CONFIG_SRCDIR([src/elpa.F90])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
......@@ -12,6 +12,8 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
# ABI version
#
# Set the libtool library version, see LIBRARY_INTERFACE
#
# See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
......@@ -26,7 +28,10 @@ AM_SILENT_RULES([yes])
# were added by the new interface)
#
AC_SUBST([ELPA_SO_VERSION], [8:0:0])
#
# API Version
AC_DEFINE([EARLIEST_API_VERSION], [20170403], [Earliest supported ELPA API version])
AC_DEFINE([CURRENT_API_VERSION], [20170403], [Current ELPA API version])
AX_CHECK_GNU_MAKE()
......@@ -34,10 +39,12 @@ if test x$_cv_gnu_make_command = x ; then
AC_MSG_ERROR([Need GNU Make])
fi
#AC_CHECK_PROG(CPP_FOUND,cpp,yes,no)
#if test x"${CPP_FOUND}" = xno; then
# AC_MSG_ERROR([no cpp found])
#fi
AC_ARG_ENABLE([legacy],
AS_HELP_STRING([--disable-legacy],
[do not build legacy API, default yes]),
[],
[enable_legacy=yes])
AM_CONDITIONAL([ENABLE_LEGACY],[test x"$enable_legacy" = x"yes"])
# gnu-make fortran module dependencies
m4_include([fdep/fortran_dependencies.m4])
......@@ -352,7 +359,8 @@ use_band_to_full_blocking=yes
AC_MSG_CHECKING(whether BAND_TO_FLULL_BLOCKING is requested)
AC_ARG_ENABLE(band-to-full-blocking,[AS_HELP_STRING([--enable-band-to-full-blocking],
[build ELPA2 with blocking in band_to_full (default: enabled)])],
want_band_to_full_blocking="yes", want_to_full_blocking="no")
[want_band_to_full_blocking="yes"],
[want_to_full_blocking="no"])
AC_MSG_RESULT([${want_band_to_full_blocking}])
if test x"${enableval}" = x"no" ; then
......@@ -633,7 +641,7 @@ m4_foreach_w([elpa_m4_kind],[real complex],[
fi
# find the number of this kernel
ELPA_2STAGE_[]m4_toupper(elpa_m4_kind)[]_DEFAULT=`grep -i '^ *X(ELPA_2STAGE_'$default_[]elpa_m4_kind[]_kernel'\>' $srcdir/elpa/elpa_constants.h.in | \
awk '// { gsub(/.*, */, ""); gsub(/).*/, ""); print;}'`
awk '// { gsub(/^[[^,]]*, */, ""); gsub(/,.*/, ""); print;}'`
AC_SUBST([ELPA_2STAGE_]m4_toupper(elpa_m4_kind)[_DEFAULT])
])
......@@ -835,14 +843,26 @@ m4_foreach_w([elpa_m4_kernel],elpa_m4_all_kernels,[
AM_CONDITIONAL([WITH_]m4_toupper(elpa_m4_kernel)[_KERNEL],[test x"$use_[]elpa_m4_kernel[]" = x"yes"])
if test x"$use_[]elpa_m4_kernel[]" = x"yes" ; then
AC_DEFINE([WITH_]m4_toupper(elpa_m4_kernel)[_KERNEL],[1],[Build elpa_m4_kernel kernel])
kernel_defined=1
else
kernel_defined=0
fi
[ELPA_2STAGE_]m4_toupper(elpa_m4_kernel)[_COMPILED]=$kernel_defined
AC_SUBST([ELPA_2STAGE_]m4_toupper(elpa_m4_kernel)[_COMPILED])
])
AM_CONDITIONAL([WITH_GPU_VERSION],[test x"$use_gpu" = x"yes"])
if test x"${use_gpu}" = x"yes" ; then
AC_DEFINE([WITH_GPU_VERSION],[1],[enable GPU support])
ELPA_2STAGE_COMPLEX_GPU_COMPILED=1
ELPA_2STAGE_REAL_GPU_COMPILED=1
else
ELPA_2STAGE_COMPLEX_GPU_COMPILED=0
ELPA_2STAGE_REAL_GPU_COMPILED=0
fi
AC_SUBST([ELPA_2STAGE_COMPLEX_GPU_COMPILED])
AC_SUBST([ELPA_2STAGE_REAL_GPU_COMPILED])
LT_INIT
......@@ -879,7 +899,6 @@ AM_CONDITIONAL([WANT_SINGLE_PRECISION_COMPLEX],[test x"$want_single_precision" =
AC_SUBST([MPI_BINARY])
AC_SUBST([WITH_MKL])
AC_SUBST([WITH_BLACS])
AC_SUBST([with_amd_bulldozer_kernel])
AC_SUBST([FC_MODINC])
AC_SUBST([FC_MODOUT])
AC_SUBST([OPENMP_CFLAGS])
......@@ -887,8 +906,9 @@ AC_SUBST([OPENMP_FCFLAGS])
AC_SUBST([OPENMP_LDFLAGS])
AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
rm -rf modules/ private_modules/ .fortran_dependencies/
mkdir modules private_modules
#rm -rf modules/ private_modules/ .fortran_dependencies/
mkdir -p modules private_modules
#gl_VISIBILITY
#AH_BOTTOM([#if HAVE_VISIBILITY
......@@ -990,3 +1010,6 @@ echo "* the next stable release. *"
echo "***********************************************************************"
echo " "
make -f $srcdir/generated_headers.am generated-headers top_srcdir="$srcdir"
echo "TODO: Check crazy BAND_TO_FULL_BLOCKING flags"
......@@ -6,4 +6,6 @@
#include <elpa/elpa_constants.h>
#include <elpa/elpa_generated.h>
const char *elpa_strerr(int elpa_error);
#endif
......@@ -5,83 +5,95 @@
*/
/* Private helper macros */
#define ELPA_ENUM_ENTRY(name, value) \
#define ELPA_ENUM_ENTRY(name, value, ...) \
name = value,
#define ELPA_ENUM_SUM(name, value) +1
#define ELPA_ENUM_SUM(name, value, ...) +1
/* Solver constants */
#define ELPA_SOLVER_MAP(X) \
#define ELPA_FOR_ALL_SOLVERS(X) \
X(ELPA_SOLVER_1STAGE, 1) \
X(ELPA_SOLVER_2STAGE, 2)
enum ELPA_SOLVERS {
ELPA_SOLVER_MAP(ELPA_ENUM_ENTRY)
ELPA_FOR_ALL_SOLVERS(ELPA_ENUM_ENTRY)
};
#define ELPA_NUMBER_OF_SOLVERS (0 ELPA_SOLVER_MAP(ELPA_ENUM_SUM))
#define ELPA_NUMBER_OF_SOLVERS (0 ELPA_FOR_ALL_SOLVERS(ELPA_ENUM_SUM))
/* Kernel constants */
#define ELPA_REAL_KERNEL_MAP(X) \
X(ELPA_2STAGE_REAL_GENERIC, 1) \
X(ELPA_2STAGE_REAL_GENERIC_SIMPLE, 2) \
X(ELPA_2STAGE_REAL_BGP, 3) \
X(ELPA_2STAGE_REAL_BGQ, 4) \
X(ELPA_2STAGE_REAL_SSE, 5) \
X(ELPA_2STAGE_REAL_SSE_BLOCK2, 6) \
X(ELPA_2STAGE_REAL_SSE_BLOCK4, 7) \
X(ELPA_2STAGE_REAL_SSE_BLOCK6, 8) \
X(ELPA_2STAGE_REAL_AVX_BLOCK2, 9) \
X(ELPA_2STAGE_REAL_AVX_BLOCK4, 10) \
X(ELPA_2STAGE_REAL_AVX_BLOCK6, 11) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK2, 12) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK4, 13) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK6, 14) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK2, 15) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK4, 16) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK6, 17) \
X(ELPA_2STAGE_REAL_GPU, 18) \
X(ELPA_2STAGE_REAL_DEFAULT, @ELPA_2STAGE_REAL_DEFAULT@)
#define ELPA_FOR_ALL_2STAGE_REAL_KERNELS(X) \
X(ELPA_2STAGE_REAL_GENERIC, 1, @ELPA_2STAGE_REAL_GENERIC_COMPILED@) \
X(ELPA_2STAGE_REAL_GENERIC_SIMPLE, 2, @ELPA_2STAGE_REAL_GENERIC_SIMPLE_COMPILED@) \
X(ELPA_2STAGE_REAL_BGP, 3, @ELPA_2STAGE_REAL_BGP_COMPILED@) \
X(ELPA_2STAGE_REAL_BGQ, 4, @ELPA_2STAGE_REAL_BGQ_COMPILED@) \
X(ELPA_2STAGE_REAL_SSE_ASSEMBLY, 5, @ELPA_2STAGE_REAL_SSE_ASSEMBLY_COMPILED@) \
X(ELPA_2STAGE_REAL_SSE_BLOCK2, 6, @ELPA_2STAGE_REAL_SSE_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_REAL_SSE_BLOCK4, 7, @ELPA_2STAGE_REAL_SSE_BLOCK4_COMPILED@) \
X(ELPA_2STAGE_REAL_SSE_BLOCK6, 8, @ELPA_2STAGE_REAL_SSE_BLOCK6_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX_BLOCK2, 9, @ELPA_2STAGE_REAL_AVX_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX_BLOCK4, 10, @ELPA_2STAGE_REAL_AVX_BLOCK4_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX_BLOCK6, 11, @ELPA_2STAGE_REAL_AVX_BLOCK6_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK2, 12, @ELPA_2STAGE_REAL_AVX2_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK4, 13, @ELPA_2STAGE_REAL_AVX2_BLOCK4_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX2_BLOCK6, 14, @ELPA_2STAGE_REAL_AVX2_BLOCK6_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK2, 15, @ELPA_2STAGE_REAL_AVX512_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK4, 16, @ELPA_2STAGE_REAL_AVX512_BLOCK4_COMPILED@) \
X(ELPA_2STAGE_REAL_AVX512_BLOCK6, 17, @ELPA_2STAGE_REAL_AVX512_BLOCK6_COMPILED@) \
X(ELPA_2STAGE_REAL_GPU, 18, @ELPA_2STAGE_REAL_GPU_COMPILED@)
#define ELPA_FOR_ALL_2STAGE_REAL_KERNELS_AND_DEFAULT(X) \
ELPA_FOR_ALL_2STAGE_REAL_KERNELS(X) \
X(ELPA_2STAGE_REAL_INVALID, -1, choke me) \
X(ELPA_2STAGE_REAL_DEFAULT, @ELPA_2STAGE_REAL_DEFAULT@, choke me)
enum ELPA_REAL_KERNELS {
ELPA_REAL_KERNEL_MAP(ELPA_ENUM_ENTRY)
ELPA_FOR_ALL_2STAGE_REAL_KERNELS_AND_DEFAULT(ELPA_ENUM_ENTRY)
};
#define ELPA_COMPLEX_KERNEL_MAP(X) \
X(ELPA_2STAGE_COMPLEX_GENERIC, 1) \
X(ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE, 2) \
X(ELPA_2STAGE_COMPLEX_BGP, 3) \
X(ELPA_2STAGE_COMPLEX_BGQ, 4) \
X(ELPA_2STAGE_COMPLEX_SSE, 5) \
X(ELPA_2STAGE_COMPLEX_SSE_BLOCK1, 6) \
X(ELPA_2STAGE_COMPLEX_SSE_BLOCK2, 7) \
X(ELPA_2STAGE_COMPLEX_AVX_BLOCK1, 8) \
X(ELPA_2STAGE_COMPLEX_AVX_BLOCK2, 9) \
X(ELPA_2STAGE_COMPLEX_AVX2_BLOCK1, 10) \
X(ELPA_2STAGE_COMPLEX_AVX2_BLOCK2, 11) \
X(ELPA_2STAGE_COMPLEX_AVX512_BLOCK1, 12) \
X(ELPA_2STAGE_COMPLEX_AVX512_BLOCK2, 13) \
X(ELPA_2STAGE_COMPLEX_GPU, 14) \
X(ELPA_2STAGE_COMPLEX_DEFAULT, @ELPA_2STAGE_COMPLEX_DEFAULT@)
#define ELPA_FOR_ALL_2STAGE_COMPLEX_KERNELS(X) \
X(ELPA_2STAGE_COMPLEX_GENERIC, 1, @ELPA_2STAGE_COMPLEX_GENERIC_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE, 2, @ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_BGP, 3, @ELPA_2STAGE_COMPLEX_BGP_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_BGQ, 4, @ELPA_2STAGE_COMPLEX_BGQ_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY, 5, @ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_SSE_BLOCK1, 6, @ELPA_2STAGE_COMPLEX_SSE_BLOCK1_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_SSE_BLOCK2, 7, @ELPA_2STAGE_COMPLEX_SSE_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX_BLOCK1, 8, @ELPA_2STAGE_COMPLEX_AVX_BLOCK1_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX_BLOCK2, 9, @ELPA_2STAGE_COMPLEX_AVX_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX2_BLOCK1, 10, @ELPA_2STAGE_COMPLEX_AVX2_BLOCK1_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX2_BLOCK2, 11, @ELPA_2STAGE_COMPLEX_AVX2_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX512_BLOCK1, 12, @ELPA_2STAGE_COMPLEX_AVX512_BLOCK1_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_AVX512_BLOCK2, 13, @ELPA_2STAGE_COMPLEX_AVX512_BLOCK2_COMPILED@) \
X(ELPA_2STAGE_COMPLEX_GPU, 14, @ELPA_2STAGE_COMPLEX_GPU_COMPILED@)
#define ELPA_FOR_ALL_2STAGE_COMPLEX_KERNELS_AND_DEFAULT(X) \
ELPA_FOR_ALL_2STAGE_COMPLEX_KERNELS(X) \
X(ELPA_2STAGE_COMPLEX_INVALID, -1, choke me) \
X(ELPA_2STAGE_COMPLEX_DEFAULT, @ELPA_2STAGE_COMPLEX_DEFAULT@, choke me)
enum ELPA_COMPLEX_KERNELS {
ELPA_COMPLEX_KERNEL_MAP(ELPA_ENUM_ENTRY)
ELPA_FOR_ALL_2STAGE_COMPLEX_KERNELS_AND_DEFAULT(ELPA_ENUM_ENTRY)
};
/* General constants */
#define ELPA_CONSTANTS_MAP(X) \
#define ELPA_FOR_ALL_ERRORS(X) \
X(ELPA_OK, 0) \
X(ELPA_ERROR, -1) \
X(ELPA_NO, 0) \
X(ELPA_OK, 1)
X(ELPA_ERROR_ENTRY_NOT_FOUND, -2) \
X(ELPA_ERROR_INVALID_VALUE, -3) \
X(ELPA_ERROR_VALUE_ALREADY_SET, -4) \
X(ELPA_ERROR_NO_STRING_REPRESENTATION, -5)
enum ELPA_CONSTANTS {
ELPA_CONSTANTS_MAP(ELPA_ENUM_ENTRY)
enum ELPA_ERRORS {
ELPA_FOR_ALL_ERRORS(ELPA_ENUM_ENTRY)
};
/* -1 to take out the default kernel again */
ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS = (0 ELPA_COMPLEX_KERNEL_MAP(ELPA_ENUM_SUM) -1),
ELPA_2STAGE_NUMBER_OF_REAL_KERNELS = (0 ELPA_REAL_KERNEL_MAP(ELPA_ENUM_SUM) -1),
enum ELPA_CONSTANTS {
ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS = (0 ELPA_FOR_ALL_2STAGE_COMPLEX_KERNELS(ELPA_ENUM_SUM)),
ELPA_2STAGE_NUMBER_OF_REAL_KERNELS = (0 ELPA_FOR_ALL_2STAGE_REAL_KERNELS(ELPA_ENUM_SUM)),
};
......@@ -105,7 +105,7 @@ endef
# $1 program
define program_dependencies
$(_f90_only_verbose)rm -f .$p.dep.args
$(_f90_only_verbose)echo -n > .$p.dep.args
$(foreach argument,$(_$p_use_mods) $(_$p_def_mods) $(foreach l,$(call recursive_lib_deps,$p),$(_$l_use_mods) $(_$l_def_mods)),$(call append_to,$(argument),.$p.dep.args))
$(_f90_only_verbose)$(top_srcdir)/fdep/fortran_dependencies.pl $p < .$p.dep.args >> $@ || { rm $@; exit 1; }
$(_f90_only_verbose)rm -f .$p.dep.args
......
! The ELPA public API
module elpa
use elpa_api
use elpa_constants
implicit none
public
contains
function elpa_allocate() result(obj)
use elpa_impl
class(elpa_t), pointer :: obj
obj => elpa_impl_allocate()
end function
subroutine elpa_deallocate(obj)
class(elpa_t), pointer :: obj
call obj%destroy()
deallocate(obj)
end subroutine
end module
......@@ -58,7 +58,7 @@ function elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&_impl ( na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, &
&_impl (obj, na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, &
mpi_comm_cols, mpi_comm_all, useGPU, time_evp_fwd, &
time_evp_solve, time_evp_back, summary_timings) result(success)
use precision
......@@ -70,11 +70,13 @@ function elpa_solve_evp_&
use timings_dummy
#endif
use iso_c_binding
use elpa_api
use elpa_mpi
use elpa1_compute
use elpa1_utilities, only : gpu_usage_via_environment_variable
implicit none
class(elpa_t), intent(in) :: obj
integer(kind=c_int), intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, &
mpi_comm_cols, mpi_comm_all
real(kind=REAL_DATATYPE), intent(out) :: ev(na)
......@@ -115,7 +117,6 @@ function elpa_solve_evp_&
integer(kind=c_int) :: my_pe, n_pes, my_prow, my_pcol, mpierr
real(kind=C_DATATYPE_KIND), allocatable :: e(:)
real(kind=c_double) :: ttt0, ttt1 ! MPI_WTIME always needs double
logical, save :: firstCall = .true.
logical :: wantDebug
integer(kind=c_int) :: istat
character(200) :: errorMessage
......@@ -142,14 +143,8 @@ function elpa_solve_evp_&
call timer%stop("mpi_communication")
success = .true.
wantDebug = .false.
if (firstCall) then
! are debug messages desired?
wantDebug = debug_messages_via_environment_variable()
firstCall = .false.
endif
do_useGPU = .false.
wantDebug = obj%get("debug") == 1
do_useGPU = .false.
if (useGPU) then
......
......@@ -114,7 +114,7 @@ function elpa_solve_evp_&
call mpi_comm_rank(mpi_comm_cols,my_pcol,mpierr)
success = .true.
if (elpa_init(20170403) /= ELPA_OK) then
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
success = .false.
return
......@@ -123,6 +123,7 @@ function elpa_solve_evp_&
e = elpa_allocate()
call e%set("na", na)
call e%set("nev", nev)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
......@@ -131,9 +132,7 @@ function elpa_solve_evp_&
call e%set("process_row", my_prow)
call e%set("process_col", my_pcol)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance"
success = .false.
return
......@@ -174,6 +173,7 @@ function elpa_solve_evp_&
endif
call e%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot solve with ELPA 1stage"
success = .false.
......@@ -181,9 +181,9 @@ function elpa_solve_evp_&
endif
if (elpa_print_times) then
time_evp_fwd = e%get("time_evp_fwd")
time_evp_solve = e%get("time_evp_solve")
time_evp_back = e%get("time_evp_back")
time_evp_fwd = e%get_double("time_evp_fwd")
time_evp_solve = e%get_double("time_evp_solve")
time_evp_back = e%get_double("time_evp_back")
endif
call e%destroy()
......@@ -197,4 +197,4 @@ function elpa_solve_evp_&
end function
! vim: syntax=fortran
......@@ -99,16 +99,16 @@
success = .true.
if (elpa_init(20170403) /= ELPA_OK) then
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
success = .false.
stop
return
endif
e = elpa_allocate()
call e%set("na", na)
call e%set("nev", nev)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
......@@ -116,12 +116,9 @@
call e%set("mpi_comm_rows", mpi_comm_rows)
call e%set("mpi_comm_cols", mpi_comm_cols)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance"
success = .false.
stop
return
endif
......@@ -129,7 +126,6 @@
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run cholesky"
stop
success = .false.
return
else
......@@ -149,3 +145,5 @@
#undef COMPLEXCASE
#undef DOUBLE_PRECISION
#undef SINGLE_PRECISION
! vim: syntax=fortran
......@@ -95,7 +95,6 @@
! integer(kind=ik) :: istat
! character(200) :: errorMessage
integer(kind=ik) :: nev
integer(kind=iK) :: successInternal
type(elpa_t) :: e
......@@ -107,10 +106,9 @@
success = .true.
if (elpa_init(20170403) /= ELPA_OK) then
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
success = .false.
stop
return
endif
......@@ -124,12 +122,9 @@
call e%set("mpi_comm_rows", mpi_comm_rows)
call e%set("mpi_comm_cols", mpi_comm_cols)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance"
success = .false.
stop
return
endif
......@@ -137,7 +132,6 @@
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run invert_trm"
stop
success = .false.
return
else
......
......@@ -84,7 +84,6 @@
#endif
#endif
! integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
integer(kind=ik) :: nev
! integer(kind=ik) :: l_cols, l_rows, l_rows_np
! integer(kind=ik) :: np, n, nb, nblk_mult, lrs, lre, lcs, lce
! integer(kind=ik) :: gcol_min, gcol, goff
......@@ -120,10 +119,9 @@
!l_rows = local_index(na, my_prow, np_rows, nblk, -1) ! Local rows of a and b
!l_cols = local_index(ncb, my_pcol, np_cols, nblk, -1) ! Local cols of b
if (elpa_init(20170403) /= ELPA_OK) then
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
success = .false.
stop
return
endif
......@@ -131,18 +129,15 @@
call e%set("na", na)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("local_ncols", ldaCols)
call e%set("nblk", nblk)
call e%set("mpi_comm_rows", mpi_comm_rows)
call e%set("mpi_comm_cols", mpi_comm_cols)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance"
stop
success = .false.
return
endif
call e%hermitian_multiply(uplo_a, uplo_c, na, ncb, a(1:lda,1:ldaCols), lda, ldaCols, &
......@@ -151,7 +146,6 @@
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run multiply_a_b"
stop
success = .false.
return
endif
......
......@@ -56,14 +56,10 @@
#include "../../general/sanity.X90"
!use elpa1_compute, solve_tridi_&
! &PRECISION&
! &_private => solve_tridi_&
! &PRECISION
use precision
use elpa_type
use elpa
#ifdef HAVE_DETAILED_TIMINGS
use timings
use timings
#else
use timings_dummy
#endif
......@@ -79,7 +75,7 @@
logical, intent(in) :: wantDebug
logical :: success
integer(kind=iK) :: successInternal
type(elpa_t) :: e
type(elpa_t) :: elpa
call timer%start("elpa_solve_tridi_&
&PRECISION&
......@@ -87,32 +83,29 @@
success = .false.
if (elpa_init(20170403) /= ELPA_OK) then
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
success = .false.
stop
return
endif
e = elpa_allocate()
elpa = elpa_allocate()
call e%set("na", na)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
call elpa%set("na", na)
call elpa%set("nev", nev)
call elpa%set("local_nrows", ldq)
call elpa%set("local_ncols", matrixCols)
call elpa%set("nblk", nblk)
call e%set("mpi_comm_rows", mpi_comm_rows)
call e%set("mpi_comm_cols", mpi_comm_cols)
call elpa%set("mpi_comm_rows", mpi_comm_rows)
call elpa%set("mpi_comm_cols", mpi_comm_cols)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
if (elpa%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance"
success = .false.
stop
return
endif
call e%solve_tridi(d(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
call elpa%solve_tridi(d(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run solve_tridi"
......@@ -122,7 +115,7 @@
else
success =.true.
endif
call e%destroy()
call elpa%destroy()
call elpa_uninit()
......@@ -135,3 +128,4 @@
#undef DOUBLE_PRECISION
#undef SINGLE_PRECISION
! vim: syntax=fortran
This diff is collapsed.
......@@ -55,18 +55,11 @@
#include "config-f90.h"
!> \brief Fortran module which provides the routines to use the 2-stage ELPA solver
module elpa2_impl
! Version 1.1.2, 2011-02-21
use elpa_utilities
! use elpa1_impl, only : elpa_print_times, time_evp_back, time_evp_fwd, time_evp_solve
use elpa2_utilities
use elpa_utilities, only : error_unit
implicit none
PRIVATE ! By default, all routines contained are private
! The following routines are public:
private
public :: elpa_solve_evp_real_2stage_double_impl !< Driver routine for real double-precision 2-stage eigenvalue problem
public :: elpa_solve_evp_complex_2stage_double_impl !< Driver routine for complex double-precision 2-stage eigenvalue problem
......
......@@ -60,8 +60,6 @@ module ELPA2_compute
use ELPA_utilities
USE ELPA1_compute
!use elpa1_impl, only : elpa_print_times, time_evp_back, time_evp_fwd, time_evp_solve
!use elpa2_utilities
use elpa_pdgeqrf
use precision
use elpa_mpi
......
......@@ -68,33 +68,37 @@
program print_available_elpa2_kernels
use precision
use elpa1
use elpa2
use elpa2_utilities
use elpa2_utilities_private
use elpa
implicit none
integer(kind=ik) :: i
class(elpa_t), pointer :: e
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "Unsupported ELPA API Version"
stop 1
endif
e => elpa_alloca