-
Notifications
You must be signed in to change notification settings - Fork 525
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
Segfault when trying to write tallies.out with DistribcellFilter #2798
Comments
Tagging @pshriwise |
Thanks for the MWE @lewisgross1296! This issue looked really familiar to me and I thought we had fixed it (see #1995 and the related test), which is I was a little confused when you presented this in the forum. It appears that fix only works for rectangular lattices though. I'll think this a bit and get back to you. |
Considering that my example could be more minimal, I've made the body of a test similar to the test you linked that causes the same error. Maybe we can chat at SW about how to turn this into a full test that goes into OpenMC. I'm not sure I fully understand exactly how to make an analogous
|
Welp, this let me down the wonderful rabbit hole of cell instances and lattice offsets, uncovering a few different issues along the way. Thanks for your patience on this issue @lewisgross1296. The failure point seen here is a result of getting through the following loop in Lines 526 to 545 in fb65dfd
As a start, I've created a PR to report a failure if we make it through that loop (#2812). In C++, our lattice classes hold an "offset table" that represents the instance offset for a cell used within one of the lattice universes. It turns out that, for hexagonal lattices, this happens because the entry in the offset table being checked in this line is It turns out that the incorrect loop-exit happens before we get to the call of Additionally, a bug was found when more than one cell was part of the universe filling the lattice. We weren't accounting for the cell offset in the offset comparison in that loop either to make sure the correct section of the offset table is accessed when determining paths. This also showed up in how tallies are handled and will require another fix -- that one will go in soon as well. TL;DR There's a problem with how we iterate over hexagonal cells and index into offsets that only manifests itself when a lattice is used to fill more than one cell. I'll be submitting a fix for those shortly and this should fix the issue you're seeing with writing the PR Plan:
|
Thanks Patrick! Glad you got to the bottom of this. Tagging @gonuke for the update |
Bug Description
Originally, I created a forum post about a segmentation fault that occurred for my model. Included is the ordinary error and a more detailed stack trace using the debugger. That model is a bit complicated, so I created a simpler example that reproduces the error.
The segfault occurs when when I use a
DistribcellFilter
on a cell representing the inside of an infiniteZCylinder
. This cell appears in the model as part of a universe which is repeated in aHexLattice
and is eventually intersected withopenmc.ZPlane
s to make a geometry with finite cells.I'm pretty sure the error happens during the process of writing
tallies.out
, since the error vanishes when I tell my settings not to produce thetallies.out
file.Steps to Reproduce
Running this script will produce the error
Environment
I am using OpenMC version 0.13.3 on Ubuntu 20.04.6 LTS. I installed from source in debug mode. The simulation is run using python 3.10.5.
The text was updated successfully, but these errors were encountered: