Commit 4768c659 authored by Andreas Marek's avatar Andreas Marek
Browse files

Map old solve_tridi routines to new interface

parent d8799c6d
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
call elpaAPI%invert_trm(a, successInternal) call elpaAPI%invert_trm(a, successInternal)
if (successInternal .ne. ELPA_OK) then if (successInternal .ne. ELPA_OK) then
print *, "Cannot run cholesky" print *, "Cannot run invert_trm"
stop stop
success = .false. success = .false.
return return
......
...@@ -56,30 +56,70 @@ ...@@ -56,30 +56,70 @@
#include "../sanity.X90" #include "../sanity.X90"
use elpa1_compute, solve_tridi_& !use elpa1_compute, solve_tridi_&
&PRECISION& ! &PRECISION&
&_private => solve_tridi_& ! &_private => solve_tridi_&
&PRECISION ! &PRECISION
use precision use precision
use elpa_type
#ifdef HAVE_DETAILED_TIMINGS
use timings
#else
use timings_dummy
#endif
implicit none implicit none
integer(kind=ik) :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols integer(kind=ik) :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
real(kind=REAL_DATATYPE) :: d(na), e(na) real(kind=REAL_DATATYPE) :: d(na), e(na)
#ifdef USE_ASSUMED_SIZE !#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: q(ldq,*) ! real(kind=REAL_DATATYPE) :: q(ldq,*)
#else !#else
real(kind=REAL_DATATYPE) :: q(ldq,matrixCols) real(kind=REAL_DATATYPE) :: q(ldq,matrixCols)
#endif !#endif
logical, intent(in) :: wantDebug logical, intent(in) :: wantDebug
logical :: success logical :: success
integer(kind=iK) :: successInternal
type(elpa_t) :: elpaAPI
call timer%start("elpa_solve_tridi_&
&PRECISION&
&_legacy_interface")
success = .false. success = .false.
call solve_tridi_& if (elpa_init(20170403) /= ELPA_OK) then
success = .false.
error stop "ELPA API version not supported"
endif
elpaAPI = elpa_create(na, nev, ldq, matrixCols, nblk, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
success = .false.
stop
return
endif
call elpaAPI%set_comm_rows(mpi_comm_rows)
call elpaAPI%set_comm_cols(mpi_comm_cols)
call elpaAPI%solve_tridi(d, e, q, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run solve_tridi"
stop
success = .false.
return
else
success =.true.
endif
call elpaAPI%destroy()
call elpa_uninit()
call timer%stop("elpa_solve_tridi_&
&PRECISION& &PRECISION&
&_private(na, nev, d, e, q, ldq, nblk, matrixCols, & &_legacy_interface")
mpi_comm_rows, mpi_comm_cols, wantDebug, success)
#undef REALCASE #undef REALCASE
#undef COMPLEXCASE #undef COMPLEXCASE
......
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