Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/include/2dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@
& - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)))**1.4
q_prim_vf(eqn_idx%mom%beg + 0)%sf(i, j, &
& 0) = patch_icpp(1)%vel(1) + (y_cc(j) - patch_icpp(1)%y_centroid)*(5.0/(2.0*pi))*exp(1.0*(1.0 - (x_cc(i) &
& - patch_icpp(1) %x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0))
& - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0))
q_prim_vf(eqn_idx%mom%beg + 1)%sf(i, j, &
& 0) = patch_icpp(1)%vel(2) - (x_cc(i) - patch_icpp(1)%x_centroid)*(5.0/(2.0*pi))*exp(1.0*(1.0 - (x_cc(i) &
& - patch_icpp(1) %x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0))
& - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0))
end if
case (281) ! Acoustic pulse
! This is patch is hard-coded for test suite optimization used in the 2D_acoustic_pulse case: This analytic patch uses
Expand Down
17 changes: 17 additions & 0 deletions toolchain/bootstrap/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,20 @@ if ! cmp "$(pwd)/toolchain/pyproject.toml" "$(pwd)/build/pyproject.toml" > /dev/

fi # end of USE_UV=0 (pip) block
fi


# Apply patches to installed packages.
# fypp: always emit a resync linemarker after single-line $: macro calls so
# that the compiler attributes the following Fortran statement to the correct
# source line rather than the call-site line (off-by-1 in backtraces).
FYPP_PY="$(python3 -c "import fypp; print(fypp.__file__)" 2>/dev/null)"
FYPP_PATCH="$(pwd)/toolchain/patches/fypp-linemarker-resync.patch"
if [ -n "$FYPP_PY" ] && [ -f "$FYPP_PATCH" ]; then
if ! grep -q "Always emit a resync marker" "$FYPP_PY" 2>/dev/null; then
if patch -p1 --forward --silent "$FYPP_PY" < "$FYPP_PATCH" 2>/dev/null; then
ok "(venv) Applied$MAGENTA fypp$COLOR_RESET linemarker-resync patch."
else
warn "(venv) Failed to apply$MAGENTA fypp$COLOR_RESET linemarker-resync patch (fypp version may have changed)."
fi
fi
fi
25 changes: 25 additions & 0 deletions toolchain/patches/fypp-linemarker-resync.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/fypp.py
+++ b/fypp.py
@@ -1842,11 +1842,16 @@ class _Renderer:
if self._linenums:
# Last line was folded, but no linenums were generated for
# the continuation lines -> current line position is not
# in sync with the one calculated from the last line number
unsync = (
len(foldedlines) and len(foldedlines[-1]) > 1
and not self._contlinenums)
# Eval directive in source consists of more than one line
multiline = span[1] - span[0] > 1
- if unsync or multiline:
+ # Always emit a resync marker after a $: call. Without this,
+ # single-line $: calls that expand to multi-line #if/#endif
+ # blocks (e.g. GPU_PARALLEL_LOOP) cause the compiler to
+ # attribute the next Fortran statement to the call-site line
+ # rather than the following source line, producing off-by-1
+ # errors in backtraces and debugger line info.
+ if unsync or multiline or True:
# For inline eval directives span[0] == span[1]
# -> next line is span[0] + 1 and not span[1] as for
# line eval directives
nextline = max(span[1], span[0] + 1)
trailing += self._linenumdir(nextline, fname)
Loading