summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2007-06-19 20:05:24 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2007-06-19 20:05:24 (GMT)
commit6017d0c70fda2a36cf963193e979f0548cb0c954 (patch)
treebc54a1f86fb94fe5dcecd2ba8b2b2623c5c38a77 /src/H5T.c
parent32d09759bdf082d1a5d87903a58b0ed6c03dbe8c (diff)
downloadhdf5-6017d0c70fda2a36cf963193e979f0548cb0c954.zip
hdf5-6017d0c70fda2a36cf963193e979f0548cb0c954.tar.gz
hdf5-6017d0c70fda2a36cf963193e979f0548cb0c954.tar.bz2
[svn-r13884] The second step of optimization for compound data for the Chicago
company. The I/O is optimized when the source and destination members are a subset of each other one way or another, and the order is the same, and no conversion is needed. For example: struct source { struct destination { TYPE1 A; --> TYPE1 A; TYPE2 B; --> TYPE2 B; TYPE3 C; --> TYPE3 C; }; TYPE4 D; TYPE5 E; }; or struct destination { struct source { TYPE1 A; --> TYPE1 A; TYPE2 B; --> TYPE2 B; TYPE3 C; --> TYPE3 C; }; TYPE4 D; TYPE5 E; }; The optimization is simply moving data from the source to the appropriate places in the buffer and bypass the reading of the background data and data conversion. Tested on smirom, liberty, sol, and copper.
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index b4bfe2d..a08f010 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -4451,6 +4451,11 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name,
table = path;
}
+ /* Set the flag to indicate both source and destination types are compound types
+ * for the optimization of data reading (in H5Dio.c). */
+ if(H5T_COMPOUND==H5T_get_class(src, TRUE) && H5T_COMPOUND==H5T_get_class(dst, TRUE))
+ path->are_compounds = TRUE;
+
/* Set return value */
ret_value = path;
@@ -4496,6 +4501,46 @@ H5T_path_noop(const H5T_path_t *p)
/*-------------------------------------------------------------------------
+ * Function: H5T_path_compound_subset
+ *
+ * Purpose: Checks if the source and destination types are both compound.
+ * Tells whether whether the source members are a subset of
+ * destination, and the order is the same, and no conversion
+ * is needed. For example:
+ * struct source { struct destination {
+ * TYPE1 A; --> TYPE1 A;
+ * TYPE2 B; --> TYPE2 B;
+ * TYPE3 C; --> TYPE3 C;
+ * }; TYPE4 D;
+ * TYPE5 E;
+ * };
+ *
+ * Return: One of the values of H5T_subset_t (can't fail).
+ *
+ * Programmer: Raymond Lu
+ * 8 June 2007
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+H5T_subset_t
+H5T_path_compound_subset(const H5T_path_t *p)
+{
+ H5T_subset_t ret_value = FALSE;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_path_compound_subset);
+
+ assert(p);
+
+ if(p->are_compounds)
+ ret_value = H5T_conv_struct_subset(&(p->cdata));
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5T_path_compound_subset */
+
+
+/*-------------------------------------------------------------------------
* Function: H5T_path_bkg
*
* Purpose: Get the "background" flag for the conversion path.