Commit 088513b2 authored by Andreas Marek's avatar Andreas Marek
Browse files

Better seperate the three steps of solve 1stage:

whether or not a step is actually computed is decided with logicals
(default all 3 steps are computed). This makes the implementation
of "solve_tridi" and "eigenvalues_only" a bit cleaner in the future
parent 17c722d6
...@@ -113,6 +113,8 @@ function elpa_solve_evp_& ...@@ -113,6 +113,8 @@ function elpa_solve_evp_&
integer(kind=ik) :: na, nev, lda, ldq, nblk, matrixCols, & integer(kind=ik) :: na, nev, lda, ldq, nblk, matrixCols, &
mpi_comm_rows, mpi_comm_cols, mpi_comm_all mpi_comm_rows, mpi_comm_cols, mpi_comm_all
logical :: do_bandred, do_solve, do_trans_ev
call obj%timer%start("elpa_solve_evp_& call obj%timer%start("elpa_solve_evp_&
&MATH_DATATYPE& &MATH_DATATYPE&
&_1stage_& &_1stage_&
...@@ -236,33 +238,44 @@ function elpa_solve_evp_& ...@@ -236,33 +238,44 @@ function elpa_solve_evp_&
stop 1 stop 1
endif endif
call obj%timer%start("forward")
call tridiag_&
&MATH_DATATYPE&
&_&
&PRECISION&
& (obj, na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, ev, e, tau, do_useGPU)
call obj%timer%stop("forward")
call obj%timer%start("solve") ! start the computations
call solve_tridi_& ! as default do all three steps (this might change at some point)
&PRECISION& do_bandred = .true.
& (obj, na, nev, ev, e, & do_solve = .true.
do_trans_ev = .true.
if (obj%eigenvalues_only) then
do_trans_ev = .true.
endif
if (do_bandred) then
call obj%timer%start("forward")
call tridiag_&
&MATH_DATATYPE&
&_&
&PRECISION&
& (obj, na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, ev, e, tau, do_useGPU)
call obj%timer%stop("forward")
endif !do_bandred
if (do_solve) then
call obj%timer%start("solve")
call solve_tridi_&
&PRECISION&
& (obj, na, nev, ev, e, &
#if REALCASE == 1 #if REALCASE == 1
q_actual, ldq, & q_actual, ldq, &
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
q_real, l_rows, & q_real, l_rows, &
#endif #endif
nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug, success) nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug, success)
call obj%timer%stop("solve") call obj%timer%stop("solve")
if (.not.(success)) return if (.not.(success)) return
endif !do_solve
if (obj%eigenvalues_only) then if (do_trans_ev) then
return
endif
if (.not.(obj%eigenvalues_only) ) then
! q must be given thats why from here on we can use q and not q_actual ! q must be given thats why from here on we can use q and not q_actual
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
q(1:l_rows,1:l_cols_nev) = q_real(1:l_rows,1:l_cols_nev) q(1:l_rows,1:l_cols_nev) = q_real(1:l_rows,1:l_cols_nev)
...@@ -275,7 +288,7 @@ function elpa_solve_evp_& ...@@ -275,7 +288,7 @@ function elpa_solve_evp_&
&PRECISION& &PRECISION&
& (obj, na, nev, a, lda, tau, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, do_useGPU) & (obj, na, nev, a, lda, tau, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, do_useGPU)
call obj%timer%stop("back") call obj%timer%stop("back")
endif ! .not.(obj%eigenvalues_only endif ! do_trans_ev
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
deallocate(q_real, stat=istat, errmsg=errorMessage) deallocate(q_real, stat=istat, errmsg=errorMessage)
...@@ -309,7 +322,6 @@ function elpa_solve_evp_& ...@@ -309,7 +322,6 @@ function elpa_solve_evp_&
&" // ": error when deallocating q_dummy "//errorMessage &" // ": error when deallocating q_dummy "//errorMessage
stop 1 stop 1
endif endif
endif endif
call obj%timer%stop("elpa_solve_evp_& call obj%timer%stop("elpa_solve_evp_&
......
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