Merge "Issue #1630 updated chunk size for single dimension chunks." into development

Former-commit-id: 14c2a2b201 [formerly 6beaa1e8ae [formerly 010d73f684ec58affd0aeffcef64c6904f909bef]]
Former-commit-id: 6beaa1e8ae
Former-commit-id: 3ad71676b3
This commit is contained in:
Richard Peter 2013-02-18 09:44:36 -06:00 committed by Gerrit Code Review
commit 0005aa9bce

View file

@ -214,7 +214,12 @@ class H5pyDataStore(IDataStore.IDataStore):
def __calculateChunk(self, nDims, dataType, storeOp, maxDims): def __calculateChunk(self, nDims, dataType, storeOp, maxDims):
if nDims == 1: if nDims == 1:
chunk = [DEFAULT_CHUNK_SIZE] if dataType != vlen_str_type:
sizeOfEntry = numpy.dtype(dataType).itemsize
chunkSize = int(FILESYSTEM_BLOCK_SIZE / sizeOfEntry)
chunk = [chunkSize]
else:
chunk = [DEFAULT_CHUNK_SIZE]
elif nDims == 2: elif nDims == 2:
if storeOp != 'APPEND': if storeOp != 'APPEND':
chunk = [DEFAULT_CHUNK_SIZE] * 2 chunk = [DEFAULT_CHUNK_SIZE] * 2