[h5py] 273/455: Fix slowdown with row-oriented selection
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:41 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit ca153dd249e243eb364a366df1054c965cc0624a
Author: andrewcollette <andrew.collette at gmail.com>
Date: Tue Jun 9 22:05:28 2009 +0000
Fix slowdown with row-oriented selection
---
h5py/highlevel.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index e5de0c9..eb9ec41 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -1031,7 +1031,13 @@ class Dataset(HLObject):
val = val2
# Perform the write, with broadcasting
- mspace = h5s.create_simple(mshape, (h5s.UNLIMITED,)*len(mshape))
+ # Be careful to pad memory shape with ones to avoid HDF5 chunking
+ # glitch, which kicks in for mismatched memory/file selections
+ if(len(mshape) < len(self.shape)):
+ mshape_pad = (1,)*(len(self.shape)-len(mshape)) + mshape
+ else:
+ mshape_pad = mshape
+ mspace = h5s.create_simple(mshape_pad, (h5s.UNLIMITED,)*len(mshape_pad))
for fspace in selection.broadcast(mshape):
self.id.write(mspace, fspace, val, mtype)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list