diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-07 04:17:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-07 04:17:35 (GMT) |
commit | 9f60f016ab71cf8ce39c859fd9eb61c6fca35d63 (patch) | |
tree | 0ddbcb2f8707b578af22c62748420b9e3c19177b /test/big.c | |
parent | 504c67846e6a4cc5706403bf21a9ae4f07aae7b4 (diff) | |
download | hdf5-9f60f016ab71cf8ce39c859fd9eb61c6fca35d63.zip hdf5-9f60f016ab71cf8ce39c859fd9eb61c6fca35d63.tar.gz hdf5-9f60f016ab71cf8ce39c859fd9eb61c6fca35d63.tar.bz2 |
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (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/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'test/big.c')
-rw-r--r-- | test/big.c | 39 |
1 files changed, 22 insertions, 17 deletions
@@ -80,8 +80,8 @@ randll(hsize_t limit, int current_index) /* does not overlap with any previous writes */ while(overlap != 0 && tries < MAX_TRIES) { - acc = rand (); - acc *= rand (); + acc = HDrandom(); + acc *= HDrandom(); acc = acc % limit; overlap = 0; @@ -294,11 +294,6 @@ writer (char* filename, hid_t fapl, int wrt_n) * or it will take some time to write a file. * We should create a dataset allocating space late and never writing fill values. * EIP 4/8/03 - - if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 || - (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - goto error; - } */ dcpl = H5Pcreate(H5P_DATASET_CREATE); H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); @@ -381,14 +376,14 @@ reader(char *filename, hid_t fapl) script = fopen(DNAME, "r"); /* Open HDF5 file */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) goto error; + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR /* Open the dataset */ - if((d2 = H5Dopen2(file, "d2", H5P_DEFAULT)) < 0) goto error; - if((fspace = H5Dget_space(d2)) < 0) goto error; + if((d2 = H5Dopen2(file, "d2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fspace = H5Dget_space(d2)) < 0) FAIL_STACK_ERROR /* Describe `buf' */ - if((mspace = H5Screate_simple(1, hs_size, hs_size)) < 0) goto error; + if((mspace = H5Screate_simple(1, hs_size, hs_size)) < 0) FAIL_STACK_ERROR /* Read each region */ while(fgets(ln, (int)sizeof(ln), script)) { @@ -400,9 +395,9 @@ reader(char *filename, hid_t fapl) fflush(stdout); if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, - hs_size, NULL) < 0) goto error; + hs_size, NULL) < 0) FAIL_STACK_ERROR if(H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0) - goto error; + FAIL_STACK_ERROR /* Check */ for(j = zero = wrong = 0; j < WRT_SIZE; j++) { @@ -423,10 +418,10 @@ reader(char *filename, hid_t fapl) } } - if(H5Dclose(d2) < 0) goto error; - if(H5Sclose(mspace) < 0) goto error; - if(H5Sclose(fspace) < 0) goto error; - if(H5Fclose(file) < 0) goto error; + if(H5Dclose(d2) < 0) FAIL_STACK_ERROR + if(H5Sclose(mspace) < 0) FAIL_STACK_ERROR + if(H5Sclose(fspace) < 0) FAIL_STACK_ERROR + if(H5Fclose(file) < 0) FAIL_STACK_ERROR free(buf); fclose(script); @@ -511,6 +506,7 @@ main (int ac, char **av) hsize_t family_size; hsize_t family_size_def; /* default family file size */ double family_size_def_dbl; /* default family file size */ + unsigned long seed = 0; /* Random # seed */ int cflag=1; /* check file system before test */ char filename[1024]; @@ -547,6 +543,14 @@ main (int ac, char **av) } } + /* Choose random # seed */ + seed = (unsigned long)HDtime(NULL); +#ifdef QAK +/* seed = (unsigned long)1155438845; */ +HDfprintf(stderr, "Random # seed was: %lu\n", seed); +#endif /* QAK */ + HDsrandom(seed); + /* Reset library */ h5_reset(); fapl = h5_fileaccess(); @@ -657,3 +661,4 @@ error: puts("*** TEST FAILED ***"); return 1; } + |