summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-03-17 01:29:54 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-03-17 01:29:54 (GMT)
commit31a709a6b24f4cf80f9cd99a3e55f56e81cf3066 (patch)
treec38f19508a87b990f911f8fe2d526b0cb1f2a2b3 /src/H5P.c
parent48e075110624e0039b1918a7187316366a20462b (diff)
downloadhdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.zip
hdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.tar.gz
hdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.tar.bz2
[svn-r322] Changes since 19980313
---------------------- ./configure.in ./configure ./test/iopipe.c Added check for system(3) ./config/freebsd2.2.1 ./config/linux Added -DH5D_DEBUG to the debug flags. ./src/H5D.c ./src/H5Dprivate.h ./src/H5P.c ./src/H5Ppublic.h ./src/H5Sprivate.h ./src/H5Ssimp.c ./html/Datasets.html Finally implemented strip mining in the I/O pipeline, placing a user-defined upper bound on the amount of temporary memory used by the pipeline. The default is 1MB type conversion and background buffers allocated/freed on demand. However, the size can be changed and/or application-allocated buffers supplied with H5Pset_buffers() called on the data transfer property list passed to H5Dread() and H5Dwrite(). Minor optimizations to H5Dread() and H5Dwrite(). More coming later... ./test/dsets.c Added calls to H5Pset_buffer() to test application-defined temporary buffers in the I/O pipeline. ./test/Makefile.in Removed `iopipe' from the list of confidence tests. Saying `make timings' in the test directory runs timing tests. I did this because (1) they don't really test anything new, and (2) they can take a long time to run.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 8bbf03d..e990675 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1679,6 +1679,100 @@ H5Pget_family (hid_t tid, hid_t *memb_tid)
/*-------------------------------------------------------------------------
+ * Function: H5Pset_buffer
+ *
+ * Purpose: Given a dataset transfer property list, set the maximum size
+ * for the type conversion buffer and background buffer and
+ * optionally supply pointers to application-allocated buffers.
+ * If the buffer size is smaller than the entire amount of data
+ * being transfered between application and file, and a type
+ * conversion buffer or background buffer is required then
+ * strip mining will be used. However, certain restrictions
+ * apply for the size of buffer which can be used for strip
+ * mining. For instance, when strip mining a 100x200x300
+ * hyperslab of a simple data space the buffer must be large
+ * enough to hold a 1x200x300 slab.
+ *
+ * If TCONV and/or BKG are null pointers then buffers will be
+ * allocated and freed during the data transfer.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, March 16, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_buffer (hid_t plist_id, size_t size, void *tconv, void *bkg)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER (H5Pset_buffer, FAIL);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
+ NULL == (plist = H5A_object (plist_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+ if (size<=0) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "buffer size must not be zero");
+ }
+
+ /* Update property list */
+ plist->buf_size = size;
+ plist->tconv = tconv;
+ plist->bkg = bkg;
+
+ FUNC_LEAVE (SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_buffer
+ *
+ * Purpose: Reads values previously set with H5Pset_buffer().
+ *
+ * Return: Success: Buffer size.
+ *
+ * Failure: 0
+ *
+ * Programmer: Robb Matzke
+ * Monday, March 16, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+size_t
+H5Pget_buffer (hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER (H5Pget_buffer, 0);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
+ NULL == (plist = H5A_object (plist_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, 0,
+ "not a dataset transfer property list");
+ }
+
+ /* Return values */
+ if (tconv) *tconv = plist->tconv;
+ if (bkg) *bkg = plist->bkg;
+
+ FUNC_LEAVE (plist->buf_size);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5Pset_mpi
*
* Signature: herr_t H5Pset_mpi(hid_t tid, MPI_Comm comm, MPI_Info info,