Skip to content
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

Random number generator exception in multithread #3920

Open
pkufourier opened this issue May 5, 2024 · 1 comment
Open

Random number generator exception in multithread #3920

pkufourier opened this issue May 5, 2024 · 1 comment

Comments

@pkufourier
Copy link

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(#3693), but in my tests it suffers from the exception also when compiled in the OpenMP+debug mode.

@WeiqunZhang
Copy link
Member

Could you please provide more details on how to reproduce the issue? Maybe you are using an amrex library that was not compiled with OpenMP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants