Skip to content

Avoid high memory use when writing unstructured mesh VTK files - #2806

Merged
pshriwise merged 1 commit into
openmc-dev:developfrom
paulromano:vtk-high-memory-use
Dec 14, 2023
Merged

pshriwise merged 1 commit into
openmc-dev:developfrom
paulromano:vtk-high-memory-use

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

I found that when trying to export unstructured mesh tally data to a VTK file using the UnstructuredMesh.write_data_to_vtk method, it blew out the memory on my machine. After a little digging, I was able to attribute this to the fact that in that method, we're holding a list of vtkTetra elements, which doesn't appear to be necessary. With this fix, the memory use is much lower.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) 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)

@paulromano
paulromano requested a review from pshriwise December 13, 2023 13:13
@paulromano paulromano changed the title Avoid high memory use in when writing unstructured mesh VTK files Avoid high memory use when writing unstructured mesh VTK files Dec 13, 2023

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'm a little surprised the list took up that much space. Thanks for the clear improvement!

@pshriwise

Copy link
Copy Markdown
Contributor

Another straightforward change from @paulromano so I don't let this one linger long either once tests pass.

@pshriwise pshriwise added the Merging Soon PR will be merged in < 24 hrs if no further comments are made. label Dec 13, 2023
@pshriwise
pshriwise merged commit fb65dfd into openmc-dev:develop Dec 14, 2023
@paulromano
paulromano deleted the vtk-high-memory-use branch December 15, 2023 01:14
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merging Soon PR will be merged in < 24 hrs if no further comments are made.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants