summaryrefslogtreecommitdiffstats
path: root/src/H5FDint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 15:37:33 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 15:37:33 (GMT)
commit48bebcc39ef565796356c159d16f09bfb0efba4d (patch)
treed571607d2e1003b4fb2d6a2294198f482c1929e1 /src/H5FDint.c
parent66947641209890553871e69f4474b450ed502ae5 (diff)
downloadhdf5-48bebcc39ef565796356c159d16f09bfb0efba4d.zip
hdf5-48bebcc39ef565796356c159d16f09bfb0efba4d.tar.gz
hdf5-48bebcc39ef565796356c159d16f09bfb0efba4d.tar.bz2
[svn-r29057] added dxpl type checking when debug mode is enabled (H5_DEBUG_BUILD)
tested on bb-8 with Serial and Parallel, debug and production builds.
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. */