From 846548244b28011f51fc1f0286b404604af2621e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 29 Nov 2024 17:41:03 +0000 Subject: [PATCH] Add hack to make Intel profilers work on Archer2 --- benchmarks/modules/utils.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/benchmarks/modules/utils.py b/benchmarks/modules/utils.py index 9a4a5976..2094b5b6 100644 --- a/benchmarks/modules/utils.py +++ b/benchmarks/modules/utils.py @@ -306,8 +306,9 @@ def add_profiler(self): # Arguments to pass to the viewer viewer_args = '' if self.profiler == 'advisor-roofline': + pkg_spec = 'intel-oneapi-advisor' # Spack package providing the profiler - self.build_system.specs.append('intel-oneapi-advisor') + self.build_system.specs.append(pkg_spec) # Name of output directory output_path = 'advisor-roofline' # Prepend advisor call to the executable @@ -328,8 +329,9 @@ def add_profiler(self): viewer_cmd = 'nsys-ui' viewer_args = f'{self.outputdir}/{output_path}.nsys-rep' elif self.profiler == 'vtune': + pkg_spec = 'intel-oneapi-vtune' # Spack package providing the profiler - self.build_system.specs.append('intel-oneapi-vtune') + self.build_system.specs.append(pkg_spec) # Name of output directory output_path = 'vtune-profiling' # Prepend VTune call to the executable @@ -341,6 +343,20 @@ def add_profiler(self): else: raise CommandLineError(f'Unknown profiler {self.profiler}') + # Hack time! On ARCHER2 the home partition isn't mounted on compute + # nodes, but due to a longstanding upstream bug + # (), + # Intel tools want to *write* into the home directory at any cost. + # We trick them by setting the HOME env var to their installation + # directory. Note: we use `prerun_cmds` instead of `env_vars` so + # that we do this only right before running the benchmark command + # and not also before compilation, where `spack location` wouldn't + # even work. Let's hope nothing else relies on HOME being set to + # the actual home directory (also because it isn't accessible, you + # know). + if self.profiler in ('advisor-roofline', 'vtune') and self.current_system.name == 'archer2': + self.prerun_cmds.append(f'export HOME=$(spack -e {self.build_system.environment} location --install-dir {pkg_spec})') + if viewer_cmd: # Print to stdout the command to use for viewing the profiling # results.