Repository navigation
Conversation
| def __init__(self, sf: PETSc.SF, comm: MPI.Comm, has_leaves: bool | None = None) -> None: | ||
| object.__setattr__(self, "sf", sf) | ||
| object.__setattr__(self, "_comm", comm) | ||
| self._has_leaves = has_leaves |
There was a problem hiding this comment.
I think that this attribute is part of the wider refactor I was suggesting. I think the decorator you've added makes sense as a standalone change, but if we are modifying the API like this I would really like to tackle the full refactor we discussed. Basically, I am not certain that this is the right design, and we won't know if it is or not unless we do the full refactor.
There was a problem hiding this comment.
OK. We can dedicate this PR to the refactor then.
There was a problem hiding this comment.
Cool. I think the first thing is probably we want to rename this to something which doesn't make sense to have True, False and None as reasonable answers. Honestly I think it makes the most sense to make the PETSc SF be None if we only have a serial thing, but then we still need to give it a comm... tricky
There was a problem hiding this comment.
What about other properties that depend on the PETSc SF? self.graph and all dependent properties self.ilocal etc. wouldn't work if the PETSc SF is None... these would need special casing at the least.
There was a problem hiding this comment.
Yeah there are definitely differences.
Maybe another option is just to rename NullStarForest to LocalStarForest.
|
WIP: refactor SF/NullSF |
Based on #5745
I would like to avoid data being exchanged over SFs which have no leaves on any rank (
has_leaves=False) such as in the case of VoMs. As described in the related PR, this leads to spawning unnecessary SFs and doing collective operations on them which are wasteful and incur overhead.Until #5747 is implemented, I suggest we explicitly prevent
bcast/reducefrom happening on these SFs.