Skip to content
Snippets Groups Projects
Commit 1cebe734 authored by amete's avatar amete
Browse files

Short-term workaround for missing psutil in LCG 97a_ATLAS_1

parent 8a4e7d77
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!34922PerfMonComps: Short-term workaround for missing psutil in LCG 97a_ATLAS_1
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
from AthenaCommon.Logging import logging from AthenaCommon.Logging import logging
from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.ConcurrencyFlags import jobproperties as jp from AthenaCommon.ConcurrencyFlags import jobproperties as jp
import os,psutil import os
log = logging.getLogger("PerfMonMT") log = logging.getLogger("PerfMonMT")
log.info("Setting up PerfMonMT...") log.info("Setting up PerfMonMT...")
...@@ -16,7 +16,13 @@ if not hasattr(svcMgr, 'PerfMonMTSvc'): ...@@ -16,7 +16,13 @@ if not hasattr(svcMgr, 'PerfMonMTSvc'):
from PerfMonComps.MTJobOptCfg import PerfMonMTSvc from PerfMonComps.MTJobOptCfg import PerfMonMTSvc
svcMgr += PerfMonMTSvc("PerfMonMTSvc") svcMgr += PerfMonMTSvc("PerfMonMTSvc")
# Set the job start time # Set the job start time
svcMgr.PerfMonMTSvc.wallTimeOffset = psutil.Process(os.getpid()).create_time() * 1000 # Get the job start time in ms try:
import psutil
svcMgr.PerfMonMTSvc.wallTimeOffset = psutil.Process(os.getpid()).create_time() * 1000 # Get the job start time in ms
except Exception:
log.warning("Cannot import psutil, wall-time measurements will be biased due to biased offset")
import time
svcMgr.PerfMonMTSvc.wallTimeOffset = time.time() * 1000 # Get the current time in ms as a substitute
# Set number of threads/slots # Set number of threads/slots
svcMgr.PerfMonMTSvc.numberOfThreads = max(1,jp.ConcurrencyFlags.NumThreads()) svcMgr.PerfMonMTSvc.numberOfThreads = max(1,jp.ConcurrencyFlags.NumThreads())
svcMgr.PerfMonMTSvc.numberOfSlots = max(1,jp.ConcurrencyFlags.NumConcurrentEvents()) svcMgr.PerfMonMTSvc.numberOfSlots = max(1,jp.ConcurrencyFlags.NumConcurrentEvents())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment