-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor MeshBlock
Partitioning
#1119
Conversation
MeshBlock
PartitioningMeshBlock
Partitioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like this. Two big picture questions:
- Does this now preclude different partitioning for different parts of a task list? Does it also preclude packs over different subsets of blocks (for example different refinement levels)?
- It's a bit weird that
Get
is sometimesGet
and sometimesGetOrAdd
. Also weird that a partition index must always requested.
No, you can build
What is confusing is that |
👍
Yeah I feel ambivalent about this. I think changing the name would be better but not sure it's worth breaking backwards compatibility. Maybe we table that change for a later PR and poll if people think it's worth doing. |
I wasn't thinking about the map key when I responded to this earlier, which did rely on the partition id. I now made the key just contain a list of the gids of all blocks in the partition. This should allow arbitrary partitioning without having to make any changes to |
src/interface/data_collection.hpp
Outdated
if (c->first != "base") { | ||
// Remove anything that doesn't contain the label base | ||
if (c->first.find("base") == std::string::npos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change made the tests break...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested downstream (without iterative tasklists, without changing GetOrAdd
-> pmesh->Add
) and all looked good.
PR Summary
This PR adds an object
BlockListPartition
that stores aBlockList_t
and a little more information about a partition of blocks. We then have the analogyBlockListPartition
is toMeshData
asMeshBlock
is toMeshBlockData
. Then instead of doing block list partitioning inside ofDataCollection
, partitioning is moved toMesh
(which at least to me is a more reasonable location for this to live) and methods for getting the partitions are added toMesh
.MeshData
gains anInitialize
method that takes aBlockListPartition
. As a result, all incarnations ofDataCollection<MeshData>::Add
are made to "just work" forMeshData
when it is passed either anotherMeshData
object or aBlockListPartition
object.DataCollection<MeshData>::GetOrAdd
is deprecated (although still available, it just callsAdd
internally). I have also removedGetOrAdd
from Parthenon internals and from the examples.This nearly gets us to working multigrid for multiple partitions, aside from the task bug described in #1125 (at least I hope).
This should close issue #1097.
PR Checklist