-
Notifications
You must be signed in to change notification settings - Fork 125
benchmarks hardening! #1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sbryngelson
wants to merge
13
commits into
MFlowCode:master
Choose a base branch
from
sbryngelson:benchmark-hardening
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+559
−94
Open
benchmarks hardening! #1078
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e8090bd
benchmarks hardening!
sbryngelson 8c01b99
lint error
sbryngelson 2e1eb87
minor
sbryngelson 0668fed
forks look nicer now i think
sbryngelson f79f4d1
more fixing!
sbryngelson 76a6e63
clean linter
sbryngelson 7333098
fix some more suggestions
sbryngelson b62854c
more hardening :O
sbryngelson adc26a0
fix bug
sbryngelson 0b31278
harden against h5dump missing
sbryngelson b0eca32
debug
sbryngelson 0589b85
lint fix
sbryngelson 6d830f3
fix brokenness
sbryngelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/bin/bash | ||
| # Monitor a SLURM job and stream its output in real-time | ||
| # Usage: monitor_slurm_job.sh <job_id> <output_file> | ||
|
|
||
| set -e | ||
|
|
||
| if [ $# -ne 2 ]; then | ||
| echo "Usage: $0 <job_id> <output_file>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| job_id="$1" | ||
| output_file="$2" | ||
|
|
||
| echo "Submitted batch job $job_id" | ||
| echo "Monitoring output file: $output_file" | ||
|
|
||
| # Wait for file to appear (check job status if it takes a while) | ||
| echo "Waiting for job to start..." | ||
| while [ ! -f "$output_file" ]; do | ||
| # Check if job failed to start | ||
| if ! squeue -j "$job_id" &>/dev/null && [ ! -f "$output_file" ]; then | ||
| echo "ERROR: Job $job_id finished without creating output file" | ||
| exit 1 | ||
sbryngelson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fi | ||
| sleep 5 | ||
| done | ||
|
|
||
| echo "=== Streaming output for job $job_id ===" | ||
| # Stream output while job runs | ||
| tail -f "$output_file" & | ||
| tail_pid=$! | ||
|
|
||
| # Wait for job to complete with retry logic for transient squeue failures | ||
| squeue_failures=0 | ||
| while true; do | ||
| if squeue -j "$job_id" &>/dev/null; then | ||
| squeue_failures=0 | ||
| else | ||
| squeue_failures=$((squeue_failures + 1)) | ||
| # Allow a few transient failures before concluding job is done | ||
| if [ $squeue_failures -ge 3 ]; then | ||
| break | ||
| fi | ||
| fi | ||
| sleep 5 | ||
| done | ||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Stop tailing | ||
| kill $tail_pid 2>/dev/null || true | ||
|
|
||
| echo "" | ||
| echo "=== Final output ===" | ||
| cat "$output_file" | ||
|
|
||
| # Check exit status | ||
| exit_code=$(scontrol show job "$job_id" 2>/dev/null | grep -oP 'ExitCode=\K[0-9]+:[0-9]+' || echo "0:0") | ||
sbryngelson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
sbryngelson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [ "$exit_code" != "0:0" ]; then | ||
| echo "ERROR: Job $job_id failed with exit code $exit_code" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Job $job_id completed successfully" | ||
| exit 0 | ||
|
|
||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.