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,21 +57,21 @@
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
integer(kind=ik) :: nev
! integer(kind=ik) :: l_cols, l_rows, l_col1, l_row1, l_colx, l_rowx
! integer(kind=ik) :: n, nc, i, info
! integer(kind=ik) :: lcs, lce, lrs, lre
......@@ -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"
......
This diff is collapsed.
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