From 0588cac0f71e31cf145792fecfe128a661fb718a Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Thu, 28 Jan 2016 15:45:23 +0100 Subject: [PATCH] Remove assumed size arrays from complex generic simple kernel This commit is performance critical and 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_complex_simple.F90 | 12 ++++++++++-- src/mod_compute_hh_trafo_complex.F90 | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/elpa2_kernels/elpa2_kernels_complex_simple.F90 b/src/elpa2_kernels/elpa2_kernels_complex_simple.F90 index 787a2ec..3d0f620 100644 --- a/src/elpa2_kernels/elpa2_kernels_complex_simple.F90 +++ b/src/elpa2_kernels/elpa2_kernels_complex_simple.F90 @@ -71,9 +71,13 @@ contains implicit none integer(kind=ik), intent(in) :: nb, nq, ldq +#ifdef DESPERATELY_WANT_ASSUMED_SIZE complex(kind=ck), intent(inout) :: q(ldq,*) complex(kind=ck), intent(in) :: hh(*) - +#else + complex(kind=ck), intent(inout) :: q(1:ldq,1:nb) + complex(kind=ck), intent(in) :: hh(1:nb) +#endif integer(kind=ik) :: i complex(kind=ck) :: h1, tau1, x(nq) @@ -110,9 +114,13 @@ contains implicit none integer(kind=ik), intent(in) :: nb, nq, ldq, ldh +#ifdef DESPERATELY_WANT_ASSUMED_SIZE complex(kind=ck), intent(inout) :: q(ldq,*) complex(kind=ck), intent(in) :: hh(ldh,*) - +#else + complex(kind=ck), intent(inout) :: q(1:ldq,1:nb+1) + complex(kind=ck), intent(in) :: hh(1:ldh,1:2) +#endif complex(kind=ck) :: s, h1, h2, tau1, tau2, x(nq), y(nq) integer(kind=ik) :: i diff --git a/src/mod_compute_hh_trafo_complex.F90 b/src/mod_compute_hh_trafo_complex.F90 index c768255..fe9b4f0 100644 --- a/src/mod_compute_hh_trafo_complex.F90 +++ b/src/mod_compute_hh_trafo_complex.F90 @@ -128,12 +128,24 @@ module compute_hh_trafo_complex ttt = mpi_wtime() do j = ncols, 1, -1 #ifdef WITH_OPENMP +#ifdef DESPERATELY_WANT_ASSUMED_SIZE call single_hh_trafo_complex_generic_simple(a(1,j+off+a_off,istripe,my_thread), & bcast_buffer(1,j+off),nbw,nl,stripe_width) #else + call single_hh_trafo_complex_generic_simple(a(1:stripe_width,j+off+a_off:j+off_a_off+nbw-1,istripe,my_thread), & + bcast_buffer(1:nbw,j+off),nbw,nl,stripe_width) +#endif + +#else /* WITH_OPENMP */ +#ifdef DESPERATELY_WANT_ASSUMED_SIZE call single_hh_trafo_complex_generic_simple(a(1,j+off+a_off,istripe), & bcast_buffer(1,j+off),nbw,nl,stripe_width) +#else + call single_hh_trafo_complex_generic_simple(a(1:stripe_width,j+off+a_off:j+off+a_off+nbw-1,istripe), & + bcast_buffer(1:nbw,j+off),nbw,nl,stripe_width) #endif + +#endif /* WITH_OPENMP */ enddo #if defined(WITH_NO_SPECIFIC_COMPLEX_KERNEL) endif -- GitLab