summaryrefslogtreecommitdiffstats
path: root/src/H5FDint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 16:38:55 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 16:38:55 (GMT)
commit0461830ee3a7eea419fbb6629c47e40c27aaf6f8 (patch)
treec4955c2febb9606bb68f803276b79503ba3f7a00 /src/H5FDint.c
parentc3f08947c1fbca8f6ccd87ca35f0f23b6209b129 (diff)
parent48bebcc39ef565796356c159d16f09bfb0efba4d (diff)
downloadhdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.zip
hdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.tar.gz
hdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.tar.bz2
[svn-r29059] merge from trunk.
Diffstat (limited to 'src/H5FDint.c')
-rw-r--r--src/H5FDint.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c
index e7cb2c0..128f30f 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -170,6 +170,25 @@ H5FD_read(H5FD_t *file, const H5P_genplist_t *dxpl, H5FD_mem_t type, haddr_t add
HDassert(TRUE == H5P_class_isa(H5P_CLASS(dxpl), H5P_CLS_DATASET_XFER_g));
HDassert(buf);
+ /* Sanity check the dxpl type against the mem type */
+#ifdef H5_DEBUG_BUILD
+ {
+ H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */
+
+ /* get the dxpl type */
+ if(H5P_get(dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type")
+
+ /* we shouldn't be here if the dxpl is labeled with NO I/O */
+ HDassert(H5FD_NOIO_DXPL != dxpl_type);
+
+ if(H5FD_MEM_DRAW == type)
+ HDassert(H5FD_RAWDATA_DXPL == dxpl_type);
+ else
+ HDassert(H5FD_METADATA_DXPL == dxpl_type);
+ }
+#endif /* H5_DEBUG_BUILD */
+
#ifndef H5_HAVE_PARALLEL
/* Do not return early for Parallel mode since the I/O could be a */
/* collective transfer. */
@@ -219,6 +238,25 @@ H5FD_write(H5FD_t *file, const H5P_genplist_t *dxpl, H5FD_mem_t type, haddr_t ad
HDassert(TRUE == H5P_class_isa(H5P_CLASS(dxpl), H5P_CLS_DATASET_XFER_g));
HDassert(buf);
+ /* Sanity check the dxpl type against the mem type */
+#ifdef H5_DEBUG_BUILD
+ {
+ H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */
+
+ /* get the dxpl type */
+ if(H5P_get(dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type")
+
+ /* we shouldn't be here if the dxpl is labeled with NO I/O */
+ HDassert(H5FD_NOIO_DXPL != dxpl_type);
+
+ if(H5FD_MEM_DRAW == type)
+ HDassert(H5FD_RAWDATA_DXPL == dxpl_type);
+ else
+ HDassert(H5FD_METADATA_DXPL == dxpl_type);
+ }
+#endif /* H5_DEBUG_BUILD */
+
#ifndef H5_HAVE_PARALLEL
/* Do not return early for Parallel mode since the I/O could be a */
/* collective transfer. */