1

Consider first script_0.sh:

# script_0.sh

foo
bar
baz

I can run this script via LSF like this, for example:

bsub -q myqueue -J myjob_0 -o path/to/log_0.out -e path/to/log_0.err -- /bin/sh ./script_0.sh

Now consider a second, very similar script:

# script_1.sh

#BSUB -q myqueue
#BSUB -J myjob_1
#BSUB -o path/to/log_1.out
#BSUB -e path/to/log_1.err

foo
bar
baz

I can also run this script, via LSF, as shown above (after changing the command-line options appropriately), but, in addition, I can do it like this:

bsub < script_1.sh

In this second form, bsub figures out the options to use by parsing the lines beginning with #BSUB .

As far as I understand, all the forms described above would entail running exactly the same commands (foo, etc.), since the two scripts are identical, if we exclude comments and blank lines.

What are the pros/cons of this second form vis-à-vis the first form? In particular, does either form make possible job scheduling strategies that are difficult or impossible to implement with the other form?

kjo
  • 33,683
  • 52
  • 148
  • 265

0 Answers0