diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
commit | d9e5ca72f39934531b534524d07cf784c3d0e613 (patch) | |
tree | 1913b13a317132523091035f1175b2291c8b9db7 /testpar/t_pflush1.c | |
parent | 053807fa81579e6bd9ac6a701ddcaac39e4d0b87 (diff) | |
download | hdf5-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 'testpar/t_pflush1.c')
-rw-r--r-- | testpar/t_pflush1.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index e35ac2c..8734bfb 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -59,13 +59,13 @@ hid_t create_file(char* name, hid_t fapl) - if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; + if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Create a chunked dataset */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error; - if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error; - if ((dset=H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; + if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; plist = H5Pcreate(H5P_DATASET_XFER); @@ -73,15 +73,14 @@ hid_t create_file(char* name, hid_t fapl) /* Write some data */ - for (i=0; i<ds_size[0]; i++) { + for(i = 0; i < ds_size[0]; i++) { /* * The extra cast in the following statement is a bug workaround * for the Win32 version 5.0 compiler. * 1998-11-06 ptl */ - for (j=0; j<ds_size[1]; j++) { + for(j = 0; j < ds_size[1]; j++) the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); - } } if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error; @@ -93,12 +92,10 @@ hid_t create_file(char* name, hid_t fapl) if(H5Gclose(grp) < 0) goto error; } - return file; error: - HD_exit(1); - + HD_exit(1); } /*------------------------------------------------------------------------- @@ -142,14 +139,14 @@ main(int argc, char* argv[]) if(mpi_rank == 0) TESTING("H5Fflush (part1)"); envval = HDgetenv("HDF5_DRIVER"); - if (envval == NULL) + if(envval == NULL) envval = "nomatch"; - if (HDstrcmp(envval, "split")) { + if(HDstrcmp(envval, "split")) { /* Create the file */ h5_fixname(FILENAME[0], fapl, name, sizeof name); file1 = create_file(name, fapl); /* Flush and exit without closing the library */ - if (H5Fflush(file1, H5F_SCOPE_GLOBAL)<0) goto error; + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; /* Create the other file which will not be flushed */ h5_fixname(FILENAME[1], fapl, name, sizeof name); @@ -179,20 +176,20 @@ main(int argc, char* argv[]) */ /* close file1 */ - if (H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p)<0){ + if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0){ printf("H5Fget_vfd_handle for file1 failed\n"); goto error; } - if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ printf("MPI_File_close for file1 failed\n"); goto error; } /* close file2 */ - if (H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p)<0){ + if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0){ printf("H5Fget_vfd_handle for file2 failed\n"); goto error; } - if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ printf("MPI_File_close for file2 failed\n"); goto error; } @@ -208,3 +205,4 @@ error: MPI_Finalize(); HD_exit(1); } + |