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,6 +204,7 @@ ...@@ -204,6 +204,7 @@
return return
endif endif
if (na .gt. 1) then
time_evp_fwd = e%get_time("elpa_solve_evp_& time_evp_fwd = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE& &MATH_DATATYPE&
&_2stage_& &_2stage_&
...@@ -235,6 +236,7 @@ ...@@ -235,6 +236,7 @@
if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) & if (my_prow==0 .and. my_pcol==0 .and. elpa_print_times) &
write(error_unit,*) 'Time solve_tridi :',time_evp_solve write(error_unit,*) 'Time solve_tridi :',time_evp_solve
if (nev .ge. 1) then
time_evp_back = e%get_time("elpa_solve_evp_& time_evp_back = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE& &MATH_DATATYPE&
&_2stage_& &_2stage_&
...@@ -257,8 +259,8 @@ ...@@ -257,8 +259,8 @@
&_2stage_& &_2stage_&
&PRECISION& &PRECISION&
&","trans_ev_to_full") &","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
if (na .gt. 2) then
a = exp(log(largest_ev)/(na-1)) 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