Skip to content

Commit

Permalink
Merge pull request #20 from amereghe/master
Browse files Browse the repository at this point in the history
preparing 'dev' release of 4th May 2018
  • Loading branch information
amereghe authored May 4, 2018
2 parents ca77111 + b73486f commit 5a17a3b
Show file tree
Hide file tree
Showing 25 changed files with 2,151 additions and 184 deletions.
10 changes: 7 additions & 3 deletions boinc_software/cronjobs/acrontab_jobs_sixtadm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
20 3 * * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinc ; /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
40 3 * * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinctest ; /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
#
# list studies in spooldirs that could be deleted and notify users (based on dir itself):
# list studies in spooldirs that could be deleted and notify users (based on <workspace>_<study> dir itself):
0 4 1 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinc ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
0 5 1 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinctest ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
#
# list studies in spooldirs that could be deleted and notify users (based on <workspace>_<study>/work dir):
0 4 15 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinc ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
0 5 15 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinctest ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
0 4 11 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinc ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh work >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
0 5 11 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinctest ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh work >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
#
# list studies in spooldirs that could be deleted and notify users (based on <workspace>_<study>/results dir):
0 4 21 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinc ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh results >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
0 5 21 * * lxplus.cern.ch cd /afs/cern.ch/work/b/boinc/boinctest ; /afs/cern.ch/user/s/sixtadm/boinc_soft/listDeleteStudies.sh results >> /afs/cern.ch/user/s/sixtadm/boinc_soft/deleteStudies.log 2>&1
27 changes: 16 additions & 11 deletions boinc_software/cronjobs/listDeleteStudies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# to be run in:
# /afs/cern.ch/work/b/boinc/boinc
oldN=30 # days
threshOccupancy=0.5 # [GB]
threshOccupancy=1.0 # [GB]
BOINCspoolDir=$PWD
SCRIPTDIR=`dirname $0`
SCRIPTDIR="`cd ${SCRIPTDIR} ; pwd`"
Expand All @@ -28,11 +28,8 @@ function treatSingleDir(){
}

trap "echo \" ...ending at \`date\` .\" " exit
echo ""
echo " starting `basename $0` at `date` ..."
lUseWork=true
if [ $# == 1 ] ; then
lUseWork=false
fi

# prepare delete dir
[ -d delete ] || mkdir delete
Expand All @@ -46,12 +43,20 @@ echo " checking BOINC spooldir ${BOINCspoolDir} ..."
# ask confirmation to user
now=`date +"%F_%H-%M-%S"`
# find old directories (based on <workspace>_<studyName>/work/)
if ${lUseWork} ; then
echo " find old directories based on <workspace>_<studyName>/work/ ..."
allStudies=`find . -maxdepth 2 -type d -name work -ctime +${oldN}`
for currCase in ${allStudies} ; do
treatSingleDir ${currCase%/work}
done
if [ -n "$1" ] ; then
case "$1" in
work | results )
echo " find old directories based on <workspace>_<studyName>/$1/ ..."
allStudies=`find . -maxdepth 2 -type d -name $1 -ctime +${oldN}`
for currCase in ${allStudies} ; do
treatSingleDir ${currCase%/$1}
done
;;
* )
echo " wrong input: $1 [work|results]"
exit 1
;;
esac
else
echo " find old directories based on <workspace>_<studyName> only ..."
allStudies=`find . -maxdepth 1 -type d -ctime +${oldN} | grep -v -e upload -e delete`
Expand Down
14 changes: 12 additions & 2 deletions boinc_software/maintain_common_space/structureMe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,17 @@ EOF
fi
if ${lScripts} ; then
# make fortran exes for checking fort.10
cd ${__Dir}
cd utilities/fortran
cd ${__Dir}/utilities/fortran
make
ls -ltrh
cd ${__origDir}
# make documentation
if [ -d ${__Dir}/utilities/doc ] ; then
cd ${__Dir}/utilities/doc
make
ls -ltrh
fi
cd ${__origDir}
# echo commits/logs
echo ""
echo " --> present branch:"
Expand Down Expand Up @@ -119,6 +125,10 @@ function checkDir(){
cd ${__Dir}/utilities/fortran
ls -ltrh
cd ${__origDir}
# documentation
cd ${__Dir}/utilities/doc
ls -ltrh
cd ${__origDir}
# checkout of SixDB
cd ${__Dir}/utilities/externals/SixDeskDB/
git log --max-count=1
Expand Down
File renamed without changes.
35 changes: 35 additions & 0 deletions sixjobs/scan_definitions
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

############################## SCAN OVER A CARTESIAN GRID ######################

# specify the variable names to be used in naming the studies, e.g.:
# scan_variables="QP IOCT"
scan_variables="QP IOCT"

# specify the placeholders in the mask file, e.g.:
# scan_placeholders="%QPV %OCV"
scan_placeholders="%QPV %OCV"

# specify the prefix of the study name
# e.g. if the base mask file is called hl13B1.mask, we use:
# scan_prefix="hl10BaseB1"
scan_prefix="hl10BaseB1"

# specify the values to be taken by the different variables
# if we want to use 14 for QP and values between 0 and 40 in steps of 40 for IOCT:
# scan_vals_QP="3"
# scan_vals_IOCT=$(seq -500 200 500)
scan_vals_QP="3"
scan_vals_IOCT=$(seq -500 200 500)


############################## SCAN OVER SPECIFIC MASKS #######################

# THIS OPTION REQUIRES ALL THE MASK FILES TO BE EXISTING

# (de)activate the scan over specific masks
scan_masks=false
scan_studies="
ats2017_QP_0_IOCT_12
ats2017_QP_0_IOCT_16
"
File renamed without changes.
File renamed without changes.
158 changes: 108 additions & 50 deletions utilities/bash/dot_profile
Original file line number Diff line number Diff line change
Expand Up @@ -625,17 +625,17 @@ sixdeskamps()
sixdeskAllFloats(){
# A.Mereghetti, 2017-04-08
# new function, to generate an array of floating point values
local __precision=1.0E-15
local __xMin=$1
local __xMax=$2
local __xDelta=$3
local __lSkipExtremes=$4
# - preliminary checks - to be moved to check_env.sh
if [ -z "${__xMax}" ] || [ -z "${__xDelta}" ] ; then
__xMax=${__xMin}
__xDelta=${__xMin}
fi
# - get all values
python ${SCRIPTDIR}/python/generate_floats.py ${__xMin} ${__xMax} ${__xDelta} ${__precision}
python ${SCRIPTDIR}/python/generate_floats.py ${__xMin} ${__xMax} ${__xDelta} ${__lSkipExtremes}
}
sixdeskFixDotFloat(){
# A.Mereghetti, 2017-04-08
Expand All @@ -661,10 +661,11 @@ sixdeskAllTunes(){
# - tunesYY: returned array of ver tune values
# - inttunesXX: returned array of integer part of hor tunes
# - inttunesYY: returned array of integer part of ver tunes
local __lForceIntegers=False
# hor:
tunesXX=""
inttunesXX=""
local __tunesXX=$(sixdeskAllFloats $tunex $tunex1 $deltax)
local __tunesXX=$(sixdeskAllFloats $tunex $tunex1 $deltax )
for tmptn in ${__tunesXX} ; do
tunesXX="${tunesXX} $(sixdeskFixDotFloat ${tmptn})"
inttunesXX="${inttunesXX} $(sixdeskinttune ${tmptn})"
Expand All @@ -674,7 +675,7 @@ sixdeskAllTunes(){
# ver:
tunesYY=""
inttunesYY=""
local __tunesYY=$(sixdeskAllFloats $tuney $tuney1 $deltay)
local __tunesYY=$(sixdeskAllFloats $tuney $tuney1 $deltay )
for tmptn in ${__tunesYY} ; do
tunesYY="${tunesYY} $(sixdeskFixDotFloat ${tmptn})"
inttunesYY="${inttunesYY} $(sixdeskinttune ${tmptn})"
Expand All @@ -691,9 +692,10 @@ sixdeskAllAmplitudes(){
ampstart=""
ampfinish=""
local __iLast=0
local __lForceIntegers=False

# get all amplitude points
local __allAmplitudes=$(sixdeskAllFloats $ns1l $ns2l $nsincl)
local __allAmplitudes=$(sixdeskAllFloats $ns1l $ns2l $nsincl )
__allAmplitudes=( ${__allAmplitudes} )

# get all amplitude intervals
Expand Down Expand Up @@ -728,7 +730,6 @@ sixdeskAllAngles(){
local __lbackcomp=$7
local __lReduceAngsWithAmplitude=$8
local __totAngle=$9
local __factor=${10}

# generated arrays:
KKs=""
Expand All @@ -740,47 +741,55 @@ sixdeskAllAngles(){
if ${__lReduceAngsWithAmplitude}; then
for (( iAmple=0; iAmple<${#fAmpEnds[@]}; iAmple++ )) ; do
if (( $(echo "${reduce_angs_with_amplitude} ${fAmpEnds[${iAmple}]}" | awk '{print ($1 < $2)}') )); then
# varying number of angles
local __angles_nb=$(echo ${fAmpEnds[${iAmple}]} ${ampfinish} ${__kmax} | awk '{printf ("%.f", ($1/$2*$3))}')
else
# constant number of angles
local __angles_nb=$(echo ${reduce_angs_with_amplitude} ${ampfinish} ${__kmax} | awk '{printf ("%.f", ($1/$2*$3))}')
fi

if [ ${__angles_nb} -eq 0 ];then
__angles_nb=1
fi

for (( kk=1; kk<=${__angles_nb}; kk++ )) ; do
KKs="${KKs} ${kk}"
local __tmpAngle=`echo ${totAngle} ${kk} ${__angles_nb} | awk '{print ($1*$2/($3+1))}'`
Angles="${Angles} ${__tmpAngle}"
if ${__lbackcomp} ; then
if ${__lbackcomp} ; then
for (( kk=1; kk<=${__angles_nb}; kk++ )) ; do
KKs="${KKs} ${kk}"
local __tmpAngle=`echo ${totAngle} ${kk} ${__angles_nb} | awk '{print ($1*$2/($3+1))}'`
Angles="${Angles} ${__tmpAngle}"
local __kang=`echo ${kk} ${__angles_nb} | awk '{print ($1/($2+1))}'`
else
local __kang=`echo ${kk} ${__angles_nb} | awk '{printf ("%.16E",$1/($2+1))}'`
fi
kAngs="${kAngs} ${__kang}"
done
kAngs="${kAngs} ${__kang}"
done
else
KKs="${KKs} $(seq 1 ${__angles_nb})"
local __angleStep=`echo ${__totAngle} ${__angles_nb} | awk '{print ($1/($2+1))}'`
Angles="${Angles} $(sixdeskAllFloats 0 ${__totAngle} ${__angleStep} True)"
local __kAngleStep=`echo ${__angles_nb} | awk '{printf ("%.18f",1.0/($1+1))}'`
kAngs="${kAngs} $(sixdeskAllFloats 0.0 1.0 ${__kAngleStep} True)"
fi
let nTotAngles+=${__angles_nb}
KKs_ampl+=( ${nTotAngles} )
done
else
if ${__lbackcomp} ; then
local __angleStep=`echo ${__totAngle} ${__kmax} | awk '{print ($1/($2+1))}'`
for (( kk=${__kmin}; kk<=${__kend}; kk+=${__kstep} )) ; do
KKs="${KKs} ${kk}"
local __tmpAngle=`echo ${kk} ${__angleStep} | awk '{print ($1*$2)}'`
Angles="${Angles} ${__tmpAngle}"
if ${__lbackcomp} ; then
local __kang=`echo ${kk} ${__kmax} | awk '{print ($1/($2+1))}'`
else
local __kang=`echo ${kk} ${__kmax} | awk '{printf ("%.16E",$1/($2+1))}'`
fi
kAngs="${kAngs} ${__kang}"
done
else
local __angleStep=`echo ${__totAngle} ${__kmax} | awk '{printf ("%.16E",$1/($2+1))}'`
KKs="${KKs} $(seq 1 ${__kmax})"
local __angleStep=`echo ${__totAngle} ${__kmax} | awk '{print ($1/($2+1))}'`
Angles="${Angles} $(sixdeskAllFloats 0 ${__totAngle} ${__angleStep} True)"
local __kAngleStep=`echo ${__kmax} | awk '{printf ("%.18f",1.0/($1+1))}'`
kAngs="${kAngs} $(sixdeskAllFloats 0.0 1.0 ${__kAngleStep} True)"
fi

for (( kk=${__kmin}; kk<=${__kend}; kk+=${__kstep} )) ; do
KKs="${KKs} ${kk}"
local __tmpAngle=`echo ${kk} ${__angleStep} | awk '{print ($1*$2)}'`
Angles="${Angles} ${__tmpAngle}"
if ${__lbackcomp} ; then
local __kang=`echo ${kk} ${__kmax} | awk '{print ($1/($2+1))}'`
else
local __kang=`echo ${kk} ${__kmax} | awk '{printf ("%.16E",$1/($2+1))}'`
fi
kAngs="${kAngs} ${__kang}"
done
KKs_ampl=( ${KKs_ampl} ${__kend} )
fi

Expand All @@ -803,35 +812,64 @@ sixdeskDefinePythonPath(){
export PATH=${1}:${PATH}
sixdeskmess 2 "Setting python to ${1} in PATH env var"
fi
sixdeskmess -1 "--> python set to: `which python` - version: `python --version`"
sixdeskmess -1 "Python set to: `which python` - version: `python --version 2>&1`"
}
sixdeskGetCurretPaths(){
tmpDir=`readlink -f $PWD`
tmpDir=`dirname ${tmpDir}`
tmpWorkspace=`basename ${tmpDir}`
if [[ "${tmpDir}" == *"scratch"* ]] ; then
# scratchdir IS in the path
tmpDir=`dirname ${tmpDir}`
tmpScratchName=`basename ${tmpDir}`
tmpDir=`dirname ${tmpDir}`
tmpBaseDir=${tmpDir}
tmpScratchDir=\$basedir/${tmpScratchName}
tmpTrackDir=\$scratchdir/\$workspace
tmpSixtrackInput=\$scratchdir/sixtrack_input/\$workspace/\$LHCDescrip
tmpSixdeskWork=\$scratchdir/work/\$workspace/\$LHCDescrip
tmpCronLogs=\$scratchdir/cronlogs/\$workspace
tmpSixdeskLogs=\$scratchdir/sixdesklogs/\$workspace
else
# scratchdir is NOT in the path
tmpDir=`dirname ${tmpDir}`
tmpBaseDir=${tmpDir}
tmpScratchDir=\$basedir/\$workspace
tmpTrackDir=\$basedir/\$workspace
tmpSixtrackInput=\$scratchdir/sixtrack_input/\$LHCDescrip
tmpSixdeskWork=\$scratchdir/work/\$LHCDescrip
tmpCronLogs=\$scratchdir/cronlogs
tmpSixdeskLogs=\$scratchdir/sixdesklogs
fi
}
sixdeskDefineUserTree(){
# define the tree in the userspace

# input variables are the starting points:
# $1: root dir (ie $basedir in sixdeskenv)
# $2: scratch dir (ie $scratchdir in sixdeskenv)
# $3: workspace name (ie $workspace in sixdeskenv)

# get current paths
sixdeskGetCurretPaths

# basic paths (back-compatibility)
[ -n "${basedir}" ] || export basedir=$1 # eg /afs/cern.ch/user/$initial/$LOGNAME
[ -n "${scratchdir}" ] || export scratchdir=$2 # eg $basedir/scratch0
[ -n "${trackdir}" ] || export trackdir=$scratchdir/$3 # eg $scratchdir/w2
[ -n "${sixdeskhome}" ] || export sixdeskhome=$basedir/$3/sixjobs # eg $trackdir/sixjobs
[ -n "${sixdeskhomeStudies}" ] || export sixdeskhomeStudies=$sixdeskhome/studies

#
[ -n "${sixtrack_input}" ] || export sixtrack_input=$scratchdir/sixtrack_input/$workspace/$LHCDescrip
[ -n "${sixdesklogs}" ] || export sixdesklogs=$scratchdir/sixdesklogs/$workspace
[ -n "${sixdesklogdir}" ] || export sixdesklogdir=$sixdesklogs/$LHCDescrip
[ -n "${cronlogs}" ] || export cronlogs=$scratchdir/cronlogs/$workspace
[ -n "${cronlogdir}" ] || export cronlogdir=$cronlogs/$LHCDescrip
[ -n "${workspace}" ] || export workspace=${tmpWorkspace}
[ -n "${basedir}" ] || export basedir=${tmpBaseDir}
[ -n "${scratchdir}" ] || export scratchdir=${tmpScratchDir}
[ -n "${trackdir}" ] || export trackdir=${tmpTrackDir}
[ -n "${sixtrack_input}" ] || export sixtrack_input=${tmpSixtrackInput}
[ -n "${sixdeskwork}" ] || export sixdeskwork=${tmpSixdeskWork}

# dependent paths
[ -n "${sixdeskhome}" ] || export sixdeskhome=${basedir}/${workspace}/sixjobs
[ -n "${sixdeskhomeStudies}" ] || export sixdeskhomeStudies=${sixdeskhome}/studies
[ -n "${sixdeskstudy}" ] || export sixdeskstudy=$sixdeskhomeStudies/$LHCDescrip
[ -n "${sixdesktrack}" ] || export sixdesktrack=$trackdir/track
[ -n "${sixdesktrackStudy}" ] || export sixdesktrackStudy=$sixdesktrack/$LHCDescrip
[ -n "${sixdeskwork}" ] || export sixdeskwork=$scratchdir/work/$workspace/$LHCDescrip

# logs/jobs paths
[ -n "${sixdesklogs}" ] || export sixdesklogs=${tmpSixdeskLogs}
[ -n "${sixdesklogdir}" ] || export sixdesklogdir=$sixdesklogs/$LHCDescrip
[ -n "${cronlogs}" ] || export cronlogs=${tmpCronLogs}
[ -n "${cronlogdir}" ] || export cronlogdir=$cronlogs/$LHCDescrip
[ -n "${sixdeskjobs}" ] || export sixdeskjobs=$sixdeskwork/$sixdeskplatform"jobs"
[ -n "${sixdeskjobs_logs}" ] || export sixdeskjobs_logs=$sixdeskjobs/jobs_logs
[ -n "${sixdeskstudy}" ] || export sixdeskstudy=$sixdeskhomeStudies/$LHCDescrip
}
sixDeskDefineMADXTree(){
local __SCRIPTDIR=$1
Expand Down Expand Up @@ -1544,3 +1582,23 @@ function sixdeskCompareVersions(){
# 0: true ; 1: false
echo $1 $2 | awk '{print ($1>=$2)}'
}
function sixdeskConfirmExit(){
local __iExit=-1
while [ ${__iExit} -lt 0 ] ; do
sixdeskmess -1 "Continue? [y/n]"
read answer
case ${answer} in
[yY] | [yY][Ee][Ss] )
sixdeskmess -1 "Continuing..."
__iExit=0
;;
[nN] | [n|N][O|o] )
sixdeskmess -1 "Interrupted"
__iExit=1
;;
*) sixdeskmess -1 "Invalid input!"
;;
esac
done
return ${__iExit}
}
Loading

0 comments on commit 5a17a3b

Please sign in to comment.