From 7a5647317606e965f58b4e464249fb8aefbea30e Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Thu, 28 Jan 2016 14:23:48 +0100 Subject: [PATCH] Remove assumend size arrays from real simple kernel This commit might be performance critical, it has to be timed carefully. Thus one can switch back to the old implementation. The new one, however, is more safe and better to debug --- src/elpa2_kernels/elpa2_kernels_real_simple.F90 | 5 +++++ src/mod_compute_hh_trafo_real.F90 | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/elpa2_kernels/elpa2_kernels_real_simple.F90 b/src/elpa2_kernels/elpa2_kernels_real_simple.F90 index bfe0457..3349589 100644 --- a/src/elpa2_kernels/elpa2_kernels_real_simple.F90 +++ b/src/elpa2_kernels/elpa2_kernels_real_simple.F90 @@ -71,8 +71,13 @@ contains implicit none integer(kind=ik), intent(in) :: nb, nq, ldq, ldh +#ifdef DESPERATELY_WANT_ASSUMED_SIZE real(kind=rk), intent(inout) :: q(ldq,*) real(kind=rk), intent(in) :: hh(ldh,*) +#else + real(kind=rk), intent(inout) :: q(ldq,1:nb+1) + real(kind=rk), intent(in) :: hh(ldh,2) +#endif real(kind=rk) :: s, h1, h2, tau1, tau2, x(nq), y(nq) integer(kind=ik) :: i diff --git a/src/mod_compute_hh_trafo_real.F90 b/src/mod_compute_hh_trafo_real.F90 index 3cf7e18..9bf517c 100644 --- a/src/mod_compute_hh_trafo_real.F90 +++ b/src/mod_compute_hh_trafo_real.F90 @@ -162,12 +162,27 @@ module compute_hh_trafo_real w(:,1) = bcast_buffer(1:nbw,j+off) w(:,2) = bcast_buffer(1:nbw,j+off-1) #ifdef WITH_OPENMP +#ifdef DESPERATELY_WANT_ASSUMED_SIZE call double_hh_trafo_generic_simple(a(1,j+off+a_off-1,istripe,my_thread), & w, nbw, nl, stripe_width, nbw) #else + call double_hh_trafo_generic_simple(a(1:stripe_width,j+off+a_off-1:j+off+a_off-1+nbw,istripe,my_thread), & + w, nbw, nl, stripe_width, nbw) + +#endif + +#else /* WITH_OPENMP */ +#ifdef DESPERATELY_WANT_ASSUMED_SIZE call double_hh_trafo_generic_simple(a(1,j+off+a_off-1,istripe), & w, nbw, nl, stripe_width, nbw) +#else + call double_hh_trafo_generic_simple(a(1:stripe_width,j+off+a_off-1:j+off+a_off-1+nbw,istripe), & + w, nbw, nl, stripe_width, nbw) + #endif + +#endif /* WITH_OPENMP */ + enddo #if defined(WITH_NO_SPECIFIC_REAL_KERNEL) endif -- GitLab