diff --git a/Control/PerformanceMonitoring/PerfMonVTune/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonVTune/CMakeLists.txt index 51ae73f5f861936e0c7e2a7917ea2067ad9f859b..dc7d818ad525a403513af328b408bcc36b8f8456 100644 --- a/Control/PerformanceMonitoring/PerfMonVTune/CMakeLists.txt +++ b/Control/PerformanceMonitoring/PerfMonVTune/CMakeLists.txt @@ -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} ) diff --git a/Control/PerformanceMonitoring/PerfMonVTune/scripts/vtune_athena.py b/Control/PerformanceMonitoring/PerfMonVTune/scripts/vtune_athena.py index 673ebba0b9e564aacc78f0115e49e96a46454b21..8306d0c464861f082f1907efa4e88bc77b91b09c 100755 --- a/Control/PerformanceMonitoring/PerfMonVTune/scripts/vtune_athena.py +++ b/Control/PerformanceMonitoring/PerfMonVTune/scripts/vtune_athena.py @@ -1,14 +1,10 @@ -#!/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 -- ' ) diff --git a/Control/PerformanceMonitoring/PerfMonVTune/share/VTuneProfileEventLoop_preInclude.py b/Control/PerformanceMonitoring/PerfMonVTune/share/VTuneProfileEventLoop_preInclude.py index 4240d9f37e01659bc1113164fa96764073f9a9d7..88d01d7a86a113218f92c88cb86ce75f7593ec37 100644 --- a/Control/PerformanceMonitoring/PerfMonVTune/share/VTuneProfileEventLoop_preInclude.py +++ b/Control/PerformanceMonitoring/PerfMonVTune/share/VTuneProfileEventLoop_preInclude.py @@ -1,3 +1,5 @@ +# 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