STEllAR-GROUP / octotiger

Astrophysics program simulating the evolution of star systems based on the fast multipole method on adaptive Octrees
http://octotiger.stellar-group.org/
Boost Software License 1.0
48 stars 17 forks source link

Prevent division by zero in masked SIMD lanes #482

Closed G-071 closed 6 months ago

G-071 commented 6 months ago

This fixes the crashes we encountered when using scenarios with disc_detect in a SIMD-enabled Kokkos build.

Here, it was possible to encounter divisions by zero in the reconstruct ppm method during the disc_detect part. These only happened in masked out (deactivated) SIMD elements and thus would not affect the results. However, they would of course cause crashes. This commit fixes those by setting the deactivated elements to one (simply by using the same mask again).

Might fix #471 .