Skip to content

Commit 0d467cd

Browse files
authored
Merge pull request #4 from powerapi-ng/add-perf-benchmarking
Adds perf alone, hwpc alone and perf+hwpc event scrapping over synthetic runs of stress-ng
2 parents 1abb7be + 1b24378 commit 0d467cd

File tree

73 files changed

+2208
-867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2208
-867
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
G5K_USERNAME="TO_BE_DEFINED"
2+
G5K_PASSWORD="TO_BE_DEFINED"
3+
DOCKER_HUB_USERNAME="TO_BE_DEFINED"
4+
DOCKER_HUB_TOKEN="TO_BE_DEFINED"

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/logs.d/**/*
2+
.env
3+
/Cargo.lock
4+
/tasks.d/**/*
5+
/jobs.d/**/*
6+
/results.d/**/*
7+
/scripts.d/**/*
8+
/inventories.d/**/*
9+
/backup/**/*
10+
/test_results/**/*
11+
/jobs.yaml
12+
/menage.sh
13+
14+
15+
# Added by cargo
16+
17+
/target

Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "benchmarking"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
log = "0.4"
8+
env_logger = "0.10"
9+
chrono = "0.4.38"
10+
reqwest = { version = "0.12.9", features = ["json"] }
11+
serde = { version = "1.0.214", features = ["derive"] }
12+
thiserror = "1.0.65"
13+
serde_json = "1.0.132"
14+
openssl = { version = "0.10.68", features = ["vendored"] }
15+
dotenv = "0.15.0"
16+
tokio = { version = "1.41.0", features = ["full"] }
17+
mockito = "1.5.0"
18+
ssh2 = "0.9.4"
19+
serde_yaml = "0.9.34"
20+
openssh = { version = "0.11.2", features = ["native-mux"] }
21+
openssh-sftp-client = { version = "0.15.1", features = ["openssh"] }
22+
rand = "0.8.5"
23+
regex = "1.11.1"
24+
askama = { version = "0.12.1", features = ["serde", "serde-json", "serde-yaml", "serde_json", "serde_yaml"] }
25+
derive_more = { version = "1.0.0", features = ["display"] }
26+
flate2 = { version = "1.0.34", features = ["zlib"] }
27+
tar = "0.4.43"
28+
bytes = "1.8.0"
29+
subprocess = "0.2.9"

HYPOTHESES.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Hypotheses
2+
3+
This document tracks hypotheses to be validated in the benchmarking process, organized by **Tested** and **To Be Tested** sections. Each hypothesis includes the rationale and expected outcome.
4+
5+
## To Be Tested
6+
7+
1. **Statistical Sufficiency of 30 Iterations**
8+
- **Hypothesis**: Running 30 iterations per measurement will yield sufficient data for statistical analysis of energy results, ensuring reliability in evaluating variability.
9+
- **Expected Outcome**: Consistent patterns emerge within 30 iterations, showing clear trends in energy measurements without requiring additional runs.
10+
- **Rationale**: 30 iterations are often a threshold for normal distribution in statistical sampling.
11+
12+
2. **Validity of `NB_CPU_OPS` Values `[10^7, 10^8, 10^9]`**
13+
- **Hypothesis**: Using `NB_CPU_OPS` values of `[10^7, 10^8, 10^9]` allows all measurements to complete within the allocated G5K reservation time.
14+
- **Expected Outcome**: These values will yield consistent, complete data sets without running into time constraints.
15+
- **Rationale**: Choosing `NB_CPU_OPS` values that finish within the reservation time maximizes efficiency and resource usage while keeping results comprehensive.
16+
17+
3. **Post-Mortem Mode Accuracy for SmartWatts**
18+
- **Hypothesis**: Running SmartWatts in post-mortem mode will still produce accurate energy measurement results, suitable for evaluating the precision of PowerAPI tools.
19+
- **Expected Outcome**: SmartWatts post-mortem results closely match real-time energy data.
20+
- **Rationale**: Save another set of stress-ng would be intesting. No proof of difference in precision have been demonstrated between CSV and MongoDB output mode for HWPC Sensor.
21+
22+
4. **Feasibility of Storing Results on NFS**
23+
- **Hypothesis**: The average size of each aggregated results file will be under 3.32 MB, allowing for efficient storage within the 25GB per site NFS limit.
24+
- **Expected Outcome**: Average file size per node stays within the 3.32 MB limit, avoiding storage issues.
25+
- **Rationale**: Storage constraints on NFS necessitate a size estimation for scalability.
26+
27+
5. **Parallel Execution of HWPC Sensor & Perf**
28+
- **Hypothesis**: HWPC Sensor and `perf` measurements can run concurrently on the same `stress-ng` process without interference or measurement degradation.
29+
- **Expected Outcome**: Both HWPC and `perf` output valid data when run in parallel, with no notable interference.
30+
- **Rationale**: Efficient benchmarking may require concurrent measurements to maximize data collection without extending reservation times.
31+
32+
---
33+
34+
## Tested Hypotheses

README.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
1+
# PowerAPI Framework Benchmarks
2+
3+
Here’s how the **"What it does"** section could look based on the content you provided:
4+
5+
---
6+
7+
## What It Does
8+
9+
This repository contains the source code for generating and running benchmarks for the **PowerAPI Framework**. These benchmarks are designed to adapt to the configuration and architecture of underlying nodes in the **Grid5000** infrastructure.
10+
11+
### Key Processes:
12+
13+
1. **Gather Node Information**: The benchmarks start by scraping the Grid5000 API to collect details about all available nodes.
14+
2. **Reuse Existing Job List (Optional)**: If a `jobs.yaml` file exists, the tool can leverage it to initialize the job list.
15+
3. **Generate Bash Scripts**: For each filtered node, a custom bash script is generated using templates located in the `/templates` directory.
16+
4. **Submit Jobs via OAR**: The generated scripts are submitted to corresponding nodes through SSH using **OAR**, ensuring that no more than `N` jobs are simultaneously active.
17+
5. **Monitor and Collect Results**:
18+
- The status of each submitted job is tracked until it completes (either successfully or in a failed state).
19+
- Upon completion, **rsync** is used to retrieve the results files locally. If the retrieval fails, the job’s state is marked as `UnknownState` for manual review.
20+
6. **Store Results**: Once all filtered nodes have completed their benchmark jobs, the benchmarking process concludes, and all result files are stored in the `/results.d` directory.
21+
22+
This automated workflow ensures efficient and scalable benchmarking tailored to the dynamic nature of the Grid5000 environment.
23+
24+
25+
## Why it exists.
26+
27+
This benchmarks aim at measuring the variability introduced by the PowerAPI framework over the RAPL interface.
28+
29+
## Who it’s for.
30+
Currently, this work remains internal for PowerAPI staff to study the variability of the PowerAPI framework along its development.
31+
32+
33+
## Installation
34+
35+
To use this repository, you need to clone it locally, ensure you have Cargo installed, and then compile and run the project. Follow the steps below:
36+
37+
### Prerequisites
38+
39+
Before proceeding, make sure your system meets the following requirements:
40+
41+
- **Rust and Cargo**: Install Rust (which includes Cargo, Rust’s package manager and build system). If Rust is not installed, follow the instructions below:
42+
1. Download and install Rust by running:
43+
```bash
44+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
45+
```
46+
2. Follow the on-screen instructions to complete the installation.
47+
3. Add Cargo to your PATH (usually done by Rust installer automatically). Restart your terminal if necessary.
48+
49+
- **Dependencies**:
50+
- A working installation of **OAR** on your Grid5000 node (or appropriate access).
51+
- SSH access configured to interact with the Grid5000 nodes (for example, `ssh rennes` ran locally shall connect you to the rennes' frontend).
52+
53+
### Clone the Repository
54+
55+
Clone this repository to your local machine:
56+
57+
```bash
58+
git clone https://github.com/powerapi-ng/benchmarking.git
59+
cd benchmarking
60+
```
61+
62+
### Build the Project
63+
64+
Compile the project using Cargo:
65+
66+
```bash
67+
cargo build --release
68+
```
69+
70+
This will produce an optimized executable located in the `target/release/` directory.
71+
72+
### Run the Project
73+
74+
Execute the compiled program:
75+
76+
```bash
77+
./target/release/benchmarking
78+
```
79+
80+
181
# Tips G5k
282
383
- To execute a script on a given list of servers (chifflot) during 4 hours max:
@@ -20,4 +100,3 @@ g5k-setup-docker -t
20100
21101
- To check reservations at Lille site (with authentification):
22102
23-
https://intranet.grid5000.fr/oar/Lille/monika.cgi

0 commit comments

Comments
 (0)