diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-30 03:46:58 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-30 03:46:58 (GMT) |
commit | 7d457ba693ea827a55277563525a4fbdb04ce2fd (patch) | |
tree | 7f1bddb78fa55c5c2edac730545ac259591500a1 /src/H5Dprivate.h | |
parent | e0c4a752e6522a2d6bf50cef42bccf165264a89c (diff) | |
download | hdf5-7d457ba693ea827a55277563525a4fbdb04ce2fd.zip hdf5-7d457ba693ea827a55277563525a4fbdb04ce2fd.tar.gz hdf5-7d457ba693ea827a55277563525a4fbdb04ce2fd.tar.bz2 |
[svn-r9342] Purpose:
Bug fix/code cleanup
Description:
Clean up raw data I/O code to bundle the I/O parameters (dataset, DXPL ID,
etc) into a single struct to pass around through the dataset I/O routines,
since they are always passed together, until very near the bottom of the I/O
stack.
Platforms tested:
FreeBSD 4.10 (sleipnir) w/parallel
Solaris 2.7 (arabica)
IRIX64 6.5 (modi4)
h5committest
Diffstat (limited to 'src/H5Dprivate.h')
-rw-r--r-- | src/H5Dprivate.h | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 610dab6..a933204 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -168,12 +168,20 @@ typedef struct H5D_t H5D_t; /* Typedef for dataset storage information */ +typedef struct { + hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */ + hssize_t *offset; /* Chunk's coordinates in elements */ +} H5D_chunk_storage_t; + +typedef struct { + haddr_t dset_addr; /* Address of dataset in file */ + hsize_t dset_size; /* Total size of dataset in file */ +} H5D_contig_storage_t; + typedef union H5D_storage_t { H5O_efl_t efl; /* External file list information for dataset */ - struct { - hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */ - hssize_t *offset; /* Chunk's coordinates in elements */ - } chunk; + H5D_chunk_storage_t chunk; /* Chunk information for dataset */ + H5D_contig_storage_t contig; /* Contiguous information for dataset */ } H5D_storage_t; /* Typedef for cached dataset transfer property list information */ @@ -199,6 +207,14 @@ typedef struct H5D_dcpl_cache_t { H5D_fill_time_t fill_time; /* Fill time (H5D_CRT_FILL_TIME_NAME) */ } H5D_dcpl_cache_t; +/* Typedef for common raw data I/O operation info */ +typedef struct H5D_io_info_t { + H5D_t *dset; /* Pointer to dataset being operated on */ + const H5D_dxpl_cache_t *dxpl_cache; /* Pointer to cache DXPL info */ + hid_t dxpl_id; /* Original DXPL ID */ + const H5D_storage_t *store; /* Dataset storage info */ +} H5D_io_info_t; + /* Library-private functions defined in H5D package */ H5_DLL herr_t H5D_init(void); H5_DLL H5D_t *H5D_open(H5G_entry_t *ent, hid_t dxpl_id); @@ -217,39 +233,25 @@ H5_DLL herr_t H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); H5_DLL herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); -/* Functions that operate on byte sequences in memory and on disk */ -H5_DLL ssize_t H5D_seq_readvv(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, H5D_t *dset, const H5D_storage_t *store, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - void *buf); -H5_DLL ssize_t H5D_seq_writevv(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, H5D_t *dset, const H5D_storage_t *store, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - const void *buf); - /* Functions that operate on contiguous storage */ H5_DLL herr_t H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout); H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset); -H5_DLL ssize_t H5D_contig_readvv(H5F_t *f, hid_t dxpl_id, H5D_t *dset, - haddr_t dset_addr, hsize_t dset_size, +H5_DLL ssize_t H5D_contig_readvv(H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], void *buf); -H5_DLL ssize_t H5D_contig_writevv(H5F_t *f, hid_t dxpl_id, H5D_t *dset, - haddr_t dset_addr, hsize_t dset_size, +H5_DLL ssize_t H5D_contig_writevv(H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], const void *buf); /* Functions that operate on compact dataset storage */ -H5_DLL ssize_t H5D_compact_readvv(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, +H5_DLL ssize_t H5D_compact_readvv(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[], void *buf); -H5_DLL ssize_t H5D_compact_writevv(H5F_t *f, hid_t dxpl_id, H5D_t *dset, +H5_DLL ssize_t H5D_compact_writevv(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[], const void *buf); @@ -260,18 +262,15 @@ struct H5D_istore_ud1_t; /*define at H5Distore.c*/ /* Functions that operate on indexed storage */ H5_DLL herr_t H5D_istore_delete(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout); -H5_DLL ssize_t H5D_istore_readvv(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, H5D_t *dset, const H5D_storage_t *store, +H5_DLL ssize_t H5D_istore_readvv(H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], void *buf); -H5_DLL ssize_t H5D_istore_writevv(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, H5D_t *dset, const H5D_storage_t *store, +H5_DLL ssize_t H5D_istore_writevv(H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], const void *buf); -H5_DLL haddr_t H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id, - const H5O_layout_t *layout, const hssize_t offset[], +H5_DLL haddr_t H5D_istore_get_addr(H5D_io_info_t *io_info, struct H5D_istore_ud1_t *_udata); H5_DLL herr_t H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, int ndims); @@ -281,15 +280,15 @@ H5_DLL herr_t H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * str struct H5S_t; /* MPI-IO function to read directly from app buffer to file rky980813 */ -H5_DLL herr_t H5D_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - H5D_t *dset, const H5D_storage_t *store, +H5_DLL herr_t H5D_mpio_spaces_read(H5D_io_info_t *io_info, + H5O_layout_readvv_func_t op, size_t nelmts, size_t elmt_size, const struct H5S_t *file_space, const struct H5S_t *mem_space, void *buf/*out*/); /* MPI-IO function to write directly from app buffer to file rky980813 */ -H5_DLL herr_t H5D_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - H5D_t *dset, const H5D_storage_t *store, +H5_DLL herr_t H5D_mpio_spaces_write(H5D_io_info_t *io_info, + H5O_layout_writevv_func_t op, size_t nelmts, size_t elmt_size, const struct H5S_t *file_space, const struct H5S_t *mem_space, const void *buf); |