Skip to content

Commit 3b5f774

Browse files
author
Tobias Kopp
committed
[Benchmark] Use actual number of cores in config name
1 parent e5bba67 commit 3b5f774

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

benchmark/database_connectors/connector.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import ABC, abstractmethod
22
import os
3+
import multiprocessing
34

45
DEFAULT_TIMEOUT = 30 # seconds
56
TIMEOUT_PER_CASE = 10 # seconds
@@ -21,6 +22,12 @@ def __init__(self, what :str):
2122
super().__init__(what)
2223

2324

25+
26+
# Helper function to get number of cores
27+
def get_num_cores():
28+
return multiprocessing.cpu_count()
29+
30+
2431
#=======================================================================================================================
2532
# Connector Abstract Base Class (ABC)
2633
#=======================================================================================================================

benchmark/database_connectors/duckdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def execute(self, n_runs, params: dict):
2121
suite = params['suite']
2222
benchmark = params['benchmark']
2323
experiment = params['name']
24-
configname = 'DuckDB (multi core)' if self.multithreaded else 'DuckDB (single core)'
24+
configname = f'DuckDB ({get_num_cores()} cores)' if self.multithreaded else 'DuckDB (single core)'
2525
tqdm.write(f'` Perform experiment {suite}/{benchmark}/{experiment} with configuration {configname}.')
2626

2727
self.clean_up()

benchmark/database_connectors/hyper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def execute(self, n_runs, params: dict()):
2727
suite = params['suite']
2828
benchmark = params['benchmark']
2929
experiment = params['name']
30-
suffix = ' (multi core)' if self.multithreaded else ' (single core)'
30+
suffix = f' ({get_num_cores()} cores)' if self.multithreaded else ' (single core)'
3131
tqdm.write(f'` Perform experiment {suite}/{benchmark}/{experiment} with configuration HyPer{suffix}.')
3232

3333
result = None

0 commit comments

Comments
 (0)