Skip to content

Commit

Permalink
Fix a problem where old entries overwrite new ones
Browse files Browse the repository at this point in the history
If a 1:2 split is change into a 2:1 split,
the old leaf nodes from the ":2" half of the old tree
are not cleared.
These are broadcasted to other processes.
If the 2:1 split is changed, again into a 1:2 split, these stale entries
become relevant because the nodes that don't repartition the subtrees
will clear the 2:1 subtree and, hence, not the ":2" part of the new
subtree.
If the old entries are larger than the new ones, the state of the tree
is inconsistent.

This commit fixes this problem by requiring the subtree repartition node
to clear the subtrees rooted at the children of the repartition root
first.
  • Loading branch information
hirschsn committed Mar 5, 2021
1 parent 6211f0d commit afec368
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kdpart.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ PartTreeStorage& _repart_parttree_par_local_impl(PartTreeStorage& s, MPI_Comm co
*/
int new_max_depth = 0;
if (is_responsible_process && subtree_neighbors.size() > 1) {
s.invalidate_subtree(my_subtree_root.child1());
s.invalidate_subtree(my_subtree_root.child2());
s.walk_subtree([&s, &splitfunc, &new_max_depth](auto node) {
// Need to split the node further?
if (node.nproc() > 1) {
Expand Down

0 comments on commit afec368

Please sign in to comment.