Commit e31aef46 authored by Andreas Marek's avatar Andreas Marek Committed by Lorenz Huedepohl

Update legacy API to new interface [ci skip]

parent c3941607
......@@ -103,7 +103,7 @@ function elpa_solve_evp_&
integer(kind=c_int) :: successInternal
type(elpa_t) :: elpa1stage
type(elpa_t) :: e
call timer%start("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
......@@ -120,15 +120,26 @@ function elpa_solve_evp_&
return
endif
elpa1stage = elpa_create(na, nev, lda, matrixCols, nblk, mpi_comm_all, &
my_prow, my_pcol, successInternal)
e = elpa_allocate()
call e%set("na", na)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
call e%set("mpi_comm_parent", mpi_comm_all)
call e%set("process_row", my_prow)
call e%set("process_col", my_pcol)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
print *, "Cannot setup ELPA instance"
success = .false.
return
endif
call elpa1stage%set("solver", ELPA_SOLVER_1STAGE, successInternal)
call e%set("solver", ELPA_SOLVER_1STAGE, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set ELPA 1stage solver"
success = .false.
......@@ -137,14 +148,14 @@ function elpa_solve_evp_&
if (present(useGPU)) then
if (useGPU) then
call elpa1stage%set("gpu", 1, successInternal)
call e%set("gpu", 1, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set gpu"
success = .false.
return
endif
else
call elpa1stage%set("gpu", 0, successInternal)
call e%set("gpu", 0, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set gpu"
success = .false.
......@@ -154,7 +165,7 @@ function elpa_solve_evp_&
endif
if (elpa_print_times) then
call elpa1stage%set("summary_timings", 1,successInternal)
call e%set("summary_timings", 1,successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set summary_timings"
success = .false.
......@@ -162,7 +173,7 @@ function elpa_solve_evp_&
endif
endif
call elpa1stage%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
call e%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot solve with ELPA 1stage"
success = .false.
......@@ -170,11 +181,11 @@ function elpa_solve_evp_&
endif
if (elpa_print_times) then
time_evp_fwd = elpa1stage%time_evp_fwd
time_evp_solve = elpa1stage%time_evp_solve
time_evp_back = elpa1stage%time_evp_back
time_evp_fwd = e%get("time_evp_fwd")
time_evp_solve = e%get("time_evp_solve")
time_evp_back = e%get("time_evp_back")
endif
call elpa1stage%destroy()
call e%destroy()
call elpa_uninit()
......
......@@ -119,13 +119,12 @@
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
print *, "Cannot setup ELPA instance"
success = .false.
stop
return
endif
call e%cholesky(a(1:lda,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
......
......@@ -127,13 +127,12 @@
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
print *, "Cannot setup ELPA instance"
success = .false.
stop
return
endif
call e%invert_tridiagonal(a(1:lda,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
......
......@@ -139,7 +139,7 @@
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run multiply_a_b"
print *, "Cannot setup ELPA instance"
stop
success = .false.
return
......
......@@ -79,7 +79,7 @@
logical, intent(in) :: wantDebug
logical :: success
integer(kind=iK) :: successInternal
type(elpa_t) :: elpaAPI
type(elpa_t) :: e
call timer%start("elpa_solve_tridi_&
&PRECISION&
......@@ -94,18 +94,25 @@
return
endif
elpaAPI = elpa_create(na, nev, ldq, matrixCols, nblk, successInternal)
e = elpa_allocate()
call e%set("na", na)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
call e%set("mpi_comm_rows", mpi_comm_rows)
call e%set("mpi_comm_cols", mpi_comm_cols)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
print *, "Cannot setup ELPA instance"
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(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
call e%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"
......@@ -115,7 +122,7 @@
else
success =.true.
endif
call elpaAPI%destroy()
call e%destroy()
call elpa_uninit()
......
......@@ -95,7 +95,7 @@
logical :: success
integer(kind=c_int) :: successInternal
type(elpa_t) :: elpa2stage
type(elpa_t) :: e
call timer%start("solve_evp_&
&MATH_DATATYPE&
......@@ -113,16 +113,26 @@
return
endif
elpa2stage = elpa_create(na, nev, lda, matrixCols, nblk, mpi_comm_all, &
my_prow, my_pcol, successInternal)
e = elpa_allocate()
call e%set("na", na)
call e%set("local_nrows", lda)
call e%set("local_ncols", matrixCols)
call e%set("nblk", nblk)
call e%set("mpi_comm_parent", mpi_comm_all)
call e%set("process_row", my_prow)
call e%set("process_col", my_pcol)
call e%setup(successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot create elpa object"
print *, "Cannot setup ELPA instance"
success = .false.
return
endif
call elpa2stage%set("solver", ELPA_SOLVER_2STAGE, successInternal)
call e%set("solver", ELPA_SOLVER_2STAGE, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set ELPA 1stage solver"
success = .false.
......@@ -131,14 +141,14 @@
if (present(useGPU)) then
if (useGPU) then
call elpa2stage%set("gpu", 1, successInternal)
call e%set("gpu", 1, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set gpu"
success = .false.
return
endif
else
call elpa2stage%set("gpu", 0, successInternal)
call e%set("gpu", 0, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set gpu"
success = .false.
......@@ -150,14 +160,14 @@
#if REALCASE == 1
if (present(useQR)) then
if (useQR) then
call elpa2stage%set("qr", 1, successInternal)
call e%set("qr", 1, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set qr"
success = .false.
return
endif
else
call elpa2stage%set("qr", 0, successInternal)
call e%set("qr", 0, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set qr"
success = .false.
......@@ -169,7 +179,7 @@
#if REALCASE == 1
if (present(THIS_ELPA_KERNEL_API)) then
call elpa2stage%set("real_kernel",THIS_ELPA_KERNEL_API, successInternal)
call e%set("real_kernel",THIS_ELPA_KERNEL_API, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set ELPA2 stage real_kernel"
success = .false.
......@@ -180,7 +190,7 @@
#if COMPLEXCASE == 1
if (present(THIS_ELPA_KERNEL_API)) then
call elpa2stage%set("complex_kernel",THIS_ELPA_KERNEL_API, successInternal)
call e%set("complex_kernel",THIS_ELPA_KERNEL_API, successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set ELPA2 stage complex_kernel"
success = .false.
......@@ -190,7 +200,7 @@
#endif
if (elpa_print_times) then
call elpa2stage%set("summary_timings", 1,successInternal)
call e%set("summary_timings", 1,successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot set summary_timings"
success = .false.
......@@ -198,7 +208,7 @@
endif
endif
call elpa2stage%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
call e%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot solve with ELPA 2stage"
success = .false.
......@@ -206,12 +216,12 @@
endif
if (elpa_print_times) then
time_evp_fwd = elpa2stage%time_evp_fwd
time_evp_solve = elpa2stage%time_evp_solve
time_evp_back = elpa2stage%time_evp_back
time_evp_fwd = e%get("time_evp_fwd")
time_evp_solve = e%get("time_evp_solve")
time_evp_back = e%get("time_evp_back")
endif
call elpa2stage%destroy()
call e%destroy()
call elpa_uninit()
......
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