k4bench.plugin.runtime¶
k4bench.plugin.runtime ¶
find_plugin_lib_dir ¶
Return directory containing the k4Bench plugin libraries.
The returned directory must contain both the .so files AND the .components manifests that DDG4 uses to resolve factory names. Without the .components files, DDG4 can only load plugins whose library name matches the class name exactly (e.g. libFoo.so for class Foo), so bundled plugins like k4BenchRegionEventAction (which lives in libk4BenchRegionTimingAction.so) would be silently skipped.
Source code in k4bench/plugin/runtime.py
ensure_plugin_built ¶
Build the k4Bench plugins if needed.
Source code in k4bench/plugin/runtime.py
setup_plugin_environment ¶
setup_plugin_environment(*, env: dict[str, str], event_json_path: Path, region_json_path: Path | None = None) -> bool
Prepare environment variables for the k4Bench timing plugins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
dict[str, str]
|
Environment dictionary to mutate (typically a copy of os.environ). |
required |
event_json_path
|
Path
|
Output path for the per-event timing JSON. |
required |
region_json_path
|
Path | None
|
Output path for the per-region timing JSON. If None, the region plugin will still be loadable but will write to its default location (k4bench_regions.json in CWD) only if it ends up being activated by the steering script. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if plugins are available and enabled. False if ddsim should run without per-event timing. |