-- JianqiaoDeng - 2022-11-03

old instruction: https://twiki.cern.ch/twiki/bin/view/Sandbox/FEWZLHCB

(1)install LHAPDF

wget https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.4.0.tar.gz

tar xvzf LHAPDF-6.4.0.tar.gz

cd LHAPDF-6.4.0

mkdir ../LHAPDF_640

source /cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0/x86_64-centos7/setup.sh

sh /cvmfs/sft.cern.ch/lcg/releases//LCG_98python3/Python/3.7.6/x86_64-centos7-gcc8-opt/Python-env.sh

./configure --prefix=/afs/cern.ch/your_path/LHAPDF_640

make -j4

make install

#Download PDF Sets, take CT14lo as example, you should download it from https://lhapdf.hepforge.org/pdfsets.html, then upload it to lxplus

cd ../LHAPDF_640/share/LHAPDF/

tar xvzf CT14lo.tar.gz #you have already upload CT14lo.tar.gz to /LHAPDF

(2)install FEWZ in lxplus:

wget http://www.hep.anl.gov/fpetriello/FEWZ_3.1.rc.tar.gz

tar xvzf FEWZ_3.1.rc.tar.gz

cd FEWZ_3.1.rc

#creat setup.sh (创建setup.sh)

LCGROOT=/cvmfs/sft.cern.ch/lcg/releases


CMTCONFIG=x86_64-centos7-gcc8-opt
source ${LCGROOT}/gcc/8.3.0/x86_64-centos7/setup.sh
LHAPDFSYS=/afs/cern.ch/work/j/jideng/public/LHAPDF_640/
export PATH=$LHAPDFSYS/bin:${PATH}
export LD_LIBRARY_PATH=$LHAPDFSYS/lib:${LD_LIBRARY_PATH}
export LHAPDF_DATA_PATH=${LHAPDFSYS}/share/LHAPDF
export PYTHONPATH=${LHAPDFSYS}/lib/python3.7/site-packages:${PYTHONPATH}
export LHAPATH=${LHAPDFSYS}/share/LHAPDF
source ${LCGROOT}/LCG_98python3/Python/3.7.6/${CMTCONFIG}/Python-env.sh


#modify makefile in FEWZ_3.1.rc(修改makefile,在FEWZ_3.1.rc目录下面)

LHAPDF = on

LHADIR = /afs/cern.ch/work/j/jideng/public/LHAPDF_640/lib/

#then comment out the following lines in the makefile, as line 38, 41, 112, 114, 121, 123 - 125.

#需要将makefile中的第38,41,112,114,121,123-125行注释掉(删掉)。

source setup.sh

make

#it takes about 20 mins (大约需要20分钟时间编译)

#if it say"condor_compile: Command not found" and "bin/fewzz" "bin/fewzw" exist, it means you successed.

(3)local test

cd bin

cp /afs/cern.ch/user/h/hyin/public/For_FEWZ/z8_lo_c14.txt .

cp /afs/cern.ch/user/h/hyin/public/For_FEWZ/histz.txt .

cp /afs/cern.ch/user/h/hyin/public/For_FEWZ/phibins.txt .

cp /afs/cern.ch/user/h/hyin/public/For_FEWZ/ptbins.txt .

source ../setup.sh

#note:z8_lo_c14.txt is input file, it means Z boson, 8 TeV, CT14LO

#note: histz.txt, it determine the hist bins will be draw

#modify local_run.sh

#set line 168: echo "../$EXEC -i ../$INFILE -h ../$HISTFILE -o $OUTFILE -p ../../$PDFDIR -s $(($i-1)) > screen.out &"

#comment out line 182-185(注释掉line182-185)

./local_run.sh z Z_LO z8_lo_c14.txt histz.txt txt ..

cd Z_LO/Z_LO0

../fewzz -i ../z8_lo_c14.txt -h ../histz.txt -o txt -p ../../.. -s 0

#Please check "Sigma (pb) = xxx" in the Z_LO/Z_LO0/LO.txt, if it is a non-zero number, then, the FEWZ works well.

(4) submit to slurm(comput19) or condor(ustc)

#Script to submit to slurm(take Wplus as example):

#./local_run.sh w Wp_LO wp13_lo_c14.txt hist_w10.txt txt ..
WORKDIR=/public/home/jqdeng/FEWZ_3.1.rc/bin
OUTPUTNAME=nWp_NNLO
INPUTFILE=wp13_NNLO_c18.txt
HISTFILE=hist_w10.txt
MAXJOBS=153 ## for W 153, for Z 216, for test 30

################################################
## create the working directory at first
################################################
./local_run.sh w ${OUTPUTNAME} ${INPUTFILE} ${HISTFILE} txt ..

################################################
## loop sub-jobs
################################################
cd ${WORKDIR}
source ${WORKDIR}/../setup.sh

for isub in $(seq 31 ${MAXJOBS}) ; do
echo "${isub} ..."
cd ${WORKDIR}/${OUTPUTNAME}/${OUTPUTNAME}${isub}

cat >>mySUB_${OUTPUTNAME}_${isub}.sh <<EOF
#!/bin/bash
#SBATCH -J mySkim
#SBATCH -p high
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -o Subjob_${isub}.out
#SBATCH -e Subjob_${isub}.err ## setup root

source /public/home/lhcb/softwares/ROOT/setup.sh
cd ${WORKDIR}/${OUTPUTNAME}/${OUTPUTNAME}${isub}
sh myANA.sh
EOF

cd ${WORKDIR}/${OUTPUTNAME}/${OUTPUTNAME}${isub}
cat >>myANA.sh <<EOF
source ${WORKDIR}/../setup.sh
../fewzw -i ../${INPUTFILE} -h ../${HISTFILE} -o txt -p ../../.. -s ${isub} > screen.out
EOF

chmod +x myANA.sh
chmod +x mySUB_${OUTPUTNAME}_${isub}.sh

sbatch mySUB_${OUTPUTNAME}_${isub}.sh

done

if you have any question about slurm, go to: https://twiki.cern.ch/twiki/bin/view/Sandbox/CCNULHCbSubmitJob

Script to submit to condor(take Wminus as example):

#./local_run.sh w Wp_LO wp13_lo_c14.txt hist_w10.txt txt ..
WORKDIR=/home/qdhan/jqdeng/FEWZ_3.1.rc/bin
OUTPUTNAME=Wm_NNLO
INPUTFILE=wm13_NNLO_c18.txt
HISTFILE=hist_w10.txt
MAXJOBS=153 ## for W 153, for Z 216, for test 30

################################################
## create the working directory at first
################################################
./local_run.sh w ${OUTPUTNAME} ${INPUTFILE} ${HISTFILE} txt ..

################################################
## loop sub-jobs
################################################
cd ${WORKDIR}
source ${WORKDIR}/../setup.sh

for isub in $(seq 0 ${MAXJOBS}) ; do
echo "${isub} ..."

cd ${WORKDIR}/${OUTPUTNAME}/${OUTPUTNAME}${isub}
cat >>mySUB_${OUTPUTNAME}_${isub} <<EOF
universe = vanilla
requirements =
executable = myANA.sh

transfer_output = true
transfer_error = true
transfer_executable = true

should_transfer_files = IF_NEEDED

#run v15 on SL5 nodes
#+SL_START = 5

when_to_transfer_output = ON_EXIT

log = JOBINDEX_${isub}.condor.log
output = JOBINDEX_${isub}.stdout
error = JOBINDEX_${isub}.stderr

accounting_group = long

#notification = NEVER
queue
EOF

cd ${WORKDIR}/${OUTPUTNAME}/${OUTPUTNAME}${isub}
cat >>myANA.sh <<EOF
source ${WORKDIR}/../setup.sh
../fewzw -i ../${INPUTFILE} -h ../${HISTFILE} -o txt -p ../../.. -s ${isub}
EOF

chmod +x myANA.sh
condor_submit mySUB_${OUTPUTNAME}_${isub}

done

notice:

accounting_group = long

This line to avoid your jobs be killed after 8 hours.

If you have more questions about condor, go to here: https://twiki.cern.ch/twiki/bin/view/Sandbox/UseCondorSubmit

(5) Get Result

./finish.sh Wp_NNLO NNLO.txt


How to run it?

sh paralell_run_NNLO.sh #the name of script

(6)tips

建议在粒子所服务器compute19上面跑,实测科大服务器condor相比compute19只有60-70%的速度

完全可以第一波提交Wp,然后3-4天后(Wp的60%的事例跑完之后)提交Wm

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt hist_w10.txt r1 manage 2.1 K 2022-11-14 - 12:32 JianqiaoDeng  
Unix shell scriptsh paralell_run_NNLO_Wm.sh r1 manage 1.6 K 2022-11-14 - 12:32 JianqiaoDeng  
Unix shell scriptsh parallel_run_NNLO_Wp.sh r1 manage 1.3 K 2022-11-14 - 12:32 JianqiaoDeng  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2022-12-06 - JianqiaoDeng
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 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