-
Notifications
You must be signed in to change notification settings - Fork 5
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
Smart submit mode #110
Open
olszowski
wants to merge
27
commits into
DataMedSci:master
Choose a base branch
from
olszowski:feature/smart_submit_mode
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.
Open
Smart submit mode #110
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
917cdb9
v1 - test
olszowski 0e55c15
refactoring + tests
olszowski 2b0736a
smart submit
olszowski 32c6c04
fixing file name for stdout and stderr
olszowski acdd1c7
removing testing code
olszowski 843574e
ignore invalid lines from command output
olszowski 60ce443
fixing command call
olszowski b06d075
fixing script generation
olszowski d2cfc6a
improved log message
olszowski 08c05e6
Merge remote-tracking branch 'mcpartools/master' into feature/smart_s…
olszowski 3532112
removing unnecessary files
olszowski 50385a3
import for reduce method
olszowski f3f23c3
fixing missing error class in python 3.x
olszowski 02f00d5
removing unnecessary whitespaces
olszowski 9cdeadd
include j2 file in manifest
olszowski 371f2c1
fixing submit file
olszowski 2f91474
improved options format, configurable utilisation and ratio
olszowski b925a95
configurable partition
olszowski 99830f7
fix partition support
olszowski c33cd2e
improved logging
olszowski 6b6814e
experimental: append sbatch log info to the end of file instead of
olszowski 615f718
log nodes in order
olszowski df19d7c
fixing python3 vs python2 ways to deal with std out from subprocess
olszowski c1619af
Merge remote-tracking branch 'mcpartools/master' into feature/smart_s…
olszowski ab27fd8
change string in tests to bstring to better match real output
olszowski 4f3a8a8
python 2 vs 3 test fix
olszowski 76935ab
python 2 vs 3 test fix
olszowski 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 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 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 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 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 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,30 @@ | ||
#!/bin/bash | ||
|
||
# Log file submit.log will be created in the same directory submit.sh is located | ||
# submit.log is for storing stdout and stderr of sbatch command, for log info from individual jobs see {log_dir:s} directory | ||
LOGFILE="$(cd $(dirname $0) && pwd)/submit.log" | ||
echo -n "" > "$LOGFILE" | ||
|
||
# Create temporary files for parsing stdout and stderr output from sbatch command before storing them in submit.log | ||
OUT=`mktemp` | ||
ERR=`mktemp` | ||
# On exit or if the script is interrupted (i.e. by receiving SIGINT signal) delete temporary files | ||
trap "rm -f $OUT $ERR" EXIT | ||
{% for node_id in nodes %} | ||
sbatch {{options_args}} --partition={{partition}} --nodelist={{node_id}} -n1 --output="{{log_dir}}/output_{{loop.index0}}_{{node_id}}.log" --error="{{log_dir}}/error_{{loop.index0}}_{{node_id}}.log" --parsable {{workspace_dir}}/{{"job_{0:04d}".format(loop.index)}}/run.sh >> $OUT 2>> $ERR | ||
{% endfor %} | ||
echo "Saving logs to $LOGFILE" | ||
|
||
# If sbatch command ended with a success log following info | ||
if [ $? -eq 0 ] ; then | ||
echo "Job ID: `cat $OUT | cut -d ";" -f 1`" > "$LOGFILE" | ||
echo "Submission time: `date +"%Y-%m-%d %H:%M:%S"`" >> "$LOGFILE" | ||
fi | ||
|
||
# If output from stderr isn't an empty string then log it as well to submit.log | ||
if [ "`cat $ERR`" != "" ] ; then | ||
echo "---------------------" >> "$LOGFILE" | ||
echo "ERROR MESSAGE" >>"$LOGFILE" | ||
echo "---------------------" >> "$LOGFILE" | ||
cat $ERR >> "$LOGFILE" | ||
fi |
This file contains 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
Empty file.
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.
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.
Why
.j2
suffix ?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.
It's a jinja2 template, I wanted this to be explicit.
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.
ok