Skip to content

Instantly share code, notes, and snippets.

@thelahunginjeet
Last active August 29, 2015 13:57
Show Gist options
  • Save thelahunginjeet/9840420 to your computer and use it in GitHub Desktop.
Save thelahunginjeet/9840420 to your computer and use it in GitHub Desktop.
LSF array job with python
#!/bin/bash
#BSUB -L /bin/bash
#BSUB -J paj[1-10]
#BSUB -e paj.%I.err
#BSUB -o paj.%I.out
#BSUB -n 1
python -c "import sys; print(sys.version); import pyica; from numpy.random import randn; print '%f' % randn()"
# comments:
# -all necessary modules must be installed in the virtual environment
# -since this is a shell script, it must be made executable (chmod u+x)
# -you have to submit with bsub < ./python_array_job.sh
# -for an array job, -n specifies the number of processes PER SUBJOB (not the total)
# -this script will run 10 copies
# -the '%I' in the error/output files is important, otherwise all processes will write to one file;
# after the run, you can concatenate the individual files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment