summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-09-30 18:50:49 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-09-30 18:50:49 (GMT)
commitbeab7f66e5dd260732fad34b9c26ccb0d8d580a5 (patch)
treed4513e30c4d6b722d466b295e6d009272e937d54 /src/H5P.c
parent8460a082a4e1fc9ea9be15cfb6bbdd866ebf9f4b (diff)
downloadhdf5-beab7f66e5dd260732fad34b9c26ccb0d8d580a5.zip
hdf5-beab7f66e5dd260732fad34b9c26ccb0d8d580a5.tar.gz
hdf5-beab7f66e5dd260732fad34b9c26ccb0d8d580a5.tar.bz2
[svn-r730] Changes since 19980928
---------------------- ./MANIFEST Changed freebsd2.2.1 to freebsd2.2.7 to match change in file name. Added a few missing files. Are all of these supposed to be distributed? ./tools/testfiles/h5dumptst.c + ./tools/testfiles/tall-1.ddl + ./tools/testfiles/tall-2.ddl + ./tools/testfiles/tall-3.ddl ./tools/testfiles/tall.ddl ./tools/testfiles/tall.h5 + ./tools/testfiles/tattr-1.ddl + ./tools/testfiles/tattr-2.ddl + ./tools/testfiles/tattr-3.ddl + ./tools/testfiles/tattr-4.ddl ./tools/testfiles/tattr.ddl ./tools/testfiles/tattr.h5 + ./tools/testfiles/tdset-1.ddl + ./tools/testfiles/tdset-2.ddl + ./tools/testfiles/tdset-3.ddl + ./tools/testfiles/tdset-4.ddl ./tools/testfiles/tdset.ddl ./tools/testfiles/tdset.h5 + ./tools/testfiles/tgroup-1.ddl + ./tools/testfiles/tgroup-2.ddl + ./tools/testfiles/tgroup-3.ddl ./tools/testfiles/tgroup.ddl ./tools/testfiles/tgroup.h5 + ./tools/testfiles/tslink-1.ddl + ./tools/testfiles/tslink-2.ddl ./tools/testfiles/tslink.ddl ./tools/testfiles/tslink.h5 ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dprivate.h ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Gstab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/istore.c Implemented split ratios as documented in previous e-mails. Frank, the new API functions are H5Pget_btree_ratios() and H5Pset_btree_ratios(). ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Spoint.c ./src/H5Sprivate.h Added more type checking for the data transfer property list passed to these functions. ./src/H5D.c Added a dataset transfer property list as an argument to H5D_allocate() for the parallel version in order to pass split ratios down to H5F_istore_lock(). Eventually we won't need the split ratios for H5D_allocate() because we'll build a completely full B-tree from the leaves up, but it might be useful to have other transfer properties at that level anyway. I always caled H5D_allocate() with &H5D_dflt_xfer. ./MANIFEST ./test/Makefile.in ./test/overhead.c [NEW] Added an `overhead' test run by `make timings'.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/H5P.c b/src/H5P.c
index c229e0a..eb4faeb 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -2524,6 +2524,103 @@ H5Pset_deflate(hid_t plist_id, unsigned level)
}
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_btree_ratios
+ *
+ * Purpose: Queries B-tree split ratios. See H5Pset_btree_ratios().
+ *
+ * Return: Success: SUCCEED with split ratios returned through
+ * the non-null arguments.
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, September 28, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/,
+ double *right/*out*/)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER(H5Pget_btree_ratios, FAIL);
+ H5TRACE4("e","ixxx",plist_id,left,middle,right);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER!=H5P_get_class(plist_id) ||
+ NULL==(plist=H5I_object(plist_id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+
+ /* Get values */
+ if (left) *left = plist->split_ratios[0];
+ if (middle) *middle = plist->split_ratios[1];
+ if (right) *right = plist->split_ratios[2];
+
+ FUNC_LEAVE(SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_btree_ratios
+ *
+ * Purpose: Sets B-tree split ratios for a dataset transfer property
+ * list. The split ratios determine what percent of children go
+ * in the first node when a node splits. The LEFT ratio is
+ * used when the splitting node is the left-most node at its
+ * level in the tree; the RIGHT ratio is when the splitting node
+ * is the right-most node at its level; and the MIDDLE ratio for
+ * all other cases. A node which is the only node at its level
+ * in the tree uses the RIGHT ratio when it splits. All ratios
+ * are real numbers between 0 and 1, inclusive.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, September 28, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
+ double right)
+{
+
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER(H5Pget_btree_ratios, FAIL);
+ H5TRACE4("e","iddd",plist_id,left,middle,right);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER!=H5P_get_class(plist_id) ||
+ NULL==(plist=H5I_object(plist_id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+ if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 ||
+ right<0.0 || right>1.0) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "split ratio must satisfy 0.0<=X<=1.0");
+ }
+
+ /* Set values */
+ plist->split_ratios[0] = left;
+ plist->split_ratios[1] = middle;
+ plist->split_ratios[2] = right;
+
+ FUNC_LEAVE(SUCCEED);
+}
+
+
#ifdef HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: H5Pset_mpi