@@ -13,13 +13,6 @@ if [ "$job_device" = "gpu" ] && [ "$ngpus" -eq 0 ]; then
1313 ngpus=1
1414fi
1515
16- # Verify the venv Python interpreter exists (created by ./mfc.sh build)
17- if [ ! -x build/venv/bin/python3 ]; then
18- echo " ERROR: build/venv/bin/python3 not found."
19- echo " The MFC build venv may not have been created. Was the pre-build step successful?"
20- exit 1
21- fi
22-
2316benchmarks=(
2417 benchmarks/5eq_rk3_weno3_hllc/case.py
2518 benchmarks/viscous_weno5_sgb_acoustic/case.py
@@ -28,6 +21,30 @@ benchmarks=(
2821 benchmarks/igr/case.py
2922)
3023
24+ # For Frontier/Frontier AMD: deps were fetched on the login node via --deps-only;
25+ # build case-optimized binaries here on the compute node before running.
26+ # For Phoenix: prebuild-case-optimization.sh already built everything in a prior SLURM job.
27+ #
28+ # Clean stale MFC target staging before building. On self-hosted CI runners,
29+ # corrupted intermediate files from a prior failed build (e.g. CCE optcg crash)
30+ # can persist and poison subsequent builds. Each case-opt config gets its own
31+ # hash-named staging dir, but install dirs and other artifacts may be stale.
32+ if [ " $job_cluster " != " phoenix" ]; then
33+ # Clean stale MFC target dirs (hash-named) from prior builds, but
34+ # preserve dependency dirs (hipfort, fftw, etc.) since the compute
35+ # node has no internet to re-fetch them.
36+ echo " === Cleaning stale MFC target staging/install ==="
37+ find build/staging -maxdepth 1 -regex ' .*/[0-9a-f]+' -type d -exec rm -rf {} + 2> /dev/null || true
38+ find build/install -maxdepth 1 -regex ' .*/[0-9a-f]+' -type d -exec rm -rf {} + 2> /dev/null || true
39+
40+ echo " === Building case-optimized binaries on compute node ==="
41+ for case in " ${benchmarks[@]} " ; do
42+ echo " --- Building: $case ---"
43+ ./mfc.sh build -i " $case " --case-optimization $gpu_opts -j 8
44+ done
45+ echo " === All case-optimized binaries built ==="
46+ fi
47+
3148passed=0
3249failed=0
3350failed_cases=" "
@@ -44,7 +61,7 @@ for case in "${benchmarks[@]}"; do
4461 rm -rf " $case_dir /D" " $case_dir /p_all" " $case_dir /restart_data"
4562
4663 # Build + run with --case-optimization, small grid, 10 timesteps
47- if ./mfc.sh run " $case " --case-optimization $gpu_opts -n " $ngpus " -j 8 -- --gbpp 1 --steps 10; then
64+ if ./mfc.sh run " $case " --case-optimization $gpu_opts -n " $ngpus " -j 8 -c " $job_cluster " - - --gbpp 1 --steps 10; then
4865 # Validate output
4966 if build/venv/bin/python3 .github/scripts/check_case_optimization_output.py " $case_dir " ; then
5067 echo " PASS: $case_name "
0 commit comments