Created
March 6, 2013 19:40
-
-
Save brwnj/5102383 to your computer and use it in GitHub Desktop.
command line usage example of bsub
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
#!/usr/bin/env bash | |
#BSUB -J example | |
JOBIDS="" | |
# example loop | |
for (( i = 0; i < 10; i++ )); do | |
RUNSCRIPT=example.sh | |
echo "#! /usr/bin/env bash" > $RUNSCRIPT | |
echo "#BSUB -J example_slave" >> $RUNSCRIPT | |
echo "sleep 3" >> $RUNSCRIPT | |
# submit the job | |
JOB=$(bsub < $RUNSCRIPT) | |
# get the id | |
JOBID=$(echo $JOB | sed -rn 's/.*<([0-9]+)>.*/\1/p') | |
# add the job id to a space delimited string | |
JOBIDS="$JOBIDS $JOBID" | |
done | |
# wait for completion | |
python -m bsub $JOBIDS | |
# do more stuff | |
echo "dependencies complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment