Batch Jobs On Lxplus

Contents

Login to Lxplus

On lxplus you are limmited both in disk space and CPU time. In order to run medium to large size jobs from lxplus, you will need to submit a batch job using bsub. Your job will be submitted to a machine compatible with the machine you are submitting from, so for CMSSW_1_3_X and lower

ssh username@lxslc3.cern.ch

and for CMSSW_1_4_X and higher

ssh username@lxplus.cern.ch

Batch Job Script

Copy the following script into a file (say lxplusbatchscript.csh) and edit the file to run on your .cfg file. Also edit the last line to write into your CASTOR area (you have limited space on lxplus. If you don't use CASTOR you may lose your output!).

# Lxplus Batch Job Script
set CMSSW_PROJECT_SRC="cmssw_projects/13X/cmssw131hlt6/src"
set CFG_FILE="cfgs/steps2_3_4_5.cfg"
set OUTPUT_FILE="Analyzer_Output.root"
set TOP="$PWD"

cd /afs/cern.ch/user/s/ssimon/$CMSSW_PROJECT_SRC
eval `scramv1 runtime -csh`
cd $TOP
cmsRun /afs/cern.ch/user/s/ssimon/$CMSSW_PROJECT_SRC/$CFG_FILE
rfcp Analyzer_Output.root /castor/cern.ch/user/s/ssimon/$OUTPUT_FILE

Set the permissions on the script file with

chmod 744 lxplusbatchscript.csh

Job Submission

Now you can submit the job by using bsub, passing it the above script. An example command is

bsub -R "pool>30000" -q 1nw -J job1 < lxplusbatchscript.csh

There are a few arguments specified in this example

  • -R "pool>30000" means you want a minimum free space of 30G to run your job.
  • -q 1nw means you are submitting to the 1-week que. Other available queues are:
    • 8nm (8 minutes)
    • 1nh (1 hour)
    • 8nh
    • 1nd (1day)
    • 2nd
    • 1nw (1 week)
    • 2nw
  • -J job1 sets job1 as your job name.
  • < lxplusbatchscript.csh gives your script to the job.
See man bsub and the links for more info.

After entering the above command you will get the output

Job <557650> is submitted to queue <1nw>.

The unique job number 557650 is automatically generated.

Checking Job Satus

You can check the status of your job with the command bjobs. (To specify the job use bjobs -J job1 or bjobs 557650)

bjobs

which gives the output

JOBID   USER    STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
557650  ssimon  PEND  1nw        lxplus096               job1       Aug  9 16:16

You can see that this job is pending. To see more information about pending jobs use bjobs -l, and see man bjobs for more info.

Killing a Job

If you make a mistake and need to kill a job (i.e. submit to wrong queue), you can do so with

bkill -J job1  

Using bkill without specifying the job will kill all of your jobs.

Links

-- DavidCockerill - 27-Apr-2011

Edit | Attach | Watch | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2012-10-02 - BenCarlson
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback