Skip to content

Improve libMesh tally performance#3978

Closed
nuclearkevin wants to merge 1 commit into
openmc-dev:developfrom
nuclearkevin:fix_libmesh_perf
Closed

Improve libMesh tally performance#3978
nuclearkevin wants to merge 1 commit into
openmc-dev:developfrom
nuclearkevin:fix_libmesh_perf

Conversation

@nuclearkevin

@nuclearkevin nuclearkevin commented Jun 20, 2026

Copy link
Copy Markdown
Member

Description

I had been noticing a fairly substantial performance penalty when using libMesh unstructured mesh tallies and a mesh that only covers a portion of the domain. The performance penalty scaled with the number of elements in the mesh (so long as the mesh did not fully cover the domain), and would disappear if the mesh fully covered the problem. After perusing the libMesh doxygen for the point locators, namely the accessor function, I discovered that libMesh will perform a linear search over all mesh elements in the event that an element containing a point was not found after querying spatial trees. This behaviour can be fixed slightly improved by calling PointLocatorBase::unset_close_to_point_tol(), which sets _use_close_to_point_tol = false and disables the linear search.

After some more testing this only results in a slight increase in performance for these problems, and only for wrapped applications that were setting the flag behind the scenes (e.g. MOOSE).

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant