Skip to content

Instantly share code, notes, and snippets.

@thelahunginjeet
Last active July 19, 2018 10:51
Show Gist options
  • Select an option

  • Save thelahunginjeet/9957401 to your computer and use it in GitHub Desktop.

Select an option

Save thelahunginjeet/9957401 to your computer and use it in GitHub Desktop.
example LSF array job showing how to use node-specific inputs and outputs
#!/bin/bash
#BSUB -L /bin/bash
#BSUB -J paj[1-4]
#BSUB -e paj.%I.err
#BSUB -o paj.%I.out
#BSUB -n 1
source ~/venv/bin/activate
python parse_command_line.py --config=conf_${LSB_JOBINDEX}.cfg --output=results_${LSB_JOBINDEX}.out
# comments:
# -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 4 copies, with different input and output files
# -you have to use %I in the commands to bsub, and then the shell variable LSB_JOBINDEX
# for the config/output files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment