-
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.
Adding a test to confirm default CPU frequency set to 2GHz and that s…
…lurm can be used to raise this to 2.25Ghz
- Loading branch information
JPRichings
committed
Sep 23, 2024
1 parent
518b122
commit 1df5134
Showing
2 changed files
with
59 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,56 @@ | ||
#!/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 CPUFreqTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that CPU frequency is set to 2GHz by default""" | ||
|
||
descr = "Checks whether SLURM_CPU_FREQ_REQ is set to 2GHz as default" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray", "PrgEnv-gnu", "PrgEnv-aocc"] | ||
#sourcesdir = None | ||
executable = "./freq_print.sh" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
freq = 2000000 | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU_CRAY_TARGET is set""" | ||
return sn.assert_found(f"SLURM_CPU_FREQ_REQ={self.freq}", self.stdout) | ||
|
||
|
||
|
||
|
||
@rfm.simple_test | ||
class CPUHighFreqTest(rfm.RunOnlyRegressionTest): | ||
"""Checks that CPU frequency is set to 2.25GHz by default""" | ||
|
||
descr = "Checks whether SLURM_CPU_FREQ_REQ is set to 2GHz as default" | ||
valid_systems = ["archer2:compute"] | ||
valid_prog_environs = ["PrgEnv-cray", "PrgEnv-gnu", "PrgEnv-aocc"] | ||
#sourcesdir = None | ||
executable = "./freq_print.sh" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
freq = 2250000 | ||
|
||
@run_before('run') | ||
def set_cpu_freq(self): | ||
self.job.launcher.options = ['--cpu-freq=2250000'] | ||
|
||
@sanity_function | ||
def assert_finished(self): | ||
"""Sanity check that CPU_CRAY_TARGET is set""" | ||
return sn.assert_found(f"SLURM_CPU_FREQ_REQ={self.freq}", self.stdout) |
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,3 @@ | ||
#!/bin/bash | ||
|
||
echo SLURM_CPU_FREQ_REQ=$SLURM_CPU_FREQ_REQ |