Last active
August 29, 2015 13:57
-
-
Save thelahunginjeet/9840652 to your computer and use it in GitHub Desktop.
LSF example of a serial python job, with a virtual environment
This file contains hidden or 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 | |
# | |
#BSUB -o pyjob.%J.out | |
#BSUB -e pyjob.%J.err | |
#BSUB -n 1 | |
# do stuff | |
source ~/venv/bin/activate | |
python -c "import pyica; import sys; print(sys.version); from numpy.random import randn; x = randn(); print '%f' %x" | |
# Notes: | |
# -%J adds the job number to the error/output files | |
# -this job is purely serial, so -n is ignored anyway | |
# -submit with bsub < ./python_job.sh | |
# -source command makes sure to activate the virtual environment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment