Skip to content

Commit

Permalink
Make sure numberOfThreads is uint32 in the PSet (#5195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmascher authored Apr 17, 2023
1 parent 496afcf commit 2187dd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/python/CRABClient/JobType/CMSSWConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import pickle
import logging

from FWCore.ParameterSet.Types import uint32

from ServerUtilities import BOOTSTRAP_CFGFILE_DUMP

from CRABClient.ClientExceptions import ConfigurationException, EnvironmentException
Expand Down Expand Up @@ -271,6 +273,10 @@ def validateConfig(self):
#Assumes a default of 1 if the parameter is not specified
cfgNumCores = getattr(self.config.JobType, 'numCores', None)
numPSetCores = getattr(getattr(self.fullConfig.process, 'options', object), 'numberOfThreads', None)
if numPSetCores and not isinstance(numPSetCores, uint32):
msg = "The only accepted type for process.options.numberOfThreads is uint32. Please, change its type in the PSet."
msg += "See https://github.com/cms-sw/cmssw/issues/32070 for details"
return False, msg
if (cfgNumCores or 1) != (numPSetCores or 1):
if cfgNumCores == None:
msg = "You did not set config.JobType.numCores in the crab configuration file "
Expand Down

0 comments on commit 2187dd4

Please sign in to comment.