-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add MultiManager to h5pyd __init__.py #185
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,9 @@ | |
import subprocess | ||
import re | ||
|
||
from h5pyd._hl.dataset import MultiManager | ||
from h5pyd import MultiManager | ||
import h5pyd as h5py | ||
from common import getTestFileName | ||
|
||
# Flag to stop resource usage collection thread after a benchmark finishes | ||
stop_stat_collection = False | ||
|
@@ -249,7 +250,13 @@ def run_benchmark(test_name, test_func, stats, datasets, num_iters): | |
dt = np.int32 | ||
stats = {} | ||
|
||
fs = [h5py.File("/home/test_user1/h5pyd_multi_bm_" + str(i), mode='w') for i in range(count)] | ||
fs = [] | ||
|
||
for i in range(count): | ||
filename = getTestFileName(f"bm_{i:04d}", subfolder="multi_bm") | ||
f = h5py.File(filename, mode='w') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the user hasn't specifically created the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated to print message on IOError. |
||
fs.append(f) | ||
|
||
data_in = np.zeros(shape, dtype=dt) | ||
datasets = [f.create_dataset("data", shape, dtype=dt, data=data_in) for f in fs] | ||
|
||
|
@@ -266,7 +273,8 @@ def run_benchmark(test_name, test_func, stats, datasets, num_iters): | |
|
||
print("Testing with shared HTTP connection...") | ||
|
||
f = h5py.File("/home/test_user1/h5pyd_multi_bm_shared", mode='w') | ||
filename = getTestFileName("bm_shared", subfolder="multi_bm") | ||
f = h5py.File(filename, mode='w') | ||
datasets = [f.create_dataset("data" + str(i), data=data_in, dtype=dt) for i in range(count)] | ||
|
||
run_benchmark("Read Multi (Shared HttpConn)", read_datasets_multi, stats, datasets, num_iters) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFileName
invokesgetTestFileName
, but then overwrites the result to redo the same work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change so getTestFileName can be invoked outside the TestCase class, but forgot to remove the duplicate code. Fixed now.