Difference: BatchJobsOnLxplus (1 vs. 3)

Revision 32008/04/04 - Main.SeanSimon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Batch Jobs On Lxplus

Line: 43 to 43
 

Set the permissions on the script file with

Changed:
<
<
>
>
 chmod 744 lxplusbatchscript.csh

Revision 22007/08/09 - Main.SeanSimon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Batch Jobs On Lxplus

Line: 26 to 26
 

Batch Job Script

Changed:
<
<
Copy the following script into a file (say LxplusBatchScript.csh) and edit the file to run on your .cfg file.
>
>
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
Line: 41 to 41
 cmsRun /afs/cern.ch/user/s/ssimon/$CMSSW_PROJECT_SRC/$CFG_FILE rfcp Analyzer_Output.root /castor/cern.ch/user/s/ssimon/$OUTPUT_FILE
Changed:
<
<
The last line copies the output file into your CASTOR area (you have limited space available on lxplus).
>
>
Set the permissions on the script file with
chmod 744 lxplusbatchscript.csh
 

Job Submission

Line: 49 to 53
 Now you can submit the job by using bsub, passing it the above script. An example command is
Changed:
<
<
bsub -R "pool>30000" -q 1nw -J job1 < scripts/LxplusBatchScript.csh
>
>
bsub -R "pool>30000" -q 1nw -J job1 < lxplusbatchscript.csh
 

There are a few arguments specified in this example

Line: 63 to 67
 
    • 1nw (1 week)
    • 2nw
  • -J job1 sets job1 as your job name.
Changed:
<
<
  • < scripts/LxplusBatchScript.csh gives your script to the job.
>
>
  • < 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

Line: 75 to 79
 

Checking Job Satus

Changed:
<
<
You can check the status of your job with the command bjobs. (In case you are running multiple jobs, to check the status of this specific job use bjobs -J job1 or bjobs 557650)
>
>
You can check the status of your job with the command bjobs. (To specify the job use bjobs -J job1 or bjobs 557650)
 
bjobs
Line: 84 to 88
 JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME 557650 ssimon PEND 1nw lxplus096 job1 Aug 9 16:16
Changed:
<
<
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.
>
>
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

Line: 97 to 101
 

Links

Added:
>
>

Revision 12007/08/09 - Main.SeanSimon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

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.

# 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
The last line copies the output file into your CASTOR area (you have limited space available on lxplus).

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 < scripts/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.
  • < scripts/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. (In case you are running multiple jobs, to check the status of this specific 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

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback