Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-21 23:14:25

0001 #! /bin/bash
0002 
0003 # command line input
0004 suite=${1:-"forPR"} # which set of benchmarks to run: full, forPR, forConf
0005 useARCH=${2:-0} # which computer cluster to run on. 0=phi3, 1=lnx, 2= phi3+lnx, 3=phi123, 4=phi123+lnx
0006 lnxuser=${3:-${USER}} #username for lnx computers
0007 
0008 # samples
0009 export sample=${sample:-"CMSSW_TTbar_PU50"}
0010 
0011 # Validation architecture
0012 export val_arch=SKL-SP
0013 
0014 # vars for KNL
0015 export KNL_HOST=${USER}@phi2.t2.ucsd.edu
0016 export KNL_WORKDIR=/data1/work/${USER}
0017 export KNL_TEMPDIR=tmp
0018 
0019 # vars for SNB
0020 export SNB_HOST=${USER}@phi1.t2.ucsd.edu
0021 export SNB_WORKDIR=/data2/nfsmic/${USER}
0022 export SNB_TEMPDIR=tmp
0023 
0024 # vars for LNX7188
0025 export LNXG_HOST=${lnxuser}@lnx7188.classe.cornell.edu
0026 export LNXG_WORKDIR=/home/${lnxuser}
0027 export LNXG_TEMPDIR=/tmp/tmp7188
0028 
0029 # vars for LNX4108
0030 export LNXS_HOST=${lnxuser}@lnx4108.classe.cornell.edu
0031 export LNXS_WORKDIR=/home/${lnxuser}
0032 export LNXS_TEMPDIR=/tmp/tmp4108
0033 
0034 # SSH options
0035 function SSHO()
0036 {
0037     ssh -o StrictHostKeyChecking=no < /dev/null "$@"
0038 }
0039 export -f SSHO
0040 
0041 #################
0042 ## Build Types ##
0043 #################
0044 
0045 export BH="BH bh"
0046 export STD="STD std"
0047 export CE="CE ce"
0048 
0049 # which set of builds to use based on input from command line
0050 if [[ "${suite}" == "full" ]]
0051 then
0052     declare -a ben_builds=(BH STD CE)
0053     declare -a val_builds=(BH STD CE)
0054 elif [[ "${suite}" == "forPR" ]]
0055 then
0056     declare -a ben_builds=(BH CE)
0057     declare -a val_builds=(STD CE)
0058 elif [[ "${suite}" == "forConf" ]]
0059 then
0060     declare -a ben_builds=(CE)
0061     declare -a val_builds=(CE)
0062 elif [[ "${suite}" == "val" || "${suite}" == "valMT1" ]]
0063 then
0064     declare -a ben_builds=()
0065     declare -a val_builds=(STD CE)
0066 else
0067     echo ${suite} "is not a valid benchmarking suite option! Exiting..."
0068     exit
0069 fi
0070 
0071 # set dependent arrays
0072 th_builds=() ## for parallelization tests
0073 vu_builds=() ## for vectorization tests
0074 meif_builds=() ## for multiple-events-in-flight tests
0075 text_builds=() ## for text dump comparison tests
0076 
0077 # loop over ben_builds and set dependent arrays, export when done
0078 for ben_build in "${ben_builds[@]}"
0079 do
0080     # set th builds : all benchmarks!
0081     th_builds+=("${ben_build}")
0082     vu_builds+=("${ben_build}")
0083     
0084     # set meif builds : only do CE
0085     if [[ "${ben_build}" == "CE" ]]
0086     then
0087         meif_builds+=("${ben_build}")
0088     fi
0089 done
0090 export ben_builds val_builds th_builds vu_builds meif_builds
0091 
0092 # th checking
0093 function CheckIfTH ()
0094 {
0095     local build=${1}
0096     local result="false"
0097 
0098     for th_build in "${th_builds[@]}"
0099     do 
0100         if [[ "${th_build}" == "${build}" ]]
0101         then
0102             result="true"
0103             break
0104         fi
0105     done
0106     
0107     echo "${result}"
0108 }
0109 export -f CheckIfTH
0110 
0111 # vu checking
0112 function CheckIfVU ()
0113 {
0114     local build=${1}
0115     local result="false"
0116 
0117     for vu_build in "${vu_builds[@]}"
0118     do 
0119         if [[ "${vu_build}" == "${build}" ]]
0120         then
0121             result="true"
0122             break
0123         fi
0124     done
0125     
0126     echo "${result}"
0127 }
0128 export -f CheckIfVU
0129 
0130 # meif checking
0131 function CheckIfMEIF ()
0132 {
0133     local build=${1}
0134     local result="false"
0135 
0136     for meif_build in "${meif_builds[@]}"
0137     do 
0138         if [[ "${meif_build}" == "${build}" ]]
0139         then
0140             result="true"
0141             break
0142         fi
0143     done
0144     
0145     echo "${result}"
0146 }
0147 export -f CheckIfMEIF
0148 
0149 # set text dump builds: need builds matched in both TH and VU tests
0150 for ben_build in "${ben_builds[@]}"
0151 do 
0152     check_th=$( CheckIfTH ${ben_build} )
0153     check_vu=$( CheckIfVU ${ben_build} )
0154 
0155     if [[ "${check_th}" == "true" ]] && [[ "${check_vu}" == "true" ]]
0156     then
0157         text_builds+=("${ben_build}")
0158     fi
0159 done
0160 
0161 export text_builds
0162 
0163 # text checking
0164 function CheckIfText ()
0165 {
0166     local build=${1}
0167     local result="false"
0168 
0169     for text_build in "${text_builds[@]}"
0170     do 
0171         if [[ "${text_build}" == "${build}" ]]
0172         then
0173             result="true"
0174             break
0175         fi
0176     done
0177 
0178     echo "${result}"
0179 }
0180 export -f CheckIfText
0181 
0182 Base_Test="NVU1_NTH1"
0183 if [[ ${useARCH} -eq 0 ]]
0184 then
0185     arch_array=(SKL-SP)
0186     arch_array_textdump=("SKL-SP ${Base_Test}" "SKL-SP NVU16int_NTH64")
0187     arch_array_benchmark=("SKL-SP skl-sp")
0188 elif [[ ${useARCH} -eq 1 ]]
0189 then
0190     arch_array=(LNX-G LNX-S)
0191     arch_array_textdump=("LNX-G ${Base_Test}" "LNX-G NVU16int_NTH64" "LNX-S ${Base_Test}" "LNX-S NVU16int_NTH64")
0192     arch_array_benchmark=("LNX-G lnx-g" "LNX-S lnx-s")
0193 elif [[ ${useARCH} -eq 2 ]]
0194 then
0195     arch_array=(SKL-SP LNX-G LNX-S)
0196     arch_array_textdump=("SKL-SP ${Base_Test}" "SKL-SP NVU16int_NTH64" "LNX-G ${Base_Test}" "LNX-G NVU16int_NTH64" "LNX-S ${Base_Test}" "LNX-S NVU16int_NTH64")
0197     arch_array_benchmark=("SKL-SP skl-sp" "LNX-G lnx-g" "LNX-S lnx-s")
0198 elif [[ ${useARCH} -eq 3 ]]
0199 then
0200     arch_array=(SNB KNL SKL-SP)
0201     arch_array_textdump=("SNB ${Base_Test}" "SNB NVU8int_NTH24" "KNL ${Base_Test}" "KNL NVU16int_NTH256" "SKL-SP ${Base_Test}" "SKL-SP NVU16int_NTH64")
0202     arch_array_benchmark=("SNB snb" "KNL knl" "SKL-SP skl-sp")
0203 elif [[ ${useARCH} -eq 4 ]]
0204 then
0205     arch_array=(SNB KNL SKL-SP LNX-G LNX-S)
0206     arch_array_textdump=("SNB ${Base_Test}" "SNB NVU8int_NTH24" "KNL ${Base_Test}" "KNL NVU16int_NTH256" "SKL-SP ${Base_Test}" "SKL-SP NVU16int_NTH64" "LNX-G ${Base_Test}" "LNX-G NVU16int_NTH64" "LNX-S ${Base_Test}" "LNX-S NVU16int_NTH64")
0207     arch_array_benchmark=("SNB snb" "KNL knl" "SKL-SP skl-sp" "LNX-G lnx-g" "LNX-S lnx-s")
0208 else
0209     echo "${useARCH} is not a valid useARCH option! Exiting..."
0210     exit
0211 fi
0212 export arch_array arch_array_textdump arch_array_benchmark