summaryrefslogtreecommitdiffstats
path: root/src/H5Dcompact.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
commit5773fd34bc5adf59b4530d95ac9f0c0585902803 (patch)
tree456ad239799382e1f083fb7fc74399e43b471912 /src/H5Dcompact.c
parent0138995d1ce2068db1f790503435a2121132d3ad (diff)
downloadhdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.zip
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.gz
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.bz2
[svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. New fortran wrappers added.
Diffstat (limited to 'src/H5Dcompact.c')
-rw-r--r--src/H5Dcompact.c91
1 files changed, 18 insertions, 73 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index c3abab6..2e4d3f7 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -41,52 +41,22 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Vprivate.h" /* Vector and array functions */
-
/****************/
/* Local Macros */
/****************/
-
/******************/
/* Local Typedefs */
/******************/
-
/********************/
/* Local Prototypes */
/********************/
-/* Layout operation callbacks */
-static herr_t H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
- hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
- H5D_chunk_map_t *cm);
-static ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info,
- size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
- size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]);
-static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info,
- size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
- size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]);
-
-
/*********************/
/* Package Variables */
/*********************/
-/* Compact storage layout I/O ops */
-const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{
- H5D_compact_io_init,
- H5D_contig_read,
- H5D_contig_write,
-#ifdef H5_HAVE_PARALLEL
- NULL,
- NULL,
-#endif /* H5_HAVE_PARALLEL */
- H5D_compact_readvv,
- H5D_compact_writevv,
- NULL
-}};
-
-
/*******************/
/* Local Variables */
/*******************/
@@ -94,7 +64,6 @@ const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{
/* Declare extern the free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(type_conv);
-
/*-------------------------------------------------------------------------
* Function: H5D_compact_fill
@@ -149,32 +118,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D_compact_io_init
- *
- * Purpose: Performs initialization before any sort of I/O on the raw data
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Thursday, March 20, 2008
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
- hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
- H5D_chunk_map_t UNUSED *cm)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_io_init)
-
- io_info->store->compact.buf = io_info->dset->shared->layout.u.compact.buf;
- io_info->store->compact.dirty = &io_info->dset->shared->layout.u.compact.dirty;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_compact_io_init() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5D_compact_readvv
*
* Purpose: Reads some data vectors from a dataset into a buffer.
@@ -192,19 +135,20 @@ H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *
*
*-------------------------------------------------------------------------
*/
-static ssize_t
+ssize_t
H5D_compact_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
- size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[])
+ size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf)
{
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_compact_readvv)
+ FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL)
- HDassert(io_info);
+ assert(io_info->dset);
/* Use the vectorized memory copy routine to do actual work */
- if((ret_value = H5V_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0)
+ if((ret_value=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr,io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr))<0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
done:
@@ -233,23 +177,24 @@ done:
*
*-------------------------------------------------------------------------
*/
-static ssize_t
+ssize_t
H5D_compact_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
- size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[])
+ size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf)
{
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_compact_writevv)
+ FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL)
- HDassert(io_info);
+ assert(io_info->dset);
/* Use the vectorized memory copy routine to do actual work */
- if((ret_value = H5V_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0)
+ if((ret_value=H5V_memcpyvv(io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr,buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr))<0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
/* Mark the compact dataset's buffer as dirty */
- *io_info->store->compact.dirty = TRUE;
+ io_info->dset->shared->layout.u.compact.dirty = TRUE;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -426,11 +371,11 @@ done:
if(H5I_dec_ref(tid_mem) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID")
if(buf)
- (void)H5FL_BLK_FREE(type_conv, buf);
+ H5FL_BLK_FREE(type_conv, buf);
if(reclaim_buf)
- (void)H5FL_BLK_FREE(type_conv, reclaim_buf);
+ H5FL_BLK_FREE(type_conv, reclaim_buf);
if(bkg)
- (void)H5FL_BLK_FREE(type_conv, bkg);
+ H5FL_BLK_FREE(type_conv, bkg);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_compact_copy() */