Skip to content

Commit

Permalink
Merge pull request #16819 from hroskes/fix-preexisting-validation
Browse files Browse the repository at this point in the history
bugfix in all in one validation tool
  • Loading branch information
cmsbuild authored Jan 19, 2017
2 parents 1986902 + 08cfbf0 commit 599e5f5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def getCompares( self ):
knownSimpleOptions = ["levels", "dbOutput","moduleList","modulesToPlot","useDefaultRange","plotOnlyGlobal","plotPng",
"dx_min","dx_max","dy_min","dy_max","dz_min","dz_max","dr_min","dr_max","rdphi_min","rdphi_max",
"dalpha_min","dalpha_max","dbeta_min","dbeta_max","dgamma_min","dgamma_max",
"jobmode", "3DSubdetector1", "3Dubdetector2", "3DTranslationalScaleFactor"])
"jobmode", "3DSubdetector1", "3Dubdetector2", "3DTranslationalScaleFactor", "jobid"])
levels = self.get( section, "levels" )
dbOutput = self.get( section, "dbOutput" )
compares[section.split(":")[1]] = ( levels, dbOutput )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ def __init__(self, valName, alignment, config, valType,
self.filesToCompare = {}
self.config = config

defaults = {"jobmode": self.general["jobmode"],
defaults = {
"jobmode": self.general["jobmode"],
"cmssw": os.environ['CMSSW_BASE'],
"parallelJobs": "1"
"parallelJobs": "1",
"jobid": "",
}
defaults.update(addDefaults)
mandatories = []
Expand All @@ -47,6 +49,14 @@ def __init__(self, valName, alignment, config, valType,
+str(maximumNumberJobs)+" exceeded!!!")
raise AllInOneError(msg)

self.jobid = self.general["jobid"]
if self.jobid:
try: #make sure it's actually a valid jobid
output = getCommandOutput2("bjobs %(jobid)s 2>&1"%self.general)
if "is not found" in output: raise RuntimeError
except RuntimeError:
raise AllInOneError("%s is not a valid jobid.\nMaybe it finished already?"%self.jobid)

self.cmssw = self.general["cmssw"]
badcharacters = r"\'"
for character in badcharacters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, valName, config, valType,
self.config = config
self.filesToCompare = {}

defaults = {"title": self.name, "jobid": ""}
defaults = {"title": self.name}
defaults.update(addDefaults)
mandatories = ["file", "color", "style"]
mandatories += addMandatories
Expand All @@ -35,14 +35,6 @@ def __init__(self, valName, config, valType,
msg = "The characters '|', '\"', and ',' cannot be used in the alignment title!"
raise AllInOneError(msg)

self.jobid = self.general["jobid"]
if self.jobid:
try: #make sure it's actually a valid jobid
output = getCommandOutput2("bjobs %(jobid)s 2>&1"%self.general)
if "is not found" in output: raise RuntimeError
except RuntimeError:
raise AllInOneError("%s is not a valid jobid.\nMaybe it finished already?"%self.jobid)

self.filesToCompare[GenericValidationData.defaultReferenceName] = \
self.general["file"]

Expand Down
3 changes: 3 additions & 0 deletions Alignment/OfflineValidation/scripts/validateAlignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def runJob( self ):
log = "> " + self.validation.name + " is already validated."
print log
return log
else:
if self.validation.jobid:
print "jobid {} will be ignored, since the validation {} is not preexisting".format(self.validation.jobid, self.validation.name)

general = self.__config.getGeneral()
log = ""
Expand Down

0 comments on commit 599e5f5

Please sign in to comment.