When I use amrex::Random(), the code like
amrex::ParallelFor(box,
[=] AMREX_GPU_DEVICE(int i, int j, int k)
{
Real udist = amrex::Random(rd), vdist = amrex::Random(rd);
});
I find that it will throw out exception as
0::Assertion `i < (this->std::vector<T, Allocator>::size())' failed, file "...../amrex-24.01/Src/Base/AMReX_Vector.H", line 35 !!!
However, after several tests, I find that this exception ONLY happens when enabled the OpenMP and the debug mode (compiled with -g) simultaneously. I also find this post stated that the ParallelForRNG may helps(https://github.com/AMReX-Codes/amrex/discussions/3693), but in my tests it suffers from the exception also when compiled in the OpenMP+debug mode.
When I use amrex::Random(), the code like amrex::ParallelFor(box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { Real udist = amrex::Random(rd), vdist = amrex::Random(rd); }); I find that it will throw out exception as 0::Assertion `i < (this->std::vector<T, Allocator>::size())' failed, file "...../amrex-24.01/Src/Base/AMReX_Vector.H", line 35 !!!
However, after several tests, I find that this exception ONLY happens when enabled the OpenMP and the debug mode (compiled with -g) simultaneously. I also find this post stated that the ParallelForRNG may helps(https://github.com/AMReX-Codes/amrex/discussions/3693), but in my tests it suffers from the exception also when compiled in the OpenMP+debug mode.