Skip to content

Commit 66128f8

Browse files
committed
fixed format
Signed-off-by: “lrlrl” <[email protected]>
1 parent 09d6eb2 commit 66128f8

File tree

5 files changed

+43
-48
lines changed

5 files changed

+43
-48
lines changed

benchkit/utils/test_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,4 @@ def abc(aval, bval, cval):
157157

158158

159159
if __name__ == "__main__":
160-
unittest.main()
160+
unittest.main()

examples/kyotocabinet/campaign_kyotocabinet_flame.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main() -> None:
3838
src_dir=kyotocabinet_src_dir,
3939
test_name=[
4040
"benchmark",
41-
],
41+
],
4242
nb_runs=1,
4343
benchmark_duration_seconds=3,
4444
nb_threads=[1, 8, 16],
@@ -64,4 +64,3 @@ def main() -> None:
6464

6565
if __name__ == "__main__":
6666
main()
67-

examples/kyotocabinet/campaign_kyotocabinet_locks.py

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,30 @@
3131

3232
patch_path = (tilt_locks_dir / "prefetch.diff").resolve()
3333

34+
3435
def build_locks(platform: Platform) -> Tuple[Path, Path]:
3536
"""
36-
Build different versions of Vsync locks, including the normal version and the regression version.
37-
37+
Build different versions of Vsync locks, including the normal and the regression version.
38+
3839
:param platform: Current platform object
3940
:return: Returns two paths: normal version and regression version (not used in this test)
4041
"""
41-
42+
4243
# Create TiltLib instance to build the normal version of the tilt lock
4344
tilt_ok = TiltLib(tilt_locks_dir=tilt_locks_dir, build_prefix="build_ok")
44-
45-
45+
4646
platform.comm.shell(
4747
command="git checkout -- include/vsync/atomic/internal/arm64.h",
4848
current_dir=vsync_dir,
4949
)
50-
tilt_ok.build()
51-
build_ok = tilt_ok.build_dir
50+
tilt_ok.build()
51+
build_ok = tilt_ok.build_dir
5252

53-
5453
tilt_reg = TiltLib(tilt_locks_dir=tilt_locks_dir, build_prefix="build_reg")
55-
56-
54+
5755
platform.comm.shell(command=f"git apply {patch_path}", current_dir=vsync_dir)
58-
tilt_reg.build()
59-
build_regression = tilt_reg.build_dir
56+
tilt_reg.build()
57+
build_regression = tilt_reg.build_dir
6058

6159
# Return the two build directories
6260
return build_ok, build_regression
@@ -68,7 +66,7 @@ def get_campaign(
6866
) -> CampaignCartesianProduct:
6967
"""
7068
Create a benchmark campaign specifying shared libraries and the type of lock.
71-
69+
7270
:param shared_libs: Shared libraries to use
7371
:param mutex_constant: Lock type constant
7472
:return: Returns a campaign instance
@@ -82,13 +80,14 @@ def get_campaign(
8280
test_name=[], # Test name is empty, meaning a custom benchmark
8381
shared_libs=shared_libs, # Set shared libraries
8482
constants={
85-
"mutex": mutex_constant,
83+
"mutex": mutex_constant,
8684
},
87-
nb_runs=3,
88-
benchmark_duration_seconds=10,
89-
nb_threads=[1, 2, 4, 8, 16, 32, 64],
85+
nb_runs=3,
86+
benchmark_duration_seconds=10,
87+
nb_threads=[1, 2, 4, 8, 16, 32, 64],
9088
)
9189

90+
9291
def get_baseline_campaign() -> CampaignCartesianProduct:
9392
return get_campaign(
9493
mutex_constant="pthread_mutex",
@@ -143,14 +142,14 @@ def get_vcaslock_lse_prefetch_campaign(build_path: Path) -> CampaignCartesianPro
143142
shared_libs=[PrecompiledSharedLib(path=vcaslocklib_path, env_vars=None)],
144143
)
145144

145+
146146
def main() -> None:
147147
platform = get_current_platform()
148-
hostname = platform.hostname
149-
148+
hostname = platform.hostname
149+
150150
# Build normal and regression versions of the tilt lock
151151
build_ok, build_regression = build_locks(platform=platform)
152-
153-
152+
154153
campaigns = [
155154
get_baseline_campaign(),
156155
get_taslock_campaign(build_path=build_ok),
@@ -160,38 +159,35 @@ def main() -> None:
160159
get_vcaslock_nolse_prefetch_campaign(build_path=build_regression),
161160
get_vcaslock_lse_prefetch_campaign(build_path=build_regression),
162161
]
163-
164-
162+
165163
suite = CampaignSuite(campaigns=campaigns)
166-
suite.print_durations()
167-
suite.run_suite()
164+
suite.print_durations()
165+
suite.run_suite()
168166

169-
170167
suite.generate_global_csv()
171168

172-
173169
title = f"Kyoto Cabinet kccachetest w/wo tilt locks - Host: {hostname}"
174170

175171
# Generate line plot comparing throughput of different lock types
176172
suite.generate_graph(
177-
plot_name="lineplot",
178-
x="nb_threads",
179-
y="throughput",
180-
hue="mutex",
181-
style="mutex",
182-
markers=True,
183-
dashes=False,
184-
title=title,
173+
plot_name="lineplot",
174+
x="nb_threads",
175+
y="throughput",
176+
hue="mutex",
177+
style="mutex",
178+
markers=True,
179+
dashes=False,
180+
title=title,
185181
)
186182

187183
# Generate scatter plot comparing throughput of different lock types
188184
suite.generate_graph(
189-
plot_name="scatterplot",
190-
x="nb_threads",
191-
y="throughput",
192-
hue="mutex",
193-
style="mutex",
194-
title=title,
185+
plot_name="scatterplot",
186+
x="nb_threads",
187+
y="throughput",
188+
hue="mutex",
189+
style="mutex",
190+
title=title,
195191
)
196192

197193

examples/kyotocabinet/campaign_kyotocabinet_perf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main() -> None:
3131
src_dir=kyotocabinet_src_dir,
3232
test_name=[
3333
"benchmark",
34-
],
34+
],
3535
nb_runs=1,
3636
benchmark_duration_seconds=3,
3737
nb_threads=[2, 4],
@@ -65,4 +65,3 @@ def main() -> None:
6565

6666
if __name__ == "__main__":
6767
main()
68-

examples/kyotocabinet/campaign_kyotocabinet_stable.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# Copyright (C) 2023 Huawei Technologies Co., Ltd. All rights reserved.
33
# SPDX-License-Identifier: MIT
44
"""
5-
Example of campaign script for Kyoto Cabinet benchmarks with the stabilization "predlinux" tools enabled.
5+
Example of campaign script for Kyoto Cabinet benchmarks
6+
with the stabilization "predlinux" tools enabled.
67
"""
78

89
from kyotocabinet import kyotocabinet_campaign
@@ -25,7 +26,7 @@ def main() -> None:
2526
src_dir=kyotocabinet_src_dir,
2627
test_name=[
2728
"benchmark",
28-
],
29+
],
2930
nb_runs=3,
3031
benchmark_duration_seconds=2,
3132
nb_threads=[8],

0 commit comments

Comments
 (0)