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

Special case: matrix size 1

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