Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:25

0001 #! /bin/bash
0002 
0003 ########################
0004 ## Command Line Input ##
0005 ########################
0006 
0007 remote_arch=${1} # SNB, KNL, SKL-SP
0008 suite=${2:-"forPR"} # which set of benchmarks to run: full, forPR, forConf
0009 useARCH=${3:-0}
0010 lnxuser=${4:-${USER}}
0011 
0012 ###################
0013 ## Configuration ##
0014 ###################
0015 
0016 source xeon_scripts/common-variables.sh ${suite} ${useARCH} ${lnxuser}
0017 source xeon_scripts/init-env.sh
0018 
0019 # architecture dependent settings
0020 if [[ "${remote_arch}" == "SNB" ]]
0021 then
0022     HOST=${SNB_HOST}
0023     DIR=${SNB_WORKDIR}/${SNB_TEMPDIR}
0024 elif [[ "${remote_arch}" == "KNL" ]]
0025 then
0026     HOST=${KNL_HOST}
0027     DIR=${KNL_WORKDIR}/${KNL_TEMPDIR}
0028 elif [[ "${remote_arch}" == "LNX-G" ]]
0029 then
0030     HOST=${LNXG_HOST}
0031     DIR=${LNXG_WORKDIR}/${LNXG_TEMPDIR}
0032 elif [[ "${remote_arch}" == "LNX-S" ]]
0033 then
0034     HOST=${LNXS_HOST}
0035     DIR=${LNXS_WORKDIR}/${LNXS_TEMPDIR}
0036 else 
0037     echo ${remote_arch} "is not a valid architecture! Exiting..."
0038     exit
0039 fi
0040 
0041 ##################
0042 ## Tar and Send ##
0043 ##################
0044 
0045 assert_settings=true
0046 echo "--------Showing System Settings--------"
0047 # unzip tarball remotely
0048 echo "Untarring repo on ${remote_arch} remotely"
0049 SSHO ${HOST} bash -c "'
0050 echo "--------Showing System Settings--------"
0051 ##### Check Settings #####
0052 echo "turbo status: "$(cat /sys/devices/system/cpu/intel_pstate/no_turbo)
0053 echo "scaling governor setting: "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
0054 echo "--------End System Settings ------------"
0055 if ${assert_settings};
0056 then
0057 echo "Ensuring correct settings"
0058 if [[ $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) != "performance" ]]
0059 then
0060 echo "performance mode is OFF. Exiting"
0061 exit 1
0062 fi
0063 if [[ $(cat /sys/devices/system/cpu/intel_pstate/no_turbo) == "0" ]]
0064 then
0065 echo "Turbo is ON. Exiting"
0066 exit 1
0067 fi
0068 fi
0069 sleep 3 ## so you can see the settings
0070 '"
0071 bad=$(SSHO ${HOST} echo $?)
0072 if [ $bad -eq 1 ]; then
0073 echo "killed"
0074 exit 1
0075 fi
0076 
0077 # tar up the directory
0078 echo "Tarring directory for ${remote_arch}... make sure it is clean!"
0079 repo=mictest.tar.gz
0080 tar --exclude-vcs --exclude='*.gz' --exclude='validation*' --exclude='*.root' --exclude='log_*' --exclude='*.png' --exclude='*.o' --exclude='*.om' --exclude='*.d' --exclude='*.optrpt' -zcvf  ${repo} *
0081 
0082 # mkdir tmp dir on remote arch
0083 echo "Making tmp dir on ${remote_arch} remotely"
0084 SSHO ${HOST} bash -c "'
0085 mkdir -p ${DIR}
0086 exit
0087 '"
0088 
0089 # copy tarball
0090 echo "Copying tarball to ${remote_arch}"
0091 scp ${repo} ${HOST}:${DIR}
0092 
0093 # unzip tarball remotely
0094 echo "Untarring repo on ${remote_arch} remotely"
0095 SSHO ${HOST} bash -c "'
0096 cd ${DIR}
0097 tar -zxvf ${repo}
0098 rm ${repo}
0099 '"
0100 
0101 # remove local tarball
0102 echo "Remove local repo tarball"
0103 rm ${repo}