Unverified Commit 62a29931 authored by Andreas Marek's avatar Andreas Marek
Browse files

Updated all variable types

All variables (real, integer, complex) are now declecared with the
appropiate kind statement. The definition of the kind types is done
in src/mod_precision.f90

To ensure interoperability with C, the kind types are decleared via
iso_c_binding to C variables
parent 0aa7e6be
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
#include "config-f90.h" #include "config-f90.h"
!> \brief Fortran module which provides the routines to use the one-stage ELPA solver !> \brief Fortran module which provides the routines to use the one-stage ELPA solver
module ELPA1 module ELPA1
use precision
use elpa_utilities use elpa_utilities
use elpa1_compute use elpa1_compute
...@@ -104,9 +104,9 @@ module ELPA1 ...@@ -104,9 +104,9 @@ module ELPA1
! Timing results, set by every call to solve_evp_xxx ! Timing results, set by every call to solve_evp_xxx
real*8, public :: time_evp_fwd !< time for forward transformations (to tridiagonal form) real(kind=rk), public :: time_evp_fwd !< time for forward transformations (to tridiagonal form)
real*8, public :: time_evp_solve !< time for solving the tridiagonal system real(kind=rk), public :: time_evp_solve !< time for solving the tridiagonal system
real*8, public :: time_evp_back !< time for back transformations of eigenvectors real(kind=rk), public :: time_evp_back !< time for back transformations of eigenvectors
logical, public :: elpa_print_times = .false. !< Set elpa_print_times to .true. for explicit timing outputs logical, public :: elpa_print_times = .false. !< Set elpa_print_times to .true. for explicit timing outputs
...@@ -235,13 +235,13 @@ contains ...@@ -235,13 +235,13 @@ contains
function get_elpa_communicators(mpi_comm_global, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols) result(mpierr) function get_elpa_communicators(mpi_comm_global, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols) result(mpierr)
use precision
implicit none implicit none
integer, intent(in) :: mpi_comm_global, my_prow, my_pcol integer(kind=ik), intent(in) :: mpi_comm_global, my_prow, my_pcol
integer, intent(out) :: mpi_comm_rows, mpi_comm_cols integer(kind=ik), intent(out) :: mpi_comm_rows, mpi_comm_cols
integer :: mpierr integer(kind=ik) :: mpierr
! mpi_comm_rows is used for communicating WITHIN rows, i.e. all processes ! mpi_comm_rows is used for communicating WITHIN rows, i.e. all processes
! having the same column coordinate share one mpi_comm_rows. ! having the same column coordinate share one mpi_comm_rows.
...@@ -290,21 +290,21 @@ end function get_elpa_communicators ...@@ -290,21 +290,21 @@ end function get_elpa_communicators
function solve_evp_real_1stage(na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols) result(success) function solve_evp_real_1stage(na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols) result(success)
use precision
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
use timings use timings
#endif #endif
implicit none implicit none
integer, intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols integer(kind=ik), intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
real*8 :: a(lda,matrixCols), ev(na), q(ldq,matrixCols) real(kind=rk) :: a(lda,matrixCols), ev(na), q(ldq,matrixCols)
integer :: my_prow, my_pcol, mpierr integer(kind=ik) :: my_prow, my_pcol, mpierr
real*8, allocatable :: e(:), tau(:) real(kind=rk), allocatable :: e(:), tau(:)
real*8 :: ttt0, ttt1 real(kind=rk) :: ttt0, ttt1
logical :: success logical :: success
logical, save :: firstCall = .true. logical, save :: firstCall = .true.
logical :: wantDebug logical :: wantDebug
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve_evp_real_1stage") call timer%start("solve_evp_real_1stage")
...@@ -390,24 +390,24 @@ end function solve_evp_real_1stage ...@@ -390,24 +390,24 @@ end function solve_evp_real_1stage
function solve_evp_complex_1stage(na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols) result(success) function solve_evp_complex_1stage(na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols) result(success)
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
use timings use timings
#endif #endif
use precision
implicit none implicit none
integer, intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols integer(kind=ik), intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
complex*16 :: a(lda,matrixCols), q(ldq,matrixCols) complex(kind=ck) :: a(lda,matrixCols), q(ldq,matrixCols)
real*8 :: ev(na) real(kind=rk) :: ev(na)
integer :: my_prow, my_pcol, np_rows, np_cols, mpierr integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
integer :: l_rows, l_cols, l_cols_nev integer(kind=ik) :: l_rows, l_cols, l_cols_nev
real*8, allocatable :: q_real(:,:), e(:) real(kind=rk), allocatable :: q_real(:,:), e(:)
complex*16, allocatable :: tau(:) complex(kind=ck), allocatable :: tau(:)
real*8 ttt0, ttt1 real(kind=rk) :: ttt0, ttt1
logical :: success logical :: success
logical, save :: firstCall = .true. logical, save :: firstCall = .true.
logical :: wantDebug logical :: wantDebug
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve_evp_complex_1stage") call timer%start("solve_evp_complex_1stage")
......
This diff is collapsed.
...@@ -133,28 +133,29 @@ function solve_evp_real_2stage(na, nev, a, lda, ev, q, ldq, nblk, & ...@@ -133,28 +133,29 @@ function solve_evp_real_2stage(na, nev, a, lda, ev, q, ldq, nblk, &
useQR) result(success) useQR) result(success)
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
use timings use timings
#endif #endif
use precision
implicit none implicit none
logical, intent(in), optional :: useQR logical, intent(in), optional :: useQR
logical :: useQRActual, useQREnvironment logical :: useQRActual, useQREnvironment
integer, intent(in), optional :: THIS_REAL_ELPA_KERNEL_API integer(kind=ik), intent(in), optional :: THIS_REAL_ELPA_KERNEL_API
integer :: THIS_REAL_ELPA_KERNEL integer(kind=ik) :: THIS_REAL_ELPA_KERNEL
integer, intent(in) :: na, nev, lda, ldq, matrixCols, mpi_comm_rows, & integer(kind=ik), intent(in) :: na, nev, lda, ldq, matrixCols, mpi_comm_rows, &
mpi_comm_cols, mpi_comm_all mpi_comm_cols, mpi_comm_all
integer, intent(in) :: nblk integer(kind=ik), intent(in) :: nblk
real*8, intent(inout) :: a(lda,matrixCols), ev(na), q(ldq,matrixCols) real(kind=rk), intent(inout) :: a(lda,matrixCols), ev(na), q(ldq,matrixCols)
real*8, allocatable :: hh_trans_real(:,:) real(kind=rk), allocatable :: hh_trans_real(:,:)
integer :: my_pe, n_pes, my_prow, my_pcol, np_rows, np_cols, mpierr integer(kind=ik) :: my_pe, n_pes, my_prow, my_pcol, np_rows, np_cols, mpierr
integer :: nbw, num_blocks integer(kind=ik) :: nbw, num_blocks
real*8, allocatable :: tmat(:,:,:), e(:) real(kind=rk), allocatable :: tmat(:,:,:), e(:)
real*8 :: ttt0, ttt1, ttts real(kind=rk) :: ttt0, ttt1, ttts
integer :: i integer(kind=ik) :: i
logical :: success logical :: success
logical, save :: firstCall = .true. logical, save :: firstCall = .true.
logical :: wantDebug logical :: wantDebug
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve_evp_real_2stage") call timer%start("solve_evp_real_2stage")
...@@ -363,25 +364,26 @@ function solve_evp_complex_2stage(na, nev, a, lda, ev, q, ldq, nblk, & ...@@ -363,25 +364,26 @@ function solve_evp_complex_2stage(na, nev, a, lda, ev, q, ldq, nblk, &
mpi_comm_all, THIS_COMPLEX_ELPA_KERNEL_API) result(success) mpi_comm_all, THIS_COMPLEX_ELPA_KERNEL_API) result(success)
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
use timings use timings
#endif #endif
use precision
implicit none implicit none
integer, intent(in), optional :: THIS_COMPLEX_ELPA_KERNEL_API integer(kind=ik), intent(in), optional :: THIS_COMPLEX_ELPA_KERNEL_API
integer :: THIS_COMPLEX_ELPA_KERNEL integer(kind=ik) :: THIS_COMPLEX_ELPA_KERNEL
integer, intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, mpi_comm_all integer(kind=ik), intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, mpi_comm_all
complex*16, intent(inout) :: a(lda,matrixCols), q(ldq,matrixCols) complex(kind=ck), intent(inout) :: a(lda,matrixCols), q(ldq,matrixCols)
real*8, intent(inout) :: ev(na) real(kind=rk), intent(inout) :: ev(na)
complex*16, allocatable :: hh_trans_complex(:,:) complex(kind=ck), allocatable :: hh_trans_complex(:,:)
integer :: my_prow, my_pcol, np_rows, np_cols, mpierr, my_pe, n_pes integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr, my_pe, n_pes
integer :: l_cols, l_rows, l_cols_nev, nbw, num_blocks integer(kind=ik) :: l_cols, l_rows, l_cols_nev, nbw, num_blocks
complex*16, allocatable :: tmat(:,:,:) complex(kind=ck), allocatable :: tmat(:,:,:)
real*8, allocatable :: q_real(:,:), e(:) real(kind=rk), allocatable :: q_real(:,:), e(:)
real*8 :: ttt0, ttt1, ttts real(kind=rk) :: ttt0, ttt1, ttts
integer :: i integer(kind=ik) :: i
logical :: success, wantDebug logical :: success, wantDebug
logical, save :: firstCall = .true. logical, save :: firstCall = .true.
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve_evp_complex_2stage") call timer%start("solve_evp_complex_2stage")
......
This diff is collapsed.
...@@ -59,14 +59,14 @@ module complex_generic_kernel ...@@ -59,14 +59,14 @@ module complex_generic_kernel
public single_hh_trafo_complex_generic public single_hh_trafo_complex_generic
contains contains
subroutine single_hh_trafo_complex_generic(q, hh, nb, nq, ldq) subroutine single_hh_trafo_complex_generic(q, hh, nb, nq, ldq)
use precision
implicit none implicit none
integer, intent(in) :: nb, nq, ldq integer(kind=ik), intent(in) :: nb, nq, ldq
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(*) complex(kind=ck), intent(in) :: hh(*)
integer i integer(kind=ik) :: i
! Safety only: ! Safety only:
...@@ -93,15 +93,15 @@ contains ...@@ -93,15 +93,15 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine double_hh_trafo_complex_generic(q, hh, nb, nq, ldq, ldh) subroutine double_hh_trafo_complex_generic(q, hh, nb, nq, ldq, ldh)
use precision
implicit none implicit none
integer, intent(in) :: nb, nq, ldq, ldh integer(kind=ik), intent(in) :: nb, nq, ldq, ldh
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(ldh,*) complex(kind=ck), intent(in) :: hh(ldh,*)
complex*16 s complex(kind=ck) :: s
integer i integer(kind=ik) :: i
! Safety only: ! Safety only:
...@@ -138,16 +138,16 @@ contains ...@@ -138,16 +138,16 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_12(q, hh, nb, ldq) subroutine hh_trafo_complex_kernel_12(q, hh, nb, ldq)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq integer(kind=ik), intent(in) :: nb, ldq
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(*) complex(kind=ck), intent(in) :: hh(*)
complex*16 x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc complex(kind=ck) :: x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc
complex*16 h1, tau1 complex(kind=ck) :: h1, tau1
integer i integer(kind=ik) :: i
x1 = q(1,1) x1 = q(1,1)
...@@ -231,16 +231,16 @@ contains ...@@ -231,16 +231,16 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_8(q, hh, nb, ldq) subroutine hh_trafo_complex_kernel_8(q, hh, nb, ldq)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq integer(kind=ik), intent(in) :: nb, ldq
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(*) complex(kind=ck), intent(in) :: hh(*)
complex*16 x1, x2, x3, x4, x5, x6, x7, x8 complex(kind=ck) :: x1, x2, x3, x4, x5, x6, x7, x8
complex*16 h1, tau1 complex(kind=ck) :: h1, tau1
integer i integer(kind=ik) :: i
x1 = q(1,1) x1 = q(1,1)
...@@ -304,16 +304,17 @@ contains ...@@ -304,16 +304,17 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_4(q, hh, nb, ldq) subroutine hh_trafo_complex_kernel_4(q, hh, nb, ldq)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq integer(kind=ik), intent(in) :: nb, ldq
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(*) complex(kind=ck), intent(in) :: hh(*)
complex*16 x1, x2, x3, x4 complex(kind=ck) :: x1, x2, x3, x4
complex*16 h1, tau1 complex(kind=ck) :: h1, tau1
integer i integer(kind=ik) :: i
x1 = q(1,1) x1 = q(1,1)
...@@ -357,17 +358,17 @@ contains ...@@ -357,17 +358,17 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_4_2hv(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_complex_kernel_4_2hv(q, hh, nb, ldq, ldh, s)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(ldh,*) complex(kind=ck), intent(in) :: hh(ldh,*)
complex*16, intent(in) :: s complex(kind=ck), intent(in) :: s
complex*16 x1, x2, x3, x4, y1, y2, y3, y4 complex(kind=ck) :: x1, x2, x3, x4, y1, y2, y3, y4
complex*16 h1, h2, tau1, tau2 complex(kind=ck) :: h1, h2, tau1, tau2
integer i integer(kind=ik) :: i
x1 = q(1,2) x1 = q(1,2)
x2 = q(2,2) x2 = q(2,2)
...@@ -443,17 +444,17 @@ contains ...@@ -443,17 +444,17 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_8_2hv(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_complex_kernel_8_2hv(q, hh, nb, ldq, ldh, s)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(ldh,*) complex(kind=ck), intent(in) :: hh(ldh,*)
complex*16, intent(in) :: s complex(kind=ck), intent(in) :: s
complex*16 x1, x2, x3, x4, x5, x6 ,x7, x8, y1, y2, y3, y4, y5, y6, y7, y8 complex(kind=ck) :: x1, x2, x3, x4, x5, x6 ,x7, x8, y1, y2, y3, y4, y5, y6, y7, y8
complex*16 h1, h2, tau1, tau2 complex(kind=ck) :: h1, h2, tau1, tau2
integer i integer(kind=ik) :: i
x1 = q(1,2) x1 = q(1,2)
x2 = q(2,2) x2 = q(2,2)
...@@ -574,17 +575,18 @@ contains ...@@ -574,17 +575,18 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine hh_trafo_complex_kernel_12_2hv(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_complex_kernel_12_2hv(q, hh, nb, ldq, ldh, s)
use precision
implicit none implicit none
integer, intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(ldh,*) complex(kind=ck), intent(in) :: hh(ldh,*)
complex*16, intent(in) :: s complex(kind=ck), intent(in) :: s
complex*16 x1, x2, x3, x4, x5, x6 ,x7, x8, x9, x10, x11, x12, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12 complex(kind=ck) :: x1, x2, x3, x4, x5, x6 ,x7, x8, x9, x10, x11, x12, y1, y2, y3, y4, y5, y6, &
complex*16 h1, h2, tau1, tau2 y7, y8, y9, y10, y11, y12
integer i complex(kind=ck) :: h1, h2, tau1, tau2
integer(kind=ik) :: i
x1 = q(1,2) x1 = q(1,2)
x2 = q(2,2) x2 = q(2,2)
......
...@@ -61,15 +61,16 @@ module complex_generic_simple_kernel ...@@ -61,15 +61,16 @@ module complex_generic_simple_kernel
public single_hh_trafo_complex_generic_simple public single_hh_trafo_complex_generic_simple
contains contains
subroutine single_hh_trafo_complex_generic_simple(q, hh, nb, nq, ldq) subroutine single_hh_trafo_complex_generic_simple(q, hh, nb, nq, ldq)
use precision
implicit none implicit none
integer, intent(in) :: nb, nq, ldq integer(kind=ik), intent(in) :: nb, nq, ldq
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(*) complex(kind=ck), intent(in) :: hh(*)
integer i integer(kind=ik) :: i
complex*16 h1, tau1, x(nq) complex(kind=ck) :: h1, tau1, x(nq)
! Just one Householder transformation ! Just one Householder transformation
...@@ -92,15 +93,15 @@ contains ...@@ -92,15 +93,15 @@ contains
! -------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------
subroutine double_hh_trafo_complex_generic_simple(q, hh, nb, nq, ldq, ldh) subroutine double_hh_trafo_complex_generic_simple(q, hh, nb, nq, ldq, ldh)
use precision
implicit none implicit none
integer, intent(in) :: nb, nq, ldq, ldh integer(kind=ik), intent(in) :: nb, nq, ldq, ldh
complex*16, intent(inout) :: q(ldq,*) complex(kind=ck), intent(inout) :: q(ldq,*)
complex*16, intent(in) :: hh(ldh,*) complex(kind=ck), intent(in) :: hh(ldh,*)
complex*16 s, h1, h2, tau1, tau2, x(nq), y(nq) complex(kind=ck) :: s, h1, h2, tau1, tau2, x(nq), y(nq)
integer i integer(kind=ik) :: i
! Calculate dot product of the two Householder vectors ! Calculate dot product of the two Householder vectors
......
...@@ -59,15 +59,15 @@ ...@@ -59,15 +59,15 @@
! public double_hh_trafo_generic ! public double_hh_trafo_generic
!contains !contains
subroutine double_hh_trafo_generic(q, hh, nb, nq, ldq, ldh) subroutine double_hh_trafo_generic(q, hh, nb, nq, ldq, ldh)
use precision
implicit none implicit none