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

PerfMonVTune: Update python files and enable flake8

parent 04a44358
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,!38852PerformanceMonitoring: First batch of cmake, flake8, clean-up updates
......@@ -5,7 +5,7 @@ atlas_subdir( PerfMonVTune )
####
# VTune hack for the time-being
find_program( VTUNE_EXECUTABLE amplxe-cl )
find_program( VTUNE_EXECUTABLE vtune )
get_filename_component( VTUNE_DIR ${VTUNE_EXECUTABLE} PATH )
set( ITT_PREFIX ${VTUNE_DIR}/.. )
......@@ -22,6 +22,6 @@ atlas_add_component( PerfMonVTune
LINK_LIBRARIES GaudiKernel AthenaBaseComps AthenaKernel ${ITT_LIBRARY} ${CMAKE_DL_LIBS} )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
atlas_install_scripts( scripts/*.py )
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_scripts( scripts/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
import glob
import logging
import multiprocessing
import os
import subprocess
import sys
import uuid
# Setting logging options
fmt = '%(asctime)s :: %(levelname)-8s :: %(message)s'
......@@ -25,32 +21,32 @@ console.setFormatter(formatter)
logger.addHandler(console)
####
## Check Athena Setup
## Check Athena Setup
####
def checkAthenaSetup():
try:
a = subprocess.check_output(['athena','--version'])
a = subprocess.check_output(['athena','--version'])
logger.debug('Athena version information \n %s',a)
except:
except Exception:
logger.fatal('Athena is not setup!')
sys.exit(-1)
sys.exit(-1)
####
## Check VTune Setup
####
def checkVTuneSetup():
try:
a = subprocess.check_output(['amplxe-cl','--version'])
a = subprocess.check_output(['vtune','--version'])
logger.debug('VTune version information \n %s',a)
except:
except Exception:
logger.fatal('VTune is not setup!')
sys.exit(-1)
sys.exit(-1)
####
## AutoGen a jobOptions fragment
## AutoGen a jobOptions fragment
####
def generateJOFragment(fileName,firstEvent,lastEvent):
logger.info('Creating jOptions fragment %s', fileName)
logger.info('Creating jOptions fragment %s', fileName)
with open('{}'.format(fileName),'w') as f:
f.write('# Auto generated jobOptions fragment to setup Athena VTune profiler')
f.write('\ninclude(\'PerfMonVTune/VTuneProfileEventLoop_preInclude.py\')')
......@@ -122,11 +118,11 @@ def main():
checkAthenaSetup()
checkVTuneSetup()
# Perpare the JO fragment
# Perpare the JO fragment
joFragment = 'PerfMonVTune_autoSetup.py'
generateJOFragment(joFragment, options.start, options.stop)
generateJOFragment(joFragment, options.start, options.stop)
# Prepare the transformation command to execute
# Prepare the transformation command to execute
if not options.tf:
logger.fatal('The transformation command is empty, quitting...')
sys.exit(-1)
......@@ -139,7 +135,7 @@ def main():
args.extend(['--preInclude',joFragment])
# Run the command
cmd = ( 'amplxe-cl' +
cmd = ( 'vtune' +
' -collect ' + options.collect +
' -strategy ' + options.strategy +
' -start-paused -- ' )
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Set up the profiler service:
from AthenaCommon.AppMgr import ServiceMgr
from PerfMonVTune.PerfMonVTuneConf import VTuneProfilerService
......@@ -6,7 +8,7 @@ ServiceMgr += VTuneProfilerService("VTuneProfilerService")
ServiceMgr.VTuneProfilerService.ResumeEvent = 10
# Set up the profiler service as the first service to be created:
theApp.CreateSvc.insert( 0, "VTuneProfilerService/VTuneProfilerService" )
theApp.CreateSvc.insert( 0, "VTuneProfilerService/VTuneProfilerService" ) # noqa: F821
# Print a message with what happened:
from AthenaCommon.Logging import logging
......
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