summaryrefslogtreecommitdiffstats
path: root/perform/overhead.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-11 16:24:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-11 16:24:11 (GMT)
commitd9e5ca72f39934531b534524d07cf784c3d0e613 (patch)
tree1913b13a317132523091035f1175b2291c8b9db7 /perform/overhead.c
parent053807fa81579e6bd9ac6a701ddcaac39e4d0b87 (diff)
downloadhdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.zip
hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.gz
hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.bz2
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with H5Dcreate2 Fix thread-safe error stack initialization for API versioned error stack printing routines. 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
Diffstat (limited to 'perform/overhead.c')
-rw-r--r--perform/overhead.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/perform/overhead.c b/perform/overhead.c
index 45dbe9a..5076103 100644
--- a/perform/overhead.c
+++ b/perform/overhead.c
@@ -206,32 +206,28 @@ test(fill_t fill_style, const double splits[],
int j;
h5_stat_t sb;
- if (!had) had = calloc((size_t)cur_size[0], sizeof(int));
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) goto error;
- if (!use_rdcc) {
- if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error;
- if (H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0)<0) goto error;
+ if(!had) had = calloc((size_t)cur_size[0], sizeof(int));
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error;
+ if(!use_rdcc) {
+ if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error;
+ if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error;
}
- if ((file=H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
- goto error;
- }
- if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dcpl, 1, ch_size)<0) goto error;
- if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
- if (H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2])<0) {
- goto error;
- }
- if ((fspace=H5Screate_simple(1, cur_size, max_size))<0) goto error;
- if ((mspace=H5Screate_simple(1, ch_size, ch_size))<0) goto error;
- if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT,
- fspace, dcpl))<0) goto error;
+ if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 1, ch_size) < 0) goto error;
+ if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if(H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2]) < 0) goto error;
+ if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT,
+ fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
#if !defined( __MWERKS__)
/*
workaround for a bug in the Metrowerks version 6.0 open function
*/
- if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666))<0) goto error;
+ if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error;
#endif
for (i=1; i<=cur_size[0]; i++) {
@@ -262,8 +258,8 @@ test(fill_t fill_style, const double splits[],
/* Write the chunk */
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL,
- hs_count, NULL)<0) goto error;
- if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i)<0) {
+ hs_count, NULL) < 0) goto error;
+ if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) {
goto error;
}
@@ -272,8 +268,8 @@ test(fill_t fill_style, const double splits[],
/* Determine overhead */
if (verbose) {
- if (H5Fflush(file, H5F_SCOPE_LOCAL)<0) goto error;
- if (HDfstat(fd, &sb)<0) goto error;
+ if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
+ if (HDfstat(fd, &sb) < 0) goto error;
/*
* The extra cast in the following statement is a bug workaround
* for the Win32 version 5.0 compiler.
@@ -318,7 +314,7 @@ test(fill_t fill_style, const double splits[],
#if !defined( __MWERKS__)
- if (HDfstat(fd, &sb)<0) goto error;
+ if (HDfstat(fd, &sb) < 0) goto error;
printf("%-7s %8.3f\n", sname,
(double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
(hssize_t)cur_size[0]);
@@ -374,14 +370,12 @@ main(int argc, char *argv[])
/* Default split ratios */
H5Eset_auto2(H5E_DEFAULT, display_error_cb, NULL);
- if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
- if (H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2)<0) {
- goto error;
- }
- if (H5Pclose(xfer)<0) goto error;
+ if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if(H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2) < 0) goto error;
+ if(H5Pclose(xfer) < 0) goto error;
/* Parse command-line options */
- for (i=1, j=0; i<argc; i++) {
+ for(i = 1, j = 0; i < argc; i++) {
if (!strcmp(argv[i], "forward")) {
fill_style = FILL_FORWARD;
} else if (!strcmp(argv[i], "reverse")) {