Disable NaN sanity check in bssn_rhs.f90 for production builds
Wrap the NaN sanity check (21 sum() full-array traversals per RHS call)
with #ifdef DEBUG so it is compiled out in production builds.
This eliminates 84 redundant full-array scans per timestep (21 per RHS
call × 4 RK4 substages) that serve no purpose when input data is valid.
Usage:
- Production build (default): NaN check is disabled, no changes needed.
- Debug build: add -DDEBUG to f90appflags in makefile.inc, e.g.
f90appflags = -O3 ... -DDEBUG -fpp ...
to re-enable the NaN sanity check.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,8 @@
|
||||
call getpbh(BHN,Porg,Mass)
|
||||
#endif
|
||||
|
||||
!!! sanity check
|
||||
!!! sanity check (disabled in production builds for performance)
|
||||
#ifdef DEBUG
|
||||
dX = sum(chi)+sum(trK)+sum(dxx)+sum(gxy)+sum(gxz)+sum(dyy)+sum(gyz)+sum(dzz) &
|
||||
+sum(Axx)+sum(Axy)+sum(Axz)+sum(Ayy)+sum(Ayz)+sum(Azz) &
|
||||
+sum(Gamx)+sum(Gamy)+sum(Gamz) &
|
||||
@@ -136,6 +137,7 @@
|
||||
gont = 1
|
||||
return
|
||||
endif
|
||||
#endif
|
||||
|
||||
PI = dacos(-ONE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user