Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #! /bin/bash
0002 
0003 # command line input
0004 dir=${1:-"benchmarks"} # Main output dir name
0005 suite=${2:-"forPR"} # which set of benchmarks to run: full, forPR, forConf
0006 afs_or_eos=${3:-"eos"} # which user space to use: afs or eos
0007 lxpuser=${4:=${USER}}
0008 
0009 # in case this is run alone
0010 source xeon_scripts/common-variables.sh ${suite}
0011 source xeon_scripts/init-env.sh
0012 
0013 # first tar the directory to be sent
0014 echo "Tarring plot directory"
0015 tarball=${dir}.tar.gz
0016 tar -zcvf ${tarball} ${dir}
0017 
0018 # vars for LXPLUS
0019 LXPLUS_HOST=${lxpuser}@lxplus.cern.ch
0020 LXPLUS_OUTDIR=www
0021 LXPLUS_WORKDIR=user/${lxpuser:0:1}/${lxpuser}
0022 
0023 if [[ "${afs_or_eos}" == "afs" ]]
0024 then
0025     LXPLUS_WORKDIR=/afs/cern.ch/${LXPLUS_WORKDIR}
0026 elif [[ "${afs_or_eos}" == "eos" ]]
0027 then
0028     LXPLUS_WORKDIR=/eos/${LXPLUS_WORKDIR}
0029 else
0030     echo "${afs_or_eos} is not a valid option! Choose either 'afs' or 'eos'! Exiting..."
0031     exit
0032 fi
0033 
0034 # then send it!
0035 scp -r ${tarball} ${LXPLUS_HOST}:${LXPLUS_WORKDIR}/${LXPLUS_OUTDIR}
0036 
0037 # Make outdir nice and pretty
0038 if [[ "${afs_or_eos}" == "afs" ]]
0039 then
0040     echo "Unpacking tarball and executing remotely: ./makereadable.sh ${dir}"
0041     SSHO ${LXPLUS_HOST} bash -c "'
0042     cd ${LXPLUS_WORKDIR}/${LXPLUS_OUTDIR}
0043     tar -zxvf ${tarball}
0044     ./makereadable.sh ${dir}
0045     rm -rf ${tarball}
0046     exit
0047     '"
0048 else
0049     echo "Unpacking tarball"
0050     SSHO ${LXPLUS_HOST} bash -c "'
0051     cd ${LXPLUS_WORKDIR}/${LXPLUS_OUTDIR}
0052     tar -zxvf ${tarball}
0053     rm -rf ${tarball}
0054     exit
0055     '"
0056 fi
0057 
0058 # remove local tarball
0059 echo "Removing local tarball of plots"
0060 rm ${tarball}
0061 
0062 # Final message
0063 echo "Finished tarring and sending plots to LXPLUS!"