Skip to content

Commit

Permalink
Replace JSON configuration with YAML file (#15)
Browse files Browse the repository at this point in the history
Switch from JSON to YAML configuration for improved readability (#15)

This change replaces the JSON configuration files with YAML files, which
are more human-readable. This update is related to issue #13.
  • Loading branch information
rodrigo-ceccato authored Jul 30, 2024
1 parent c38adb5 commit 88c20fb
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 83 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ source .venv/bin/activate

## Running
```sh
python3 spinner/main.py -b F -r T -c spinner/bench_settings.json -e F
python3 spinner/main.py -b F -r T -c spinner/bench_settings.yaml -e F

python3 spinner/main.py -g T -s 1000000000 -o random_numbers.bin -r T -c spinner/bench_settings.json -e T -h "sdumont[6174-6177]"
python3 spinner/main.py -g T -s 1000000000 -o random_numbers.bin -r T -c spinner/bench_settings.yaml -e T -h "sdumont[6174-6177]"
```

# Mandatory development policy
Expand Down
79 changes: 0 additions & 79 deletions spinner/bench_settings.json

This file was deleted.

51 changes: 51 additions & 0 deletions spinner/bench_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
metadata:
description: I/O benchmarks
version: "1.0"
runs: 2
timeout: 600
input_file: random_numbers.bin
omp-tasks:
bench_path: benchs/omp-tasks
env:
CC: gcc
CXX: g++
build_instructions:
- command: mkdir -p build
cwd: "{{bench_path}}"
- command: cmake .. -DCMAKE_BUILD_TYPE=Release
cwd: "{{bench_path}}/build"
- command: make -j
cwd: "{{bench_path}}/build"
command:
template: "{{bench_path}}/build/lustre1 -t {{tasks}} -r {{read_step}} -f {{input_file}}"
mpi-io:
bench_path: benchs/mpi-io
env:
CC: mpicc
CXX: mpicxx
build_instructions:
- command: mkdir -p build
cwd: "{{bench_path}}"
- command: cmake .. -DCMAKE_BUILD_TYPE=Release
cwd: "{{bench_path}}/build"
- command: make -j
cwd: "{{bench_path}}/build"
command:
template: "mpirun -np {{procs}} -ppn {{ppn}} -hosts {{hosts}} {{bench_path}}/build/mpi_io_count {{input_file}} {{read_step}}"

omp-tasks:
tasks:
- 1
- 2
read_step:
- 100
- 101

mpi-io:
nodes:
- 1
procs:
- 1
- 2
read_step:
- 100
4 changes: 2 additions & 2 deletions spinner/runner/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from rich.progress import Progress
from rich import print as rprint
import pandas as pd
import json
import yaml


def run_benchmarks(config, hosts):
"""
Generate execution matrix from input configuration and run all benchmarks.
"""
bench_config = json.load(open(config))
bench_config = yaml.safe_load(open(config))
bench_metadata = bench_config["metadata"]
bench_metadata["start_timestamp"] = str(pd.Timestamp.now())

Expand Down

0 comments on commit 88c20fb

Please sign in to comment.