Skip to content

Commit 0498fe5

Browse files
committed
Add MPI compilation macros
1 parent 3ce8d16 commit 0498fe5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/module_io/get_pchg_pw.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ void get_pchg_pw(const std::vector<int>& out_pchg,
170170
}
171171
}
172172

173+
#ifdef __MPI
173174
// Reduce the charge density across all pools if kpar > 1
174175
if (kpar > 1 && chg != nullptr)
175176
{
@@ -178,6 +179,7 @@ void get_pchg_pw(const std::vector<int>& out_pchg,
178179
chg->reduce_diff_pools(rho_band[is].data());
179180
}
180181
}
182+
#endif
181183

182184
// Symmetrize the charge density, otherwise the results are incorrect if the symmetry is on
183185
std::cout << " Symmetrizing band-decomposed charge density..." << std::endl;
@@ -210,10 +212,10 @@ void get_pchg_pw(const std::vector<int>& out_pchg,
210212

211213
ModuleIO::write_vdata_palgrid(pgrid, rho_band[is].data(), is, nspin, 0, ssc.str(), 0.0, ucell);
212214
}
213-
}
214-
}
215-
}
216-
}
215+
} // else if_separate_k is false
216+
} // end of ib loop over nbands
217+
} // end of ip loop over kpar
218+
} // get_pchg_pw
217219
} // namespace ModuleIO
218220

219221
#endif // GET_PCHG_PW_H

0 commit comments

Comments
 (0)