amrex
amrex copied to clipboard
MFIter::allow_multiple_mfiters' failed
0::Assertion `depth == 1 || MFIter::allow_multiple_mfiters' failed, file "/home/wuxf/amrex/Src/Base/AMReX_MFIter.cpp", line 254, Msg: "Nested or multiple active MFIters is not supported by default. This can be changed by calling MFIter::allowMultipleMFIters(true)". !!! SIGABRT
Any comments about how to fix it?
This is usually a bug in the user's code. The assertion is there to prevent common bugs like below
for (MFIter mfi(...) ....) {
for (MFIter ....) {}; // or a function that contains MFIter loop
}
The error message has already provided a way to get around it if the pattern above is not a bug for you.
I see, thanks. I don't think my code has a bug. This assertion caused the crash of my code. When I added MFIter::allowMultipleMFIters(true) before the assertion, it works well.
I am curious and would like to understand how our users are using it. Do you mind show us some code snippets?
I used the AMReX to configure the latest FLASH (FLASHX).
I see. There is a Fortan wrapper, amrex_mfiter_allow_multiple
in amrex_multifab_module
.
@wuxf99 I think this can be closed?
Yes.
Thanks, Xingfu
On Apr 27, 2021, at 1:37 PM, Klaus @.***> wrote:
@wuxf99 I think this can be closed?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi, I had the same error message and wanted to know what caused it as I could not find obvious programming errors.
It turned out that I've used phi.setVal(0.0)
and MultiFab::Copy(...)
inside the mfiter loop. Moving these out of the loop solved the issue.
Hope this helps others. Nils