Skip to content

Commit c0a685f

Browse files
committed
Follow up to #7478
1 parent 6a7ad58 commit c0a685f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

source/source_lcao/module_extrap/wf_orthonormalize_lcao.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,9 @@ double max_orthonormality_deviation(const double* overlap,
247247
WfcExtrapStatus allreduce_dense_vector(std::vector<double>& values, const Parallel_Orbitals& pv)
248248
{
249249
#ifdef __MPI
250-
if (!pv.is_serial)
250+
const MPI_Comm comm = pv.comm();
251+
if (comm != MPI_COMM_NULL)
251252
{
252-
const MPI_Comm comm = pv.comm();
253-
if (comm == MPI_COMM_NULL)
254-
{
255-
return WfcExtrapStatus::InvalidInput;
256-
}
257253
if (values.size() > static_cast<std::size_t>(std::numeric_limits<int>::max()))
258254
{
259255
return WfcExtrapStatus::InvalidInput;
@@ -303,7 +299,8 @@ WfcExtrapStatus assemble_global_overlap(const double* overlap,
303299

304300
int local_band_to_global(const int ib_local, const Parallel_Orbitals& pv)
305301
{
306-
return (ib_local / pv.nb * pv.dim1 + pv.coord[1]) * pv.nb + ib_local % pv.nb;
302+
const int block_size = pv.get_block_size();
303+
return (ib_local / block_size * pv.get_dim1() + pv.get_coord_col()) * block_size + ib_local % block_size;
307304
}
308305

309306
int local_wfc_col_to_global(const int ib_local, const Parallel_Orbitals& pv, const bool coeff_columns_are_basis)

0 commit comments

Comments
 (0)