CI: skip the redundant rebuild in the case-opt run job - #1766
CI: skip the redundant rebuild in the case-opt run job#1766sbryngelson wants to merge 4 commits into
Conversation
… built On phoenix and frontier_amd the binaries are built in a prior SLURM job, so run_case_optimization.sh skips its own build block. It then calls mfc.sh run, which builds unconditionally: run() calls build(targets), and __build_target configures, builds and installs every non-dependency target for every case. syscheck, pre_process and post_process hash to one slug shared by all benchmarks, so the three concurrent frontier_amd shards, which share a workspace and leave the SLURM queue together, install to the same paths at the same time. The losing shard fails with "file INSTALL cannot copy file ... No such file or directory" and exits 143. Pass --no-build on those two clusters. is_buildable() then returns False and __build_target returns before configure, build and install, so the run phase issues no cmake invocations and there is nothing to race on. frontier (CCE) still builds on the compute node and is unchanged.
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR prevents intermittent failures in the Case Optimization CI job on shared-workspace SLURM clusters by ensuring the run step does not rebuild/reinstall binaries that were already built in a prior job.
Changes:
- Introduces a
build_optsflag that becomes--no-buildonphoenixandfrontier_amd. - Passes
build_optsthrough to./mfc.sh runso concurrent shards skipcmake --build/cmake --install. - Adds in-script documentation explaining the shared-slug collision and resulting install race.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1766 +/- ##
=======================================
Coverage 61.67% 61.67%
=======================================
Files 84 84
Lines 21619 21619
Branches 3196 3196
=======================================
Hits 13334 13334
Misses 6093 6093
Partials 2192 2192 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
The
Case Opt | Oak Ridge | Frontier (AMD) (gpu-omp)job fails intermittently duringcmake --install:The exit code 143 is not an external kill.
toolchain/main.pycallsquit(signal.SIGTERM)onMFCException, so any build or install failure surfaces as 143.Cause
On
frontier_amdthe run step submits three concurrent SLURM jobs that share one workspace.run_case_optimization.shskips its own build block for that cluster, becauseprebuild-case-optimization.shalready built and installed every binary in a prior SLURM job. It then calls./mfc.sh runanyway, andrunalways builds:run()callsbuild(targets)unconditionally, and__build_targetrunsconfigure,build, andinstallfor every non-dependency target on every case.syscheck,pre_processandpost_processhash to a single slug for all five benchmarks, becauseget_slughashescase.get_fpp(target)andget_fppmaps onlypre_processandsimulationto real generators. Everything else gets"! This file is purposefully empty.". The per-shard logs confirm it:Only
simulationgets a per-case slug. So all three shards runcmake --buildandcmake --installagainst the samebuild/stagingandbuild/installpaths, with no synchronization. The pre-build already guards against exactly this, with a marker handshake and the comment "Concurrent shards must not build those shared staging dirs simultaneously". The run phase never got the same treatment.The collision window is at shard startup. All three jobs left the queue in the same second after roughly 90 minutes pending:
They then walked through an identical startup and reached the shared
syscheckinstall together. That is why the failure lands on a shard's first case, and why the losing shard differs between attempts of the same run: attempt 1 failed onhypo_hll(shard 3), attempt 2 onviscous_weno5_sgb_acoustic(shard 2).Fix
Pass
--no-buildtomfc.sh runon the clusters whose binaries were built in a prior SLURM job, which isphoenixandfrontier_amd, the same two the in-script build block already skips.--no-buildmakesis_buildable()returnFalse, so__build_targetreturns beforeconfigure,buildandinstall. The run phase then issues no cmake invocations at all and there is nothing left to race on.run()still loads and validates the case and still calls__generate_input_files, so only the build side is affected.frontier(CCE) is unchanged: it builds on the compute node inside this script, so it keeps building throughrun.Testing
--gbppand--stepsdo not enterget_slug.bash -npasses.shellcheckreports no new findings; the remainingSC2086andSC2154warnings are pre-existing and unrelated.Case Optmatrix on this PR, on both Phoenix and Frontier AMD.Known remaining exposure
The pre-build has the same structural hazard and this PR does not address it. Shards 2 and 3 wait on
build/.prebuild-shared-targets-done, then each runs./mfc.sh run "$case" --dry-runper case, which reinstalls the shared targets into the same paths. It has not been observed to fail, most likely because the marker is polled on a 30 secondsleep, so the shards are staggered rather than released together. Worth a follow-up, but it is a different change and should not ride along with this one.Type of change (delete unused ones)
Reference
Failing job: https://github.com/MFlowCode/MFC/actions/runs/32684872325/job/97532516750