Commit ea606c3b authored by Pavel Kus's avatar Pavel Kus Committed by Andreas Marek
Browse files

real/complex unification in declarations

in elpa2_trans_ev_tridi_to_band_template
parent 73abcc8b
...@@ -97,32 +97,22 @@ ...@@ -97,32 +97,22 @@
use precision use precision
use iso_c_binding use iso_c_binding
implicit none implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj class(elpa_abstract_impl_t), intent(inout) :: obj
logical, intent(in) :: useGPU logical, intent(in) :: useGPU
integer(kind=ik), intent(in) :: kernel integer(kind=ik), intent(in) :: kernel
integer(kind=ik), intent(in) :: na, nev, nblk, nbw, ldq, matrixCols, mpi_comm_rows, mpi_comm_cols integer(kind=ik), intent(in) :: na, nev, nblk, nbw, ldq, matrixCols, mpi_comm_rows, mpi_comm_cols
#if REALCASE == 1
#ifdef USE_ASSUMED_SIZE #ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: q(ldq,*) MATH_DATATYPE(kind=rck) :: q(ldq,*)
#else #else
real(kind=REAL_DATATYPE) :: q(ldq,matrixCols) MATH_DATATYPE(kind=rck) :: q(ldq,matrixCols)
#endif #endif
real(kind=REAL_DATATYPE), intent(in) :: hh_trans(:,:) MATH_DATATYPE(kind=rck), intent(in) :: hh_trans(:,:)
#endif
integer(kind=c_intptr_t) :: q_dev integer(kind=c_intptr_t) :: q_dev
#if COMPLEXCASE == 1
#ifdef USE_ASSUMED_SIZE
complex(kind=COMPLEX_DATATYPE) :: q(ldq,*)
#else
complex(kind=COMPLEX_DATATYPE) :: q(ldq,matrixCols)
#endif
complex(kind=COMPLEX_DATATYPE) :: hh_trans(:,:)
#endif
integer(kind=ik) :: np_rows, my_prow, np_cols, my_pcol integer(kind=ik) :: np_rows, my_prow, np_cols, my_pcol
integer(kind=ik) :: tmp integer(kind=ik) :: tmp
...@@ -139,52 +129,24 @@ ...@@ -139,52 +129,24 @@
integer(kind=ik) :: mpierr, src, src_offset, dst, offset, nfact, num_blk integer(kind=ik) :: mpierr, src, src_offset, dst, offset, nfact, num_blk
logical :: flag logical :: flag
#if REALCASE == 1
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
real(kind=REAL_DATATYPE), pointer :: aIntern(:,:,:,:) MATH_DATATYPE(kind=rck), pointer :: aIntern(:,:,:,:)
#else #else
real(kind=REAL_DATATYPE), pointer :: aIntern(:,:,:) MATH_DATATYPE(kind=rck), pointer :: aIntern(:,:,:)
#endif
real(kind=REAL_DATATYPE) :: a_real
#endif #endif
MATH_DATATYPE(kind=rck) :: a_var
#if COMPLEXCASE == 1
#ifdef WITH_OPENMP
complex(kind=COMPLEX_DATATYPE), pointer :: aIntern(:,:,:,:)
#else
complex(kind=COMPLEX_DATATYPE), pointer :: aIntern(:,:,:)
#endif
complex(kind=COMPLEX_DATATYPE) :: a_complex
#endif
type(c_ptr) :: aIntern_ptr type(c_ptr) :: aIntern_ptr
#if REALCASE == 1 MATH_DATATYPE(kind=rck) , allocatable :: row(:)
real(kind=REAL_DATATYPE) , allocatable :: row(:) MATH_DATATYPE(kind=rck) , allocatable :: row_group(:,:)
real(kind=REAL_DATATYPE) , allocatable :: row_group(:,:)
#endif
#if COMPLEXCASE == 1
complex(kind=COMPLEX_DATATYPE), allocatable :: row(:)
complex(kind=COMPLEX_DATATYPE), allocatable :: row_group(:,:)
#endif
#if REALCASE == 1
#ifdef WITH_OPENMP
real(kind=REAL_DATATYPE), allocatable :: top_border_send_buffer(:,:), top_border_recv_buffer(:,:)
real(kind=REAL_DATATYPE), allocatable :: bottom_border_send_buffer(:,:), bottom_border_recv_buffer(:,:)
#else
real(kind=REAL_DATATYPE), allocatable :: top_border_send_buffer(:,:,:), top_border_recv_buffer(:,:,:)
real(kind=REAL_DATATYPE), allocatable :: bottom_border_send_buffer(:,:,:), bottom_border_recv_buffer(:,:,:)
#endif
#endif
#if COMPLEXCASE == 1
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
complex(kind=COMPLEX_DATATYPE), allocatable :: top_border_send_buffer(:,:), top_border_recv_buffer(:,:) MATH_DATATYPE(kind=rck), allocatable :: top_border_send_buffer(:,:), top_border_recv_buffer(:,:)
complex(kind=COMPLEX_DATATYPE), allocatable :: bottom_border_send_buffer(:,:), bottom_border_recv_buffer(:,:) MATH_DATATYPE(kind=rck), allocatable :: bottom_border_send_buffer(:,:), bottom_border_recv_buffer(:,:)
#else #else
complex(kind=COMPLEX_DATATYPE), allocatable :: top_border_send_buffer(:,:,:), top_border_recv_buffer(:,:,:) MATH_DATATYPE(kind=rck), allocatable :: top_border_send_buffer(:,:,:), top_border_recv_buffer(:,:,:)
complex(kind=COMPLEX_DATATYPE), allocatable :: bottom_border_send_buffer(:,:,:), bottom_border_recv_buffer(:,:,:) MATH_DATATYPE(kind=rck), allocatable :: bottom_border_send_buffer(:,:,:), bottom_border_recv_buffer(:,:,:)
#endif
#endif #endif
integer(kind=c_intptr_t) :: aIntern_dev integer(kind=c_intptr_t) :: aIntern_dev
...@@ -200,15 +162,8 @@ ...@@ -200,15 +162,8 @@
integer(kind=ik) :: n_times integer(kind=ik) :: n_times
integer(kind=ik) :: top, chunk, this_chunk integer(kind=ik) :: top, chunk, this_chunk
#if REALCASE == 1 MATH_DATATYPE(kind=rck), allocatable :: result_buffer(:,:,:)
real(kind=REAL_DATATYPE), allocatable :: result_buffer(:,:,:) MATH_DATATYPE(kind=rck), allocatable :: bcast_buffer(:,:)
real(kind=REAL_DATATYPE), allocatable :: bcast_buffer(:,:)
#endif
#if COMPLEXCASE == 1
complex(kind=COMPLEX_DATATYPE), allocatable :: result_buffer(:,:,:)
complex(kind=COMPLEX_DATATYPE), allocatable :: bcast_buffer(:,:)
#endif
integer(kind=ik) :: n_off integer(kind=ik) :: n_off
...@@ -604,10 +559,10 @@ ...@@ -604,10 +559,10 @@
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
if (posix_memalign(aIntern_ptr, 64_c_intptr_t, stripe_width*a_dim2*stripe_count*max_threads* & if (posix_memalign(aIntern_ptr, 64_c_intptr_t, stripe_width*a_dim2*stripe_count*max_threads* &
#if REALCASE == 1 #if REALCASE == 1
C_SIZEOF(a_real)) /= 0) then C_SIZEOF(a_var)) /= 0) then
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
C_SIZEOF(a_complex)) /= 0) then C_SIZEOF(a_var)) /= 0) then
#endif #endif
print *,"trans_ev_tridi_to_band_& print *,"trans_ev_tridi_to_band_&
&MATH_DATATYPE& &MATH_DATATYPE&
...@@ -624,10 +579,10 @@ ...@@ -624,10 +579,10 @@
if (posix_memalign(aIntern_ptr, 64_c_intptr_t, stripe_width*a_dim2*stripe_count* & if (posix_memalign(aIntern_ptr, 64_c_intptr_t, stripe_width*a_dim2*stripe_count* &
#if REALCASE == 1 #if REALCASE == 1
C_SIZEOF(a_real)) /= 0) then C_SIZEOF(a_var)) /= 0) then
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
C_SIZEOF(a_complex)) /= 0) then C_SIZEOF(a_var)) /= 0) then
#endif #endif
print *,"trans_ev_tridi_to_band_real: error when allocating aIntern"//errorMessage print *,"trans_ev_tridi_to_band_real: error when allocating aIntern"//errorMessage
stop 1 stop 1
......
Supports Markdown
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