Skip to content

Commit 1ab1998

Browse files
committed
add schedule(dynamic)
1 parent 5095627 commit 1ab1998

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/module_elecstate/module_dm/density_matrix.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void DensityMatrix<std::complex<double>, double>::cal_DMR(const int ik_in)
7171
// set zero since this function is called in every scf step
7272
target_DMR->set_zero();
7373
#ifdef _OPENMP
74-
#pragma omp parallel for
74+
#pragma omp parallel for schedule(dynamic)
7575
#endif
7676
for (int i = 0; i < target_DMR->size_atom_pairs(); ++i)
7777
{
@@ -233,12 +233,11 @@ void DensityMatrix<std::complex<double>, double>::cal_DMR_full(hamilt::HContaine
233233

234234
ModuleBase::timer::tick("DensityMatrix", "cal_DMR_full");
235235
int ld_hk = this->_paraV->nrow;
236-
int ld_hk2 = 2 * ld_hk;
237236
hamilt::HContainer<std::complex<double>>* target_DMR = dmR_out;
238237
// set zero since this function is called in every scf step
239238
target_DMR->set_zero();
240239
#ifdef _OPENMP
241-
#pragma omp parallel for
240+
#pragma omp parallel for schedule(dynamic)
242241
#endif
243242
for (int i = 0; i < target_DMR->size_atom_pairs(); ++i)
244243
{
@@ -336,7 +335,7 @@ void DensityMatrix<double, double>::cal_DMR(const int ik_in)
336335
assert(this->_nk == 1);
337336
#endif
338337
#ifdef _OPENMP
339-
#pragma omp parallel for
338+
#pragma omp parallel for schedule(dynamic)
340339
#endif
341340
for (int i = 0; i < target_DMR->size_atom_pairs(); ++i)
342341
{

0 commit comments

Comments
 (0)