Skip to content

Commit

Permalink
fix parallel particle init bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Oct 14, 2019
1 parent 468d524 commit 5cc7062
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exec/immersedIons/particleGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ void FhdParticleContainer::InitParticles(species* particleInfo, const Real* dxp)
const Geometry& geom = Geom(lev);

int pcount = 0;

bool proc0_enter = true;

for (MFIter mfi = MakeMFIter(lev, true); mfi.isValid(); ++mfi) {

Expand All @@ -21,7 +23,9 @@ void FhdParticleContainer::InitParticles(species* particleInfo, const Real* dxp)
IntVect smallEnd = tile_box.smallEnd();
IntVect bigEnd = tile_box.bigEnd();

if(ParallelDescriptor::MyProc() == 0 && mfi.LocalTileIndex() == 0) {
if(ParallelDescriptor::MyProc() == 0 && mfi.LocalTileIndex() == 0 && proc0_enter) {

proc0_enter = false;

for(int i_spec=0; i_spec < nspecies; i_spec++) {
for (int i_part=0; i_part<particleInfo[i_spec].total;i_part++) {
Expand Down

0 comments on commit 5cc7062

Please sign in to comment.