Skip to content

Commit

Permalink
Merge pull request #19825 from hroskes/eos-client-alignment-validation
Browse files Browse the repository at this point in the history
fix eos in alignment validation
  • Loading branch information
cmsbuild committed Aug 4, 2017
2 parents 95a3822 + b16c5c2 commit c5c56e0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@
export LSFWORKDIR=`pwd -P`
echo LSF working directory is $LSFWORKDIR
source /afs/cern.ch/cms/caf/setup.sh
eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
export X509_USER_PROXY=.oO[scriptsdir]Oo./.user_proxy
cd .oO[CMSSW_BASE]Oo./src
export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo.
eval `scramv1 ru -sh`
#rfmkdir -p .oO[datadir]Oo. &>! /dev/null
#remove possible result file from previous runs
previous_results=$($eos ls /store/caf/user/$USER/.oO[eosdir]Oo.)
previous_results=$(eos ls /store/caf/user/$USER/.oO[eosdir]Oo.)
for file in ${previous_results}
do
if [ ${file} = /store/caf/user/$USER/.oO[eosdir]Oo./.oO[outputFile]Oo. ]
Expand Down Expand Up @@ -99,7 +98,7 @@
find . -maxdepth 1 -name "LOGFILE*.oO[alignmentName]Oo.*" -print | xargs -I {} bash -c "rfcp {} .oO[logdir]Oo."
#copy root files to eos
$eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo.
eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo.
if [ .oO[parallelJobs]Oo. -eq 1 ]
then
root_files=$(ls --color=never -d *.oO[alignmentName]Oo.*.root)
Expand Down Expand Up @@ -218,7 +217,6 @@
######################################################################
mergeTemplate="""
#!/bin/bash
eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
CWD=`pwd -P`
cd .oO[CMSSW_BASE]Oo./src
export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo.
Expand All @@ -239,7 +237,7 @@
###############################################################################
# download root files from eos
root_files=$($eos ls /store/caf/user/$USER/.oO[eosdir]Oo. \
root_files=$(eos ls /store/caf/user/$USER/.oO[eosdir]Oo. \
| grep ".root$" | grep -v "result.root$")
#for file in ${root_files}
#do
Expand Down Expand Up @@ -285,7 +283,7 @@
compareAlignmentsExecution="""
#merge for .oO[validationId]Oo. if it does not exist or is not up-to-date
echo -e "\n\nComparing validations"
$eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./
eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./
cp .oO[Alignment/OfflineValidation]Oo./scripts/compareFileAges.C .
root -x -q -b -l "compareFileAges.C(\\\"root://eoscms.cern.ch//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./.oO[validationId]Oo._result.root\\\", \\\".oO[compareStringsPlain]Oo.\\\")"
comparisonNeeded=${?}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
PVValidationScriptTemplate="""
#!/bin/bash
source /afs/cern.ch/cms/caf/setup.sh
eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
echo -----------------------
echo Job started at `date`
Expand Down Expand Up @@ -211,7 +210,7 @@
ls -lh .
$eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./plots/
eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./plots/
for RootOutputFile in $(ls *root )
do
xrdcp -f ${RootOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
zMuMuScriptTemplate="""
#!/bin/bash
source /afs/cern.ch/cms/caf/setup.sh
eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
echo -----------------------
echo Job started at `date`
Expand Down Expand Up @@ -249,7 +248,7 @@
if [[ .oO[zmumureference]Oo. == *store* ]]; then xrdcp -f .oO[zmumureference]Oo. BiasCheck_Reference.root; else ln -fs .oO[zmumureference]Oo. ./BiasCheck_Reference.root; fi
root -q -b -l MultiHistoOverlap_.oO[resonance]Oo..C
$eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./plots/
eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./plots/
for RootOutputFile in $(ls *root )
do
xrdcp -f ${RootOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./
Expand Down
2 changes: 1 addition & 1 deletion Alignment/OfflineValidation/scripts/validateAlignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def createMergeScript( path, validations ):
for f in validation.getRepMap()["outputFiles"]:
longName = os.path.join("/store/caf/user/$USER/",
validation.getRepMap()["eosdir"], f)
repMap["rmUnmerged"] += " $eos rm "+longName+"\n"
repMap["rmUnmerged"] += " eos rm "+longName+"\n"
repMap["rmUnmerged"] += ("else\n"
" echo -e \\n\"WARNING: Merging failed, unmerged"
" files won't be deleted.\\n"
Expand Down
10 changes: 4 additions & 6 deletions Alignment/OfflineValidation/test/PVValidationSubmitter.csh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ set inputsource=$1
set taskname=$2
set options=$3

set eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select'

echo "Submitting validation for file $inputsource with $options in task $taskname"

source /afs/cern.ch/cms/caf/setup.csh
Expand Down Expand Up @@ -90,22 +88,22 @@ if(${options} != "--dryRun") then
echo "Content of working directory is: "
\ls -lrt

set reply=`${eos} find -d /store/caf/user/$USER/Alignment/PVValidation/${taskname}`
set reply=`eos find -d /store/caf/user/$USER/Alignment/PVValidation/${taskname}`
set word=`echo $reply |awk '{split($0,a," "); print a[1]}'`

if(${word} == "") then
echo "Creating folder $taskname"
${eos} mkdir /store/caf/user/$USER/Alignment/PVValidation/${taskname}
eos mkdir /store/caf/user/$USER/Alignment/PVValidation/${taskname}
else
echo "Sorry /store/caf/user/$USER/Alignment/PVValidation/${taskname} already exists!"
endif

if (! -d ${CMSSW_DIR}/test/PVValResults) then
mkdir ${CMSSW_DIR}/PVValResults
${eos} cp -f ${outfile} /store/caf/user/$USER/Alignment/PVValidation/${taskname}
eos cp -f ${outfile} /store/caf/user/$USER/Alignment/PVValidation/${taskname}
cp ${jobname}.out ${CMSSW_DIR}/PVValResults
else
${eos} cp -f ${outfile} /store/caf/user/$USER/Alignment/PVValidation/${taskname}
eos cp -f ${outfile} /store/caf/user/$USER/Alignment/PVValidation/${taskname}
cp ${jobname}.out ${CMSSW_DIR}/PVValResults
endif
endif
Expand Down
6 changes: 2 additions & 4 deletions Alignment/OfflineValidation/test/submitAllJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
CopyRights += '# December 2015 #\n'
CopyRights += '##################################\n'

eos = '/afs/cern.ch/project/eos/installation/cms/bin/eos.select'

##############################################
def drawProgressBar(percent, barLen=40):
##############################################
Expand Down Expand Up @@ -151,12 +149,12 @@ def mkdir_eos(out_path):
newpath=os.path.join(newpath,dir)
# do not issue mkdir from very top of the tree
if newpath.find('test_out') > 0:
p = subprocess.Popen([eos+" mkdir",newpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(["eos", "mkdir", newpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = p.communicate()
p.wait()

# now check that the directory exists
p = subprocess.Popen([eos+"ls",out_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(["eos", "ls", out_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = p.communicate()
p.wait()
if p.returncode !=0:
Expand Down

0 comments on commit c5c56e0

Please sign in to comment.