#!/bin/csh # # Example of LSF batch job # # 1) Before submitting a job, be sure that the script is executable # # chmod +x test_batch.sh # # (and maybe it is also clever to try to run a *reduced* version of your script interactively) # # 2) The job can be either spooled by stdin redirection of the script on the bsub command line: # # bsub -q phenix_cas < test_batch.sh # # or directly (in that case one can pass an argument to the script): # # bsub -q phenix_cas test_batch.sh 99 # # 3) A bit more complete submission making use of bsub options: # # -L : sources your .login before starting the job # -J : gives a name to the job # -o : outputs the result of the job in a file (otherwise the output is mailed to you) # if LSF encounters an existing file with the same name as the output log file, # appends the new output lines to the existing file. # # bsub -q phenix_cas -L /bin/csh -J test_batch_job -o test_batch_job.o < test_batch.sh # # -m : to specify your job to run in a given machine: # # bsub -q phenix_cas -L /bin/csh -J test_batch_job -o test_batch_job.o -m rcas2071.rcf.bnl.gov < test_batch.sh # # Embedded LSF options can be overridden by bsub command line options # # 4) To check the status: # # bjobs -w (your jobs in 'wide' format) # bjobs -u all | grep phenix # bjobs -u enterria ( -r = "running") # # 5) To visualize the output of your running jobs: # # bpeek job_id # # Or take a look at the ~/.lsbatch/*.out files # # 6) To kill the job: # # bkill job_id # # To kill all your jobs: # # bkill -u enterria 0 # # 7) Remind that if you want to acess your AFS zone from a batch job your AFS rights have to be "read" for "anyuser". # My acl: # # > fs la # Access list for . is # Normal rights: # system:administrators rlidwka # system:authuser rl # system:anyuser rl # enterria rlidwka # # To change the acl: # # > fs setacl # # If you want to use this AFS directory from LSF, # you need to give system:anyuser the right access control list, namely read and list = rl. # # fs setacl /afs/rhic.bnl.gov/phenix/users/user/ system:anyuser rl #source ~/.login # <--- You do not need it if you submit your job with '-L /bin/csh' option your job here ...