Commit f665dcf0 authored by Victor Yu's avatar Victor Yu

Add placeholder for GENERIC_COO matrix format

No implementation is checked in yet.
parent 9da4affe
......@@ -312,28 +312,6 @@ void c_elsi_extrapolate_dm_complex(elsi_handle handle_c,
double _Complex *ovlp,
double _Complex *dm);
void c_elsi_construct_dm_real(elsi_handle handle_c,
double *occ,
double *evec,
double *dm);
void c_elsi_construct_dm_complex(elsi_handle handle_c,
double *occ,
double _Complex *evec,
double _Complex *dm);
void c_elsi_construct_edm_real(elsi_handle handle_c,
double *occ,
double *eval,
double *evec,
double *edm);
void c_elsi_construct_edm_complex(elsi_handle handle_c,
double *occ,
double *eval,
double _Complex *evec,
double _Complex *edm);
void c_elsi_init_rw(elsi_rw_handle *handle_c,
int rw_task,
int parallel_mode,
......
......@@ -1617,144 +1617,6 @@ subroutine elsi_extrapolate_dm_complex_c_wrapper(h_c,ovlp_c,dm_c)&
end subroutine
subroutine elsi_construct_dm_real_c_wrapper(h_c,occ_c,evec_c,dm_c)&
bind(C,name="c_elsi_construct_dm_real")
implicit none
type(c_ptr), value, intent(in) :: h_c
type(c_ptr), value, intent(in) :: occ_c
type(c_ptr), value, intent(in) :: evec_c
type(c_ptr), value, intent(in) :: dm_c
type(elsi_handle), pointer :: h_f
real(kind=c_double), pointer :: occ_f(:)
real(kind=c_double), pointer :: evec_f(:,:)
real(kind=c_double), pointer :: dm_f(:,:)
integer(kind=c_int) :: n_state
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_state = h_f%ph%n_states
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
call c_f_pointer(occ_c,occ_f,shape=[n_state])
call c_f_pointer(evec_c,evec_f,shape=[lrow,lcol])
call c_f_pointer(dm_c,dm_f,shape=[lrow,lcol])
call elsi_construct_dm_real(h_f,occ_f,evec_f,dm_f)
end subroutine
subroutine elsi_construct_dm_complex_c_wrapper(h_c,occ_c,evec_c,dm_c)&
bind(C,name="c_elsi_construct_dm_complex")
implicit none
type(c_ptr), value, intent(in) :: h_c
type(c_ptr), value, intent(in) :: occ_c
type(c_ptr), value, intent(in) :: evec_c
type(c_ptr), value, intent(in) :: dm_c
type(elsi_handle), pointer :: h_f
real(kind=c_double), pointer :: occ_f(:)
complex(kind=c_double), pointer :: evec_f(:,:)
complex(kind=c_double), pointer :: dm_f(:,:)
integer(kind=c_int) :: n_state
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_state = h_f%ph%n_states
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
call c_f_pointer(occ_c,occ_f,shape=[n_state])
call c_f_pointer(evec_c,evec_f,shape=[lrow,lcol])
call c_f_pointer(dm_c,dm_f,shape=[lrow,lcol])
call elsi_construct_dm_complex(h_f,occ_f,evec_f,dm_f)
end subroutine
subroutine elsi_construct_edm_real_c_wrapper(h_c,occ_c,eval_c,evec_c,edm_c)&
bind(C,name="c_elsi_construct_edm_real")
implicit none
type(c_ptr), value, intent(in) :: h_c
type(c_ptr), value, intent(in) :: occ_c
type(c_ptr), value, intent(in) :: eval_c
type(c_ptr), value, intent(in) :: evec_c
type(c_ptr), value, intent(in) :: edm_c
type(elsi_handle), pointer :: h_f
real(kind=c_double), pointer :: occ_f(:)
real(kind=c_double), pointer :: eval_f(:)
real(kind=c_double), pointer :: evec_f(:,:)
real(kind=c_double), pointer :: edm_f(:,:)
integer(kind=c_int) :: n_state
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_state = h_f%ph%n_states
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
call c_f_pointer(occ_c,occ_f,shape=[n_state])
call c_f_pointer(eval_c,eval_f,shape=[n_state])
call c_f_pointer(evec_c,evec_f,shape=[lrow,lcol])
call c_f_pointer(edm_c,edm_f,shape=[lrow,lcol])
call elsi_construct_edm_real(h_f,occ_f,eval_f,evec_f,edm_f)
end subroutine
subroutine elsi_construct_edm_complex_c_wrapper(h_c,occ_c,eval_c,evec_c,edm_c)&
bind(C,name="c_elsi_construct_edm_complex")
implicit none
type(c_ptr), value, intent(in) :: h_c
type(c_ptr), value, intent(in) :: occ_c
type(c_ptr), value, intent(in) :: eval_c
type(c_ptr), value, intent(in) :: evec_c
type(c_ptr), value, intent(in) :: edm_c
type(elsi_handle), pointer :: h_f
real(kind=c_double), pointer :: occ_f(:)
real(kind=c_double), pointer :: eval_f(:)
complex(kind=c_double), pointer :: evec_f(:,:)
complex(kind=c_double), pointer :: edm_f(:,:)
integer(kind=c_int) :: n_state
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_state = h_f%ph%n_states
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
call c_f_pointer(occ_c,occ_f,shape=[n_state])
call c_f_pointer(eval_c,eval_f,shape=[n_state])
call c_f_pointer(evec_c,evec_f,shape=[lrow,lcol])
call c_f_pointer(edm_c,edm_f,shape=[lrow,lcol])
call elsi_construct_edm_complex(h_f,occ_f,eval_f,evec_f,edm_f)
end subroutine
subroutine elsi_init_rw_c_wrapper(h_c,rw_task,parallel_mode,n_basis,n_electron)&
bind(C,name="c_elsi_init_rw")
......
......@@ -18,7 +18,7 @@ module ELSI_CONSTANTS
integer(kind=i4), parameter :: UNSET = -910910
integer(kind=i4), parameter :: N_SOLVERS = 7
integer(kind=i4), parameter :: N_MATRIX_FORMATS = 3
integer(kind=i4), parameter :: N_MATRIX_FORMATS = 4
integer(kind=i4), parameter :: N_PARALLEL_MODES = 2
! Method names
......@@ -37,6 +37,7 @@ module ELSI_CONSTANTS
integer(kind=i4), parameter :: BLACS_DENSE = 0
integer(kind=i4), parameter :: PEXSI_CSC = 1
integer(kind=i4), parameter :: SIESTA_CSC = 2
integer(kind=i4), parameter :: GENERIC_COO = 3
! Triangular matrix
integer(kind=i4), parameter :: FULL_MAT = 0
......
......@@ -72,6 +72,10 @@ module ELSI_DATATYPE
integer(kind=i4) :: blk_sp2
logical :: siesta_csc_ready = .false.
! Sparse matrix information (generic)
integer(kind=i4) :: nnz_l_sp3 ! Local number of nonzeros
logical :: generic_coo_ready = .false.
end type
type, public :: elsi_param_t
......@@ -220,16 +224,18 @@ module ELSI_DATATYPE
complex(kind=r8), allocatable :: dm_cmplx_den(:,:)
! Sparse
real(kind=r8), allocatable :: ham_real_csc(:)
complex(kind=r8), allocatable :: ham_cmplx_csc(:)
real(kind=r8), allocatable :: ovlp_real_csc(:)
complex(kind=r8), allocatable :: ovlp_cmplx_csc(:)
real(kind=r8), allocatable :: dm_real_csc(:)
complex(kind=r8), allocatable :: dm_cmplx_csc(:)
real(kind=r8), allocatable :: ham_real_sp(:)
complex(kind=r8), allocatable :: ham_cmplx_sp(:)
real(kind=r8), allocatable :: ovlp_real_sp(:)
complex(kind=r8), allocatable :: ovlp_cmplx_sp(:)
real(kind=r8), allocatable :: dm_real_sp(:)
complex(kind=r8), allocatable :: dm_cmplx_sp(:)
integer(kind=i4), allocatable :: row_ind_sp1(:)
integer(kind=i4), allocatable :: col_ptr_sp1(:)
integer(kind=i4), allocatable :: row_ind_sp2(:)
integer(kind=i4), allocatable :: col_ptr_sp2(:)
integer(kind=i4), allocatable :: row_ind_sp3(:)
integer(kind=i4), allocatable :: col_ind_sp3(:)
! Auxiliary
real(kind=r8), allocatable :: ovlp_real_copy(:,:)
......
......@@ -123,10 +123,6 @@ module ELSI
public :: elsi_orthonormalize_ev_complex
public :: elsi_extrapolate_dm_real
public :: elsi_extrapolate_dm_complex
public :: elsi_construct_dm_real
public :: elsi_construct_dm_complex
public :: elsi_construct_edm_real
public :: elsi_construct_edm_complex
public :: elsi_compute_mu_and_occ
public :: elsi_compute_entropy
......
......@@ -10,7 +10,8 @@
module ELSI_IO
use ELSI_CONSTANTS, only: MULTI_PROC,SINGLE_PROC,BLACS_DENSE,PEXSI_CSC,&
SIESTA_CSC,ELPA_SOLVER,PEXSI_SOLVER,SIPS_SOLVER,OMM_SOLVER,NTPOLY_SOLVER
SIESTA_CSC,GENERIC_COO,ELPA_SOLVER,PEXSI_SOLVER,SIPS_SOLVER,OMM_SOLVER,&
NTPOLY_SOLVER
use ELSI_DATATYPE, only: elsi_param_t,elsi_basic_t
use ELSI_PRECISION, only: r8,i4,i8
use FORTJSON, only: fjson_write_name_value,fjson_reset_fj_handle,&
......@@ -156,9 +157,9 @@ subroutine elsi_add_log(ph,bh,jh,dt0,t0,caller)
end select
if(ph%matrix_format == BLACS_DENSE) then
call elsi_print_den_settings(bh,jh)
call elsi_print_dense_settings(bh,jh)
else
call elsi_print_csc_settings(bh,jh)
call elsi_print_sparse_settings(bh,jh)
end if
call fjson_finish_object(jh)
......@@ -198,6 +199,8 @@ subroutine elsi_print_handle_summary(ph,bh,jh)
call fjson_write_name_value(jh,"matrix_format","PEXSI_CSC")
else if(ph%matrix_format == SIESTA_CSC) then
call fjson_write_name_value(jh,"matrix_format","SIESTA_CSC")
else if(ph%matrix_format == GENERIC_COO) then
call fjson_write_name_value(jh,"matrix_format","GENERIC_COO")
end if
call fjson_write_name_value(jh,"n_basis",ph%n_basis)
......@@ -389,14 +392,14 @@ end subroutine
!>
!! This routine prints out settings for the dense matrix format.
!!
subroutine elsi_print_den_settings(bh,jh)
subroutine elsi_print_dense_settings(bh,jh)
implicit none
type(elsi_basic_t), intent(in) :: bh
type(fjson_handle), intent(inout) :: jh
character(len=*), parameter :: caller = "elsi_print_den_settings"
character(len=*), parameter :: caller = "elsi_print_dense_settings"
call fjson_start_name_object(jh,"matrix_format_settings")
call fjson_write_name_value(jh,"blk",bh%blk)
......@@ -410,20 +413,21 @@ end subroutine
!>
!! This routine prints out settings for the sparse matrix format.
!!
subroutine elsi_print_csc_settings(bh,jh)
subroutine elsi_print_sparse_settings(bh,jh)
implicit none
type(elsi_basic_t), intent(in) :: bh
type(fjson_handle), intent(inout) :: jh
character(len=*), parameter :: caller = "elsi_print_csc_settings"
character(len=*), parameter :: caller = "elsi_print_sparse_settings"
call fjson_start_name_object(jh,"matrix_format_settings")
call fjson_write_name_value(jh,"def0",bh%def0)
call fjson_write_name_value(jh,"blk_sp2",bh%blk_sp2)
call fjson_write_name_value(jh,"pexsi_csc_ready",bh%pexsi_csc_ready)
call fjson_write_name_value(jh,"siesta_csc_ready",bh%siesta_csc_ready)
call fjson_write_name_value(jh,"generic_coo_ready",bh%generic_coo_ready)
call fjson_finish_object(jh)
end subroutine
......@@ -489,6 +493,9 @@ subroutine elsi_final_print(ph,bh)
else if(ph%matrix_format == SIESTA_CSC) then
write(msg,"(2X,A,A22)") "| Matrix format :","SIESTA_CSC"
call elsi_say(bh,msg)
else if(ph%matrix_format == GENERIC_COO) then
write(msg,"(2X,A,A22)") "| Matrix format :","GENERIC_COO"
call elsi_say(bh,msg)
end if
write(msg,"(2X,A,I22)") "| Number of basis functions :",ph%n_basis
......
......@@ -1391,14 +1391,14 @@ subroutine elsi_get_edm_real(eh,edm)
case(OMM_SOLVER)
call elsi_compute_edm_omm(eh%ph,eh%bh,eh%omm_c_real,edm)
case(PEXSI_SOLVER)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,eh%dm_real_csc)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,eh%dm_real_sp)
call elsi_pexsi_to_blacs_dm(eh%ph,eh%bh,eh%row_ind_sp1,eh%col_ptr_sp1,&
eh%dm_real_csc,edm)
eh%dm_real_sp,edm)
case(SIPS_SOLVER)
call elsi_build_edm_sips(eh%ph,eh%bh,eh%row_ind_sp1,eh%col_ptr_sp1,&
eh%occ(:,eh%ph%i_spin,eh%ph%i_kpt),eh%dm_real_csc)
eh%occ(:,eh%ph%i_spin,eh%ph%i_kpt),eh%dm_real_sp)
call elsi_sips_to_blacs_dm(eh%ph,eh%bh,eh%row_ind_sp1,eh%col_ptr_sp1,&
eh%dm_real_csc,edm)
eh%dm_real_sp,edm)
case(NTPOLY_SOLVER)
call elsi_compute_edm_ntpoly(eh%ph,eh%bh,eh%ph%nt_ham,eh%ph%nt_dm)
call elsi_ntpoly_to_blacs_dm(eh%bh,eh%ph%nt_dm,edm)
......@@ -1480,10 +1480,9 @@ subroutine elsi_get_edm_real_sparse(eh,edm)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,edm)
case(SIESTA_CSC)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,&
eh%dm_real_csc)
eh%dm_real_sp)
call elsi_pexsi_to_siesta_dm(eh%ph,eh%bh,eh%row_ind_sp1,&
eh%col_ptr_sp1,eh%dm_real_csc,eh%row_ind_sp2,eh%col_ptr_sp2,&
edm)
eh%col_ptr_sp1,eh%dm_real_sp,eh%row_ind_sp2,eh%col_ptr_sp2,edm)
case default
call elsi_stop(eh%bh,"Unsupported matrix format.",caller)
end select
......@@ -1494,10 +1493,9 @@ subroutine elsi_get_edm_real_sparse(eh,edm)
eh%occ(:,eh%ph%i_spin,eh%ph%i_kpt),edm)
case(SIESTA_CSC)
call elsi_build_edm_sips(eh%ph,eh%bh,eh%row_ind_sp1,eh%col_ptr_sp1,&
eh%occ(:,eh%ph%i_spin,eh%ph%i_kpt),eh%dm_real_csc)
eh%occ(:,eh%ph%i_spin,eh%ph%i_kpt),eh%dm_real_sp)
call elsi_sips_to_siesta_dm(eh%ph,eh%bh,eh%row_ind_sp1,&
eh%col_ptr_sp1,eh%dm_real_csc,eh%row_ind_sp2,eh%col_ptr_sp2,&
edm)
eh%col_ptr_sp1,eh%dm_real_sp,eh%row_ind_sp2,eh%col_ptr_sp2,edm)
case default
call elsi_stop(eh%bh,"Unsupported matrix format.",caller)
end select
......@@ -1558,10 +1556,9 @@ subroutine elsi_get_edm_complex(eh,edm)
case(OMM_SOLVER)
call elsi_compute_edm_omm(eh%ph,eh%bh,eh%omm_c_cmplx,edm)
case(PEXSI_SOLVER)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,&
eh%dm_cmplx_csc)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,eh%dm_cmplx_sp)
call elsi_pexsi_to_blacs_dm(eh%ph,eh%bh,eh%row_ind_sp1,eh%col_ptr_sp1,&
eh%dm_cmplx_csc,edm)
eh%dm_cmplx_sp,edm)
case(NTPOLY_SOLVER)
call elsi_compute_edm_ntpoly(eh%ph,eh%bh,eh%ph%nt_ham,eh%ph%nt_dm)
call elsi_ntpoly_to_blacs_dm(eh%bh,eh%ph%nt_dm,edm)
......@@ -1638,9 +1635,9 @@ subroutine elsi_get_edm_complex_sparse(eh,edm)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,edm)
case(SIESTA_CSC)
call elsi_compute_edm_pexsi(eh%ph,eh%bh,eh%pexsi_ne_vec,&
eh%dm_cmplx_csc)
eh%dm_cmplx_sp)
call elsi_pexsi_to_siesta_dm(eh%ph,eh%bh,eh%row_ind_sp1,&
eh%col_ptr_sp1,eh%dm_cmplx_csc,eh%row_ind_sp2,eh%col_ptr_sp2,&
eh%col_ptr_sp1,eh%dm_cmplx_sp,eh%row_ind_sp2,eh%col_ptr_sp2,&
edm)
case default
call elsi_stop(eh%bh,"Unsupported matrix format.",caller)
......
This diff is collapsed.
......@@ -360,28 +360,28 @@ subroutine elsi_reinit(eh)
call elsi_deallocate(eh%bh,eh%evec_cmplx,"evec_cmplx")
end if
if(allocated(eh%ham_real_csc)) then
call elsi_deallocate(eh%bh,eh%ham_real_csc,"ham_real_csc")
if(allocated(eh%ham_real_sp)) then
call elsi_deallocate(eh%bh,eh%ham_real_sp,"ham_real_sp")
end if
if(allocated(eh%ham_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%ham_cmplx_csc,"ham_cmplx_csc")
if(allocated(eh%ham_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%ham_cmplx_sp,"ham_cmplx_sp")
end if
if(allocated(eh%ovlp_real_csc)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_csc,"ovlp_real_csc")
if(allocated(eh%ovlp_real_sp)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_sp,"ovlp_real_sp")
end if
if(allocated(eh%ovlp_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%ovlp_cmplx_csc,"ovlp_cmplx_csc")
if(allocated(eh%ovlp_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%ovlp_cmplx_sp,"ovlp_cmplx_sp")
end if
if(allocated(eh%dm_real_csc)) then
call elsi_deallocate(eh%bh,eh%dm_real_csc,"dm_real_csc")
if(allocated(eh%dm_real_sp)) then
call elsi_deallocate(eh%bh,eh%dm_real_sp,"dm_real_sp")
end if
if(allocated(eh%dm_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%dm_cmplx_csc,"dm_cmplx_csc")
if(allocated(eh%dm_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%dm_cmplx_sp,"dm_cmplx_sp")
end if
if(allocated(eh%row_ind_sp1)) then
......@@ -400,6 +400,14 @@ subroutine elsi_reinit(eh)
call elsi_deallocate(eh%bh,eh%col_ptr_sp2,"col_ptr_sp2")
end if
if(allocated(eh%row_ind_sp3)) then
call elsi_deallocate(eh%bh,eh%row_ind_sp2,"row_ind_sp3")
end if
if(allocated(eh%col_ind_sp3)) then
call elsi_deallocate(eh%bh,eh%col_ptr_sp2,"col_ind_sp3")
end if
if(.not. eh%ph%solver == ELPA_SOLVER) then
if(allocated(eh%ovlp_real_copy)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_copy,"ovlp_real_copy")
......@@ -487,28 +495,28 @@ subroutine elsi_cleanup(eh)
end if
! Sparse arrays
if(allocated(eh%ham_real_csc)) then
call elsi_deallocate(eh%bh,eh%ham_real_csc,"ham_real_csc")
if(allocated(eh%ham_real_sp)) then
call elsi_deallocate(eh%bh,eh%ham_real_sp,"ham_real_sp")
end if
if(allocated(eh%ham_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%ham_cmplx_csc,"ham_cmplx_csc")
if(allocated(eh%ham_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%ham_cmplx_sp,"ham_cmplx_sp")
end if
if(allocated(eh%ovlp_real_csc)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_csc,"ovlp_real_csc")
if(allocated(eh%ovlp_real_sp)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_sp,"ovlp_real_sp")
end if
if(allocated(eh%ovlp_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%ovlp_cmplx_csc,"ovlp_cmplx_csc")
if(allocated(eh%ovlp_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%ovlp_cmplx_sp,"ovlp_cmplx_sp")
end if
if(allocated(eh%dm_real_csc)) then
call elsi_deallocate(eh%bh,eh%dm_real_csc,"dm_real_csc")
if(allocated(eh%dm_real_sp)) then
call elsi_deallocate(eh%bh,eh%dm_real_sp,"dm_real_sp")
end if
if(allocated(eh%dm_cmplx_csc)) then
call elsi_deallocate(eh%bh,eh%dm_cmplx_csc,"dm_cmplx_csc")
if(allocated(eh%dm_cmplx_sp)) then
call elsi_deallocate(eh%bh,eh%dm_cmplx_sp,"dm_cmplx_sp")
end if
if(allocated(eh%row_ind_sp1)) then
......@@ -527,6 +535,14 @@ subroutine elsi_cleanup(eh)
call elsi_deallocate(eh%bh,eh%col_ptr_sp2,"col_ptr_sp2")
end if
if(allocated(eh%row_ind_sp3)) then
call elsi_deallocate(eh%bh,eh%row_ind_sp2,"row_ind_sp3")
end if
if(allocated(eh%col_ind_sp3)) then
call elsi_deallocate(eh%bh,eh%col_ptr_sp2,"col_ind_sp3")
end if
! Auxiliary arrays
if(allocated(eh%ovlp_real_copy)) then
call elsi_deallocate(eh%bh,eh%ovlp_real_copy,"ovlp_real_copy")
......
This diff is collapsed.
......@@ -29,10 +29,6 @@ module ELSI_TOOLS
public :: elsi_orthonormalize_ev_complex
public :: elsi_extrapolate_dm_real
public :: elsi_extrapolate_dm_complex
public :: elsi_construct_dm_real
public :: elsi_construct_dm_complex
public :: elsi_construct_edm_real
public :: elsi_construct_edm_complex
public :: elsi_compute_mu_and_occ
public :: elsi_compute_entropy
......@@ -164,92 +160,6 @@ subroutine elsi_extrapolate_dm_complex(eh,ovlp,dm)
end subroutine
!>
!! This routine constructs density matrix from occupation numbers and
!! eigenvectors.
!!
subroutine elsi_construct_dm_real(eh,occ,evec,dm)
implicit none
type(elsi_handle), intent(in) :: eh !< Handle
real(kind=r8), intent(in) :: occ(eh%ph%n_states) !< Occupation numbers
real(kind=r8), intent(in) :: evec(eh%bh%n_lrow,eh%bh%n_lcol) !< Eigenvectors
real(kind=r8), intent(out) :: dm(eh%bh%n_lrow,eh%bh%n_lcol) !< Density matrix
character(len=*), parameter :: caller = "elsi_construct_dm_real"
call elsi_check_init(eh%bh,eh%handle_init,caller)
call elsi_build_dm(eh%ph,eh%bh,eh%row_map,eh%col_map,occ,evec,dm)
end subroutine
!>
!! This routine constructs density matrix from occupation numbers and
!! eigenvectors.
!!
subroutine elsi_construct_dm_complex(eh,occ,evec,dm)
implicit none
type(elsi_handle), intent(in) :: eh !< Handle
real(kind=r8), intent(in) :: occ(eh%ph%n_states) !< Occupation numbers
complex(kind=r8), intent(in) :: evec(eh%bh%n_lrow,eh%bh%n_lcol) !< Eigenvectors
complex(kind=r8), intent(out) :: dm(eh%bh%n_lrow,eh%bh%n_lcol) !< Density matrix
character(len=*), parameter :: caller = "elsi_construct_dm_complex"
call elsi_check_init(eh%bh,eh%handle_init,caller)
call elsi_build_dm(eh%ph,eh%bh,eh%row_map,eh%col_map,occ,evec,dm)
end subroutine
!>
!! This routine constructs energy-weighted density matrix from occupation
!! numbers, eigenvalues, and eigenvectors.
!!
subroutine elsi_construct_edm_real(eh,occ,eval,evec,edm)
implicit none
type(elsi_handle), intent(in) :: eh !< Handle
real(kind=r8), intent(in) :: occ(eh%ph%n_states) !< Occupation numbers
real(kind=r8), intent(in) :: eval(eh%ph%n_states) !< Eigenvalues
real(kind=r8), intent(in) :: evec(eh%bh%n_lrow,eh%bh%n_lcol) !< Eigenvectors
real(kind=r8), intent(out) :: edm(eh%bh%n_lrow,eh%bh%n_lcol) !< Density matrix
character(len=*), parameter :: caller = "elsi_construct_dm_real"
call elsi_check_init(eh%bh,eh%handle_init,caller)
call elsi_build_edm(eh%ph,eh%bh,eh%row_map,eh%col_map,occ,eval,evec,edm)
end subroutine
!>
!! This routine constructs energy-weighted density matrix from occupation
!! numbers, eigenvalues, and eigenvectors.
!!
subroutine elsi_construct_edm_complex(eh,occ,eval,evec,edm)
implicit none
type(elsi_handle), intent(in) :: eh !< Handle
real(kind=r8), intent(in) :: occ(eh%ph%n_states) !< Occupation numbers
real(kind=r8), intent(in) :: eval(eh%ph%n_states) !< Eigenvalues
complex(kind=r8), intent(in) :: evec(eh%bh%n_lrow,eh%bh%n_lcol) !< Eigenvectors
complex(kind=r8), intent(out) :: edm(eh%bh%n_lrow,eh%bh%n_lcol) !< Density matrix
character(len=*), parameter :: caller = "elsi_construct_dm_complex"
call elsi_check_init(eh%bh,eh%handle_init,caller)
call elsi_build_edm(eh%ph,eh%bh,eh%row_map,eh%col_map,occ,eval,evec,edm)
end subroutine
!>
!! This routine computes the chemical potential and occupation numbers.
!!
......
......@@ -11,7 +11,8 @@ module ELSI_UTILS
use ELSI_CONSTANTS, only: UNSET,UT_MAT,LT_MAT,N_SOLVERS,N_PARALLEL_MODES,&
N_MATRIX_FORMATS,MULTI_PROC,SINGLE_PROC,BLACS_DENSE,PEXSI_CSC,&
SIESTA_CSC,ELPA_SOLVER,OMM_SOLVER,PEXSI_SOLVER,SIPS_SOLVER,NTPOLY_SOLVER
SIESTA_CSC,GENERIC_COO,ELPA_SOLVER,OMM_SOLVER,PEXSI_SOLVER,SIPS_SOLVER,&
NTPOLY_SOLVER
use ELSI_DATATYPE, only: elsi_param_t,elsi_basic_t
use ELSI_IO, only: elsi_say,elsi_get_time
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
......@@ -229,6 +230,8 @@ subroutine elsi_reset_basic(bh)
bh%n_lcol_sp2 = UNSET
bh%blk_sp2 = UNSET
bh%siesta_csc_ready = .false.
bh%nnz_l_sp3 = UNSET
bh%generic_coo_ready = .false.
end subroutine
......@@ -323,6 +326,11 @@ subroutine elsi_check(ph,bh,caller)
call elsi_stop(bh,"Number of MPI tasks per pole should be set for"//&
" PEXSI_CSC matrix format and PEXSI solver.",caller)
end if
else if(ph%matrix_format == GENERIC_COO) then
if(.not. bh%generic_coo_ready) then
call elsi_stop(bh,"GENERIC_COO matrix format not properly set up.",&
caller)
end if
end if
! Specific check for each solver
......
Markdown is supported
0%