Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/src_io/write_wfc_realspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ namespace Write_Wfc_Realspace
// t0 t1 t2 t3 t4 t5 t6 t7
// -------------------------------->
// rank0 k0 k1 k2 k3 k4 k5
// \ \ \ \ \ \
// \ \ \ \ \ \
// rank1 k0 k1 k2 k3 k4 k5
// \ \ \ \ \ \
// \ \ \ \ \ \
// rank2 k0 k1 k2 k3 k4 k5


Expand Down Expand Up @@ -157,4 +157,4 @@ namespace Write_Wfc_Realspace
}
#endif
}
};
};
26 changes: 17 additions & 9 deletions source/src_pdiag/pdiag_double.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,22 +664,29 @@ void Pdiag_Double::diago_double_begin(
MPI_Bcast(&maxnloc, 1, MPI_LONG, 0, comm_2D);
wfc_2d.create(this->ncol,this->nrow); // Fortran order

int is_already_decomposed, elpa_error;
static elpa_t handle;
static bool has_set_elpa_handle = false;
if(! has_set_elpa_handle)
{
set_elpahandle(handle, desc, nrow, ncol);
has_set_elpa_handle = true;
}

int is_already_decomposed;
if(ifElpaHandle(GlobalC::CHR.get_new_e_iteration(), (GlobalV::CALCULATION=="nscf")))
{
ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_set");
ModuleBase::timer::tick("Diago_LCAO_Matrix","decompose_S");
LapackConnector::copy(nloc, s_mat, inc, Stmp, inc);
set_elpahandle(handle, desc, nrow, ncol);
is_already_decomposed=0;
ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_set");
ModuleBase::timer::tick("Diago_LCAO_Matrix","decompose_S");
}
else
{
is_already_decomposed=1;
}

ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_solve");
int elpa_error;
elpa_generalized_eigenvectors_d(handle, h_mat, Stmp, eigen, wfc_2d.c, is_already_decomposed, &elpa_error);
ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_solve");

Expand Down Expand Up @@ -1019,15 +1026,16 @@ void Pdiag_Double::diago_complex_begin(
MPI_Bcast(&maxnloc, 1, MPI_LONG, 0, comm_2D);
wfc_2d.create(this->ncol,this->nrow); // Fortran order

LapackConnector::copy(nloc, cs_mat, inc, Stmp, inc);
ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_set");
static elpa_t handle;

if(ifElpaHandle(GlobalC::CHR.get_new_e_iteration(), (GlobalV::CALCULATION=="nscf")))
static bool has_set_elpa_handle = false;
if(! has_set_elpa_handle)
{
set_elpahandle(handle, desc, nrow, ncol);
has_set_elpa_handle = true;
}
ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_set");

LapackConnector::copy(nloc, cs_mat, inc, Stmp, inc);

ModuleBase::timer::tick("Diago_LCAO_Matrix","elpa_solve");
int elpa_derror;
elpa_generalized_eigenvectors_dc(handle, reinterpret_cast<double _Complex*>(ch_mat),
Expand Down