summaryrefslogtreecommitdiffstats
path: root/src/H5Fio.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/H5Fio.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/H5Fio.c')
-rw-r--r--src/H5Fio.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/H5Fio.c b/src/H5Fio.c
index 04c4055..d001bc0 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -97,6 +97,8 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
hid_t dxpl_id, void *buf/*out*/)
{
H5F_io_info_t fio_info; /* I/O info for operation */
+ H5FD_mem_t map_type; /* Mapped memory type */
+ hid_t my_dxpl_id = dxpl_id; /* transfer property to use for I/O */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -113,13 +115,22 @@ HDfprintf(stderr, "%s: read from addr = %a, size = %Zu\n", FUNC, addr, size);
if(H5F_addr_le(f->shared->tmp_addr, (addr + size)))
HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space")
+ /* Treat global heap as raw data */
+ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
+
+#ifdef H5_DEBUG_BUILD
+ /* GHEAP type is treated as RAW, so update the dxpl type property too */
+ if(H5FD_MEM_GHEAP == type)
+ my_dxpl_id = H5AC_rawdata_dxpl_id;
+#endif /* H5_DEBUG_BUILD */
+
/* Set up I/O info for operation */
fio_info.f = f;
- if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
+ if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(my_dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
/* Pass through metadata accumulator layer */
- if(H5F__accum_read(&fio_info, type, addr, size, buf) < 0)
+ if(H5F__accum_read(&fio_info, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through metadata accumulator failed")
done:
@@ -147,6 +158,8 @@ H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
hid_t dxpl_id, const void *buf)
{
H5F_io_info_t fio_info; /* I/O info for operation */
+ H5FD_mem_t map_type; /* Mapped memory type */
+ hid_t my_dxpl_id = dxpl_id; /* transfer property to use for I/O */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -164,13 +177,22 @@ HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size);
if(H5F_addr_le(f->shared->tmp_addr, (addr + size)))
HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space")
+ /* Treat global heap as raw data */
+ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
+
+#ifdef H5_DEBUG_BUILD
+ /* GHEAP type is treated as RAW, so update the dxpl type property too */
+ if(H5FD_MEM_GHEAP == type)
+ my_dxpl_id = H5AC_rawdata_dxpl_id;
+#endif /* H5_DEBUG_BUILD */
+
/* Set up I/O info for operation */
fio_info.f = f;
- if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
+ if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(my_dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
/* Pass through metadata accumulator layer */
- if(H5F__accum_write(&fio_info, type, addr, size, buf) < 0)
+ if(H5F__accum_write(&fio_info, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through metadata accumulator failed")
done: