Skip to content

Commit

Permalink
Tweak the output configuration file schema and temp file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundGoodman committed Feb 25, 2024
1 parent dc7ca30 commit 69c2373
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/hpc_multibench/run_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ def sbatch_contents(self) -> str:
sbatch_file += f"#SBATCH --{key}={value}\n"
sbatch_file += f"#SBATCH --output={self.output_file}\n"

sbatch_file += "\necho '===== CONFIGURATION ====='\n"
if len(self.module_loads) > 0:
sbatch_file += "echo '=== MODULE LOADS ==='\n"
sbatch_file += "module purge\n"
sbatch_file += f"module load {' '.join(self.module_loads)}\n"

if len(self.environment_variables) > 0:
sbatch_file += "echo '=== ENVIRONMENT VARIABLES ==='\n"
for key, value in self.environment_variables.items():
sbatch_file += f"export {key}={value}\n"
sbatch_file += f"echo '{key}={value}'\n"

sbatch_file += "\necho '===== CONFIGURATION ====='\n"
sbatch_file += "echo '=== CPU ARCHITECTURE ==='\n"
sbatch_file += "lscpu\n"
sbatch_file += "echo '=== SLURM CONFIG ==='\n"
Expand Down Expand Up @@ -109,6 +113,7 @@ def run(self, dependencies: list[int] | None = None) -> int | None:

# Create and run the temporary sbatch file via slurm
with NamedTemporaryFile(
prefix=self.name,
suffix=".sbatch", dir=Path("./"), mode="w+"
) as sbatch_tmp:
sbatch_tmp.write(self.sbatch_contents)
Expand Down
9 changes: 3 additions & 6 deletions yaml_examples/kudu/simple_rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ run_configurations:

benches:
"serial":
enabled: False
run_configurations:
- "cpp-reference"
- "rust-reference"
Expand All @@ -68,7 +69,6 @@ benches:
- "100 100 100"
- "150 150 150"
- "200 200 200"
# - "250 250 250"
analysis:
metrics:
"Mesh x size": "nx: (\\d+)"
Expand All @@ -84,22 +84,19 @@ benches:
y: "Wall time (s)"

"parallel":
enabled: False
run_configurations:
- "cpp-openmp"
- "rust-rayon"
matrix:
args:
- "50 50 50"
- "100 100 100"
- "150 150 150"
- "200 200 200"
- "250 250 250"
- "300 300 300"
environment_variables:
- {"OMP_NUM_THREADS": 1, "RAYON_NUM_THREADS": 1}
# - {"OMP_NUM_THREADS": 4, "RAYON_NUM_THREADS": 4}
- {"OMP_NUM_THREADS": 16, "RAYON_NUM_THREADS": 16}
- {"OMP_NUM_THREADS": 32, "RAYON_NUM_THREADS": 32}
# - {"OMP_NUM_THREADS": 64, "RAYON_NUM_THREADS": 64}
analysis:
metrics:
"Mesh x size": "nx: (\\d+)"
Expand Down

0 comments on commit 69c2373

Please sign in to comment.