Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:12

0001 #!/bin/bash
0002 
0003 #script to run generic lhe generation tarballs
0004 #kept as simply as possible to minimize need
0005 #to update the cmssw release
0006 #(all the logic goes in the run script inside the tarball
0007 # on frontier)
0008 #J.Bendavid
0009 
0010 echo "   ______________________________________     "
0011 echo "         Running Generic Tarball/Gridpack     "
0012 echo "   ______________________________________     "
0013 
0014 repo=${1}
0015 echo "%MSG-MG5 repository = $repo"
0016 
0017 name=${2} 
0018 echo "%MSG-MG5 gridpack = $name"
0019 
0020 nevt=${3}
0021 echo "%MSG-MG5 number of events requested = $nevt"
0022 
0023 rnum=${4}
0024 echo "%MSG-MG5 random seed used for the run = $rnum"
0025 
0026 ncpu=${5}
0027 echo "%MSG-MG5 thread count requested = $ncpu"
0028 
0029 LHEWORKDIR=`pwd`
0030 
0031 if [[ -d lheevent ]]
0032     then
0033     echo 'lheevent directory found'
0034     echo 'Setting up the environment'
0035     rm -rf lheevent
0036 fi
0037 mkdir lheevent; cd lheevent
0038 
0039 # retrieve the wanted gridpack from the official repository 
0040 fn-fileget -c `cmsGetFnConnect frontier://smallfiles` ${repo}/${name}
0041 
0042 #check the structure of the tarball
0043 tar xaf ${name} ; rm -f ${name} ;
0044 
0045 #generate events
0046 ./runcmsgrid.sh $nevt $rnum $ncpu
0047 
0048 mv cmsgrid_final.lhe $LHEWORKDIR/
0049 
0050 cd $LHEWORKDIR
0051 
0052 #cleanup working directory (save space on worker node for edm output)
0053 rm -rf lheevent
0054 
0055 exit 0
0056