Commit d457e188 authored by Yingzhou Li's avatar Yingzhou Li

Fixed a bug in ChebFilter and updated test drivers

parent bfdd7aab
......@@ -180,6 +180,8 @@ contains
real(r8), save, allocatable :: Vec_conv(:)
real(r8), save, allocatable :: Vec_ev(:)
real(r8), save, allocatable :: Vec_evold(:)
logical :: convflag ! convergence flag.
!**********************************************!
! -- Init: parameter setup
......@@ -208,10 +210,10 @@ contains
return
end if
! -- HPsi = H*Psi
! -- start inner iteration
if (ijob == SID_INNERITER) then
ninneriter = 0
call rci_op_null(task)
call rci_op_scale(iS, task, m, n, 0.0_r8, MID_Psiold, m)
ijob = ijob + 1
return
end if
......@@ -389,10 +391,11 @@ contains
write(*,*) 'Eigenvalues are:'
print *, Vec_ev(1:n_state)
end if
convflag = (n_state == int(sum(Vec_conv)))
deallocate (Vec_conv)
deallocate (Vec_ev)
deallocate (Vec_evold)
call rci_op_converge(task, (n_state == int(sum(Vec_conv))))
call rci_op_converge(task, convflag)
return
end if
......
......@@ -48,8 +48,8 @@ contains
r_h%ppcg_rrstep = min(5,max_iter)
! ChebFilter default
r_h%est_lb = 0
r_h%est_ub = 1000
r_h%est_lb = -100
r_h%est_ub = 200
r_h%max_inneriter = 10
select case (solver)
......
......@@ -13,8 +13,6 @@ program elsi_rci_test
implicit none
include "mpif.h"
character(len=128) :: arg1 ! ev or dm
character(len=128) :: arg2 ! dense or sparse
character(len=128) :: arg3 ! real or cmplx
......@@ -114,6 +112,7 @@ subroutine test_die()
write(*,"(A)") " ## Arg #4: 1 = RCI_Davidson ##"
write(*,"(A)") " ## 2 = RCI_OMM ##"
write(*,"(A)") " ## 3 = RCI_PPCG ##"
write(*,"(A)") " ## 4 = RCI_ChebFilter ##"
write(*,"(A)") " ## Arg #5: H matrix file ##"
write(*,"(A)") " ## Arg #6: S matrix file ##"
write(*,"(A)") " ## ##"
......
......@@ -75,6 +75,9 @@ subroutine test_rci_ev_cmplx_den(solver,h_file,s_file)
if (solver == RCI_SOLVER_PPCG) then
write (*, '(" 2) Computes the eigenfunc with RCI_PPCG.")')
endif
if (solver == RCI_SOLVER_CHEBFILTER) then
write (*, '(" 2) Computes the eigenfunc with RCI_CHEBFILTER.")')
endif
write (*, *)
e_ref = e_elpa
......
......@@ -84,6 +84,9 @@ subroutine test_rci_ev_cmplx_pw(solver,h_file)
if (solver == RCI_SOLVER_PPCG) then
write (*, '(" 2) Computes the eigenfunc with RCI_PPCG.")')
endif
if (solver == RCI_SOLVER_CHEBFILTER) then
write (*, '(" 2) Computes the eigenfunc with RCI_CHEBFILTER.")')
endif
write (*, *)
e_ref = e_elpa
......@@ -202,7 +205,8 @@ subroutine test_rci_ev_cmplx_pw(solver,h_file)
Work(iS%Bidx)%Mat = Work(iS%Aidx)%Mat
case (RCI_P_MULTI)
if (solver == RCI_SOLVER_OMM) then
if ((solver == RCI_SOLVER_OMM) &
.or. (solver == RCI_SOLVER_CHEBFILTER)) then
! No preconditioner
Work(iS%Bidx)%Mat = Work(iS%Aidx)%Mat
else
......@@ -270,6 +274,7 @@ subroutine test_rci_ev_cmplx_pw(solver,h_file)
lWorktmp = max(1, 2*iS%n - 1)
allocate (Worktmp(lWorktmp))
allocate (RWorktmp(max(1,3*iS%n-2)))
call rci_write_mat_cmplx('HR.m',Work(iS%Aidx)%Mat)
call zhegv(1, iS%jobz, iS%uplo, iS%n, &
Work(iS%Aidx)%Mat, iS%lda, &
......
......@@ -88,6 +88,9 @@ subroutine test_rci_ev_real_csc(solver,h_file,s_file)
if (solver == RCI_SOLVER_PPCG) then
write (*, '(" 2) Computes the eigenfunc with RCI_PPCG.")')
endif
if (solver == RCI_SOLVER_CHEBFILTER) then
write (*, '(" 2) Computes the eigenfunc with RCI_CHEBFILTER.")')
endif
write (*, *)
e_ref = e_elpa
......
......@@ -72,6 +72,9 @@ subroutine test_rci_ev_real_den(solver,h_file,s_file)
if (solver == RCI_SOLVER_PPCG) then
write (*, '(" 2) Computes the eigenfunc with RCI_PPCG.")')
endif
if (solver == RCI_SOLVER_CHEBFILTER) then
write (*, '(" 2) Computes the eigenfunc with RCI_CHEBFILTER.")')
endif
write (*, *)
e_ref = e_elpa
......
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