Commit 3925cb4a authored by Andreas Marek's avatar Andreas Marek

Do not use "elpa_utilities" in test programs

The functions in elpa_utilities are considered "ELPA internal",
i.e. the should not be accessible by the users and thus not
be part of the API.
parent a3c411ab
......@@ -485,60 +485,60 @@ program test
call exit(status)
#if defined(__EIGENVALUES) || defined(__SOLVE_TRIDIAGONAL)
contains
!Processor col for global col number
pure function pcol(global_col, nblk, np_cols) result(local_col)
implicit none
integer(kind=c_int), intent(in) :: global_col, nblk, np_cols
integer(kind=c_int) :: local_col
local_col = MOD((global_col-1)/nblk,np_cols)
end function
!Processor row for global row number
pure function prow(global_row, nblk, np_rows) result(local_row)
implicit none
integer(kind=c_int), intent(in) :: global_row, nblk, np_rows
integer(kind=c_int) :: local_row
local_row = MOD((global_row-1)/nblk,np_rows)
end function
function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) &
result(possible)
implicit none
integer(kind=c_int) :: pi, pj, li, lj, xi, xj
integer(kind=c_int), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
integer(kind=c_int), intent(out) :: iLocal, jLocal
logical :: possible
possible = .true.
iLocal = 0
jLocal = 0
pi = prow(iGlobal, nblk, np_rows)
if (my_prow .ne. pi) then
possible = .false.
return
endif
pj = pcol(jGlobal, nblk, np_cols)
if (my_pcol .ne. pj) then
possible = .false.
return
endif
li = (iGlobal-1)/(np_rows*nblk) ! block number for rows
lj = (jGlobal-1)/(np_cols*nblk) ! block number for columns
xi = mod( (iGlobal-1),nblk)+1 ! offset in block li
xj = mod( (jGlobal-1),nblk)+1 ! offset in block lj
iLocal = li * nblk + xi
jLocal = lj * nblk + xj
end function
#endif
!#if defined(__EIGENVALUES) || defined(__SOLVE_TRIDIAGONAL)
! contains
!
! !Processor col for global col number
! pure function pcol(global_col, nblk, np_cols) result(local_col)
! implicit none
! integer(kind=c_int), intent(in) :: global_col, nblk, np_cols
! integer(kind=c_int) :: local_col
! local_col = MOD((global_col-1)/nblk,np_cols)
! end function
!
! !Processor row for global row number
! pure function prow(global_row, nblk, np_rows) result(local_row)
! implicit none
! integer(kind=c_int), intent(in) :: global_row, nblk, np_rows
! integer(kind=c_int) :: local_row
! local_row = MOD((global_row-1)/nblk,np_rows)
! end function
!
! function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) &
! result(possible)
! implicit none
!
! integer(kind=c_int) :: pi, pj, li, lj, xi, xj
! integer(kind=c_int), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
! integer(kind=c_int), intent(out) :: iLocal, jLocal
! logical :: possible
!
! possible = .true.
! iLocal = 0
! jLocal = 0
!
! pi = prow(iGlobal, nblk, np_rows)
!
! if (my_prow .ne. pi) then
! possible = .false.
! return
! endif
!
! pj = pcol(jGlobal, nblk, np_cols)
!
! if (my_pcol .ne. pj) then
! possible = .false.
! return
! endif
! li = (iGlobal-1)/(np_rows*nblk) ! block number for rows
! lj = (jGlobal-1)/(np_cols*nblk) ! block number for columns
!
! xi = mod( (iGlobal-1),nblk)+1 ! offset in block li
! xj = mod( (jGlobal-1),nblk)+1 ! offset in block lj
!
! iLocal = li * nblk + xi
! jLocal = lj * nblk + xj
!
! end function
!#endif
end program
......@@ -56,9 +56,62 @@ module test_analytic
contains
!Processor col for global col number
pure function pcol(global_col, nblk, np_cols) result(local_col)
implicit none
integer(kind=c_int), intent(in) :: global_col, nblk, np_cols
integer(kind=c_int) :: local_col
local_col = MOD((global_col-1)/nblk,np_cols)
end function
!Processor row for global row number
pure function prow(global_row, nblk, np_rows) result(local_row)
implicit none
integer(kind=c_int), intent(in) :: global_row, nblk, np_rows
integer(kind=c_int) :: local_row
local_row = MOD((global_row-1)/nblk,np_rows)
end function
function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) &
result(possible)
implicit none
integer(kind=c_int) :: pi, pj, li, lj, xi, xj
integer(kind=c_int), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
integer(kind=c_int), intent(out) :: iLocal, jLocal
logical :: possible
possible = .true.
iLocal = 0
jLocal = 0
pi = prow(iGlobal, nblk, np_rows)
if (my_prow .ne. pi) then
possible = .false.
return
endif
pj = pcol(jGlobal, nblk, np_cols)
if (my_pcol .ne. pj) then
possible = .false.
return
endif
li = (iGlobal-1)/(np_rows*nblk) ! block number for rows
lj = (jGlobal-1)/(np_cols*nblk) ! block number for columns
xi = mod( (iGlobal-1),nblk)+1 ! offset in block li
xj = mod( (jGlobal-1),nblk)+1 ! offset in block lj
iLocal = li * nblk + xi
jLocal = lj * nblk + xj
end function
subroutine prepare_matrix_analytic_real_double (na, a, nblk, myid, np_rows, &
np_cols, my_prow, my_pcol)
use elpa_utilities
implicit none
integer(kind=ik), intent(in) :: na, nblk, myid, np_rows, np_cols, my_prow, my_pcol
......@@ -84,7 +137,6 @@ module test_analytic
function check_correctness_analytic_real_double (na, nev, ev, z, nblk, myid, np_rows, &
np_cols, my_prow, my_pcol) result(status)
use elpa_utilities
implicit none
integer(kind=ik), intent(in) :: na, nev, nblk, myid, np_rows, np_cols, my_prow, my_pcol
......
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