Last active
February 24, 2023 18:59
-
-
Save michaelsilverstein/c15706dd45e9f56de4314e3ade7a9cc4 to your computer and use it in GitHub Desktop.
Qsub a python script
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
#!/bin/bash -l | |
# USAGE: bash run_python_batchjob.qsub [PYTHON FILE] | |
# Make job script | |
if [ -z "$1" ] | |
then | |
echo "ERROR: MUST PROVIDE INPUT PATH" | |
echo "USAGE: bash run_python_batchjob.qsub [PYTHON FILE]" | |
exit | |
else | |
python_file=$1 | |
fi | |
job_script=$(mktemp) | |
# Submit batch job | |
batch_job_text="#!/bin/bash -l\n\ | |
#$ -P cometsfba\n\ | |
#$ -j y\n\ | |
#$ -m bae\n\ | |
python $python_file | |
" | |
echo -e $batch_job_text > $job_script | |
cat $job_script | |
qsub $job_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update
#$ -P cometsfba\n\
with your SCC project