Skip to content

Fix SV dump in MLIR DLO build

Atoli Huppe requested to merge dlo-fix-sv-dump into master

What does this MR do?

Dumping state variables in DLO builds caused segmentation faults because of a bug in the MULTI_ION_IF:get_sv function that loads a state variable into an array. The function wasn't updated to be able to load state variables arranged in an AoSoA way.

The bug is reproducible by building openCARP with MLIR and DLO enabled. Running the following command causes the bug.

bench -I AlievPanfilov --bin --no-trace --validate -n 10000000 -a 1

The number of cells needs to be set sufficiently large for the overflow to indeed cause a segmentation fault. Otherwise bench simply dumps garbage data to the state variables without crashing. We never experienced the bug before because we run our tests with n small enough for the program to not crash.

With the fixed proposed in this MR, the problem is fixed and state variables can be dumped even with a very big number of cells.

I also removed some extraneous (unrelated) debug prints in this MR.

Related issues

Author's checklist

  • Follow the Contribution Guidelines. Sign the CLA and add yourself to the list of contribtutors for your first contribution.
  • Describe your change in the CHANGELOG.md file in the top-level folder of the openCARP repository.
  • Apply the appropriate labels.
  • Does this commit add new dependencies? If no, just tick the box. If yes, please evaluate carefully if the additional dependency is a more sustainable option than including the functionality in own code. If the former, describe the dependency clearly, add them to the Software Management Plan and the installation instructions (*.md files, CMake files, Docker files etc.).

Reviewer's checklist

All reviewers can help ensure accuracy, clarity, completeness, and adherence to the Contribution Guidelines.

Reviewer

  • Review by a code reviewer or other selected colleague to confirm accuracy, clarity, and completeness. This can be skipped for minor fixes without substantive content changes.

Maintainer

  • Review by assigned maintainer, who can always request/require the above reviews.
Edited by Atoli Huppe

Merge request reports