summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-10-01 18:56:51 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-10-01 18:56:51 (GMT)
commit849d36019d929c409c50cce08842354139dca2f8 (patch)
tree360639325199a5d2a59ea02d3a9e4ee2662016f9 /src/H5Distore.c
parentd809c9309b7fa204ed9f94409228d01087f8b00a (diff)
downloadhdf5-849d36019d929c409c50cce08842354139dca2f8.zip
hdf5-849d36019d929c409c50cce08842354139dca2f8.tar.gz
hdf5-849d36019d929c409c50cce08842354139dca2f8.tar.bz2
[svn-r733]
Changes since 19980930 ---------------------- ./MANIFEST ./doc/html/H5.format.html ./src/H5D.c ./src/H5Dprivate.h ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5O.c ./src/H5Ofill.c [NEW] ./src/H5Oprivate.h ./src/H5P.c ./src/H5Ppublic.h ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Spoint.c ./src/H5Sprivate.h ./src/Makefile.in Added fill values as documented in previous e-mails. They only work for chunked datasets so far. ./src/H5E.c ./src/H5Epublic.h ./src/H5P.c Changed H5E_TEMPLATE to H5E_PLIST. ./src/H5Omtime.c ./src/H5V.c Fixed a typo in a comment. ./src/H5Tconv.c Fixed a bug in compound type conversions that caused an assertion to fail.
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 88399fd..ebfb004 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1170,8 +1170,8 @@ H5F_istore_prune (H5F_t *f, size_t size)
static void *
H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
const double split_ratios[], const H5O_pline_t *pline,
- const hssize_t offset[], hbool_t relax,
- intn *idx_hint/*in,out*/)
+ const H5O_fill_t *fill, const hssize_t offset[],
+ hbool_t relax, intn *idx_hint/*in,out*/)
{
uintn idx; /*hash index number */
hbool_t found = FALSE; /*already in cache? */
@@ -1268,9 +1268,20 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
"data pipeline read failed");
}
rdcc->nmisses++;
+ } else if (fill && fill->buf) {
+ /*
+ * The chunk doesn't exist in the file. Replicate the fill
+ * value throughout the chunk.
+ */
+ assert(0==chunk_size % fill->size);
+ H5V_array_fill(chunk, fill->buf, fill->size,
+ chunk_size/fill->size);
+ rdcc->ninits++;
+
} else {
/*
- * The chunk doesn't exist in the file. Assume all zeros.
+ * The chunk doesn't exist in the file and no fill value was
+ * specified. Assume all zeros.
*/
HDmemset (chunk, 0, chunk_size);
rdcc->ninits++;
@@ -1510,8 +1521,8 @@ H5F_istore_unlock (H5F_t *f, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const hssize_t offset_f[],
- const hsize_t size[], void *buf)
+ const H5O_pline_t *pline, const H5O_fill_t *fill,
+ const hssize_t offset_f[], const hsize_t size[], void *buf)
{
hssize_t offset_m[H5O_LAYOUT_NDIMS];
hsize_t size_m[H5O_LAYOUT_NDIMS];
@@ -1635,7 +1646,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
* the chunk.
*/
if (NULL==(chunk=H5F_istore_lock (f, layout, xfer->split_ratios,
- pline, chunk_offset,
+ pline, fill, chunk_offset,
FALSE, &idx_hint))) {
HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL,
"unable to read raw data chunk");
@@ -1682,8 +1693,9 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const hssize_t offset_f[],
- const hsize_t size[], const void *buf)
+ const H5O_pline_t *pline, const H5O_fill_t *fill,
+ const hssize_t offset_f[], const hsize_t size[],
+ const void *buf)
{
hssize_t offset_m[H5O_LAYOUT_NDIMS];
hsize_t size_m[H5O_LAYOUT_NDIMS];
@@ -1811,7 +1823,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
* chunk.
*/
if (NULL==(chunk=H5F_istore_lock (f, layout, xfer->split_ratios,
- pline, chunk_offset,
+ pline, fill, chunk_offset,
naccessed==chunk_size,
&idx_hint))) {
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,