Commit d0703559 authored by Andreas Marek's avatar Andreas Marek

Assumed size arrays for new interface

parent 47761780
......@@ -97,6 +97,8 @@ module elpa1_auxiliary_impl
#include "elpa_cholesky_template.X90"
end function elpa_cholesky_real_double_impl
#undef DOUBLE_PRECISION
#undef REALCASE
#ifdef WANT_SINGLE_PRECISION_REAL
#define REALCASE 1
......@@ -108,6 +110,8 @@ module elpa1_auxiliary_impl
#include "elpa_cholesky_template.X90"
end function elpa_cholesky_real_single_impl
#undef SINGLE_PRECISION
#undef REALCASE
#endif /* WANT_SINGLE_PRECSION_REAL */
......@@ -132,6 +136,8 @@ module elpa1_auxiliary_impl
mpi_comm_cols, wantDebug) result(success)
#include "elpa_invert_trm.X90"
end function elpa_invert_trm_real_double_impl
#undef DOUBLE_PRECISION
#undef REALCASE
#if WANT_SINGLE_PRECISION_REAL
#define REALCASE 1
......@@ -156,6 +162,8 @@ module elpa1_auxiliary_impl
mpi_comm_cols, wantDebug) result(success)
#include "elpa_invert_trm.X90"
end function elpa_invert_trm_real_single_impl
#undef SINGLE_PRECISION
#undef REALCASE
#endif /* WANT_SINGLE_PRECISION_REAL */
......@@ -185,7 +193,8 @@ module elpa1_auxiliary_impl
#include "elpa_cholesky_template.X90"
end function elpa_cholesky_complex_double_impl
#undef DOUBLE_PRECISION
#undef COMPLEXCASE
#ifdef WANT_SINGLE_PRECISION_COMPLEX
#define COMPLEXCASE 1
......@@ -213,6 +222,8 @@ module elpa1_auxiliary_impl
#include "elpa_cholesky_template.X90"
end function elpa_cholesky_complex_single_impl
#undef SINGLE_PRECISION
#undef COMPLEXCASE
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
......@@ -239,6 +250,8 @@ module elpa1_auxiliary_impl
mpi_comm_cols, wantDebug) result(success)
#include "elpa_invert_trm.X90"
end function elpa_invert_trm_complex_double_impl
#undef DOUBLE_PRECISION
#undef COMPLEXCASE
#ifdef WANT_SINGLE_PRECISION_COMPLEX
#define COMPLEXCASE 1
......@@ -264,6 +277,8 @@ module elpa1_auxiliary_impl
mpi_comm_cols, wantDebug) result(success)
#include "elpa_invert_trm.X90"
end function elpa_invert_trm_complex_single_impl
#undef SINGLE_PRECISION
#undef COMPLEXCASE
#endif /* WANT_SINGE_PRECISION_COMPLEX */
......@@ -274,6 +289,8 @@ module elpa1_auxiliary_impl
mpi_comm_rows, mpi_comm_cols, c, ldc, ldcCols) result(success)
#include "elpa_multiply_a_b.X90"
end function elpa_mult_at_b_real_double_impl
#undef DOUBLE_PRECISION
#undef REALCASE
#if WANT_SINGLE_PRECISION_REAL
#define REALCASE 1
......@@ -318,7 +335,8 @@ module elpa1_auxiliary_impl
#include "elpa_multiply_a_b.X90"
end function elpa_mult_at_b_real_single_impl
#undef SINGLE_PRECISION
#undef REALCASE
#endif /* WANT_SINGLE_PRECISION_REAL */
......@@ -365,6 +383,8 @@ module elpa1_auxiliary_impl
#include "elpa_multiply_a_b.X90"
end function elpa_mult_ah_b_complex_double_impl
#undef DOUBLE_PRECISION
#undef COMPLEXCASE
#ifdef WANT_SINGLE_PRECISION_COMPLEX
#define COMPLEXCASE 1
......@@ -411,7 +431,8 @@ module elpa1_auxiliary_impl
#include "elpa_multiply_a_b.X90"
end function elpa_mult_ah_b_complex_single_impl
#undef SINGLE_PRECISION
#undef COMPLEXCASE
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
#define REALCASE 1
......@@ -441,7 +462,8 @@ module elpa1_auxiliary_impl
#include "elpa_solve_tridi_impl_public.X90"
end function
#undef DOUBLE_PRECISION
#undef REALCASE
#ifdef WANT_SINGLE_PRECISION_REAL
#define REALCASE 1
......@@ -471,7 +493,8 @@ module elpa1_auxiliary_impl
#include "elpa_solve_tridi_impl_public.X90"
end function
#undef SINGLE_PRECISION
#undef REALCASE
#endif /* WANT_SINGLE_PRECISION_REAL */
......
......@@ -56,18 +56,18 @@
integer(kind=ik) :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
#if REALCASE == 1
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
#if COMPLEXCASE == 1
!#ifdef USE_ASSUMED_SIZE
! complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
#else
complex(kind=COMPLEX_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
integer(kind=ik) :: l_cols, l_rows, l_col1, l_row1, l_colx, l_rowx
......
......@@ -78,23 +78,23 @@ function elpa_solve_evp_&
integer(kind=c_int) :: my_pe, n_pes, my_prow, my_pcol, mpierr
#if REALCASE == 1
!#ifdef USE_ASSUMED_SIZE
! real(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,*)
! real(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,*)
real(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,*)
#else
real(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,matrixCols)
real(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,matrixCols)
!#endif
#endif
#endif /* REALCASE */
#if COMPLEXCASE == 1
!#ifdef USE_ASSUMED_SIZE
! complex(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,*)
! complex(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,*)
complex(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,*)
#else
complex(kind=C_DATATYPE_KIND), intent(inout) :: a(lda,matrixCols)
complex(kind=C_DATATYPE_KIND), intent(out) :: q(ldq,matrixCols)
!#endif
#endif
#endif /* COMPLEXCASE */
......
......@@ -57,18 +57,18 @@
integer(kind=ik) :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
#if REALCASE == 1
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
#if COMPLEXCASE == 1
!#ifdef USE_ASSUMED_SIZE
! complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
#else
complex(kind=COMPLEX_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
! integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
integer(kind=ik) :: nev
......@@ -118,7 +118,7 @@
call elpaAPI%set_comm_rows(mpi_comm_rows)
call elpaAPI%set_comm_cols(mpi_comm_cols)
call elpaAPI%cholesky(a, successInternal)
call elpaAPI%cholesky(a(1:lda,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run cholesky"
......
......@@ -66,19 +66,19 @@
integer(kind=ik) :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
#if REALCASE == 1
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
#if COMPLEXCASE == 1
!#ifdef USE_ASSUMED_SIZE
! complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=COMPLEX_DATATYPE) :: a(lda,*)
#else
complex(kind=COMPLEX_DATATYPE) :: a(lda,matrixCols)
!#endif
#endif
#endif
! integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
......@@ -126,7 +126,7 @@
call elpaAPI%set_comm_rows(mpi_comm_rows)
call elpaAPI%set_comm_cols(mpi_comm_cols)
call elpaAPI%invert_trm(a, successInternal)
call elpaAPI%invert_trm(a(1:lda,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run invert_trm"
......
......@@ -70,18 +70,18 @@
integer(kind=ik), intent(in) :: na, lda, ldaCols, ldb, ldbCols, ldc, ldcCols, nblk
integer(kind=ik) :: ncb, mpi_comm_rows, mpi_comm_cols
#if REALCASE == 1
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#endif
#endif
#if COMPLEXCASE == 1
!#ifdef USE_ASSUMED_SIZE
#ifdef USE_ASSUMED_SIZE
complex(kind=COMPLEX_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
! complex(kind=COMPLEX_DATATYPE) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#else
complex(kind=COMPLEX_DATATYPE) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
#endif
#endif
! integer(kind=ik) :: my_prow, my_pcol, np_rows, np_cols, mpierr
integer(kind=ik) :: nev
......
......@@ -70,11 +70,11 @@
implicit none
integer(kind=ik) :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
real(kind=REAL_DATATYPE) :: d(na), e(na)
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: q(ldq,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: q(ldq,*)
#else
real(kind=REAL_DATATYPE) :: q(ldq,matrixCols)
!#endif
#endif
logical, intent(in) :: wantDebug
logical :: success
......@@ -105,7 +105,7 @@
call elpaAPI%set_comm_rows(mpi_comm_rows)
call elpaAPI%set_comm_cols(mpi_comm_cols)
call elpaAPI%solve_tridi(d, e, q, successInternal)
call elpaAPI%solve_tridi(d(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run solve_tridi"
......
......@@ -369,11 +369,11 @@ module elpa_type
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=c_double) :: a(self%local_nrows, *), q(self%local_nrows, *)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
real(kind=c_double) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
!#endif
#endif
real(kind=c_double) :: ev(self%na)
real(kind=c_double) :: time_evp_fwd, time_evp_solve, time_evp_back
......@@ -488,11 +488,11 @@ module elpa_type
use iso_c_binding
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=c_float) :: a(self%local_nrows, *), q(self%local_nrows, *)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=c_float) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
real(kind=c_float) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
!#endif
#endif
real(kind=c_float) :: ev(self%na)
real(kind=c_double) :: time_evp_fwd, time_evp_solve, time_evp_back
......@@ -613,11 +613,11 @@ module elpa_type
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! complex(kind=c_double_complex) :: a(self%local_nrows, *), q(self%local_nrows, *)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=c_double_complex) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=c_double_complex) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
!#endif
#endif
real(kind=c_double) :: ev(self%na)
real(kind=c_double) :: time_evp_fwd, time_evp_solve, time_evp_back
......@@ -720,11 +720,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! complex(kind=c_float_complex) :: a(self%local_nrows, *), q(self%local_nrows, *)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck4) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=ck4) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
!#endif
#endif
real(kind=rk4) :: ev(self%na)
real(kind=c_double) :: time_evp_fwd, time_evp_solve, time_evp_back
......@@ -834,11 +834,11 @@ module elpa_type
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=ik), intent(in) :: na, lda, ldaCols, ldb, ldbCols, ldc, ldcCols, ncb
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk8) :: a(lda,*), b(ldb,*), c(ldc,*)
#else
real(kind=rk8) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#endif
integer, optional :: success
logical :: success_l
......@@ -864,11 +864,11 @@ module elpa_type
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=ik), intent(in) :: na, lda, ldaCols, ldb, ldbCols, ldc, ldcCols, ncb
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk4) :: a(lda,*), b(ldb,*), c(ldc,*)
#else
real(kind=rk4) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#endif
integer, optional :: success
logical :: success_l
#ifdef WANT_SINGLE_PRECISION_REAL
......@@ -898,11 +898,11 @@ module elpa_type
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=ik), intent(in) :: na, lda, ldaCols, ldb, ldbCols, ldc, ldcCols, ncb
!#ifdef USE_ASSUMED_SIZE
! complex(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck8) :: a(lda,*), b(ldb,*), c(ldc,*)
#else
complex(kind=ck8) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#endif
integer, optional :: success
logical :: success_l
......@@ -928,11 +928,11 @@ module elpa_type
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=ik), intent(in) :: na, lda, ldaCols, ldb, ldbCols, ldc, ldcCols, ncb
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*), b(ldb,*), c(ldc,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck4) :: a(lda,*), b(ldb,*), c(ldc,*)
#else
complex(kind=ck4) :: a(lda,ldaCols), b(ldb,ldbCols), c(ldc,ldcCols)
!#endif
#endif
integer, optional :: success
logical :: success_l
......@@ -960,11 +960,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk8) :: a(self%local_nrows,*)
#else
real(kind=rk8) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1002,11 +1002,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk4) :: a(self%local_nrows,*)
#else
real(kind=rk4) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1048,11 +1048,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck8) :: a(self%local_nrows,*)
#else
complex(kind=ck8) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1089,11 +1089,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck4) :: a(self%local_nrows,*)
#else
complex(kind=ck4) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1134,11 +1134,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk8) :: a(self%local_nrows,*)
#else
real(kind=rk8) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1174,11 +1174,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk4) :: a(self%local_nrows,*)
#else
real(kind=rk4) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1219,11 +1219,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck8) :: a(self%local_nrows,*)
#else
complex(kind=ck8) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1259,11 +1259,11 @@ module elpa_type
use precision
implicit none
class(elpa_t) :: self
!#ifdef USE_ASSUMED_SIZE
! real(kind=REAL_DATATYPE) :: a(lda,*)
!#else
#ifdef USE_ASSUMED_SIZE
complex(kind=ck4) :: a(self%local_nrows,*)
#else
complex(kind=ck4) :: a(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
integer(kind=c_int) :: success_internal
......@@ -1305,11 +1305,11 @@ module elpa_type
implicit none
class(elpa_t) :: self
real(kind=rk8) :: d(self%na), e(self%na)
!#ifdef USE_ASSUMED_SIZE
! real(kind=rk8) :: q(self%local_nrows,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk8) :: q(self%local_nrows,*)
#else
real(kind=rk8) :: q(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
......@@ -1349,11 +1349,11 @@ module elpa_type
implicit none
class(elpa_t) :: self
real(kind=rk4) :: d(self%na), e(self%na)
!#ifdef USE_ASSUMED_SIZE
! real(kind=rk4) :: q(self%local_nrows,*)
!#else
#ifdef USE_ASSUMED_SIZE
real(kind=rk4) :: q(self%local_nrows,*)
#else
real(kind=rk4) :: q(self%local_nrows,self%local_ncols)
!#endif
#endif
integer, optional :: success
logical :: success_l
......
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