mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
[svn-r14203] Description:
Break up H5D source file into H5D/H5Dint/H5Ddeprec Attempt fix for "szip noencoder" build failure. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
This commit is contained in:
parent
e5413fa795
commit
637fa77ea7
2
MANIFEST
2
MANIFEST
@ -452,9 +452,11 @@
|
||||
./src/H5D.c
|
||||
./src/H5Dcompact.c
|
||||
./src/H5Dcontig.c
|
||||
./src/H5Ddbg.c
|
||||
./src/H5Ddeprec.c
|
||||
./src/H5Defl.c
|
||||
./src/H5Dfill.c
|
||||
./src/H5Dint.c
|
||||
./src/H5Dio.c
|
||||
./src/H5Distore.c
|
||||
./src/H5Dmpio.c
|
||||
|
123
src/H5Ddbg.c
Normal file
123
src/H5Ddbg.c
Normal file
@ -0,0 +1,123 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/****************/
|
||||
/* Module Setup */
|
||||
/****************/
|
||||
|
||||
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
|
||||
|
||||
/* Interface initialization */
|
||||
#define H5_INTERFACE_INIT_FUNC H5D_init_dbg_interface
|
||||
|
||||
|
||||
/***********/
|
||||
/* Headers */
|
||||
/***********/
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5Dpkg.h" /* Datasets */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
|
||||
|
||||
/****************/
|
||||
/* Local Macros */
|
||||
/****************/
|
||||
|
||||
|
||||
/******************/
|
||||
/* Local Typedefs */
|
||||
/******************/
|
||||
|
||||
|
||||
/********************/
|
||||
/* Local Prototypes */
|
||||
/********************/
|
||||
|
||||
|
||||
/*********************/
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
/*****************************/
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
H5D_init_dbg_interface -- Initialize interface-specific information
|
||||
USAGE
|
||||
herr_t H5D_init_dbg_interface()
|
||||
RETURNS
|
||||
Non-negative on success/Negative on failure
|
||||
DESCRIPTION
|
||||
Initializes any interface-specific data or routines. (Just calls
|
||||
H5D_init() currently).
|
||||
|
||||
--------------------------------------------------------------------------*/
|
||||
static herr_t
|
||||
H5D_init_dbg_interface(void)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_init_dbg_interface)
|
||||
|
||||
FUNC_LEAVE_NOAPI(H5D_init())
|
||||
} /* H5D_init_dbg_interface() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Ddebug
|
||||
*
|
||||
* Purpose: Prints various information about a dataset. This function is
|
||||
* not to be documented in the API at this time.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 28, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Ddebug(hid_t dset_id)
|
||||
{
|
||||
H5D_t *dset; /* Dataset to debug */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(H5Ddebug, FAIL)
|
||||
H5TRACE1("e", "i", dset_id);
|
||||
|
||||
/* Check args */
|
||||
if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
|
||||
|
||||
/* Print B-tree information */
|
||||
if(H5D_CHUNKED == dset->shared->layout.type)
|
||||
(void)H5D_istore_dump_btree(dset->oloc.file, H5AC_dxpl_id, stdout, dset->shared->layout.u.chunk.ndims, dset->shared->layout.u.chunk.addr);
|
||||
else if(H5D_CONTIGUOUS == dset->shared->layout.type)
|
||||
HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.u.contig.addr);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Ddebug() */
|
||||
|
@ -327,30 +327,9 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id)
|
||||
HDassert(dataset);
|
||||
HDassert(size);
|
||||
|
||||
/* Check if the filters in the DCPL will need to encode, and if so, can they?
|
||||
* Filters need encoding if fill value is defined and a fill policy is set that requires
|
||||
* writing on an extend.
|
||||
*/
|
||||
fill = &dataset->shared->dcpl_cache.fill;
|
||||
if(!dataset->shared->checked_filters) {
|
||||
H5D_fill_value_t fill_status; /* Whether the fill value is defined */
|
||||
|
||||
/* Retrieve the "defined" status of the fill value */
|
||||
if(H5P_is_fill_value_defined(fill, &fill_status) < 0)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Couldn't retrieve fill value from dataset.")
|
||||
|
||||
/* See if we can check the filter status */
|
||||
if(fill_status == H5D_FILL_VALUE_DEFAULT || fill_status == H5D_FILL_VALUE_USER_DEFINED) {
|
||||
if(fill->fill_time == H5D_FILL_TIME_ALLOC ||
|
||||
(fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) {
|
||||
/* Filters must have encoding enabled. Ensure that all filters can be applied */
|
||||
if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) < 0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters")
|
||||
|
||||
dataset->shared->checked_filters = TRUE;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
/* Check if the filters in the DCPL will need to encode, and if so, can they? */
|
||||
if(H5D_check_filters(dataset) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters")
|
||||
|
||||
/*
|
||||
* NOTE: Restrictions on extensions were checked when the dataset was
|
||||
@ -375,6 +354,7 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices")
|
||||
|
||||
/* Allocate space for the new parts of the dataset, if appropriate */
|
||||
fill = &dataset->shared->dcpl_cache.fill;
|
||||
if(fill->alloc_time == H5D_ALLOC_TIME_EARLY)
|
||||
if(H5D_alloc_storage(dataset->oloc.file, dxpl_id, dataset, H5D_ALLOC_EXTEND, TRUE, FALSE) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value")
|
||||
|
@ -290,7 +290,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf,
|
||||
/* Convert disk buffer into memory buffer */
|
||||
if(!H5T_path_noop(tpath)) {
|
||||
void *elem_ptr; /* Pointer to element to use for fill value */
|
||||
void *bkg_ptr; /* Pointer to background element to use for fill value */
|
||||
void *bkg_ptr = NULL; /* Pointer to background element to use for fill value */
|
||||
|
||||
/* Wrap the local buffer for elements */
|
||||
if(NULL == (elem_wb = H5WB_wrap(elem_buf, sizeof(elem_buf))))
|
||||
|
2425
src/H5Dint.c
Normal file
2425
src/H5Dint.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1345,7 +1345,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts,
|
||||
size_t request_nelmts; /*requested strip mine */
|
||||
hsize_t smine_start; /*strip mine start loc */
|
||||
size_t n, smine_nelmts; /*elements per strip */
|
||||
size_t accessed_bytes; /*total accessed size in a chunk */
|
||||
size_t accessed_bytes = 0; /*total accessed size in a chunk */
|
||||
H5S_sel_iter_t mem_iter; /*memory selection iteration info*/
|
||||
hbool_t mem_iter_init = FALSE; /*memory selection iteration info has been initialized */
|
||||
H5S_sel_iter_t bkg_iter; /*background iteration info*/
|
||||
@ -2163,7 +2163,7 @@ H5D_compound_opt_read(size_t nelmts, const H5S_t *space,
|
||||
size_t i;
|
||||
|
||||
H5T_t *src, *dst;
|
||||
size_t src_stride, dst_stride, type_size;
|
||||
size_t src_stride, dst_stride, type_size = 0;
|
||||
size_t elmtno; /*element counter */
|
||||
|
||||
herr_t ret_value = SUCCEED; /*return value */
|
||||
|
31
src/H5Dpkg.h
31
src/H5Dpkg.h
@ -291,6 +291,18 @@ typedef struct H5D_istore_ud1_t {
|
||||
haddr_t addr; /*file address of chunk */
|
||||
} H5D_istore_ud1_t;
|
||||
|
||||
/* Internal data structure for computing variable-length dataset's total size */
|
||||
typedef struct {
|
||||
hid_t dataset_id; /* ID of the dataset we are working on */
|
||||
hid_t fspace_id; /* ID of the file dataset's dataspace we are working on */
|
||||
hid_t mspace_id; /* ID of the memory dataset's dataspace we are working on */
|
||||
void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */
|
||||
void *vl_tbuf; /* Ptr to the temporary buffer we are using for VL data */
|
||||
hid_t xfer_pid; /* ID of the dataset xfer property list */
|
||||
hsize_t size; /* Accumulated number of bytes for the selection */
|
||||
} H5D_vlen_bufsize_t;
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Package Private Variables */
|
||||
/*****************************/
|
||||
@ -306,20 +318,31 @@ H5_DLL H5D_t *H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space,
|
||||
H5_DLL H5D_t *H5D_create_named(const H5G_loc_t *loc, const char *name,
|
||||
hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id,
|
||||
hid_t dapl_id, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation,
|
||||
hid_t dxpl_id);
|
||||
H5_DLL herr_t H5D_alloc_storage(H5F_t *f, hid_t dxpl_id, H5D_t *dset, H5D_time_alloc_t time_alloc,
|
||||
hbool_t update_time, hbool_t full_overwrite);
|
||||
H5_DLL hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id);
|
||||
H5_DLL haddr_t H5D_get_offset(const H5D_t *dset);
|
||||
H5_DLL herr_t H5D_iterate(void *buf, hid_t type_id, const H5S_t *space,
|
||||
H5D_operator_t op, void *operator_data);
|
||||
H5_DLL void * H5D_vlen_get_buf_size_alloc(size_t size, void *info);
|
||||
H5_DLL herr_t H5D_vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim,
|
||||
const hsize_t *point, void *op_data);
|
||||
H5_DLL herr_t H5D_check_filters(H5D_t *dataset);
|
||||
H5_DLL herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
|
||||
|
||||
/* Functions that perform serial I/O operations */
|
||||
H5_DLL herr_t H5D_select_fscat (H5D_io_info_t *io_info,
|
||||
H5_DLL herr_t H5D_select_fscat(H5D_io_info_t *io_info,
|
||||
const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts,
|
||||
haddr_t chunk_addr, void *chunk, const void *_buf);
|
||||
H5_DLL size_t H5D_select_fgath (H5D_io_info_t *io_info,
|
||||
H5_DLL size_t H5D_select_fgath(H5D_io_info_t *io_info,
|
||||
const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts,
|
||||
haddr_t chunk_addr, void *chunk, void *buf);
|
||||
H5_DLL herr_t H5D_select_mscat (const void *_tscat_buf,
|
||||
H5_DLL herr_t H5D_select_mscat(const void *_tscat_buf,
|
||||
const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts,
|
||||
const H5D_dxpl_cache_t *dxpl_cache, void *_buf/*out*/);
|
||||
H5_DLL size_t H5D_select_mgath (const void *_buf,
|
||||
H5_DLL size_t H5D_select_mgath(const void *_buf,
|
||||
const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts,
|
||||
const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/);
|
||||
H5_DLL herr_t H5D_select_read(H5D_io_info_t *io_info,
|
||||
|
@ -46,7 +46,9 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
|
||||
H5AC.c H5B.c H5Bcache.c \
|
||||
H5B2.c H5B2cache.c H5B2dbg.c H5B2int.c H5B2stat.c H5B2test.c \
|
||||
H5C.c H5CS.c \
|
||||
H5D.c H5Dcompact.c H5Dcontig.c H5Ddeprec.c H5Defl.c H5Dfill.c H5Dio.c \
|
||||
H5D.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \
|
||||
H5Ddeprec.c H5Defl.c H5Dfill.c H5Dint.c \
|
||||
H5Dio.c \
|
||||
H5Distore.c H5Dmpio.c H5Doh.c H5Dselect.c H5Dtest.c \
|
||||
H5E.c H5Edeprec.c H5Eint.c \
|
||||
H5F.c H5Fdbg.c H5Ffake.c H5Fmount.c H5Fsfile.c H5Fsuper.c H5Ftest.c \
|
||||
|
@ -83,7 +83,7 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
|
||||
H5Adeprec.lo H5Aint.lo H5Atest.lo H5AC.lo H5B.lo H5Bcache.lo \
|
||||
H5B2.lo H5B2cache.lo H5B2dbg.lo H5B2int.lo H5B2stat.lo \
|
||||
H5B2test.lo H5C.lo H5CS.lo H5D.lo H5Dcompact.lo H5Dcontig.lo \
|
||||
H5Ddeprec.lo H5Defl.lo H5Dfill.lo H5Dio.lo H5Distore.lo \
|
||||
H5Ddbg.lo H5Ddeprec.lo H5Defl.lo H5Dfill.lo H5Dint.lo H5Dio.lo H5Distore.lo \
|
||||
H5Dmpio.lo H5Doh.lo H5Dselect.lo H5Dtest.lo H5E.lo \
|
||||
H5Edeprec.lo H5Eint.lo H5F.lo H5Fdbg.lo H5Ffake.lo H5Fmount.lo \
|
||||
H5Fsfile.lo H5Fsuper.lo H5Ftest.lo H5FD.lo H5FDcore.lo \
|
||||
@ -402,7 +402,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
|
||||
H5AC.c H5B.c H5Bcache.c \
|
||||
H5B2.c H5B2cache.c H5B2dbg.c H5B2int.c H5B2stat.c H5B2test.c \
|
||||
H5C.c H5CS.c \
|
||||
H5D.c H5Dcompact.c H5Dcontig.c H5Ddeprec.c H5Defl.c H5Dfill.c H5Dio.c \
|
||||
H5D.c H5Dcompact.c H5Dcontig.c H5Ddbg.c H5Ddeprec.c H5Defl.c H5Dfill.c H5Dint.c H5Dio.c \
|
||||
H5Distore.c H5Dmpio.c H5Doh.c H5Dselect.c H5Dtest.c \
|
||||
H5E.c H5Edeprec.c H5Eint.c \
|
||||
H5F.c H5Fdbg.c H5Ffake.c H5Fmount.c H5Fsfile.c H5Fsuper.c H5Ftest.c \
|
||||
@ -598,9 +598,11 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5D.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dcompact.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dcontig.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ddbg.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ddeprec.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Defl.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dfill.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dint.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Distore.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dmpio.Plo@am__quote@
|
||||
|
Loading…
Reference in New Issue
Block a user