LSF For Users: Mike Page SCD Consulting Services Group
LSF For Users: Mike Page SCD Consulting Services Group
Mike Page
[email protected]
SCD Consulting Services Group
SCD/HSS/CSG
What is LSF?
LSF - Load Sharing Facility
-------------------------------------------------------------------
Check: env | grep -i lsf
Essential Commands
for Users
• bhosts • bmod
• bqueues • bbot/btop
• bsub • bswitch
• bjobs • bstop/bresume
• bhist
• bkill
• bpeek
Essential Commands
Purpose
• bhosts - information about available hosts (lshosts)
• bqueues - information about available queues
• bsub - submit jobs to batch subsystem
• bjobs - list jobs in the batch subsystem
• bhist - displays historical information about user’s jobs
• bpeek - displays stdout and stderr of user’s unfinished job
• bmod - modifies job submission options for user’s job
Essential Commands
Purpose (cont’d)
• bbot/btop - moves a pending job relative to user’s last/first job
in a queue
• bswitch - switches user’s unfinished jobs from one queue to
another
• bstop/bresume - suspends/resumes user’s unfinished jobs
• bkill - kill, suspend or resume user’s jobs
Essential Commands: bhosts
bhosts [-w|-l][-R “res_req”][host_name|host_group]
Displays information about hosts/platforms
bsub a.out
bsub -n 2 a.out
bsub myscript
bsub -q queuename a.out
bsub -i infile -o outfile - e errfile a.out
# Fortran example
pgf90 -o samp_f -Mextend samp.f
./samp_f
# C example
pgcc -o samp_c samp.c
./samp_c
# C++ example
pgCC --no_auto_instantiation -o samp_cc samp.cc
./samp_cc
# Fortran example
mpif90 -o mpi_samp_f mpisamp.f
mpirun.lsf ./mpi_samp_f
# C example
mpicc -o mpi_samp_c mpisamp.c
mpirun.lsf ./mpi_samp_c
# C++ example
mpicxx -o mpi_samp_cc mpisamp.cc
mpirun.lsf ./mpi_samp_cc
bsub < mpi.lsf
Sample LSF script
OpenMP Job
#!/bin/ksh # C example
# pgcc -mp -o samp_c samp.c
# LSF script to run the test OMP codes export OMP_NUM_THREADS=1
# ./samp_c
#BSUB -P 93300070 # Proposal group 2 - Project 93300070 export OMP_NUM_THREADS=2
#BSUB -a mpich_gm # select the mpich-gm elim ./samp_c
#BSUB -x # exclusive use of node
#BSUB -n 2 # number of tasks # C++ example
#BSUB -R "span[hosts=1]" # jobs run on one host pgCC --no_auto_instantiation -mp -o sampcc samp.cc
#BSUB -J omplsf.test # job name export OMP_NUM_THREADS=1
#BSUB -o omplsf.out # ouput filename ./samp_cc
#BSUB -e omplsf.err # input filename export OMP_NUM_THREADS=2
#BSUB -q regular # queue ./samp_cc
# Fortran example
pgf90 -o samp_f -Mextend -mp samp.f
export OMP_NUM_THREADS=1
./samp_f
export OMP_NUM_THREADS=2
./samp_f
bhist -J job_name
bhist -C start_time, end_time
bhist -D start_time, end_time
bhist -S start_time, end_time
bhist -T start_time, end_time
Essential Commands: bpeek
bpeek - displays stdout and stderr of user’s selected, unfinished job
bpeek -f uses ‘tail -f’ to display output instead of ‘cat’
destination_queue [0]
bswitch destination_queue [job_ID | "job_ID[index_list]"] ...
bswitch [-h | -V]
Essential Commands: bstop/bresume
bstop -suspends unfinished jobs