Skip to content

Instantly share code, notes, and snippets.

@michaelsilverstein
Last active February 24, 2023 18:59
Show Gist options
  • Save michaelsilverstein/c15706dd45e9f56de4314e3ade7a9cc4 to your computer and use it in GitHub Desktop.
Save michaelsilverstein/c15706dd45e9f56de4314e3ade7a9cc4 to your computer and use it in GitHub Desktop.
Qsub a python script
#!/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
@michaelsilverstein
Copy link
Author

Update #$ -P cometsfba\n\ with your SCC project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment