-
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
Possibly remove MeshBlockTree
#912
Comments
IMO if there's good reason to refactor this code, this seems perfectly reasonable to me. A tree datastructure doesn't have to be represented with pointer chasing, and your space filling curve/morton number code already is the biggest lift for moving us off of pointers. I might worry about using actual |
There is already a hashing overload built for |
If we're that deep, I think we have other problems, so not disturbing IMO |
Interesting idea! Here are my 50 cents on the items raised
Some questions:
|
I haven't thought about this aspect at all really. Assuming that implementing this would rely on having separate meshblock lists similar to GMG, I think it would be helpful.
I think the |
I have not carefully though about it, but when weakly scaling a simulation there certainly has to be a number of ranks at which the memory footprint of the mesh on a rank overwhelms the memory footprint of meshblocks on a rank. I think @Yurlungur mentioned to me that he actually ran into this issue at some point. |
I did... When doing a weak scaling test with AMR on Trinity. This was with Athena++ |
As I am working on including geometric multigrid in Parthenon (#911), I am finding more and more that I would like to move away from relying on
MeshBlockTree
. I could possibly removeMeshBlockTree
entirely in that PR, but I wanted to get some feedback before I went down that (possibly drastic) path.The reasons that I can see for doing this are:
LogicalLocation
s of the mesh in standard library containers (i.e. either astd::map<LogicalLocation, ...>
or astd::unordered_map<LogicalLocation, ...>
), then all of theMeshBlockTree
code and most of the code inbvals_base.cpp
is no longer necessary. Generally, I have found the code inbvals
to be some of the hardest to follow within Parthenon (see Refactor bvals code #903). With the recent changes toLogicalLocation
, there are methods to find lists of possible neighbor blocks for a given block, determine the neighboring block pairs offsets, etc. which are required for building aNeighborBlock
object, and other mesh location related utilities. As a result, it is very straightforward to find all of the neighbors of a given block by just finding a list of possible neighbors, and then seeing which of those neighbors are in the mesh.Mesh
- Storing the levels of the mesh in a vector ofstd::map
s makes it very easy to find parent blocks on the coarser mesh and daughter blocks on a finer mesh, as well as find neighbor blocks on the current mesh. This could of course be done ifMeshBlockTree
was extended, but this seems somewhat more complex to me.MeshBlockTree
) is duplicated on all ranks. For very large numbers of ranks, this can result in the mesh structure taking up a significant fraction of each nodes memory. As a result, we may eventually want to move to having the mesh structure not be entirely duplicated on each rank. It seems easier to me to do this if the local mesh structure is stored in astd::map
than if it is stored in aMeshBlockTree
(although I admittedly haven't spent a huge amount of time thinking about how to do this).Possible drawbacks:
MeshBlockTree
currently.MeshBlockTree
(although it seems likely that we can make astd::unordered_map
perform faster than the current octree structure).BoundaryBase
andBoundaryCommunication
, so there will be some refactoring that has to be done there.The text was updated successfully, but these errors were encountered: