-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some refactoring of duplicate content
- Loading branch information
Showing
7 changed files
with
86 additions
and
116 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
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
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
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
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,28 @@ | ||
=== "Cosma" | ||
|
||
This tutorial is run on the [Cosma](https://cosma.readthedocs.io/en/latest/) supercomputer. | ||
It should be straightforward to run on a different platform, the requirements are `gcc`, `git` and `python3`. (for the later parts you also need `make`, `autotools`, `cmake` and `spack`). | ||
Before proceeding to install ReFrame, we recommend creating a python virtual environment to avoid clashes with other installed python packages. | ||
First load a newer python module. | ||
```bash | ||
module swap python/3.10.12 | ||
``` | ||
|
||
=== "ARCHER2" | ||
|
||
This tutorial is run on ARCHER2, you should have signed up for a training account before starting. | ||
It can be ran on other HPC systems with a batch scheduler but will require making some changes to the config. | ||
Before proceeding to install ReFrame, we recommend creating a python virtual environment to avoid clashes with other installed python packages. | ||
First load the system python module. | ||
```bash | ||
module load cray-python | ||
``` | ||
|
||
Then create an environment and activate it with | ||
|
||
```bash | ||
python3 -m venv reframe_tutorial | ||
source reframe_tutorial/bin/activate | ||
``` | ||
|
||
You will have to activate the environment each time you login. To deactivate the environment run `deactivate`. |
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,39 @@ | ||
### Add Sanity Check | ||
|
||
The rest of the benchmark follows the [Writing a Performance Test ReFrame Tutorial](https://reframe-hpc.readthedocs.io/en/latest/tutorial_basics.html#writing-a-performance-test). First we need a sanity check that ensures the benchmark ran successfully. A function decorated with the `@sanity_function` decorator is used by ReFrame to check that the test ran successfully. The sanity function can perform a number of checks, in this case we want to match a line of the expected standard output. | ||
|
||
```python | ||
@sanity_function | ||
def validate_solution(self): | ||
return sn.assert_found(r'Solution Validates', self.stdout) | ||
``` | ||
|
||
---- | ||
|
||
### Add Performance Pattern Check | ||
|
||
To record the performance of the benchmark, ReFrame should extract a figure of merit from the output of the test. A function decorated with the `@performance_function` decorator extracts or computes a performance metric from the test’s output. | ||
|
||
> In this example, we extract four performance variables, namely the memory bandwidth values for each of the “Copy”, “Scale”, “Add” and “Triad” sub-benchmarks of STREAM, where each of the performance functions use the [`extractsingle()`](https://reframe-hpc.readthedocs.io/en/latest/deferrable_functions_reference.html#reframe.utility.sanity.extractsingle) utility function. For each of the sub-benchmarks we extract the “Best Rate MB/s” column of the output (see below) and we convert that to a float. | ||
---- | ||
|
||
### Performance Pattern Check | ||
|
||
```python | ||
@performance_function('MB/s', perf_key='Copy') | ||
def extract_copy_perf(self): | ||
return sn.extractsingle(r'Copy:\s+(\S+)\s+.*', self.stdout, 1, float) | ||
|
||
@performance_function('MB/s', perf_key='Scale') | ||
def extract_scale_perf(self): | ||
return sn.extractsingle(r'Scale:\s+(\S+)\s+.*', self.stdout, 1, float) | ||
|
||
@performance_function('MB/s', perf_key='Add') | ||
def extract_add_perf(self): | ||
return sn.extractsingle(r'Add:\s+(\S+)\s+.*', self.stdout, 1, float) | ||
|
||
@performance_function('MB/s', perf_key='Triad') | ||
def extract_triad_perf(self): | ||
return sn.extractsingle(r'Triad:\s+(\S+)\s+.*', self.stdout, 1, float) | ||
``` |
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