Commit 9a45b873 authored by Victor Yu's avatar Victor Yu

Add an option to save overlap matrix

parent 1dc51216
......@@ -84,6 +84,7 @@ module ELSI_DATATYPE
integer(kind=i4) :: n_calls_all ! Total number of calls
! Overlap
logical :: save_ovlp
logical :: unit_ovlp
logical :: ill_ovlp
logical :: ill_check
......@@ -193,6 +194,7 @@ module ELSI_DATATYPE
logical :: nt_started = .false.
type(Matrix_ps) :: nt_ham
type(Matrix_ps) :: nt_ovlp
type(Matrix_ps) :: nt_ovlp_copy
type(Matrix_ps) :: nt_dm
type(SolverParameters_t) :: nt_options
type(Permutation_t) :: nt_perm
......
......@@ -43,6 +43,7 @@ module ELSI
public :: elsi_set_output_log
public :: elsi_set_output_tag
public :: elsi_set_uuid
public :: elsi_set_save_ovlp
public :: elsi_set_unit_ovlp
public :: elsi_set_zero_def
public :: elsi_set_illcond_check
......
......@@ -33,6 +33,7 @@ module ELSI_MUTATOR
public :: elsi_set_output_log
public :: elsi_set_output_tag
public :: elsi_set_uuid
public :: elsi_set_save_ovlp
public :: elsi_set_unit_ovlp
public :: elsi_set_zero_def
public :: elsi_set_illcond_check
......@@ -234,6 +235,29 @@ subroutine elsi_set_uuid(eh,uuid)
end subroutine
!>
!! This routine sets whether to save the overlap matrix or its Cholesky factor
!! for density matrix extrapolation.
!!
subroutine elsi_set_save_ovlp(eh,save_ovlp)
implicit none
type(elsi_handle), intent(inout) :: eh !< Handle
integer(kind=i4), intent(in) :: save_ovlp !< Save overlap?
character(len=*), parameter :: caller = "elsi_set_save_ovlp"
call elsi_check_init(eh%bh,eh%handle_init,caller)
if(save_ovlp == 0) then
eh%ph%save_ovlp = .false.
else
eh%ph%save_ovlp = .true.
end if
end subroutine
!>
!! This routine sets the overlap matrix to be identity.
!!
......
......@@ -269,6 +269,7 @@ subroutine elsi_cleanup_ntpoly(ph)
call DeactivateLogger()
call DestructMatrix(ph%nt_ham)
call DestructMatrix(ph%nt_ovlp)
call DestructMatrix(ph%nt_ovlp_copy)
call DestructMatrix(ph%nt_dm)
call DestructPermutation(ph%nt_perm)
call DestructProcessGrid(ph%nt_pgrid)
......
......@@ -508,6 +508,7 @@ subroutine elsi_dm_real(eh,ham,ovlp,dm,energy)
call fjson_get_datetime_rfc3339(dt0)
eh%ph%n_calls = eh%ph%n_calls+1
eh%ph%ill_check = .false.
solver_save = eh%ph%solver
if(eh%ph%solver == SIPS_SOLVER .and. eh%ph%n_calls <= eh%ph%sips_n_elpa) then
......@@ -747,6 +748,7 @@ subroutine elsi_dm_complex(eh,ham,ovlp,dm,energy)
call fjson_get_datetime_rfc3339(dt0)
eh%ph%n_calls = eh%ph%n_calls+1
eh%ph%ill_check = .false.
solver_save = eh%ph%solver
if(eh%ph%solver == OMM_SOLVER .and. eh%ph%n_calls <= eh%ph%omm_n_elpa) then
......@@ -912,6 +914,7 @@ subroutine elsi_dm_real_sparse(eh,ham,ovlp,dm,energy)
call fjson_get_datetime_rfc3339(dt0)
eh%ph%n_calls = eh%ph%n_calls+1
eh%ph%ill_check = .false.
solver_save = eh%ph%solver
if(eh%ph%solver == SIPS_SOLVER .and. eh%ph%n_calls <= eh%ph%sips_n_elpa) then
......@@ -1282,6 +1285,7 @@ subroutine elsi_dm_complex_sparse(eh,ham,ovlp,dm,energy)
call fjson_get_datetime_rfc3339(dt0)
eh%ph%n_calls = eh%ph%n_calls+1
eh%ph%ill_check = .false.
solver_save = eh%ph%solver
if(eh%ph%solver == OMM_SOLVER .and. eh%ph%n_calls <= eh%ph%omm_n_elpa) then
......
......@@ -90,6 +90,7 @@ subroutine elsi_reset_param(ph)
ph%parallel_mode = UNSET
ph%n_calls = 0
ph%n_calls_all = 0
ph%save_ovlp = .false.
ph%unit_ovlp = .false.
ph%ill_ovlp = .false.
ph%ill_check = .true.
......
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