Skip to content

Commit

Permalink
Merge pull request #27492 from adewit/fix-pede-eoscopy-mst
Browse files Browse the repository at this point in the history
TkAl Millepede: improve file copying and copy error reporting
  • Loading branch information
cmsbuild committed Jul 12, 2019
2 parents 302e068 + 240536e commit cdba05b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py
Expand Up @@ -58,6 +58,7 @@
insuffPriv = 0
quotaspace = 0
copyerr=0
ispede=0

kill_reason = None
pedeLogErrStr = ""
Expand Down Expand Up @@ -106,6 +107,8 @@
insuffPriv = 1
if re.search(re.compile('Give up doing',re.M), line):
copyerr = 1
if re.search(re.compile('Directory content before',re.M),line):
ispede = 1
# AP 05.11.2015 Extract cpu-time.
# STDOUT doesn't contain NCU anymore. Now KSI2K and HS06 seconds are displayed.
# The ncuFactor is calculated from few samples by comparing KSI2K seconds with
Expand Down Expand Up @@ -446,7 +449,8 @@
print(lib.JOBDIR[i],lib.JOBID[i],'Job not ended')
remark = 'job not ended'
okStatus = 'FAIL'
if copyerr == 1:
if copyerr == 1 and ispede!=1:
#Copy errors in pede job can occur when a nonexistent file is commented in alignment_merge.py but not in theScript.sh, and in that case is *not* a failure
print(lib.JOBDIR[i],lib.JOBID[i],'Copy to eos failed')
remark = 'copy to eos failed'
okStatus = 'FAIL'
Expand Down
Expand Up @@ -58,7 +58,7 @@ trap clean_up HUP INT TERM SEGV USR2 XCPU XFSZ IO
# a helper function to repeatedly try failing copy commands
untilSuccess () {
# trying "${1} ${2} ${3} > /dev/null" until success, if ${4} is a
# positive number run {1} with -f flag,
# positive number run {1} with -f flag and using --cksum md5,
# break after ${5} tries (with four arguments do up to 5 tries).
if [[ ${#} -lt 4 || ${#} -gt 5 ]]
then
Expand All @@ -76,7 +76,7 @@ untilSuccess () {

if [[ ${4} -gt 0 ]]
then
${1} -f ${2} ${3} > /dev/null
${1} -f --cksum md5 ${2} ${3} > /dev/null
else
${1} ${2} ${3} > /dev/null
fi
Expand All @@ -86,7 +86,7 @@ untilSuccess () {
then # ... but not until infinity!
if [[ ${4} -gt 0 ]]
then
echo ${0}: Give up doing \"${1} -f ${2} ${3} \> /dev/null\".
echo ${0}: Give up doing \"${1} -f --cksum md5 ${2} ${3} \> /dev/null\".
return 1
else
echo ${0}: Give up doing \"${1} ${2} ${3} \> /dev/null\".
Expand All @@ -96,9 +96,9 @@ untilSuccess () {
TRIES=$((${TRIES}+1))
if [[ ${4} -gt 0 ]]
then
echo ${0}: WARNING, problems with \"${1} -f ${2} ${3} \> /dev/null\", try again.
echo ${0}: WARNING, problems with \"${1} -f --cksum md5 ${2} ${3} \> /dev/null\", try again.
sleep $((${TRIES}*5)) # for before each wait a litte longer...
${1} -f ${2} ${3} > /dev/null
${1} -f --cksum md5 ${2} ${3} > /dev/null
else
echo ${0}: WARNING, problems with \"${1} ${2} ${3} \> /dev/null\", try again.
sleep $((${TRIES}*5)) # for before each wait a litte longer...
Expand All @@ -108,7 +108,7 @@ untilSuccess () {

if [[ ${4} -gt 0 ]]
then
echo successfully executed \"${1} -f ${2} ${3} \> /dev/null\"
echo successfully executed \"${1} -f --cksum md5 ${2} ${3} \> /dev/null\"
else
echo successfully executed \"${1} ${2} ${3} \> /dev/null\"
fi
Expand Down

0 comments on commit cdba05b

Please sign in to comment.