Skip to content

Commit 5cbb091

Browse files
committed
improve the efficiency for npro ==1 case
1 parent ccb0d26 commit 5cbb091

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/source_hsolver/hsolver_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void HSolverLCAO<T, Device>::solve(hamilt::Hamilt<T>* pHamilt,
4949
if (this->method != "pexsi")
5050
{
5151
#ifdef __MPI
52-
if (this->method == "cusolver")
52+
if (this->method == "cusolver" && GlobalV::NPROC > 1)
5353
{
5454
this->parakSolve_cusolver(pHamilt, psi, pes);
5555
}
@@ -155,7 +155,7 @@ void HSolverLCAO<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T>* hm, psi::Psi<T>&
155155
#ifdef __CUDA
156156
else if (this->method == "cusolver")
157157
{
158-
// Note: Only the non-MPI version will execute this if branch
158+
// Note: This branch will only be executed in the single-process case
159159
DiagoCusolver<T> cu;
160160
hamilt::MatrixBlock<T> hk, sk;
161161
hm->matrix(hk, sk);

0 commit comments

Comments
 (0)