Skip to content

Commit fb98146

Browse files
QianruipkuFisherd99
authored andcommitted
fix stuck in out_chg (deepmodeling#5603)
1 parent 68b5807 commit fb98146

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

source/module_hamilt_pw/hamilt_pwdft/parallel_grid.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ void Parallel_Grid::reduce(double* rhotot, const double* const rhoin)const
355355
// send the Barrier command.
356356
if(GlobalV::MY_POOL!=0)
357357
{
358-
MPI_Barrier(MPI_COMM_WORLD);
359358
return;
360359
}
361360

@@ -407,8 +406,6 @@ void Parallel_Grid::reduce(double* rhotot, const double* const rhoin)const
407406

408407
delete[] zpiece;
409408

410-
MPI_Barrier(MPI_COMM_WORLD);
411-
412409
return;
413410
}
414411
#endif

source/module_io/write_cube.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void ModuleIO::write_vdata_palgrid(
3535
// reduce
3636
std::vector<double> data_xyz_full(nxyz); // data to be written
3737
#ifdef __MPI // reduce to rank 0
38-
if (my_pool == 0)
38+
if (my_pool == 0 && GlobalV::MY_STOGROUP == 0)
3939
{
4040
pgrid.reduce(data_xyz_full.data(), data);
4141
}

tests/integrate/107_PW_OK/INPUT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pseudo_dir ../../PP_ORB
1111
ecutwfc 20
1212
scf_thr 1e-8
1313
scf_nmax 100
14+
kpar 2
1415

1516
out_chg 1
1617
dft_functional scan

0 commit comments

Comments
 (0)