ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
308 stars 195 forks source link

'out_of_range' error depending to OMP_NUM_THREADS #4593

Open EyaDammak opened 10 months ago

EyaDammak commented 10 months ago

On the local computer, when I run some input codes (inputs_rz from the scraping test for examples, https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Tests/scraping/inputs_rz), I have this error: [error_message.txt] + this backtrace file: Backtrace.0.1.txt

Here the commands that I did: /cmake -S . -B build -DWarpX_DIMS="RZ" -DWarpX_EB=ON -DWarpX_MPI=OFF -DCMAKE_BUILD_TYPE=Debug /cmake --build build -j 4

Nonetheless, when I impose export OMP_NUM_THREADS=1, the inputs script runs. With export OMP_NUM_THREADS=2, sometimes it runs and sometimes not. And for `OMP_NUM_THREADS' > 2, the input script doesn't run.

I have similar problems with python scripts: https://github.com/EyaDammak/WarpX/blob/spacecraft_charging_automated_test/Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py Using these commands: /cmake -S . -B build -DWarpX_DIMS="RZ;3" -DWarpX_EB=ON -DWarpX_PYTHON=ON /cmake --build build --target pip_install -j 4

ax3l commented 10 months ago

Interesting, this points to ComputeDivB: https://github.com/ECP-WarpX/WarpX/blob/4ab88c5909ac2a0dd300d8ed111bfa04280b3e76/Source/WarpX.cpp#L2931

with algo.maxwell_solver = none...

ax3l commented 10 months ago

It might be possible that you posted the Backtrace.0.1.txt from another run (a Python run)?

ax3l commented 6 months ago

If it is a race condition #4799, then the backtrace hint to ParticleBoundaryBuffer::gatherParticles(MultiParticleContainer&, amrex::Vector<amrex::MultiFab const*, std::allocator<amrex::MultiFab const*> > const&) [clone ._omp_fn.1] at /home/eyadammak/src/warpx/Source/Particles/ParticleBoundaryBuffer.cpp:326 might be valid...?