Skip to content

Commit

Permalink
progress on updating osu-microbenchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
august-knox committed Nov 13, 2024
1 parent 4933893 commit 57f6a9d
Showing 1 changed file with 72 additions and 28 deletions.
100 changes: 72 additions & 28 deletions experiments/osu-micro-benchmarks/experiment.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from benchpark.directives import variant
from benchpark.error import BenchparkError
from benchpark.experiment import Experiment
from benchpark.scaling import StrongScaling
import re


class OsuMicroBenchmarks(Experiment):

variant(
"version",
default="develop",
description="app version",
)

variant(
"workload",
default="osu_latency",
Expand Down Expand Up @@ -83,8 +92,19 @@ class OsuMicroBenchmarks(Experiment):
)

def compute_applications_section(self):
variables = {}
scaling_modes = {
"strong": self.spec.satisfies("strong=oui"),
"single_node": self.spec.satisfies("single_node=oui"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
if len(scaling_mode_enabled) != 1:
raise BenchparkError(
f"Only one type of scaling per experiment is allowed for application package {self.name}"
)

variables = {}
num_nodes = {"n_nodes", 1}
variables["scaling_nodes"] = "2"
variables["n_nodes"] = "{scaling_nodes}"
variables["n_ranks_per_node"] = "36"
Expand All @@ -93,37 +113,61 @@ def compute_applications_section(self):
workload = re.search(pattern, str(self.spec.variants))
workload_string = workload.group(1)

return {
"osu-micro-benchmarks": {
# TODO replace with a hash once we have one?
"workloads": {
workload_string: {
"experiments": {
"scaling_{n_nodes}nodes_medium": {
"variants": {
"package_manager": "spack",
},
"variables": variables,
}
}
}
}
}
if self.spec.satisfies("single_node=oui"):
for pk, pv in num_nodes.items():
self.add_experiment_variable(pk, pv, True)

elif self.spec.satisfies("strong=oui"):
scaled_variables = self.generate_strong_scaling_params(
{tuple(num_nodes.keys()): list(num_nodes.values())},
int(self.spec.variants["scaling-factor"][0]),
int(self.spec.variants["scaling-iterations"][0]),
)
for pk, pv in scaled_variables.items():
self.add_experiment_variable(pk, pv, True)
# return {
# "osu-micro-benchmarks": {
# # TODO replace with a hash once we have one?
# "workloads": {
# workload_string: {
# "experiments": {
# "scaling_{n_nodes}nodes_medium": {
# "variants": {
# "package_manager": "spack",
# },
# "variables": variables,
# }
# }
# }
# }
# }
}

def compute_spack_section(self):
app_version = self.spec.variants["version"][0]
# get system config options
# TODO: Get compiler/mpi/package handles directly from system.py
system_specs = {}
system_specs["compiler"] = "default-compiler"
system_specs["mpi"] = "default-mpi"
# set package spack specs
# empty package_specs value implies external package
self.add_spack_spec(system_specs["mpi"])
self.add_spack_spec(
self.name, [f"osu-micro-benchmarks@{app_version}", system_specs["compiler"]]
)
# TODO: express that we need certain variables from system
# Does not need to happen before merge, separate task
osu_microbenchmarks_spack_spec = "osu-micro-benchmarks"
packages = ["default-mpi", self.spec.name]
#osu_microbenchmarks_spack_spec = "osu-micro-benchmarks"
# packages = ["default-mpi", self.spec.name]

return {
"packages": {
"osu-micro-benchmarks": {
"pkg_spec": osu_microbenchmarks_spack_spec,
"compiler": "default-compiler",
}
},
"environments": {"osu-micro-benchmarks": {"packages": packages}},
# return {
# "packages": {
# "osu-micro-benchmarks": {
# "pkg_spec": osu_microbenchmarks_spack_spec,
# "compiler": "default-compiler",
# }
# },
# "environments": {"osu-micro-benchmarks": {"packages": packages}},

}
# }

0 comments on commit 57f6a9d

Please sign in to comment.