Commit e4e42c43 authored by Pavel Kus's avatar Pavel Kus

finally getting rid of CONST_* macros for numbers

parent 58c393cd
......@@ -94,26 +94,12 @@ explicit_tokens_complex = [
("PRECISION_CMPLX", "DCMPLX", "CMPLX"),
("PRECISION_IMAG", "DIMAG", "AIMAG"),
("PRECISION_REAL", "DREAL", "REAL"),
("CONST_REAL_0_0", "0.0_rk8", "0.0_rk4"),
("CONST_REAL_1_0", "1.0_rk8", "1.0_rk4"),
("CONST_REAL_0_5", "0.5_rk8", "0.5_rk4"),
("CONST_COMPLEX_PAIR_0_0", "(0.0_rk8,0.0_rk8)", "(0.0_rk4,0.0_rk4)"),
("CONST_COMPLEX_PAIR_1_0", "(1.0_rk8,0.0_rk8)", "(1.0_rk4,0.0_rk4)"),
("CONST_COMPLEX_PAIR_NEGATIVE_1_0", "(-1.0_rk8,0.0_rk8)", "(-1.0_rk4,0.0_rk4)"),
("CONST_COMPLEX_PAIR_NEGATIVE_0_5", "(-0.5_rk8,0.0_rk8)", "(-0.5_rk4,0.0_rk4)"),
("CONST_COMPLEX_0_0", "0.0_ck8", "0.0_ck4"),
("CONST_COMPLEX_1_0", "1.0_ck8", "1.0_ck4"),
("size_of_PRECISION_complex", "size_of_double_complex_datatype", "size_of_single_complex_datatype"),
("C_DATATYPE_KIND", "c_double", "c_float"),
]
explicit_tokens_real = [
("PRECISION_SUFFIX", "\"_double\"", "\"_single\""),
("CONST_0_0", "0.0_rk8", "0.0_rk4"),
("CONST_0_5", "0.5_rk8", "0.5_rk4"),
("CONST_1_0", "1.0_rk8", "1.0_rk4"),
("CONST_2_0", "2.0_rk8", "2.0_rk4"),
("CONST_8_0", "8.0_rk8", "8.0_rk4"),
("size_of_PRECISION_real", "size_of_double_real_datatype", "size_of_single_real_datatype"),
("MPI_REAL_PRECISION", "MPI_REAL8", "MPI_REAL4"),
("C_DATATYPE_KIND", "c_double", "c_float"),
......
......@@ -65,6 +65,7 @@
use mod_check_for_gpu
use iso_c_binding
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
logical :: useGPU
#if REALCASE == 1
......@@ -142,16 +143,13 @@
if (na .eq. 1) then
#if REALCASE == 1
ev(1) = a(1,1)
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_REAL_1_0
endif
#endif
#if COMPLEXCASE == 1
ev(1) = real(a(1,1))
#endif
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_COMPLEX_PAIR_1_0
q(1,1) = ONE
endif
#endif
call obj%timer%stop("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
......
......@@ -659,8 +659,8 @@
#endif /* WITH_MPI */
! call PRECISION_TRMM('L', 'U', 'N', 'N', t_rows, t_cols, CONST_1_0, tmat_complete, cwy_blocking, t_tmp2, cwy_blocking)
! call PRECISION_TRMM('R', 'U', 'N', 'N', t_rows, t_cols, -CONST_1_0, tmat_complete(t_rows+1,t_rows+1), cwy_blocking, &
! call PRECISION_TRMM('L', 'U', 'N', 'N', t_rows, t_cols, ONE, tmat_complete, cwy_blocking, t_tmp2, cwy_blocking)
! call PRECISION_TRMM('R', 'U', 'N', 'N', t_rows, t_cols, -ONE, tmat_complete(t_rows+1,t_rows+1), cwy_blocking, &
! t_tmp2, cwy_blocking)
! tmat_complete(1:t_rows,t_rows+1:t_rows+t_cols) = t_tmp2(1:t_rows,1:t_cols)
......@@ -731,8 +731,8 @@
#endif /* WITH_MPI */
! if (l_rows>0) then
! call PRECISION_TRMM('L', 'U', 'T', 'N', n_cols, l_cols, CONST_1_0, tmat_complete, cwy_blocking, tmp2, n_cols)
! call PRECISION_GEMM('N', 'N', l_rows, l_cols, n_cols, -CONST_1_0, hvm, ubound(hvm,dim=1), tmp2, n_cols, CONST_1_0, q, ldq)
! call PRECISION_TRMM('L', 'U', 'T', 'N', n_cols, l_cols, ONE, tmat_complete, cwy_blocking, tmp2, n_cols)
! call PRECISION_GEMM('N', 'N', l_rows, l_cols, n_cols, -ONE, hvm, ubound(hvm,dim=1), tmp2, n_cols, ONE, q, ldq)
! endif
enddo ! istep
......
......@@ -91,6 +91,7 @@ subroutine reverse_vector_local_&
(n,x,incx,work,lwork)
use precision
implicit none
#include "../../general/precision_kinds.F90"
! input
integer(kind=ik) :: incx, n, lwork
......@@ -101,7 +102,7 @@ subroutine reverse_vector_local_&
integer(kind=ik) :: srcoffset, destoffset, ientry
if (lwork .eq. -1) then
work(1) = CONST_0_0
work(1) = 0.0_rk
return
end if
......
......@@ -44,13 +44,6 @@
#undef scal_PRECISION_LASET
#undef PRECISION_SUFFIX
#undef CONST_0_0
#undef CONST_REAL_0_0
#undef CONST_0_5
#undef CONST_1_0
#undef CONST_REAL_1_0
#undef CONST_2_0
#undef CONST_8_0
#undef MPI_REAL_PRECISION
#undef MPI_MATH_DATATYPE_PRECISION
#undef MPI_MATH_DATATYPE_PRECISION_EXPL
......@@ -104,13 +97,6 @@
#define scal_PRECISION_GEMM PDGEMM
#define scal_PRECISION_NRM2 PDNRM2
#define scal_PRECISION_LASET PDLASET
#define CONST_0_0 0.0_rk8
#define CONST_REAL_0_0 0.0_rk8
#define CONST_0_5 0.5_rk8
#define CONST_1_0 1.0_rk8
#define CONST_REAL_1_0 1.0_rk8
#define CONST_2_0 2.0_rk8
#define CONST_8_0 8.0_rk8
#define MPI_REAL_PRECISION MPI_REAL8
#define MPI_MATH_DATATYPE_PRECISION MPI_REAL8
#define MPI_MATH_DATATYPE_PRECISION_EXPL MPI_REAL8
......@@ -163,13 +149,6 @@
#define scal_PRECISION_GEMM PSGEMM
#define scal_PRECISION_NRM2 PSNRM2
#define scal_PRECISION_LASET PSLASET
#define CONST_0_0 0.0_rk4
#define CONST_REAL_0_0 0.0_rk4
#define CONST_0_5 0.5_rk4
#define CONST_1_0 1.0_rk4
#define CONST_REAL_1_0 1.0_rk4
#define CONST_2_0 2.0_rk4
#define CONST_8_0 8.0_rk4
#define MPI_REAL_PRECISION MPI_REAL4
#define MPI_MATH_DATATYPE_PRECISION MPI_REAL4
#define MPI_MATH_DATATYPE_PRECISION_EXPL MPI_REAL4
......@@ -236,15 +215,6 @@
#undef PRECISION_CMPLX
#undef PRECISION_IMAG
#undef PRECISION_REAL
#undef CONST_REAL_0_0
#undef CONST_REAL_1_0
#undef CONST_REAL_0_5
#undef CONST_COMPLEX_PAIR_0_0
#undef CONST_COMPLEX_PAIR_1_0
#undef CONST_COMPLEX_PAIR_NEGATIVE_1_0
#undef CONST_COMPLEX_PAIR_NEGATIVE_0_5
#undef CONST_COMPLEX_0_0
#undef CONST_COMPLEX_1_0
#undef C_DATATYPE_KIND
......@@ -305,15 +275,6 @@
#define PRECISION_CMPLX DCMPLX
#define PRECISION_IMAG DIMAG
#define PRECISION_REAL DREAL
#define CONST_REAL_0_0 0.0_rk8
#define CONST_REAL_1_0 1.0_rk8
#define CONST_REAL_0_5 0.5_rk8
#define CONST_COMPLEX_PAIR_0_0 (0.0_rk8,0.0_rk8)
#define CONST_COMPLEX_PAIR_1_0 (1.0_rk8,0.0_rk8)
#define CONST_COMPLEX_PAIR_NEGATIVE_1_0 (-1.0_rk8,0.0_rk8)
#define CONST_COMPLEX_PAIR_NEGATIVE_0_5 (-0.5_rk8,0.0_rk8)
#define CONST_COMPLEX_0_0 0.0_ck8
#define CONST_COMPLEX_1_0 1.0_ck8
#define C_DATATYPE_KIND c_double
#define THRESHOLD 1e-11_rk8
......@@ -370,15 +331,6 @@
#define PRECISION_CMPLX CMPLX
#define PRECISION_IMAG AIMAG
#define PRECISION_REAL REAL
#define CONST_REAL_0_0 0.0_rk4
#define CONST_REAL_1_0 1.0_rk4
#define CONST_REAL_0_5 0.5_rk4
#define CONST_COMPLEX_PAIR_0_0 (0.0_rk4,0.0_rk4)
#define CONST_COMPLEX_PAIR_1_0 (1.0_rk4,0.0_rk4)
#define CONST_COMPLEX_PAIR_NEGATIVE_1_0 (-1.0_rk4,0.0_rk4)
#define CONST_COMPLEX_PAIR_NEGATIVE_0_5 (-0.5_rk4,0.0_rk4)
#define CONST_COMPLEX_0_0 0.0_ck4
#define CONST_COMPLEX_1_0 1.0_ck4
#define C_DATATYPE_KIND c_float
#define THRESHOLD 1e-4_rk4
......
......@@ -243,10 +243,10 @@
!TODO either we will not have this part of test at all, or it will be improved
if(nblk > 0) then
! First check, whether the elements on diagonal are 1 .. "normality" of the vectors
err = CONST_REAL_0_0
err = 0.0_rk
do i=1, nev
if (map_global_array_index_to_local_index(i, i, rowLocal, colLocal, nblk, np_rows, np_cols, my_prow, my_pcol)) then
err = max(err, abs(tmp1(rowLocal,colLocal) - CONST_REAL_1_0))
err = max(err, abs(tmp1(rowLocal,colLocal) - 1.0_rk))
endif
end do
#ifdef WITH_MPI
......
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