What is the best way now to export the path to all nodes? Can I write a shell script with the export command + the job command and pass this script to bsub?
Yes. Write a script (say its named myscript
) that both sets the PATH and then starts your program. Then submit your job with the command line bsub myscript
. Your local installation will be used rather than the system installation.
An even simpler option, LSF will set the environment variables of the submission environment into the execution environment, including PATH.
[mclosson@hostA ~]$ echo $PATH /lsf/9.1/linux2.6-glibc2.3-x86_64/etc:/lsf/9.1/linux2.6-glibc2.3-x86_64/bin:/bin:/usr/bin [mclosson@hostA ~]$ bsub -m hostB -Is 'echo $PATH' Job <217> is submitted to default queue <interactive>. <<Waiting for dispatch ...>> <<Starting on hostB>> /lsf/9.1/linux2.6-glibc2.3-x86_64/bin:/lsf/9.1/linux2.6-glibc2.3-x86_64/etc:/bin:/usr/bin
Now update your path so that it includes the local installation of your program.
[mclosson@hostA ~]$ export PATH=/tmp/xxx:$PATH [mclosson@hostA ~]$ bsub -m hostB -Is 'echo $PATH' Job <218> is submitted to default queue <interactive>. <<Waiting for dispatch ...>> <<Starting on hostB>> /lsf/9.1/linux2.6-glibc2.3-x86_64/bin:/tmp/xxx:/lsf/9.1/linux2.6-glibc2.3-x86_64/etc:/bin:/usr/bin