summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-06 23:02:32 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-06 23:02:32 (GMT)
commitcf419d05ab65b423bc4ce395972e84522ca3eec5 (patch)
tree6f689a9e56f4e251f51aacec02a067b9f8d232a1 /src
parent4d3351f1d777bc3cb891443b6165a87251d4e643 (diff)
downloadhdf5-cf419d05ab65b423bc4ce395972e84522ca3eec5.zip
hdf5-cf419d05ab65b423bc4ce395972e84522ca3eec5.tar.gz
hdf5-cf419d05ab65b423bc4ce395972e84522ca3eec5.tar.bz2
[svn-r454] Changes since 19980702
---------------------- ./src/H5T.c Prints statistics for no-op conversions also. For now, hardware floating point conversions may or may not raise SIGFPE depending on the hardware, operating system, etc. Software conversions never raise SIGFPE and use +Inf or -Inf for overflow. ./test/dtypes.c Catches SIGFPE and causes the test to be skipped. Better test for NaN. ./config/irix5.3 Removed the -U_POSIX_SOURCE because it was removed from the main makefiles. ./bin/trace ./src/H5S.c Fixed a typo that prevented tracing info from being added to new API functions.
Diffstat (limited to 'src')
-rw-r--r--src/H5S.c2
-rw-r--r--src/H5T.c34
-rw-r--r--src/H5Tconv.c16
3 files changed, 38 insertions, 14 deletions
diff --git a/src/H5S.c b/src/H5S.c
index ad4cb1a..7ebf490 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1026,6 +1026,7 @@ H5Sset_extent_simple (hid_t sid, int rank, const hsize_t *dims, const hsize_t *m
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Sset_extent_simple, FAIL);
+ H5TRACE4("e","iIs*h*h",sid,rank,dims,max);
/* Check args */
if ((space = H5I_object(sid)) == NULL) {
@@ -1336,6 +1337,7 @@ H5Screate_simple (int rank, const hsize_t *dims, const hsize_t *maxdims)
int i;
FUNC_ENTER(H5Screate, FAIL);
+ H5TRACE3("i","Is*h*h",rank,dims,maxdims);
/* Check arguments */
if (rank<0) {
diff --git a/src/H5T.c b/src/H5T.c
index 4fe6078..8026516 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -679,6 +679,7 @@ H5T_term_interface(void)
#ifdef H5T_DEBUG
intn nprint=0;
hsize_t nbytes;
+ H5T_cdata_t *cdata;
#endif
/* Unregister all conversion functions */
@@ -734,6 +735,39 @@ H5T_term_interface(void)
H5T_path_g[i] = NULL;
}
+#ifdef H5T_DEBUG
+ /* Print debugging infor for the `noop' conversion */
+ if (H5T_conv_noop==H5T_find(NULL, NULL, H5T_BKG_NO, &cdata)) {
+ if (cdata->stats->ncalls>0) {
+ if (0==nprint++) {
+ HDfprintf (stderr, "H5T: type conversion statistics "
+ "accumulated over life of library:\n");
+ HDfprintf (stderr, " %-*s %8s/%-5s %8s %8s %8s %15s\n",
+ H5T_NAMELEN-1, "Name", "Elmts", "Calls", "User",
+ "System", "Elapsed", "Bandwidth");
+ HDfprintf (stderr, " %-*s %8s-%-5s %8s %8s %8s %15s\n",
+ H5T_NAMELEN-1, "----", "-----", "-----", "----",
+ "------", "-------", "---------");
+ }
+ nbytes = cdata->stats->nelmts;
+ HDfprintf (stderr,
+ " %-*s %8Hd/%-5d %8.2f %8.2f %8.2f",
+ H5T_NAMELEN-1, "no-op",
+ cdata->stats->nelmts,
+ cdata->stats->ncalls,
+ cdata->stats->timer.utime,
+ cdata->stats->timer.stime,
+ cdata->stats->timer.etime);
+ if (cdata->stats->timer.etime>0) {
+ HDfprintf (stderr, " %15g\n",
+ nbytes / cdata->stats->timer.etime);
+ } else {
+ HDfprintf (stderr, " %15s\n", "Inf");
+ }
+ }
+ }
+#endif
+
/* Clear conversion tables */
H5T_apath_g = 0;
H5T_npath_g = 0;
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 800a9ea..930b330 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -13,7 +13,6 @@
#include <H5Eprivate.h>
#include <H5MMprivate.h>
#include <H5Tpkg.h>
-#include <float.h> /*for FLT_MAX and FLT_MIN */
#include <math.h> /*for ceil() */
/* Conversion data for H5T_conv_struct() */
@@ -1350,19 +1349,8 @@ H5T_conv_double_float (hid_t __unused__ src_id, hid_t __unused__ dst_id,
s = (double*)buf;
d = (float*)buf;
- /*
- * We have to watch out because some machines generate a SIGFPE if
- * the source has a larger magnitude than can be represented in the
- * destination.
- */
- for (elmtno=0; elmtno<nelmts; elmtno++, d++, s++) {
- if (*s > FLT_MAX) {
- *d = FLT_MAX;
- } else if (*s < -FLT_MAX) {
- *d = -FLT_MAX;
- } else {
- *d = *s;
- }
+ for (elmtno=0; elmtno<nelmts; elmtno++) {
+ *d++ = *s++;
}
break;