-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Slurm sets CPU frequency correctly #47
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1df5134
Adding a test to confirm default CPU frequency set to 2GHz and that s…
c1e032d
Edits to comply with syle guide
66e923a
Edits to comply with style guide
cd233a9
updated quotes to meet syntax standard
df5652a
reducing number of prg env's used to reduce test duplication
33efa1e
Updated functions doc strings
JPRichings File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,53 @@ | ||
#!/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"] | ||
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"] | ||
executable = "./freq_print.sh" | ||
|
||
tags = {"production", "maintenance", "craype"} | ||
|
||
freq = 2250000 | ||
|
||
@run_before("run") | ||
def set_cpu_freq(self): | ||
"""Add slurm command line variable to job script to set frequency to 2.25Ghz""" | ||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.25GHz is not the default though, is it? I think the test and class descriptions should reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I caught a couple of other similar doc string errors and have updated them