diff --git a/Configuration/PyReleaseValidation/python/MatrixInjector.py b/Configuration/PyReleaseValidation/python/MatrixInjector.py index 70fc045a28e41..1f68b24c6f099 100644 --- a/Configuration/PyReleaseValidation/python/MatrixInjector.py +++ b/Configuration/PyReleaseValidation/python/MatrixInjector.py @@ -70,9 +70,12 @@ def __init__(self,opt,mode='init',options=''): #################################### # require self.RequiresGPU = opt.RequiresGPU - if self.RequiresGPU not in (0,1,2): - print('RequiresGPU should be 0,1,2. Now, reset to 0.') - self.RequiresGPU = 0 #reset if number is not 0,1,2 + if self.RequiresGPU not in ('forbidden','optional','required'): + print('RequiresGPU must be forbidden, optional, required. Now, set to forbidden.') + self.RequiresGPU = 'forbidden' + if self.RequiresGPU == 'optional': + print('Optional GPU is turned off for RelVals. Now, changing it to forbidden') + self.RequiresGPU = 'forbidden' self.GPUMemory = opt.GPUMemory self.CUDACapabilities = opt.CUDACapabilities.split(',') self.CUDARuntime = opt.CUDARuntime @@ -171,7 +174,8 @@ def __init__(self,opt,mode='init',options=''): "nowmIO": {}, "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified "EventStreams": self.numberOfStreams, - "KeepOutput" : False + "KeepOutput" : False, + "GPUParams": None } self.defaultInput={ "TaskName" : "DigiHLT", #Task Name @@ -183,7 +187,8 @@ def __init__(self,opt,mode='init',options=''): "nowmIO": {}, "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified "EventStreams": self.numberOfStreams, - "KeepOutput" : False + "KeepOutput" : False, + "GPUParams": None } self.defaultTask={ "TaskName" : None, #Task Name @@ -197,8 +202,8 @@ def __init__(self,opt,mode='init',options=''): "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified "EventStreams": self.numberOfStreams, "KeepOutput" : False, - "RequiresGPU" : 0, - "GPUParams": {None} + "RequiresGPU" : None, + "GPUParams": None } self.defaultGPUParams={ "GPUMemory": self.GPUMemory, @@ -404,7 +409,6 @@ def prepare(self, mReader, directories, mode='init'): thisLabel+='_FastSim' if 'lhe' in s[2][index] in s[2][index]: chainDict['nowmTasklist'][-1]['LheInputFiles'] =True - elif nextHasDSInput: chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultInput)) try: @@ -434,6 +438,9 @@ def prepare(self, mReader, directories, mode='init'): if setPrimaryDs: chainDict['nowmTasklist'][-1]['PrimaryDataset']=setPrimaryDs nextHasDSInput=None + if 'GPU' in step and self.RequiresGPU == 'required': + chainDict['nowmTasklist'][-1]['RequiresGPU'] = self.RequiresGPU + chainDict['nowmTasklist'][-1]['GPUParams']=self.defaultGPUParams else: #not first step and no inputDS chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultTask)) @@ -446,7 +453,7 @@ def prepare(self, mReader, directories, mode='init'): chainDict['nowmTasklist'][-1]['LumisPerJob']=splitForThisWf if step in wmsplit: chainDict['nowmTasklist'][-1]['LumisPerJob']=wmsplit[step] - if 'GPU' in step and (self.RequiresGPU == 1 or self.RequiresGPU == 2): + if 'GPU' in step and self.RequiresGPU == 'required': chainDict['nowmTasklist'][-1]['RequiresGPU'] = self.RequiresGPU chainDict['nowmTasklist'][-1]['GPUParams']=self.defaultGPUParams diff --git a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py index 7a52f2768af48..4781bd5d26995 100755 --- a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py +++ b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py @@ -333,22 +333,22 @@ def runSelected(opt): action='store') parser.add_option('--RequiresGPU', - help='if GPU is reuired or not: 0 = Not (default), 1 = can use if available, 2 = must use. Default = 0.', + help='if GPU is reuired or not: forbidden (default, CPU-only), optional, required', dest='RequiresGPU', default=0) parser.add_option('--GPUMemory', - help='to specify GPU memory. Default = 8000 MB (for RequiresGPU=2).', + help='to specify GPU memory. Default = 8000 MB (for RequiresGPU = required).', dest='GPUMemory', default='8000') parser.add_option('--CUDACapabilities', - help='to specify CUDA capabilities. Default = 7.5 (for RequiresGPU=2).', + help='to specify CUDA capabilities. Default = 7.5 (for RequiresGPU = required).', dest='CUDACapabilities', default='7.5') parser.add_option('--CUDARuntime', - help='to specify CUDA runtime. Default = 11.2 (for RequiresGPU=2).', + help='to specify CUDA runtime. Default = 11.2 (for RequiresGPU= required).', dest='CUDARuntime', default='11.2') @@ -436,7 +436,6 @@ def stepOrIndex(s): if opt.numberEventsInLuminosityBlock: opt.numberEventsInLuminosityBlock=int(opt.numberEventsInLuminosityBlock) if opt.memoryOffset: opt.memoryOffset=int(opt.memoryOffset) if opt.memPerCore: opt.memPerCore=int(opt.memPerCore) - if opt.RequiresGPU: opt.RequiresGPU=int(opt.RequiresGPU) if opt.wmcontrol: performInjectionOptionTest(opt)