Repository navigation
Assert caches are prepared - #4540
Merged
Merged
Conversation
Member
Author
|
I might need to pull a third commit from #4411 before this will pass tests; fingers crossed. |
GiudGiud
approved these changes
Sep 8, 2026
lindsayad
added a commit
to lindsayad/moose
that referenced
this pull request
Oct 1, 2026
MooseMesh::cacheInfo() stored a std::set<SubdomainID> for every node of every element a rank
holds, although nearly every node lies inside a single subdomain. Now _node_block stores one
SubdomainID per node and _interface_node_blocks keeps a full set only for nodes on a subdomain
interface. getNodeBlockIds() keeps its signature by returning a shared {id} set from
_block_singletons for nodes in _node_block. When the mesh has a single subdomain, cacheInfo()
stores nothing and getNodeBlockIds() returns libMesh's cached subdomain set, which cacheInfo()
refreshes so that runtime subdomain changes are picked up.
On the single-block, 262144 element cantilever of idaholab#33740 on 24 ranks, cacheInfo() drops from
0.517 s to 0.041 s, peak memory per process from 776 MB to 718 MB, and run time from 9.11 s to
8.46 s. On a serial 262144 element mesh, cacheInfo() drops from 0.36 s to 0.11 s and peak
memory from 290 MB to 261 MB with 8 blocks, and from 0.35 s to 0.125 s and 292 MB to 265 MB
with 64 blocks. Results are unchanged.
Debug builds need libMesh/libmesh#4540, which relaxes the is_prepared() assertion in
MeshBase::get_mesh_subdomains() so that it can be called while MooseMesh::prepare() runs.
Refs idaholab#33740
closes idaholab#33847
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pulling these out of #4411, partly because Alex was right that we really should have assertions like this and so I want to get them in before someone adds a new violation of them, partly because I'm hoping that if I keep stripping #4411 down smaller and smaller then I'll finally be able to get the whole thing merged by fixing the problems as they come.