}
goCPass0()
-{
+(
umask 0002
targetDirectory=${1}
[[ "${runpath}" != "${outputDir}" ]] && rm -rf ${runpath} && echo "removing ${runpath}"
return 0
-}
+)
goCPass1()
-{
+(
umask 0002
targetDirectory=${1}
echo doneFile ${doneFile}
echo runpath ${runpath}
echo outputDir ${outputDir}
+ echo batchWorkingDirectory ${batchWorkingDirectory}
echo ALICE_ROOT ${ALICE_ROOT}
echo PWD ${PWD}
echo "########## ###########"
"${ALICE_ROOT}/ANALYSIS/macros/QAtrain_duo.C"
)
- for file in ${filesCPass1[*]}; do
+ for file in "${filesCPass1[@]}"; do
[[ ! -f ${file##*/} && -f ${file} ]] && echo "copying ${file}" && cp -f ${file} .
- [[ ${file##*/} =~ .*\.sh ]] && chmod +x ${file##*/}
+ [[ ${file##*/} =~ .*\.sh ]] && echo "making ${file##*/} executable" && chmod +x ${file##*/}
done
echo "this directory (${PWD}) contents:"
/bin/ls
echo
+ #remove spaces around commas from calls to root
sed -i '/.*root .*\.C/ s|\s*,\s*|,|g' *.sh
if [[ -n ${postSetUpActionCPass1} ]]; then
#create the Barrel and OuterDet directories for CPass1 and link the local OCDB directory
#there to make the localOCDBaccessConfig.C file work, since it may point to the OCDB
#entries using a relative path, e.g. local://./OCDB
+ echo "linking the OCDB/ for Barrel and OuterDet directories"
mkdir Barrel OuterDet
+ ls -l
ln -s ../OCDB Barrel/OCDB
ln -s ../OCDB OuterDet/OCDB
[[ "${runpath}" != "${outputDir}" ]] && rm -rf ${runpath}
return 0
-}
+)
goMergeCPass0()
-{
+(
#
# find the output files and merge them
#
[[ "${runpath}" != "${outputDir}" ]] && rm -rf ${runpath}
return 0
-}
+)
goMergeCPass1()
-{
+(
#
# find the output files and merge them
#
[[ "${runpath}" != "${outputDir}" ]] && rm -rf ${runpath}
return 0
-}
+)
goMerge()
-{
+(
#generic root merge using CPass1 merge.C script
inputList=${1}
outputFile=${2}
rm -f ${outputFile}
aliroot -b -q "${ALICE_ROOT}/PWGPP/CalibMacros/CPass0/merge.C(\"${inputList}\",\"\",kFALSE,\"${outputFile}\")" > merge_${inputList}.log
return 0
-}
+)
goSubmitMakeflow()
{
}
goGenerateMakeflow()
-{
+(
#generate the makeflow file
[[ $# -lt 3 ]] && echo "args: id inputFileList configFile" && return 1
productionID=${1}
echo
return 0
-}
+)
goPrintValues()
-{
+(
#print the values given the key from any number of files (store in output file on second argument)
if [[ $# -lt 3 ]]; then
echo "goPrintValues key outputFile inputFiles"
shift 2 #remove 2 first arguments from arg list to only pass the input files to awk
awk -v key=${key} '$0 ~ key" " {print $2}' "$@" | tee ${outputFile}
return 0
-}
+)
goCreateQAplots()
-{
+(
umask 0002
mergedQAfileList=${1}
productionID=${2}
cd ${olddir}
return 0
-}
+)
goTest()
-{
- umask 0002
- exec 2>&1
- exec > >(tee test.log)
- echo "$@"
- echo something
- return 0
-}
+(
+ echo AA
+)
alirootInfo()
-{
- (
+(
umask 0002
# save aliroot repository info
[[ -z "${ALICE_ROOT}" ]] && return 1
git diff ${currentBranch}
popd
return 0
- )
-}
+)
setYear()
-{
+(
#set the year
# ${1} - year to be set
# ${2} - where to set the year
[[ ${year1} -ne ${year2} && -n ${year2} && -n ${year1} ]] && path=${2/\/${year2}\//\/${year1}\/}
echo ${path}
return 0
-}
+)
guessPeriod()
-{
+(
#guess the period from the path, pick the rightmost one
local IFS="/"
declare -a path=( ${1} )
done
echo ${period}
return 0
-}
+)
guessYear()
-{
+(
#guess the year from the path, pick the rightmost one
local IFS="/"
declare -a path=( ${1} )
done
echo ${year}
return 0
-}
+)
guessRunNumber()
-{
+(
#guess the run number from the path, pick the rightmost one
#works for /path/foo/000123456/bar/...
#and /path/foo.run123456.bar
done
echo ${runNumber}
return 0
-}
+)
validateLog()
-{
+(
log=${1}
errorConditions=(
'There was a crash'
fi
return 0
-}
+)
summarizeLogs()
-{
+(
#print a summary of logs
logFiles=(
"*.log"
done < <(/bin/ls ${PWD}/*/core 2>/dev/null; /bin/ls ${PWD}/core 2>/dev/null)
return ${logstatus}
-}
+)
spitOutLocalOCDBaccessConfig()
{
}
goMakeFilteredTrees()
-{
+(
outputDir=${1}
runNumber=${2}
#get path to input list
#record the working directory provided by the batch system
batchWorkingDirectory=${PWD}
-
- commonOutputPath=${PWD}
+ [[ -z ${commonOutputPath} ]] && commonOutputPath=${PWD}
doneFile=${commonOutputPath}/meta/filtering.cpass1.run${runNumber}.done
runpath=${outputDir}
#[[ ${reconstructInTemporaryDir} -eq 1 && -n ${TMPDIR} ]] && runpath=${TMPDIR}
[[ ${reconstructInTemporaryDir} -eq 1 ]] && runpath=$(mktemp -d -t goMakeFilteredTrees.XXXXXX)
-
[[ -f ${alirootSource} && -z ${ALICE_ROOT} ]] && source ${alirootSource}
mkdir -p ${outputDir}
cd ${commonOutputPath}
[[ "${runpath}" != "${outputDir}" ]] && rm -rf ${runpath}
return 0
-}
+)
submit()
{
waitForJOBID=${4}
command=${5}
shift 5
- commandArgs=("$@")
+ local commandArgs=("$@")
#add quote strings around the extra arguments
for ((i=0; i<${#commandArgs[@]}; i++)); do
}
goWaitForOutput()
-{
+(
umask 0002
[[ $# -lt 3 ]] && echo "goWaitForOutput() wrong number of arguments, exiting.." && return 1
echo searchPath=${1}
done
echo "DONE! exiting..."
return 0
-}
+)
mergeSysLogs()
-{
+(
outputFile=${1}
shift
inputFiles="$@"
(( i++ ))
done < <(ls -1 ${inputFiles}) > ${outputFile}
return 0
-}
+)
goMakeMergedSummaryTree()
-{
+(
# create list of calibration entries
# takes no arguments, just run it in the base output
# directory with the following files in the working directory
aliroot -b -q "mergeTree.C" > mergeTrees.log
return $?
-}
+)
goMakeSummary()
-{
+(
#all the final stuff goes in here for ease of use:
# summary logs
# qa plot making
[[ -n ${MAILTO} ]] && cat ${log} | mail -s "benchmark ${productionID} done" ${MAILTO}
return 0
-}
+)
goMakeSummaryTree()
-{
+(
if [[ $# -lt 1 ]] ; then
return
fi
done
return 0
-}
+)
parseConfig()
{