Commit 4423aa9a authored by Andreas Marek's avatar Andreas Marek

Special case: matrix size 1

parent d97f8400
......@@ -122,6 +122,7 @@ function elpa_solve_evp_&
&PRECISION&
&")
success = .true.
if (present(q)) then
obj%eigenvalues_only = .false.
......@@ -136,6 +137,28 @@ function elpa_solve_evp_&
nblk = obj%nblk
matrixCols = obj%local_ncols
! special case na = 1
if (na .eq. 1) then
#if REALCASE == 1
ev(1) = a(1,1)
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_REAL_1_0
endif
#endif
#if COMPLEXCASE == 1
ev(1) = real(a(1,1))
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_COMPLEX_PAIR_1_0
endif
#endif
call obj%timer%stop("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&")
return
endif
if (nev == 0) then
nev = 1
obj%eigenvalues_only = .true.
......@@ -167,7 +190,6 @@ function elpa_solve_evp_&
#endif
call obj%timer%stop("mpi_communication")
success = .true.
call obj%get("debug", debug)
wantDebug = debug == 1
......
......@@ -123,6 +123,8 @@
&PRECISION&
&")
success = .true.
if (present(q)) then
obj%eigenvalues_only = .false.
else
......@@ -136,6 +138,28 @@
nblk = obj%nblk
matrixCols = obj%local_ncols
! special case na = 1
if (na .eq. 1) then
#if REALCASE == 1
ev(1) = a(1,1)
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_REAL_1_0
endif
#endif
#if COMPLEXCASE == 1
ev(1) = real(a(1,1))
if (.not.(obj%eigenvalues_only)) then
q(1,1) = CONST_COMPLEX_PAIR_1_0
endif
#endif
call obj%timer%stop("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&")
return
endif
if (nev == 0) then
nev = 1
obj%eigenvalues_only = .true.
......@@ -210,7 +234,6 @@
call obj%get("debug",debug)
wantDebug = debug == 1
success = .true.
do_useGPU = .false.
do_useGPU_trans_ev_tridi =.false.
......
......@@ -204,61 +204,63 @@
return
endif
time_evp_fwd = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","bandred")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time bandred_real :', time_evp_fwd
time_evp_fwd = time_evp_fwd + e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","tridiag")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time tridiag_band_real :',e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","tridiag")
time_evp_solve = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","solve")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time solve_tridi :',time_evp_solve
time_evp_back = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_band")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time trans_ev_tridi_to_band_real:',time_evp_back
time_evp_back = time_evp_back + &
e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_full")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time trans_ev_band_to_full_real :',e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_full")
if (na .gt. 1) then
time_evp_fwd = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","bandred")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time bandred_real :', time_evp_fwd
time_evp_fwd = time_evp_fwd + e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","tridiag")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time tridiag_band_real :',e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","tridiag")
time_evp_solve = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","solve")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time solve_tridi :',time_evp_solve
if (nev .ge. 1) then
time_evp_back = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_band")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time trans_ev_tridi_to_band_real:',time_evp_back
time_evp_back = time_evp_back + &
e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_full")
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time trans_ev_band_to_full_real :',e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_2stage_&
&PRECISION&
&","trans_ev_to_full")
endif
endif ! na > 1
call elpa_deallocate(e)
call elpa_uninit()
......
......@@ -238,7 +238,11 @@ module test_analytic
! go to zero-based indexing
ii = i - 1
jj = j - 1
a = exp(log(largest_ev)/(na-1))
if (na .gt. 2) then
a = exp(log(largest_ev)/(na-1))
else
a = exp(log(largest_ev)/(1))
endif
s = 0.5_rk8
c = sqrt(3.0_rk8)/2.0_rk8
element = ONE
......
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