Skip to content

Instantly share code, notes, and snippets.

@sithhell
Created August 20, 2013 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sithhell/6281025 to your computer and use it in GitHub Desktop.
Save sithhell/6281025 to your computer and use it in GitHub Desktop.
diff -r 1400018dc59a src/parallelization/hiparsimulator/partitionmanager.h
--- a/src/parallelization/hiparsimulator/partitionmanager.h Thu Aug 08 06:31:20 2013 -0500
+++ b/src/parallelization/hiparsimulator/partitionmanager.h Tue Aug 20 07:59:22 2013 -0500
@@ -66,12 +66,7 @@
CoordBox<DIM> ownBoundingBox = ownExpandedRegion().boundingBox();
for (unsigned i = 0; i < boundingBoxes.size(); ++i) {
- if (i != rank &&
- boundingBoxes[i].intersects(ownBoundingBox) &&
- (!(getRegion(rank, ghostZoneWidth) &
- getRegion(i, 0)).empty() ||
- !(getRegion(i, ghostZoneWidth) &
- getRegion(rank, 0)).empty()))
+ if (i != rank)
intersect(i);
}
@@ -82,12 +77,12 @@
for (typename RegionVecMap::iterator i = outerGhostZoneFragments.begin();
i != outerGhostZoneFragments.end();
++i)
- if (i->first != OUTGROUP)
+ if (i->first != OUTGROUP && !i->second.empty())
outer -= i->second.back();
for (typename RegionVecMap::iterator i = innerGhostZoneFragments.begin();
i != innerGhostZoneFragments.end();
++i)
- if (i->first != OUTGROUP)
+ if (i->first != OUTGROUP && !i->second.empty())
inner -= i->second.back();
outerGhostZoneFragments[OUTGROUP] =
SuperVector<Region<DIM> >(getGhostZoneWidth() + 1, outer);
@@ -237,11 +232,17 @@
{
SuperVector<Region<DIM> >& outerGhosts = outerGhostZoneFragments[node];
SuperVector<Region<DIM> >& innerGhosts = innerGhostZoneFragments[node];
- outerGhosts.resize(getGhostZoneWidth() + 1);
- innerGhosts.resize(getGhostZoneWidth() + 1);
+ outerGhosts.reserve(getGhostZoneWidth() + 1);
+ innerGhosts.reserve(getGhostZoneWidth() + 1);
for (unsigned i = 0; i <= getGhostZoneWidth(); ++i) {
- outerGhosts[i] = getRegion(rank, i) & getRegion(node, 0);
- innerGhosts[i] = getRegion(rank, 0) & getRegion(node, i);
+ const Region<DIM>& outerGhost = getRegion(rank, i) & getRegion(node, 0);
+ if(!outerGhost.empty()) {
+ outerGhosts << outerGhost;
+ }
+ const Region<DIM>& innerGhost = getRegion(rank, 0) & getRegion(node, i);
+ if(!innerGhost.empty()) {
+ innerGhosts << innerGhost;
+ }
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment