summaryrefslogtreecommitdiffstats
path: root/src/H5Dmpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-05-16 03:04:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-05-16 03:04:56 (GMT)
commit22f48585bdf5e13898b7728b33ec71fd7c9cf4ec (patch)
tree3c6f99b03d177a2b1c88442a93cf017a8c465a24 /src/H5Dmpio.c
parentafbdbb8e93d2b2d96098abfa4bf1615205487ca5 (diff)
downloadhdf5-22f48585bdf5e13898b7728b33ec71fd7c9cf4ec.zip
hdf5-22f48585bdf5e13898b7728b33ec71fd7c9cf4ec.tar.gz
hdf5-22f48585bdf5e13898b7728b33ec71fd7c9cf4ec.tar.bz2
[svn-r15015] Description:
Detect chunks that are >4GB before dataset gets created and return error to application. Tweak lots of internal variables that hold the chunk size/dimensions to use an 'uint32_t', instead of a 'size_t', so that the integer size is constant. Correct a number of our tests which were creating datasets with chunks that were >4GB and add some specific tests for >4GB chunk size detection. Minor whitespace & other code cleanups. Tested on: Mac OS X/32 10.5.2 (amazon) Forthcoming testing on other platforms...
Diffstat (limited to 'src/H5Dmpio.c')
-rw-r--r--src/H5Dmpio.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 889fbce..dd0c602 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -1183,7 +1183,7 @@ if(H5DEBUG(D))
H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */
H5D_istore_ud1_t udata; /* B-tree pass-through */
void *chunk; /* Pointer to the data chunk in cache */
- size_t accessed_bytes; /* Total accessed size in a chunk */
+ uint32_t accessed_bytes; /* Total accessed size in a chunk */
unsigned idx_hint = 0; /* Cache index hint */
haddr_t caddr; /* Address of the cached chunk */
@@ -1203,9 +1203,11 @@ if(H5DEBUG(D))
/* Load the chunk into cache and lock it. */
if(H5D_chunk_cacheable(io_info, caddr)) {
hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */
+ size_t tmp_accessed_bytes; /* Total accessed size in a chunk */
/* Compute # of bytes accessed in chunk */
- accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ tmp_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ H5_ASSIGN_OVERFLOW(accessed_bytes, tmp_accessed_bytes, size_t, uint32_t);
/* Determine if we will access all the data in the chunk */
if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size))
@@ -1419,7 +1421,7 @@ if(H5DEBUG(D)) {
if(make_ind) {
void *chunk; /* Pointer to the data chunk in cache */
H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */
- size_t accessed_bytes = 0; /* Total accessed size in a chunk */
+ uint32_t accessed_bytes = 0; /* Total accessed size in a chunk */
unsigned idx_hint = 0; /* Cache index hint */
/* Switch to independent I/O */
@@ -1429,9 +1431,11 @@ if(H5DEBUG(D)) {
/* Load the chunk into cache and lock it. */
if(H5D_chunk_cacheable(io_info, chunk_addr)) {
hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */
+ size_t tmp_accessed_bytes; /* Total accessed size in a chunk */
/* Compute # of bytes accessed in chunk */
- accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ tmp_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ H5_ASSIGN_OVERFLOW(accessed_bytes, tmp_accessed_bytes, size_t, uint32_t);
/* Determine if we will access all the data in the chunk */
if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size))