CU e-Science HTC-HPC Cluster and Cloud
  • CU e-Science HTC-HPC Cluster and Cloud
  • Introduction to our cluster
    • Our resources
    • Registration
    • Login to our cluster
    • Disk space
    • Acknowledgement and Publication
  • Slurm
    • 101: How to submit Slurm batch jobs
    • 101: Interactive jobs with Slurm
    • Basic Slurm commands
    • QoS and Partition
    • Job priority
    • Available complier and software
    • Examples
      • Simple C, C++, Python program
      • Python with VirtualEnv
      • How do I submit a large number of very similar jobs?
      • CMSSW
      • R
      • Mathematica
      • Message Passing Interface (MPI)
  • Kubenetes
    • Under construction!
Powered by GitBook
On this page

Was this helpful?

  1. Slurm
  2. Examples

CMSSW

Here, an example on how to use CMSSW with the Slurm. We will simulate minimum bias events with CMS Phase-2 detector.

cmssw_template.slurm

#!/bin/tcsh
#
#SBATCH --qos=cu_htc
#SBATCH --partition=cpu
#SBATCH --job-name=cmssw
#SBATCH --output=Log_CMSSW_INPUT1.txt
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=08:00:00
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=2G

module purge

#To handle ENV and PATHs
source /work/app/share_env/hepsw.csh
setenv MYCODEDIR /work/home/srimanob/Phase2SW/11_3_Production/CMSSW_11_3_0/src
setenv MYPROJOUTPUT /work/project/cms/srimanob/11_3_0/MinBias
echo "MYCODEDIR = "$MYCODEDIR
echo "TMPDIR = "$TMPDIR

#To run CMSSW program
cd $TMPDIR
cmsrel CMSSW_11_3_0
cd CMSSW_11_3_0/src
eval `scram runtime -csh`
cmsDriver.py MinBias_14TeV_pythia8_TuneCP5_cfi  --mc --conditions auto:phase2_realistic_T21 -n 100 --era Phase2C11M9 --eventcontent RAWSIM -s GEN,SIM --datatier GEN-SIM --beamspot HLLHC14TeV --geometr
y Extended2026D76 --python MinBias_14TeV_pythia8_TuneCP5_2026D76_GenSimHLBeamSpot14.py --nThreads 8 --no_exec --fileout file:minbias.root --customise_commands "from IOMC.RandomEngine.RandomServiceHelp
er import RandomNumberServiceHelper ; randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService) ; randSvc.populate() \n process.source.firstLuminosityBlock = cms.untracked.uint32(INPUT
1)"
cmsRun MinBias_14TeV_pythia8_TuneCP5_2026D76_GenSimHLBeamSpot14.py
cp -rf minbias.root $MYPROJOUTPUT/minbias_INPUT1.root

Submission script, to submit many jobs with the same driver.

#!/bin/tcsh

set lhe = 10
while ( $lhe < 18 )
    sed s/INPUT1/$lhe/g cmssw_template.slurm >! cmssw-$lhe.slurm
    sbatch cmssw-$lhe.slurm
    sleep 2s
    rm -rf cmssw-$lhe.slurm
    @ lhe++
end

exit
PreviousHow do I submit a large number of very similar jobs?NextR

Last updated 3 years ago

Was this helpful?