From c02ab8885456a022e9129c1c558a2463ed052b58 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 24 Feb 2022 22:18:25 +0100 Subject: [PATCH] Add 'CUDAService' category also when CUDA is disabled, but only if it does not exist yet --- HeterogeneousCore/CUDACore/python/ProcessAcceleratorCUDA.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HeterogeneousCore/CUDACore/python/ProcessAcceleratorCUDA.py b/HeterogeneousCore/CUDACore/python/ProcessAcceleratorCUDA.py index 19aca3fc6e4ce..a92d49f9014c8 100644 --- a/HeterogeneousCore/CUDACore/python/ProcessAcceleratorCUDA.py +++ b/HeterogeneousCore/CUDACore/python/ProcessAcceleratorCUDA.py @@ -19,9 +19,11 @@ def apply(self, process, accelerators): from HeterogeneousCore.CUDAServices.CUDAService_cfi import CUDAService process.add_(CUDAService) + if not hasattr(process.MessageLogger, "CUDAService"): + process.MessageLogger.CUDAService = cms.untracked.PSet() + if self._label in accelerators: process.CUDAService.enabled = True - process.MessageLogger.CUDAService = cms.untracked.PSet() else: process.CUDAService.enabled = False