Skip to content

Assert caches are prepared - #4540

Merged
roystgnr merged 2 commits into
libMesh:develfrom
roystgnr:assert_caches
Sep 8, 2026
Merged

roystgnr merged 2 commits into
libMesh:develfrom
roystgnr:assert_caches

Conversation

@roystgnr

@roystgnr roystgnr commented Sep 8, 2026

Copy link
Copy Markdown
Member

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.

@roystgnr

roystgnr commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

I might need to pull a third commit from #4411 before this will pass tests; fingers crossed.

@moosebuild

Copy link
Copy Markdown

Job Coverage, step Generate coverage on 68a28d7 wanted to post the following:

Coverage

41ae1d #4540 68a28d
Total Total +/- New
Rate 65.99% 65.99% +0.00% 100.00%
Hits 79526 79530 +4 12
Misses 40994 40994 - 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@roystgnr
roystgnr merged commit d247482 into libMesh:devel Sep 8, 2026
23 checks passed
@roystgnr
roystgnr deleted the assert_caches branch September 8, 2026 14:27
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants