-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from JPRichings/202409_Counters
New tests to check pm counters are accessible and reporting
- Loading branch information
Showing
1 changed file
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
#!/usr/bin/env python3 | ||
"""Reframe test to check that CPU target environment variable is correctly set""" | ||
|
||
# Based on work from: | ||
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) | ||
# ReFrame Project Developers. See the top-level LICENSE file for details. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
import reframe as rfm | ||
import reframe.utility.sanity as sn | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersEnergyTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the Node Energy counter is reporting""" | ||
|
||
descr = "Checks whether the node energy pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/energy" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that Energy is reported""" | ||
return sn.assert_found(r"\S+ J \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersPowerTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the Node Power counter is reporting""" | ||
|
||
descr = "Checks whether the node power pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/power" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that Power is reporting""" | ||
return sn.assert_found(r"\S+ W \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersCPUEnergyTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the CPU Energy counter is reporting""" | ||
|
||
descr = "Checks whether the cpu energy pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/cpu_energy" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU Energy is reporting""" | ||
return sn.assert_found(r"\S+ J \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersCPUPowerTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the CPU Power counter is reporting""" | ||
|
||
descr = "Checks whether the cpu power pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/cpu_power" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU Power is reporting""" | ||
return sn.assert_found(r"\S+ W \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersMemoryEnergyTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the Memory Energy counter is reporting""" | ||
|
||
descr = "Checks whether the memory energy pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/memory_energy" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that Memory Energy is reporting""" | ||
return sn.assert_found(r"\S+ J \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersMemPowerTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the Memory Power counter is reporting""" | ||
|
||
descr = "Checks whether the memory power pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/memory_power" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that Memory Power is reporting""" | ||
return sn.assert_found(r"\S+ W \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersCPU0TempTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the CPU 0 Temperature counter is reporting""" | ||
|
||
descr = "Checks whether the cpu 0 temperature pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/cpu0_temp" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU 0 temperature is reporting""" | ||
return sn.assert_found(r"\S+ C \S+ us", self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class CrayCountersCPU1TempTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that the CPU 1 Temperature counter is reporting""" | ||
|
||
descr = "Checks whether the cpu 1 temperature pm counter is accessible and reporting" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray"] | ||
sourcesdir = None | ||
executable = "cat /sys/cray/pm_counters/cpu1_temp" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU 1 temperature is reporting""" | ||
return sn.assert_found(r"\S+ C \S+ us", self.stdout) |