Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions benchkit/core/compat/new2old.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
`subprocess.*` directly (or otherwise bypasses `ctx.exec`), wrappers/sharedlibs
cannot be injected by this compatibility layer.
- **Fetch arguments must be single-valued** in a legacy cartesian campaign. If a fetch
parameter appears in `parameter_space`, it must have exactly one value because
parameter appears in `variables`, it must have exactly one value because
`fetch()` is executed once during `bootstrap()`.

API
Expand All @@ -81,13 +81,13 @@
>>> from benchkit.benches.leveldb import LevelDBBench
>>> from benchkit.core.compat.new2old import CampaignCartesianProduct
>>>
>>> parameter_space = {
>>> variables = {
... "bench_name": ["readrandom", "seekrandom"],
... "nb_threads": [2, 4, 8],
... }
>>> campaign = CampaignCartesianProduct(
... benchmark=LevelDBBench(),
... parameter_space=parameter_space,
... variables=variables,
... nb_runs=1,
... duration_s=5,
... )
Expand All @@ -99,7 +99,7 @@
such as `parent_dir`, `commit`, `patches`, etc. In a legacy cartesian campaign we
expect fetch parameters to be fixed (single-valued). Therefore this adapter enforces:

- If a fetch parameter appears in the provided `parameter_space`, it must have exactly
- If a fetch parameter appears in the provided `variables`, it must have exactly
one value.

If you want to vary fetch parameters, use the new engine directly rather than the
Expand Down
2 changes: 1 addition & 1 deletion tests/campaigns/campaign_perf_cartprod.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def main() -> None:
campaign = CampaignCartesianProduct(
name="strace",
benchmark=SleepBench(),
parameter_space={"duration_seconds": [3]},
variables={"duration_seconds": [3]},
nb_runs=1,
command_wrappers=[perfstatwrap],
post_run_hooks=[perfstatwrap.post_run_hook_update_results],
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_leveldb_new2old.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@


def main() -> None:
parameter_space = {
variables = {
"bench_name": ["readrandom", "seekrandom"],
"nb_threads": [2, 4, 8],
}

campaign = CampaignCartesianProduct(
benchmark=LevelDBBench(),
parameter_space=parameter_space,
variables=variables,
)

campaign.run()
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_leveldb_new2old_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def postrun_hook(


def main() -> None:
parameter_space = {
variables = {
"bench_name": ["readrandom", "seekrandom"],
"nb_threads": [2, 4, 8],
}

campaign = CampaignCartesianProduct(
benchmark=LevelDBBench(),
parameter_space=parameter_space,
variables=variables,
pre_run_hooks=[prerun_hook],
post_run_hooks=[postrun_hook],
)
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_leveldb_new2old_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def main() -> None:
parameter_space = {
variables = {
"bench_name": ["readrandom"],
"nb_threads": [1],
"master_thread_core": [0],
Expand All @@ -17,7 +17,7 @@ def main() -> None:

campaign = CampaignCartesianProduct(
benchmark=LevelDBBench(),
parameter_space=parameter_space,
variables=variables,
command_wrappers=[taskset_wrap],
duration_s=5,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_new2old_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def __call__(self, *args, **kwargs) -> None:


def main() -> None:
parameter_space: dict[str, list[Any]] = {
variables: dict[str, list[Any]] = {
# no parameters needed; we just want one run
}

bench = HooksBench()

campaign = CampaignCartesianProduct(
benchmark=bench,
parameter_space=parameter_space,
variables=variables,
pre_run_hooks=[PreMarkHook()],
post_run_hooks=[PostMarkHook()],
duration_s=1,
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_new2old_ldpreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def preload(


def main() -> None:
parameter_space = {
variables = {
"hook_enabled": [True, False],
}

Expand All @@ -109,7 +109,7 @@ def main() -> None:

campaign = CampaignCartesianProduct(
benchmark=bench,
parameter_space=parameter_space,
variables=variables,
shared_libs=[lib],
duration_s=1,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_new2old_wrap_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def wrap(


def main() -> None:
parameter_space = {
variables = {
"wrap_enabled": [True, False],
}

Expand All @@ -80,7 +80,7 @@ def main() -> None:

campaign = CampaignCartesianProduct(
benchmark=bench,
parameter_space=parameter_space,
variables=variables,
command_wrappers=[wrapper],
duration_s=1,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/core/compat/test_new2old_wrap_taskset.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def collect(self, ctx) -> Dict[str, Any]:


def main() -> None:
parameter_space = {
variables = {
"master_thread_core": [None, 0, 1],
}

Expand All @@ -93,7 +93,7 @@ def main() -> None:

campaign = CampaignCartesianProduct(
benchmark=bench,
variables=parameter_space,
variables=variables,
command_wrappers=[wrapper],
duration_s=1,
)
Expand Down