-
Notifications
You must be signed in to change notification settings - Fork 369
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
Assert no nested MFIters #1530
Assert no nested MFIters #1530
Conversation
Add assertion to catch nested MFIters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool idea!
This is indeed a good idea but we need to fix the implementation. This breaks AmrLevel (at least) because
and so the constructor will increment |
Thanks for catching this. This is tricky. There is another case that can cause problems. I think some codes do
I think we can fix it by setting |
`FillPatchIterator` is derived from `MFIter`. We need to reset `MFIter::depth` so that the ctor of `FillPatchIterator` can start `MFIter`.
## Summary `MultiFab::setVal` should not be called inside `MFIter`. ## Additional background This was caught by #1530. ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] are described in the proposed changes to the AMReX documentation, if appropriate
Summary
Add assertion to catch nested MFIters (e.g., MultiFab functions are called inside MFIter).
Checklist
The proposed changes: