summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-12-17 19:35:20 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-12-17 19:35:20 (GMT)
commit09aaf83332da95084928082e0a8b834460c47dbf (patch)
treef3bd1b2226ca05da937992bd627897d285451902 /src/H5A.c
parentc26c6a4b25920bda133c93b10b87afedcfa81cdb (diff)
downloadhdf5-09aaf83332da95084928082e0a8b834460c47dbf.zip
hdf5-09aaf83332da95084928082e0a8b834460c47dbf.tar.gz
hdf5-09aaf83332da95084928082e0a8b834460c47dbf.tar.bz2
[svn-r971] Changes since 19981214
---------------------- ./INSTALL Added warning that enabling debugging code can adversely affect performance even when the debugging isn't turned on at run-time. Performance testing shows that under certain circumstances (like data type conversions of compound types) the H5_timer functions, although only a few lines each, contribute a fairly large percent to the execution time. ./src/H5T.c ./src/H5Tpkg.h ./src/H5Tpublic.h Improved the H5Tunregister() function to make unregistering more flexible. It takes the same arguments as H5Tregister() but also accepts wild cards. All conversion functions that match the H5Tunregister() search criteria are removed from the global type conversion table. The H5Tregister_hard() and H5Tregister_soft() were combined into a single function called H5Tregister() which is the counterpart to H5Tunregister(). A new `persistence' argument was added to differentiate between the two types of conversion functions. The application is allowed to register a hard conversion function for the no-op conversion path although the library isn't obligated to call it (it usually does). This is mostly for completeness, but the application might use it to help determine if the raw data pipeline was able to use the optimized path for the case when no type conversion is necessary. The library doesn't allow this path to be unregistered although the application can redefine it as often as it likes. Fixed the type conversion tables in preparation for MT-safety and to fix previosly-known design bugs wrt. unregistering conversion functions or changing the C function associated with a conversion path. The MT-safety stuff is documented in a separate white paper. Increased the conversion function debugging name from 9 characters to 31 characters so the output can be more descriptive. Moved conversion path statistics from the H5T_cdata_t member into the conversion path itself. This makes H5T_cdata_t contain only application-visible data structures. ./src/H5A.c ./src/H5D.c ./src/H5Ofill.c ./src/H5P.c ./src/H5T.c Improved the way type conversion functions are called so the caller doesn't have to check for data type debugging and increment type conversion timers and statistics. Changed check for no-op conversion since it is now application-definable and there may even be more than one definition at a time in a multi-threaded application (one thread might be using the no-op conversion path when some other thread changes its definition -- the first thread still sees the original defintion until it's done with the operation). ./doc/html/Datatypes.html Updated the user guide to reflect the changes to data type conversion registration functions. ./bin/trace ./src/H5.c Added tracing support for the new H5T_pers_t data type. ./test/dtypes.c Added printf to display alignment value if non-aligned data types are being tested. ./test/h5test.c Modified the H5Tunregister() calls to use the new arguments. All 94 of those calls can be replaced by a single call to the new H5Tunregister() function. ./src/H5.c Added HAVE_GETTIMEOFDAY around an auto variable and initialized the elapsed time to zero when gettimeofday() is not available. ./src/H5F.c ./src/H5Fprivate.h ./src/H5P.c Added an H5*_init() functions which do the same thing as H5*_init_interface() but can be called from other packages and don't do anything if the interface is already initialized. This fixes a couple memory leaks in applications that repeatedly close and open the library with H5close(). ./src/H5Tconv.c Optimized some data alignment code in the hardware conversion functions. Hardware conversions accumulate statistics about source and destination data alignment and print that information when the conversion function is unregistered (usually when the application exits) if data type debugging is compiled into the library and enabled at run-time. The conversion caching was cleaned up for the compound data type conversion function. It now caches conversion paths in a manner that will be MT-safe and is much simpler than the old method. Also cleaned up some array index maps. ./src/H5detect.c Fixd mispelling of alingemnt. ./src/H5private.h Changed `TRUE' to `1' in assignment to interface_initialize_g in FUNC_ENTER macro definition. ./tools/testh5dump.sh Completely rewritten to make it shorter, better documented, and conforming to most of the other test outputs. The comparison of the actual output with the expected output is insensitive to differences in white space. The test now passes for the first time on Linux where the output width wasn't as expected but the output was otherwise correct. ./tools/testfiles/tall-1.ddl ./tools/testfiles/tall-2.ddl ./tools/testfiles/tall-3.ddl ./tools/testfiles/tattr-1.ddl ./tools/testfiles/tattr-2.ddl ./tools/testfiles/tattr-3.ddl ./tools/testfiles/tattr-4.ddl ./tools/testfiles/tcomp-1.ddl ./tools/testfiles/tcomp-2.ddl ./tools/testfiles/tcomp-3.ddl ./tools/testfiles/tcomp-4.ddl ./tools/testfiles/tdset-1.ddl ./tools/testfiles/tdset-2.ddl ./tools/testfiles/tdset-3.ddl ./tools/testfiles/tdset-4.ddl ./tools/testfiles/tgroup-1.ddl ./tools/testfiles/tgroup-2.ddl ./tools/testfiles/tgroup-3.ddl ./tools/testfiles/tlink-1.ddl ./tools/testfiles/tlink-2.ddl ./tools/testfiles/tlink-3.ddl ./tools/testfiles/tlink-4.ddl ./tools/testfiles/tlink-5.ddl ./tools/testfiles/tslink-1.ddl ./tools/testfiles/tslink-2.ddl Changed `../h5dump' to just `h5dump'. ./config/alpha-dec-osf4.0 Added more warning and optimization switches to the native compiler.
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 7ccf64d..3aac523 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -604,17 +604,13 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, void *buf)
{
uint8_t *tconv_buf = NULL; /* data type conv buffer */
size_t nelmts; /* elements in attribute */
- H5T_conv_t tconv_func = NULL; /* conversion function */
- H5T_cdata_t *cdata = NULL; /* type conversion data */
+ H5T_path_t *tpath = NULL; /* conversion information*/
hid_t src_id = -1, dst_id = -1;/* temporary type atoms */
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type*/
size_t buf_size; /* desired buffer size */
int idx; /* index of attribute in object header */
herr_t ret_value = FAIL;
-#ifdef H5T_DEBUG
- H5_timer_t timer;
-#endif
FUNC_ENTER(H5A_write, FAIL);
@@ -641,11 +637,10 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, void *buf)
/* Convert memory buffer into disk buffer */
/* Set up type conversion function */
- if (NULL == (tconv_func = H5T_find(mem_type, attr->dt,
- H5T_BKG_NO, &cdata))) {
+ if (NULL == (tpath = H5T_path_find(mem_type, attr->dt, NULL, NULL))) {
HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL,
"unable to convert between src and dest data types");
- } else if (H5T_conv_noop!=tconv_func) {
+ } else if (!H5T_IS_NOOP(tpath)) {
if ((src_id = H5I_register(H5I_DATATYPE,
H5T_copy(mem_type, H5T_COPY_ALL)))<0 ||
(dst_id = H5I_register(H5I_DATATYPE,
@@ -655,18 +650,11 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, void *buf)
}
}
- /* Perform data type conversion. */
-#ifdef H5T_DEBUG
- H5T_timer_begin (&timer, cdata);
-#endif
- cdata->command = H5T_CONV_CONV;
- if ((tconv_func) (src_id, dst_id, cdata, nelmts, tconv_buf, NULL)<0) {
+ /* Perform data type conversion */
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, tconv_buf, NULL)<0) {
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL,
"data type conversion failed");
}
-#ifdef H5T_DEBUG
- H5T_timer_end (&timer, cdata, nelmts);
-#endif
/* Free the previous attribute data buffer, if there is one */
if(attr->data)
@@ -775,16 +763,12 @@ H5A_read(H5A_t *attr, const H5T_t *mem_type, void *buf)
{
uint8_t *tconv_buf = NULL; /* data type conv buffer*/
size_t nelmts; /* elements in attribute*/
- H5T_conv_t tconv_func = NULL; /* conversion function */
- H5T_cdata_t *cdata = NULL; /* type conversion data */
+ H5T_path_t *tpath = NULL; /* type conversion info */
hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type */
size_t buf_size; /* desired buffer size */
herr_t ret_value = FAIL;
-#ifdef H5T_DEBUG
- H5_timer_t timer;
-#endif
FUNC_ENTER(H5A_read, FAIL);
@@ -811,11 +795,10 @@ H5A_read(H5A_t *attr, const H5T_t *mem_type, void *buf)
/* Convert memory buffer into disk buffer */
/* Set up type conversion function */
- if (NULL == (tconv_func = H5T_find(attr->dt, mem_type,
- H5T_BKG_NO, &cdata))) {
+ if (NULL == (tpath = H5T_path_find(attr->dt, mem_type, NULL, NULL))) {
HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL,
"unable to convert between src and dest data types");
- } else if (H5T_conv_noop!=tconv_func) {
+ } else if (!H5T_IS_NOOP(tpath)) {
if ((src_id = H5I_register(H5I_DATATYPE,
H5T_copy(attr->dt, H5T_COPY_ALL)))<0 ||
(dst_id = H5I_register(H5I_DATATYPE,
@@ -826,17 +809,10 @@ H5A_read(H5A_t *attr, const H5T_t *mem_type, void *buf)
}
/* Perform data type conversion. */
-#ifdef H5T_DEBUG
- H5T_timer_begin (&timer, cdata);
-#endif
- cdata->command = H5T_CONV_CONV;
- if ((tconv_func) (src_id, dst_id, cdata, nelmts, tconv_buf, NULL)<0) {
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, tconv_buf, NULL)<0) {
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL,
"data type conversion failed");
}
-#ifdef H5T_DEBUG
- H5T_timer_end (&timer, cdata, nelmts);
-#endif
/* Copy the converted data into the user's buffer */
HDmemcpy(buf,tconv_buf,dst_type_size*nelmts);