Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic POWHEG debugging changes for EL8 #3795

Merged
merged 15 commits into from
Nov 14, 2024
25 changes: 23 additions & 2 deletions bin/Powheg/Templates/runGetSource_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,29 @@ sed -i -e "s#LHAPDF_CONFIG[ \t]*=[ \t]*#\#LHAPDF_CONFIG=#g" Makefile
sed -i -e "s#DEBUG[ \t]*=[ \t]*#\#DEBUG=#g" Makefile
sed -i -e "s#FPE[ \t]*=[ \t]*#\#FPE=#g" Makefile

if [[ `grep GoSam Makefile` != "" || `grep Gosam Makefile` != "" || `grep GOSAM Makefile` != "" ]]; then
sed -i -e "s#-fno-automatic#-fallow-invalid-boz#g" Makefile
# DON'T DO FOR GoSam, CHANGES PHYSICS OF THE PROCESS!!
#if [[ `grep GoSam Makefile` != "" || `grep Gosam Makefile` != "" || `grep GOSAM Makefile` != "" ]]; then
# sed -i -e "s#-fno-automatic#-fallow-invalid-boz#g" Makefile
#fi

## FOR OpenLoops, CHANGE FORTRAN OPTIONS AND REMOVE SILLY BINARY NUMBERS
if [[ `grep OpenLoops Makefile` != "" ]]; then
sed -i -e "s#proclib ;#proclib f77_flags=-fallow-invalid-boz,-std=legacy,-ffixed-line-length-none,-fno-range-check f90_flags=-fallow-invalid-boz,-std=legacy,-ffixed-line-length-none,-fno-range-check ;#g" Makefile
cd ../OpenLoopsStuff/
sed -i -e "/case/ s=B\"00\"=0=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"01\"=1=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"10\"=2=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"11\"=3=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1111\"=15=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"0110\"=6=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"0111\"=7=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1001\"=9=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1101\"=13=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1110\"=14=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1011\"=11=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"1010\"=10=g" OpenLoop*/lib_src/openloops/*/*.*90
sed -i -e "/case/ s=B\"0101\"=5=g" OpenLoop*/lib_src/openloops/*/*.*90
cd -
fi

$patch_4
Expand Down
30 changes: 21 additions & 9 deletions bin/Powheg/Utilities/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,38 +144,34 @@ def runGetSource_patch_4(process) :
"bbH" : "# Use option O0 for bbH (O2 too long)\n \
sed -i -e \"s#O2#O0#g\" Makefile",
"HW_ew" : "# fix fortran options/linking to OpenLoops/missing libraries in VH_ew\n \
sed -i -e \"s#OL_process_src#OL_process_src f90_flags=-ffree-line-length-none#g\" Makefile\n \
sed -i -e \"s#\$(PWD)/\$(OBJ)#\$(OBJ)#g\" Makefile\n \
sed -i -e \"s#\$(OLPATH)/lib_src#lib_src#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .;sed -i -e \"s/python2/python3/g\" scons-local/scons.py;./scons#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .#g\" Makefile\n \
sed -i -e \"s#abspath(os.path.join(config#relpath(os.path.join(config#g\" ../OpenLoopsStuff/OpenLoops/SConstruct\n \
sed -i -e \"s#rpath=\$(PWD)/\$(OBJDIR) -L\$(PWD)/\$(OBJDIR)#rpath=\$(OBJDIR) -L\$(OBJDIR)#g\" Makefile\n \
sed -i -e \"s#PDFPACK=lhapdfif.o#PDFPACK=lhapdf6if.o lhapdf6ifcc.o#g\" Makefile\n \
cat ${patches_dir}/missing_lhapdf6.txt >> Makefile",
"HZ_ew" : "# fix fortran options/linking to OpenLoops/missing libraries in VH_ew\n \
sed -i -e \"s#OL_process_src#OL_process_src f90_flags=-ffree-line-length-none#g\" Makefile\n \
sed -i -e \"s#\$(PWD)/\$(OBJ)#\$(OBJ)#g\" Makefile\n \
sed -i -e \"s#\$(OLPATH)/lib_src#lib_src#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .;sed -i -e \"s/python2/python3/g\" scons-local/scons.py;./scons#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .#g\" Makefile\n \
sed -i -e \"s#abspath(os.path.join(config#relpath(os.path.join(config#g\" ../OpenLoopsStuff/OpenLoops/SConstruct\n \
sed -i -e \"s#rpath=\$(PWD)/\$(OBJDIR) -L\$(PWD)/\$(OBJDIR)#rpath=\$(OBJDIR) -L\$(OBJDIR)#g\" Makefile\n \
sed -i -e \"s#opencount.o#opencount.o sigequiv_hook.o#g\" Makefile\n \
sed -i -e \"s#PDFPACK=lhapdfif.o#PDFPACK=lhapdf6if.o lhapdf6ifcc.o#g\" Makefile\n \
cat ${patches_dir}/missing_lhapdf6.txt >> Makefile",
"HZJ_ew" : "# fix fortran options/linking to OpenLoops/missing libraries in VH_ew\n \
sed -i -e \"s#OL_process_src#OL_process_src f90_flags=-ffree-line-length-none#g\" Makefile\n \
sed -i -e \"s#\$(PWD)/\$(OBJ)#\$(OBJ)#g\" Makefile\n \
sed -i -e \"s#\$(OLPATH)/lib_src#lib_src#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .;sed -i -e \"s/python2/python3/g\" scons-local/scons.py;./scons#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .#g\" Makefile\n \
sed -i -e \"s#abspath(os.path.join(config#relpath(os.path.join(config#g\" ../OpenLoopsStuff/OpenLoops/SConstruct\n \
sed -i -e \"s#rpath=\$(PWD)/\$(OBJDIR) -L\$(PWD)/\$(OBJDIR)#rpath=\$(OBJDIR) -L\$(OBJDIR)#g\" Makefile\n \
sed -i -e \"s#OL_process_src#OL_process_src f90_flags=-ffree-line-length-none#g\" Makefile\n \
sed -i -e \"s#boostrot.o#boostrot.o boostrot4.o#g\" Makefile",
"HWJ_ew" : "# fix fortran options/linking to OpenLoops/missing libraries in VH_ew\n \
sed -i -e \"s#OL_process_src#OL_process_src f90_flags=-ffree-line-length-none#g\" Makefile\n \
sed -i -e \"s#\$(PWD)/\$(OBJ)#\$(OBJ)#g\" Makefile\n \
sed -i -e \"s#\$(OLPATH)/lib_src#lib_src#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .;sed -i -e \"s/python2/python3/g\" scons-local/scons.py;./scons#g\" Makefile\n \
sed -i -e \"s#cd \$(OLPATH)#cp -r \$(OLPATH)/* .#g\" Makefile\n \
sed -i -e \"s#abspath(os.path.join(config#relpath(os.path.join(config#g\" ../OpenLoopsStuff/OpenLoops/SConstruct\n \
sed -i -e \"s#rpath=\$(PWD)/\$(OBJDIR) -L\$(PWD)/\$(OBJDIR)#rpath=\$(OBJDIR) -L\$(OBJDIR)#g\" Makefile\n \
sed -i -e \"s#opencount.o#opencount.o sigequiv_hook.o#g\" Makefile\n \
Expand Down Expand Up @@ -223,6 +219,7 @@ def runGetSource_patch_6(process) :
"WWJ" : "cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" | sed -e \"s#\#\ LIBSFASTJET#LIBSFASTJET#g\" | sed -e \"s#\#\ FJCXXFLAGS#FJCXXFLAGS#g\" > Makefile\n \
cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \
sed -i -e 's#python#python2#g' matrix\n \
./matrix --minnlo_interface\n \
cd -\n \
cd ${WORKDIR}/${name}\n \
Expand All @@ -235,18 +232,28 @@ def runGetSource_patch_6(process) :
"ZZJ" : "cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" > Makefile\n \
cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \
sed -i -e 's#python#python2#g' matrix\n \
./matrix --minnlo_interface\n \
cd -\n \
source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.10.0/etc/profile.d/init.sh",
"WZJ" : "cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" > Makefile\n \
cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \
sed -i -e 's#python#python2#g' matrix\n \
./matrix --minnlo_interface\n \
cd -\n \
source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.10.0/etc/profile.d/init.sh",
"ZgamJ" : "cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" > Makefile\n \
cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \
sed -i -e 's#python#python2#g' matrix\n \
./matrix --minnlo_interface\n \
cd -\n \
source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.10.0/etc/profile.d/init.sh",
"gg4l" : "cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" > Makefile\n \
cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \
sed -i -e 's#python#python2#g' matrix\n \
./matrix --minnlo_interface\n \
cd -\n \
source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.10.0/etc/profile.d/init.sh",
Expand Down Expand Up @@ -334,8 +341,13 @@ def runGetSource_patch_6(process) :
cd obj-gfortran/proclib\n \
cp ../../recola2-collier-2.2.4/recola2-2.2.4/librecola.so .\n \
cd ../..\n \
mv ../pwhg_analysis-dummy.f .\n \
head -n 9 ../mintwrapper.f > temp.f\n \
cat temp.f mintwrapper_custom.f > temp2.f\n \
mv temp2.f mintwrapper_custom.f\n \
rm -f temp.f\n \
cp Makefile Makefile.orig\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#RECOLALOCATION=.\+#RECOLALOCATION=$\(PWD\)/recola2-collier-2.2.4/recola2-2.2.4#g\" > Makefile\n \
cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#RCLPATH =.\+#RCLPATH=$\(PWD\)/recola2-collier-2.2.4/recola2-2.2.4#g\" | sed -e \"s#lhapdfif.o#lhapdf6if.o lhapdf6ifcc.o#g\" > Makefile\n \
export LD_LIBRARY_PATH=`pwd`/lib/:`pwd`/lib64/:${LD_LIBRARY_PATH}",

"VV_dec_ew" : "echo \"Adding Recola2.2.4 library\"\n \
Expand Down
4 changes: 2 additions & 2 deletions bin/Powheg/run_pwg_condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


#POWHEG_SOURCE = "powhegboxV2_rev3728_date20200429.tar.gz"
POWHEG_SOURCE = "powhegboxV2_rev4060_date20240611.tar.gz"
POWHEG_SOURCE = "powhegboxV2_rev4091_date20241106.tar.gz"
POWHEGRES_SOURCE = "powhegboxRES_rev4060_date20240610.tar.gz"


Expand Down Expand Up @@ -315,7 +315,7 @@ def runGetSource(parstage, xgrid, folderName, powInputName, process, noPdfCheck,
template_dict["defaultPDF"] = 904400
template_dict["period"] = "Run3_Pb"

powhegResProcesses = ["b_bbar_4l", "HWJ_ew", "HW_ew", "HZJ_ew", "HZ_ew", "vbs-ssww-nloew", "WWJ", "ZZJ", "HJJ_ew", "LQ-s-chan", "gg4l", "Zgam", "ZgamJ", "VV_dec_ew"]
powhegResProcesses = ["DIS","b_bbar_4l", "HWJ_ew", "HW_ew", "HZJ_ew", "HZ_ew", "vbs-ssww-nloew", "WWJ", "WZJ", "ZZJ", "HJJ_ew", "Wc", "LQ-s-chan", "gg4l", "Zgam", "ZgamJ", "VV_dec_ew"]
if process in powhegResProcesses:
template_dict["powhegSrc"] = POWHEGRES_SOURCE
template_dict["svnRepo"] = "svn://powhegbox.mib.infn.it/trunk/POWHEG-BOX-RES"
Expand Down
6 changes: 4 additions & 2 deletions bin/Powheg/run_pwg_parallel_condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def flush(self):
eoscmd = '/afs/cern.ch/project/eos/installation/cms/bin/eos.select' ;

parser = argparse.ArgumentParser()
parser.add_argument('-p', '--parstage' , dest="parstage", default= '01239', help='stage of the production process [01239]')
parser.add_argument('-p', '--parstage' , dest="parstage", default= '123', help='stage of the production process [01239]')
parser.add_argument('-f', '--folderName' , dest="folderName", default='testProd', help='local folder and last eos folder name[testProd]')
parser.add_argument('-e', '--eosFolder' , dest="eosFolder", default='NONE' , help='folder before the last one, on EOS')
parser.add_argument('-j', '--numJobs' , dest="numJobs", default= '10', help='number of jobs to be used for multicore grid step 1,2,3')
Expand Down Expand Up @@ -75,7 +75,9 @@ def flush(self):

steps = []
if '0' in args.parstage:
steps.append((0, 'compile', '-p 0','null'))
#steps.append((0, 'compile', '-p 0','null'))
print ("Compilation on condor is not supported anymore, please run step 0 interactively")
sys.exit()
if '1' in args.parstage:
for ix in range(1, int(args.numX)+1):
steps.append(
Expand Down
2 changes: 1 addition & 1 deletion bin/Powheg/runcmsgrid_powheg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if [[ -e ${myDir} ]]; then
fi

export LD_LIBRARY_PATH=`pwd`/lib/:`pwd`/lib64/:`pwd`/obj-gfortran/proclib/:${LD_LIBRARY_PATH}
if [[ "${process}" == "WWJ" ]]; then
if [[ "${process}" == "WWJ" || "${process}" == "WZJ" || "${process}" == "ZZJ" || "${process}" == "ZgamJ" ]]; then
export LD_LIBRARY_PATH=`pwd`/MATRIXStuff/external/ginac-install/lib/:`pwd`/MATRIXStuff/external/cln-install/lib/:`pwd`/MATRIXStuff/lib/ppllll24/:${LD_LIBRARY_PATH}
fi
mkdir ${myDir}; cd ${myDir} ;
Expand Down
4 changes: 2 additions & 2 deletions bin/Powheg/source/create_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ for file in $(ls $workdir/User-Processes-V2)
do
echo $file
# tar cspzf $powhegdir/${file}.tgz --exclude .svn $file
tar cspzf $powhegdir/${file}.tgz $file
tar cpzf $powhegdir/${file}.tgz $file
done

cd $workdir
tar cspzf ${output}.tar.gz POWHEG-BOX
tar cpzf ${output}.tar.gz POWHEG-BOX
sourcedir=/eos/project/c/cmsweb/www/generators/directories/cms-project-generators/slc6_amd64_gcc481/powheg/V2.0/src

mv ${output}.tar.gz $sourcedir/${output}.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions bin/Powheg/source/create_source_res.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ cd User-Processes-RES
for file in $(ls $workdir/User-Processes-RES)
do
echo $file
tar cspzf $powhegdir/${file}.tgz $file
tar cpzf $powhegdir/${file}.tgz $file
done

cd $workdir
tar cspzf ${output}.tar.gz POWHEG-BOX
tar cpzf ${output}.tar.gz POWHEG-BOX

sourcedir=/eos/project/c/cmsweb/www/generators/directories/cms-project-generators/slc6_amd64_gcc481/powheg/V2.0/src
mv ${output}.tar.gz $sourcedir/${output}.tar.gz
Expand Down
6 changes: 4 additions & 2 deletions bin/Powheg/source/test_source_compilation_condor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ source_name="${source_name%.*}"
#hostname > lxplus_node.log

# Download the CMSSW release
source /cvmfs/cms.cern.ch/cmsset_default.sh
mkdir -p $workdir
cd $workdir
export SCRAM_ARCH=${scram_arch_version}
scramv1 project CMSSW ${cmssw_version}
scram project CMSSW ${cmssw_version}
cd ${cmssw_version}/src
eval `scramv1 runtime -sh`
eval `scram runtime -sh`
echo "PDF REPOSITORY/VERSION: "${LHAPDF_DATA_PATH}

# Copy the POWHEG scripts
Expand Down Expand Up @@ -128,6 +129,7 @@ executable = source_compilation_${source_name}_$2_$3.sh
output = \$(ClusterId).\$(ProcId).out
error = \$(ClusterId).\$(ProcId).err
log = \$(ClusterId).log
MY.WantOS = "el8"
+JobFlavour = "tomorrow"

should_transfer_files = YES
Expand Down
87 changes: 31 additions & 56 deletions bin/Powheg/source/test_source_compilation_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,25 @@ echo " ______________________________________________________ "
echo " Running Powheg script "$(basename "$0")" "
echo " ______________________________________________________ "

source_name=$1
source_name="${source_name%.*}"
source_name="${source_name%.*}"
process=$1

cat << EOF > source_compilation_${process}_$2_$3.sh
#!/bin/bash

# Define a few variables
genproduction_dir=$PWD/../../..
topdir=$PWD
source_file=powhegboxRES_rev4060_date20240610.tar.gz
source_dir=/eos/project/c/cmsweb/www/generators/directories/cms-project-generators/slc6_amd64_gcc481/powheg/V2.0/src/$1

process=$1
scram_arch_version=$2
cmssw_version=$3
workdir=test

EOF

cat << 'EOF' >> source_compilation_${process}_$2_$3.sh

##################################################################################
##################################################################################
Expand All @@ -39,59 +55,19 @@ source_name="${source_name%.*}"
##################################################################################
##################################################################################

source_dir=/eos/project/c/cmsweb/www/generators/directories/cms-project-generators/slc6_amd64_gcc481/powheg/V2.0/src/$1

# check whether the script needs to run on all the processes
# or on a (sub)set defined in the variable "processes"
if [ -z "$processes" ]; then
process_list=`tar -tvf $source_dir 'POWHEG-BOX/*.tgz' | awk '{print $6}'`
process_list=$(echo $process_list | sed 's/POWHEG\-BOX\///g')
process_list=$(echo $process_list | sed 's/\.tgz//g')
else
process_list=$(printf " %s" "${processes[@]}")
process_list=${process_list:1}
fi

process_list=`echo "$process_list"` # DYNNLOPS is not meant to be compiled

echo "PROCESS LIST: "${process_list}

for file in ${process_list}
do
process="${file%.*}"
cat << EOF > source_compilation_${process}_$2_$3.sh
#!/bin/bash

# Define a few variables
process=${process}
genproduction_dir=$PWD/../../..
topdir=$PWD
source_file=$1
source_dir=/eos/project/c/cmsweb/www/generators/directories/cms-project-generators/slc6_amd64_gcc481/powheg/V2.0/src/$1
scram_arch_version=$2
cmssw_version=$3
workdir=test

EOF

cat << 'EOF' >> source_compilation_${process}_$2_$3.sh

echo "source file: "$source_dir

source_name=$(basename "$source_file")
source_name="${source_name%.*}"
source_name="${source_name%.*}"

# store the lxplus node to retrieve the output in case of disconnection
#hostname > lxplus_node.log

# Download the CMSSW release
source /cvmfs/cms.cern.ch/cmsset_default.sh
mkdir -p $workdir
cd $workdir
export SCRAM_ARCH=${scram_arch_version}
scramv1 project CMSSW ${cmssw_version}
scram project CMSSW ${cmssw_version}
cd ${cmssw_version}/src
eval `scramv1 runtime -sh`
eval `scram runtime -sh`
echo "PDF REPOSITORY/VERSION: "${LHAPDF_DATA_PATH}

# Copy the POWHEG scripts
Expand All @@ -111,25 +87,28 @@ cp ${genproduction_dir}/bin/Powheg/examples/V2/gg_H_quark-mass-effects_NNPDF30_1
rm ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log

# Loop on the processes, compile and fetch the last lines of the compilation log
echo "compiling ${process}"
echo "compiling $process"
echo ${PWD}
echo "python3 ./run_pwg_condor.py -p 0 -i powheg.input -m ${process} -f my_${process} -d 1"
python3 ./run_pwg_condor.py -p 0 -i powheg.input -m ${process} -f my_${process} -d 1
echo "=========== LAST 30 COMPILATION LINES FOR PROCESS ${process} ===========" >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
echo "=========== COMPILATION LINES FOR PROCESS ${process} ===========" >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
echo "" >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
tail -n 30 run_src_my_${process}.log >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
cat run_src_my_${process}.log >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
echo "" >> ${topdir}/compile_report_-_${process}_-_${scram_arch_version}_-_${cmssw_version}.log
rm -rf my_${process}

EOF

cat << EOF > condor_${process}_$2_$3.sub
cat << EOF > condor_${process}_$2_$3.sub

executable = source_compilation_${process}_$2_$3.sh
output = \$(ClusterId).\$(ProcId).out
error = \$(ClusterId).\$(ProcId).err
log = \$(ClusterId).log
+JobFlavour = "testmatch"
MY.WantOS = "el8"
+JobFlavour = "nextweek"
request_memory = 8000M
request_disk = 800M

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
Expand All @@ -138,8 +117,4 @@ Queue 1

EOF

condor_submit condor_${process}_$2_$3.sub
done

#echo "If you want, select some specific processes in source_compilation_${source_name}_$2_$3.sh"
#echo "When ready run: \"condor_submit condor_${source_name}_$2_$3.sub\" "
echo "When ready run: \"condor_submit condor_${process}_$2_$3.sub\" "