-
Notifications
You must be signed in to change notification settings - Fork 5
Update slurm_submit to capture job ID #135
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,9 +3,13 @@ | |||||||||||||||||||||||||||||||||||||||||
# Wrapper script for Slurm batch submit | ||||||||||||||||||||||||||||||||||||||||||
# Args are submit script, outputfile, and error file | ||||||||||||||||||||||||||||||||||||||||||
# Return the job id via stdout | ||||||||||||||||||||||||||||||||||||||||||
# Ensure that slurm_submit and slurm_checkjob are in the PATH . ~/.local_settings may need to be updated | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an extra space in 'that slurm_submit' - should be 'that slurm_submit' with only one space.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
module purge | ||||||||||||||||||||||||||||||||||||||||||
PATH=/usr/common/software/bin:/usr/common/mss/bin:/usr/common/nsg/bin:/opt/ovis/bin:/opt/ovis/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I generally don't think paths should be hardcoded in scripts, but it seems unlikely this script is ever going to be used for anything other than hipmer so it's probably fine |
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
SUBMIT=$1 | ||||||||||||||||||||||||||||||||||||||||||
LOGFILE=$2 | ||||||||||||||||||||||||||||||||||||||||||
ERRFILE=$3 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
sbatch -o $LOGFILE -e $ERRFILE $SUBMIT | ||||||||||||||||||||||||||||||||||||||||||
sbatch -o $LOGFILE -e $ERRFILE $SUBMIT|sed 's/Submitted batch job //' | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sed command assumes sbatch will always output 'Submitted batch job ' prefix. Consider adding error handling to verify the command succeeded and the output format is as expected before parsing.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space after the # character - should be '# Ensure' instead of '# Ensure' for consistency with other comments.
Copilot uses AI. Check for mistakes.