diff --git a/source/module_hamilt_pw/hamilt_pwdft/parallel_grid.cpp b/source/module_hamilt_pw/hamilt_pwdft/parallel_grid.cpp index 829029e4bb..5d6fe41764 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/parallel_grid.cpp +++ b/source/module_hamilt_pw/hamilt_pwdft/parallel_grid.cpp @@ -355,7 +355,6 @@ void Parallel_Grid::reduce(double* rhotot, const double* const rhoin)const // send the Barrier command. if(GlobalV::MY_POOL!=0) { - MPI_Barrier(MPI_COMM_WORLD); return; } @@ -407,8 +406,6 @@ void Parallel_Grid::reduce(double* rhotot, const double* const rhoin)const delete[] zpiece; - MPI_Barrier(MPI_COMM_WORLD); - return; } #endif diff --git a/source/module_io/write_cube.cpp b/source/module_io/write_cube.cpp index 8fa212c60f..dbb4e469cf 100644 --- a/source/module_io/write_cube.cpp +++ b/source/module_io/write_cube.cpp @@ -35,7 +35,7 @@ void ModuleIO::write_vdata_palgrid( // reduce std::vector data_xyz_full(nxyz); // data to be written #ifdef __MPI // reduce to rank 0 - if (my_pool == 0) + if (my_pool == 0 && GlobalV::MY_STOGROUP == 0) { pgrid.reduce(data_xyz_full.data(), data); } diff --git a/tests/integrate/107_PW_OK/INPUT b/tests/integrate/107_PW_OK/INPUT index 05c3e66e66..764bb78d76 100644 --- a/tests/integrate/107_PW_OK/INPUT +++ b/tests/integrate/107_PW_OK/INPUT @@ -11,6 +11,7 @@ pseudo_dir ../../PP_ORB ecutwfc 20 scf_thr 1e-8 scf_nmax 100 +kpar 2 out_chg 1 dft_functional scan