From a2567e36f04594afe382abf44b8bd1ea34bcf299 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 23 Aug 2002 07:42:56 -0500 Subject: [svn-r5886] Purpose: Bug fix Description: Correctly apply filters (like compression) to fill values in chunks that are pre-allocated. This is OK in parallel also, since all the chunks are identical at this point and any chunk may be written by any process. Platforms tested: FreeBSD 4.6 (sleipnir) w/parallel --- src/H5Distore.c | 14 ++++++++++++++ src/H5Fistore.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/H5Distore.c b/src/H5Distore.c index c9dc766..0bba74e 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -2431,6 +2431,20 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, */ HDmemset (chunk, 0, (size_t)chunk_size); } /* end else */ + + /* Check if there are filters which need to be applied to the chunk */ + if (pline.nfilters>0) { + unsigned filter_mask=0; + size_t buf_size=chunk_size; + size_t nbytes=(size_t)chunk_size; + + /* Push the chunk through the filters */ + if (H5Z_pipeline(f, &pline, 0, &filter_mask, &nbytes, &buf_size, &chunk)<0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed"); + + /* Keep the number of bytes the chunk turned in to */ + chunk_size=nbytes; + } /* end if */ } /* end if */ /* Loop over all chunks */ diff --git a/src/H5Fistore.c b/src/H5Fistore.c index c9dc766..0bba74e 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -2431,6 +2431,20 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, */ HDmemset (chunk, 0, (size_t)chunk_size); } /* end else */ + + /* Check if there are filters which need to be applied to the chunk */ + if (pline.nfilters>0) { + unsigned filter_mask=0; + size_t buf_size=chunk_size; + size_t nbytes=(size_t)chunk_size; + + /* Push the chunk through the filters */ + if (H5Z_pipeline(f, &pline, 0, &filter_mask, &nbytes, &buf_size, &chunk)<0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed"); + + /* Keep the number of bytes the chunk turned in to */ + chunk_size=nbytes; + } /* end if */ } /* end if */ /* Loop over all chunks */ -- cgit v0.12