Skip to content

Commit

Permalink
Add more full YAML examples
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundGoodman committed Feb 12, 2024
1 parent 96f27e9 commit 4f75cad
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 21 deletions.
28 changes: 20 additions & 8 deletions src/hpc_multibench/dsl_example.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Manually construct run configurations via the Python DSL interface."""
"""
Manually construct run configurations via the Python DSL interface.
#
# def get_cpp_reference_impl() -> RunConfiguration:
# """Build a run configuration for the reference implementation."""
# run.sbatch_config = {
# "ntasks-per-node": "1",
# "cpus-per-task": "1",
# "mem-per-cpu": "3700", # max on avon?
```python
from hpc_multibench.configuration import RunConfiguration
def get_cpp_reference_impl() -> RunConfiguration:
'''Build a run configuration for the reference implementation.'''
run = RunConfiguration("./test_HPCCG")
run.build_commands = ["make -j 8"]
run.sbatch_config = {
"nodes": "1",
"ntasks-per-node": "1",
"cpus-per-task": "1",
"mem-per-cpu": "3700", # max on avon?
}
run.module_loads = ["GCC/11.3.0"]
run.directory = Path("../0_cpp_versions/0_ref")
return run
```
"""
2 changes: 1 addition & 1 deletion src/hpc_multibench/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

def main() -> None: # pragma: no cover
"""Run the tool."""
yaml_path = Path("./testing_plan.yaml")
yaml_path = Path("./yaml_examples/cpp_rust_comp_plan.yaml")
benches = get_benches(yaml_path)
print(benches)
126 changes: 126 additions & 0 deletions yaml_examples/cpp_rust_comp_plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#defaults:
# "default name":
executables:
"cpp_reference":
sbatch_config:
"nodes": 1
"ntasks-per-node": 1
"cpus-per-task": 1
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
environment_variables: {}
directory: "../0_cpp_versions/0_ref"
build_commands:
- "make -j 8"
run_command: "./test_HPCCG"

"cpp_openmp":
sbatch_config:
"nodes": 1
"ntasks-per-node": 1
"cpus-per-task": 16
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
environment_variables:
"OMP_NUM_THREADS": 16
directory: "../0_cpp_versions/1_openmp"
build_commands:
- "make -j 8"
run_command: "./test_HPCCG"

"cpp_mpi":
sbatch_config:
"nodes": 2
"ntasks-per-node": 8
"cpus-per-task": 1
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
- "OpenMPI/4.1.4"
environment_variables: {}
directory: "../0_cpp_versions/2_mpi"
build_commands:
- "make -j 8"
run_command: "mpirun -n 2 ./test_HPCCG"

"cpp_hybrid":
sbatch_config:
"nodes": 2
"ntasks-per-node": 4
"cpus-per-task": 2
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
- "OpenMPI/4.1.4"
environment_variables:
"OMP_NUM_THREADS": 2
directory: "../0_cpp_versions/3_hybrid"
build_commands:
- "make -j 8"
run_command: "mpirun -n 2 ./test_HPCCG"

"rust_reference":
sbatch_config:
"nodes": 1
"ntasks-per-node": 1
"cpus-per-task": 1
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
- "Clang/13.0.1"
environment_variables: {}
directory: "../5_iterators"
build_commands:
- "cargo build --release"
run_command: "cargo run --release"

"rust_rayon":
sbatch_config:
"nodes": 1
"ntasks-per-node": 1
"cpus-per-task": 16
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
- "Clang/13.0.1"
environment_variables:
"OMP_NUM_THREADS": 16
directory: "../6_parallel"
build_commands:
- "cargo build --release"
run_command: "cargo run --release"

"rust_mpi":
sbatch_config:
"nodes": 2
"ntasks-per-node": 8
"cpus-per-task": 1
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
- "Clang/13.0.1"
- "OpenMPI/4.1.4"
environment_variables: {}
directory: "../6_mpi"
build_commands:
- "cargo build --release"
run_command: "mpirun -n 2 cargo run --release"

benches:
"cpp_rust_comp":
executables:
- "cpp_reference"
- "cpp_openmp"
# - "cpp_mpi"
# - "cpp_hybrid"
- "rust_reference"
# - "rust_rayon"
# - "rust_mpi"
matrix:
- args:
- "50 50 50"
- "100 100 100"
- environment_variables:
- OMP_NUM_THREADS: 8
25 changes: 13 additions & 12 deletions testing_plan.yaml → yaml_examples/testing_plan.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
#- defaults:
# - "default name":
#defaults:
# "default name":
executables:
"executable name":
sbatch_config:
"nodes": 1
"ntasks-per-node": 1
"cpus-per-task": "1"
"mem-per-cpu": "3700"
"cpus-per-task": 1
"mem-per-cpu": 3700
module_loads:
- "GCC/11.3.0"
environment_variables: {}
directory: "../0_cpp_versions/0_ref"
build_commands:
- "make -j 8"
run_command: "./test_HPCCG"

benches:
"bench name":
executables: ["executable name"]
matrix:
- args:
- "50 50 50"
- "100 100 100"
- environment_variables:
- OMP_NUM_THREADS: 8
"bench name":
executables: ["executable name"]
matrix:
- args:
- "50 50 50"
- "100 100 100"
- environment_variables:
- OMP_NUM_THREADS: 8

0 comments on commit 4f75cad

Please sign in to comment.