From d9e5ca72f39934531b534524d07cf784c3d0e613 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 11 Oct 2007 11:24:11 -0500 Subject: [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 --- c++/src/H5CommonFG.cpp | 6 +- examples/Attributes.txt | 2 +- examples/h5_attribute.c | 2 +- examples/h5_compound.c | 2 +- examples/h5_dtransform.c | 2 +- examples/h5_extend_write.c | 4 +- examples/h5_group.c | 8 +- examples/h5_mount.c | 7 +- examples/h5_ref2reg.c | 12 +- examples/h5_reference.c | 22 +- examples/h5_select.c | 11 +- examples/h5_shared_mesg.c | 2 +- examples/h5_write.c | 13 +- examples/ph5example.c | 26 +- fortran/src/H5Df.c | 36 +- fortran/src/README | 6 +- hl/examples/ex_lite3.c | 19 +- hl/fortran/src/H5IMcc.c | 186 +++-- hl/src/H5LT.c | 383 +++------- hl/src/H5PT.c | 66 +- hl/src/H5TB.c | 102 ++- hl/test/test_ds.c | 1031 +++++++++++++------------- hl/test/test_lite.c | 2 +- perform/benchpar.c | 4 +- perform/chunk.c | 28 +- perform/iopipe.c | 13 +- perform/overhead.c | 54 +- perform/perf.c | 16 +- perform/perf_meta.c | 19 +- perform/pio_engine.c | 8 +- src/H5Ddeprec.c | 10 +- src/H5Dpublic.h | 10 +- src/H5E.c | 5 + src/H5vers.txt | 1 + src/H5version.h | 15 + test/Makefile.am | 6 +- test/big.c | 8 +- test/cache_api.c | 6 +- test/cmpd_dset.c | 27 +- test/dangle.c | 16 +- test/dsets.c | 1058 +++++++++++++-------------- test/dtransform.c | 158 ++-- test/dtypes.c | 30 +- test/enum.c | 11 +- test/err_compat.c | 8 +- test/error_test.c | 8 +- test/extend.c | 4 +- test/external.c | 112 +-- test/fillval.c | 28 +- test/flush1.c | 18 +- test/gen_bogus.c | 6 +- test/gen_cross.c | 4 +- test/gen_deflate.c | 2 +- test/gen_filters.c | 2 +- test/gen_new_array.c | 4 +- test/gen_new_fill.c | 30 +- test/gen_new_group.c | 4 +- test/gen_new_mtime.c | 2 +- test/gen_noencoder.c | 4 +- test/gen_nullspace.c | 2 +- test/gen_old_array.c | 4 +- test/gen_old_layout.c | 2 +- test/gen_old_mtime.c | 2 +- test/getname.c | 54 +- test/istore.c | 48 +- test/links.c | 12 +- test/mount.c | 4 +- test/mtime.c | 2 +- test/ntypes.c | 192 +++-- test/objcopy.c | 102 +-- test/reserved.c | 47 +- test/set_extent.c | 56 +- test/space_overflow.c | 10 +- test/stream_test.c | 19 +- test/tarray.c | 50 +- test/tattr.c | 225 +++--- test/testmeta.c | 12 +- test/tfile.c | 62 +- test/tgenprop.c | 30 +- test/th5o.c | 16 +- test/th5s.c | 42 +- test/titerate.c | 22 +- test/tmisc.c | 469 ++++++------ test/trefer.c | 58 +- test/tselect.c | 90 +-- test/tsohm.c | 70 +- test/ttime.c | 4 +- test/ttsafe_acreate.c | 8 +- test/ttsafe_cancel.c | 16 +- test/ttsafe_dcreate.c | 63 +- test/ttsafe_error.c | 22 +- test/tunicode.c | 57 +- test/tvlstr.c | 90 +-- test/tvltypes.c | 146 ++-- test/unlink.c | 36 +- test/vfd.c | 12 +- testpar/t_chunk_alloc.c | 44 +- testpar/t_coll_chunk.c | 18 +- testpar/t_dset.c | 480 ++++++------ testpar/t_filter_read.c | 32 +- testpar/t_mdset.c | 464 ++++++------ testpar/t_pflush1.c | 34 +- testpar/t_span_tree.c | 10 +- tools/h5copy/h5copygentest.c | 14 +- tools/h5diff/h5diffgentest.c | 235 +++--- tools/h5dump/h5dumpgentest.c | 1576 ++++++++++++++++++++-------------------- tools/h5import/h5import.c | 29 +- tools/h5jam/h5jamgentest.c | 8 +- tools/h5repack/h5repack_copy.c | 9 +- tools/h5repack/h5repack_refs.c | 4 +- tools/h5repack/h5repacktst.c | 289 ++++---- tools/h5stat/h5stat_gentest.c | 6 +- tools/lib/talign.c | 2 +- tools/misc/h5repart_gentest.c | 42 +- 114 files changed, 4429 insertions(+), 4712 deletions(-) diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 7cd3705..a6a1530 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -164,13 +164,13 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co hid_t space_id = data_space.getId(); hid_t create_plist_id = create_plist.getId(); - // Call C routine H5Dcreate to create the named dataset - hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id ); + // Call C routine H5Dcreate2 to create the named dataset + hid_t dataset_id = H5Dcreate2( getLocId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT ); // If the creation of the dataset failed, throw an exception if( dataset_id < 0 ) { - throwException("createDataSet", "H5Dcreate failed"); + throwException("createDataSet", "H5Dcreate2 failed"); } // No failure, create and return the DataSet object diff --git a/examples/Attributes.txt b/examples/Attributes.txt index e32601c..299451b 100644 --- a/examples/Attributes.txt +++ b/examples/Attributes.txt @@ -22,7 +22,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group dataspace = H5Screate_simple(rank, dimsf, NULL); /* Create a dataset */ - dataset = H5Dcreate(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT); + dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index b49b0e1..e26ed6e 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -95,7 +95,7 @@ main (void) /* * Create the dataset in the file. */ - dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT); + dataset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write data to the dataset. diff --git a/examples/h5_compound.c b/examples/h5_compound.c index da22c87..3fca2a5 100644 --- a/examples/h5_compound.c +++ b/examples/h5_compound.c @@ -87,7 +87,7 @@ main(void) /* * Create the dataset. */ - dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT); + dataset = H5Dcreate2(file, DATASETNAME, s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Wtite data to the dataset; diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 6f4108b..71ec10a 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -99,7 +99,7 @@ main (void) * Create a new dataset within the file using defined dataspace and * datatype and default dataset creation properties. */ - dataset = H5Dcreate(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT); + dataset = H5Dcreate2(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); printf("\nOriginal Data: \n"); PRINT(windchillF); diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index b54cc66..74f6c01 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -81,8 +81,8 @@ main (void) * Create a new dataset within the file using cparms * creation properties. */ - dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, dataspace, - cparms); + dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + cparms, H5P_DEFAULT); /* * Extend the dataset. This call assures that dataset is at least 3 x 3. diff --git a/examples/h5_group.c b/examples/h5_group.c index f0adff7..da6a848 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -71,8 +71,8 @@ main(void) plist = H5Pcreate(H5P_DATASET_CREATE); H5Pset_chunk(plist, 2, cdims); H5Pset_deflate( plist, 6); - dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT, - dataspace, plist); + dataset = H5Dcreate2(file, "/Data/Compressed_Data", H5T_NATIVE_INT, + dataspace, H5P_DEFAULT, plist, H5P_DEFAULT); /* * Close the first dataset . */ @@ -85,8 +85,8 @@ main(void) dims[0] = 500; dims[1] = 20; dataspace = H5Screate_simple(RANK, dims, NULL); - dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT, - dataspace, H5P_DEFAULT); + dataset = H5Dcreate2(file, "/Data/Float_Data", H5T_NATIVE_FLOAT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* *Close the second dataset and file. diff --git a/examples/h5_mount.c b/examples/h5_mount.c index 6c4910c..6da71a1 100644 --- a/examples/h5_mount.c +++ b/examples/h5_mount.c @@ -45,10 +45,9 @@ int main(void) /* * Initialization of buffer matrix "bm" */ - for(i =0; i>palette<< dataset*/ - if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0 ) + if(H5LTset_attribute_string(loc_id, pal_name, "CLASS", PALETTE_CLASS) < 0) return -1; /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ - if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 ) + if(H5LTset_attribute_string(loc_id, pal_name, "PAL_VERSION", "1.2") < 0) return -1; return 0; @@ -420,16 +416,16 @@ herr_t H5IMmake_palettef( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMget_palettef( hid_t loc_id, +herr_t H5IMget_palettef(hid_t loc_id, const char *image_name, int pal_number, - int_f *pal_data ) + int_f *pal_data) { if(sizeof(int_f) == sizeof(int)) return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data); - else if (sizeof(int_f) == sizeof(long)) + else if(sizeof(int_f) == sizeof(long)) return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LONG,pal_data); - else if (sizeof(int_f) == sizeof(long_long)) + else if(sizeof(int_f) == sizeof(long_long)) return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LLONG,pal_data); else return -1; @@ -462,7 +458,7 @@ herr_t H5IMget_palettef( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5IM_get_palette( hid_t loc_id, +herr_t H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hid_t tid, @@ -486,7 +482,7 @@ herr_t H5IM_get_palette( hid_t loc_id, /* Try to find the attribute "PALETTE" on the >>image<< dataset */ has_pal = H5IM_find_palette(image_id); - if(has_pal == 1 ) + if(has_pal == 1) { if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -495,62 +491,62 @@ herr_t H5IM_get_palette( hid_t loc_id, if((attr_type = H5Aget_type(attr_id)) < 0) goto out; - if ( (attr_class = H5Tget_class( attr_type )) < 0 ) + if((attr_class = H5Tget_class(attr_type)) < 0) goto out; /* Check if it is really a reference */ - if ( attr_class == H5T_REFERENCE ) + if(attr_class == H5T_REFERENCE) { /* Get the reference(s) */ - if ( (attr_space_id = H5Aget_space( attr_id )) < 0 ) + if((attr_space_id = H5Aget_space(attr_id)) < 0) goto out; - n_refs = H5Sget_simple_extent_npoints( attr_space_id ); + n_refs = H5Sget_simple_extent_npoints(attr_space_id); dim_ref = n_refs; - refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = malloc(sizeof(hobj_ref_t) * (int)dim_ref); - if ( H5Aread( attr_id, attr_type, refbuf ) < 0 ) + if(H5Aread(attr_id, attr_type, refbuf) < 0) goto out; /* Get the palette id */ - if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0 ) + if((pal_id = H5Rdereference(image_id, H5R_OBJECT, &refbuf[pal_number])) < 0) goto out; /* Read the palette dataset using the memory type TID */ - if ( H5Dread( pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0 ) + if(H5Dread(pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0) goto out; - if ( H5Sclose( attr_space_id ) < 0 ) + if(H5Sclose(attr_space_id) < 0) goto out; /* close the dereferenced dataset */ - if (H5Dclose(pal_id)<0) + if(H5Dclose(pal_id) < 0) goto out; - free( refbuf ); + free(refbuf); } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0 ) + if(H5Tclose(attr_type) < 0) goto out; /* Close the attribute. */ - if ( H5Aclose( attr_id ) < 0 ) + if(H5Aclose(attr_id) < 0) goto out; } /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0 ) + if(H5Dclose(image_id) < 0) return -1; return 0; out: - H5Dclose( image_id ); + H5Dclose(image_id); return -1; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index a98d567..e226f89 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -45,6 +45,61 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, void *data); /*------------------------------------------------------------------------- + * Function: H5LT_make_dataset + * + * Purpose: Creates and writes a dataset of a type tid + * + * Return: Success: 0, Failure: -1 + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: October 10, 2007 + * + *------------------------------------------------------------------------- + */ + +static herr_t +H5LT_make_dataset_numerical( hid_t loc_id, + const char *dset_name, + int rank, + const hsize_t *dims, + hid_t tid, + const void *data ) +{ + hid_t did = -1, sid = -1; + + /* Create the data space for the dataset. */ + if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + return -1; + + /* Create the dataset. */ + if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + + /* Write the dataset only if there is data to write */ + if(data) + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto out; + + /* End access to the dataset and release resources used by it. */ + if(H5Dclose(did) < 0) + return -1; + + /* Terminate access to the data space. */ + if(H5Sclose(sid) < 0) + return -1; + + return 0; + +out: + H5E_BEGIN_TRY { + H5Dclose(did); + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} + +/*------------------------------------------------------------------------- * * Public functions * @@ -77,39 +132,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, hid_t tid, const void *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, tid, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, tid, data)); } /*------------------------------------------------------------------------- @@ -137,39 +160,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, const hsize_t *dims, const char *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_CHAR, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_CHAR, data)); } @@ -199,39 +190,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, const hsize_t *dims, const short *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_SHORT, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_SHORT, data)); } /*------------------------------------------------------------------------- @@ -260,39 +219,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, const hsize_t *dims, const int *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_INT, data)); } @@ -323,39 +250,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, const hsize_t *dims, const long *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_LONG, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_LONG, data)); } /*------------------------------------------------------------------------- @@ -384,39 +279,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, const hsize_t *dims, const float *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_FLOAT, data)); } @@ -447,39 +310,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, const hsize_t *dims, const double *data ) { - - hid_t did, sid; - - /* Create the data space for the dataset. */ - if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) - return -1; - - /* Create the dataset. */ - if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT )) < 0 ) - goto out; - - /* Write the dataset only if there is data to write */ - - if ( data ) - { - if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) - goto out; - } - - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0 ) - return -1; - - /* Terminate access to the data space. */ - if ( H5Sclose( sid ) < 0 ) - return -1; - - return 0; - -out: - H5Dclose( did ); - H5Sclose( sid ); - return -1; + return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_DOUBLE, data)); } @@ -507,55 +338,53 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, const char *dset_name, const char *buf ) { + hid_t did = -1; + hid_t sid = -1; + hid_t tid = -1; + size_t size; - hid_t did=-1; - hid_t sid=-1; - hid_t tid; - size_t size; - - /* create a string data type */ - if ( (tid = H5Tcopy( H5T_C_S1 )) < 0 ) - goto out; - - size = strlen(buf) + 1; /* extra null term */ + /* create a string data type */ + if((tid = H5Tcopy(H5T_C_S1)) < 0 ) + goto out; - if ( H5Tset_size(tid,size) < 0 ) - goto out; + size = strlen(buf) + 1; /* extra null term */ - if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 ) - goto out; + if(H5Tset_size(tid, size) < 0) + goto out; - /* Create the data space for the dataset. */ - if ( (sid = H5Screate( H5S_SCALAR )) < 0 ) - goto out; + if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0) + goto out; - /* Create the dataset. */ - if ( (did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT)) < 0 ) - goto out; + /* Create the data space for the dataset. */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + goto out; - /* Write the dataset only if there is data to write */ + /* Create the dataset. */ + if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - if (buf) - { - if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 ) - goto out; - } + /* Write the dataset only if there is data to write */ + if(buf) + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto out; - /* close*/ - if ( H5Dclose(did) < 0 ) - return -1; - if ( H5Sclose(sid) < 0 ) - return -1; - if ( H5Tclose(tid) < 0 ) - goto out; + /* close*/ + if(H5Dclose(did) < 0) + return -1; + if(H5Sclose(sid) < 0) + return -1; + if(H5Tclose(tid) < 0) + goto out; - return 0; + return 0; out: - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - return -1; + H5E_BEGIN_TRY { + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + } H5E_END_TRY; + return -1; } @@ -574,7 +403,7 @@ out: */ static herr_t -H5LT_read_dataset(hid_t loc_id, const char *dset_name, hid_t tid, void *data) +H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void *data) { hid_t did; @@ -616,7 +445,7 @@ herr_t H5LTread_dataset(hid_t loc_id, hid_t tid, void *data) { - return(H5LT_read_dataset(loc_id, dset_name, tid, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, tid, data)); } @@ -638,7 +467,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_CHAR, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_CHAR, data)); } /*------------------------------------------------------------------------- @@ -659,7 +488,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_SHORT, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_SHORT, data)); } /*------------------------------------------------------------------------- @@ -680,7 +509,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_INT, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_INT, data)); } /*------------------------------------------------------------------------- @@ -701,7 +530,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_LONG, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_LONG, data)); } /*------------------------------------------------------------------------- @@ -722,7 +551,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_FLOAT, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_FLOAT, data)); } @@ -744,7 +573,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *data ) { - return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_DOUBLE, data)); + return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_DOUBLE, data)); } diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index aedc7b5..f337360 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -83,8 +83,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id, hid_t ret_value; /* Register the packet table ID type if this is the first table created */ - if( H5PT_ptable_id_type < 0) - if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) <0) + if(H5PT_ptable_id_type < 0) + if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0) goto out; /* Get memory for the table identifier */ @@ -94,35 +94,33 @@ hid_t H5PTcreate_fl ( hid_t loc_id, dims[0] = 0; dims_chunk[0] = chunk_size; maxdims[0] = H5S_UNLIMITED; - if ( (space_id = H5Screate_simple( 1, dims, maxdims )) < 0 ) + if((space_id = H5Screate_simple(1, dims, maxdims)) < 0) goto out; /* Modify dataset creation properties to enable chunking */ - plist_id = H5Pcreate (H5P_DATASET_CREATE); - if ( H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0 ) + plist_id = H5Pcreate(H5P_DATASET_CREATE); + if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0) goto out; if(compression >= 0 && compression <= 9) - { - if( H5Pset_deflate(plist_id, (unsigned)compression) < 0) + if(H5Pset_deflate(plist_id, (unsigned)compression) < 0) goto out; - } /* Create the dataset. */ - if ( (dset_id=H5Dcreate( loc_id, dset_name, dtype_id, space_id, plist_id))<0 ) + if((dset_id = H5Dcreate2(loc_id, dset_name, dtype_id, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) goto out; /* Terminate access to the data space. */ - if ( H5Sclose( space_id ) < 0 ) + if(H5Sclose(space_id) < 0) goto out; /* End access to the property list */ - if ( H5Pclose( plist_id ) < 0 ) + if(H5Pclose(plist_id) < 0) goto out; /* Create the table identifier */ table->dset_id = dset_id; - if((table->type_id = H5Tcopy(dtype_id)) <0) + if((table->type_id = H5Tcopy(dtype_id)) < 0) goto out; H5PT_create_index(table); @@ -131,7 +129,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id, /* Get an ID for this table */ ret_value = H5Iregister(H5PT_ptable_id_type, table); - if (ret_value != H5I_INVALID_HID) + if(ret_value != H5I_INVALID_HID) H5PT_ptable_count++; else H5PT_close(table); @@ -180,14 +178,14 @@ hid_t H5PTcreate_vl ( hid_t loc_id, /* Create a variable length type that uses single bytes as its base type */ vltype = H5Tvlen_create(H5T_NATIVE_UCHAR); - if (vltype < 0) + if(vltype < 0) goto out; - if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) <0) + if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) < 0) goto out; /* close the vltype */ - if (H5Tclose(vltype) < 0) + if(H5Tclose(vltype) < 0) goto out; return ret_value; @@ -229,7 +227,7 @@ hid_t H5PTopen( hid_t loc_id, /* Register the packet table ID type if this is the first table created */ if( H5PT_ptable_id_type < 0) - if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free))<0) + if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0) goto out; table = (htbl_t *)malloc(sizeof(htbl_t)); @@ -237,35 +235,35 @@ hid_t H5PTopen( hid_t loc_id, /* Open the dataset */ if((table->dset_id = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - if (table->dset_id < 0) + if(table->dset_id < 0) goto out; /* Get the dataset's disk datatype */ - if ((type_id = H5Dget_type(table->dset_id)) < 0) + if((type_id = H5Dget_type(table->dset_id)) < 0) goto out; /* Get the table's native datatype */ - if ((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0) + if((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0) goto out; - if (H5Tclose(type_id) < 0) + if(H5Tclose(type_id) < 0) goto out; /* Initialize the current record pointer */ - if((H5PT_create_index(table)) <0) + if((H5PT_create_index(table)) < 0) goto out; /* Get number of records in table */ - if((space_id=H5Dget_space(table->dset_id)) <0) + if((space_id=H5Dget_space(table->dset_id)) < 0) goto out; - if ( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0 ) + if( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0) goto out; table->size = dims[0]; /* Get an ID for this table */ ret_value = H5Iregister(H5PT_ptable_id_type, table); - if (ret_value != H5I_INVALID_HID) + if(ret_value != H5I_INVALID_HID) H5PT_ptable_count++; else H5PT_close(table); @@ -311,11 +309,11 @@ herr_t H5PT_close( htbl_t* table) goto out; /* Close the dataset */ - if (H5Dclose(table->dset_id) < 0) + if(H5Dclose(table->dset_id) < 0) goto out; /* Close the memory datatype */ - if (H5Tclose(table->type_id) < 0) + if(H5Tclose(table->type_id) < 0) goto out; free(table); @@ -370,7 +368,7 @@ herr_t H5PTclose( hid_t table_id ) /* Remove the packet table type ID if no more packet */ /* tables are open */ - if (H5PT_ptable_count == 0) + if(H5PT_ptable_count == 0) { H5Idestroy_type(H5PT_ptable_id_type); H5PT_ptable_id_type = H5I_UNINIT; @@ -419,11 +417,11 @@ herr_t H5PTappend( hid_t table_id, goto out; /* If we are asked to write 0 records, just do nothing */ - if (nrecords == 0) + if(nrecords == 0) return 0; if((H5TB_common_append_records(table->dset_id, table->type_id, - nrecords, table->size, data)) <0) + nrecords, table->size, data)) < 0) goto out; /* Update table size */ @@ -473,7 +471,7 @@ herr_t H5PTget_next( hid_t table_id, goto out; /* If nrecords == 0, do nothing */ - if (nrecords == 0) + if(nrecords == 0) return 0; if((H5TB_common_read_records(table->dset_id, table->type_id, @@ -516,11 +514,11 @@ herr_t H5PTread_packets( hid_t table_id, /* find the table struct from its ID */ table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type); - if (table == NULL) + if(table == NULL) goto out; /* If nrecords == 0, do nothing */ - if (nrecords == 0) + if(nrecords == 0) return 0; if( H5TB_common_read_records(table->dset_id, table->type_id, @@ -799,7 +797,7 @@ herr_t H5PTfree_vlen_readbuff( hid_t table_id, if((table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type)) == NULL) goto out; - if ((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0) + if((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0) goto out; /* Free the memory. If this succeeds, ret_value should be 0. */ diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 9f4b161..2471466 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -117,50 +117,44 @@ herr_t H5TBmake_table( const char *table_title, return -1; /* Modify dataset creation properties, i.e. enable chunking */ - plist_id = H5Pcreate (H5P_DATASET_CREATE); - if(H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0) + plist_id = H5Pcreate(H5P_DATASET_CREATE); + if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0) return -1; /* Set the fill value using a struct as the data type. */ - if(fill_data ) - { - if(H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0) + if(fill_data) + if(H5Pset_fill_value(plist_id, mem_type_id, fill_data) < 0) return -1; - } /* Dataset creation property list is modified to use GZIP compression with the compression effort set to 6. Note that compression can be used only when dataset is chunked. */ - if(compress ) - { - if(H5Pset_deflate( plist_id, 6) < 0) + if(compress) + if(H5Pset_deflate(plist_id, 6) < 0) return -1; - } /* Create the dataset. */ - if((did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0) + if((did = H5Dcreate2(loc_id, dset_name, mem_type_id, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) goto out; /* Only write if there is something to write */ - if(data ) - { + if(data) /* Write data to the dataset. */ if(H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0) goto out; - } /* Terminate access to the data space. */ - if(H5Sclose( sid ) < 0) + if(H5Sclose(sid) < 0) goto out; /* End access to the dataset */ - if(H5Dclose( did ) < 0) + if(H5Dclose(did) < 0) goto out; /* End access to the property list */ - if(H5Pclose( plist_id ) < 0) + if(H5Pclose(plist_id) < 0) goto out; /*------------------------------------------------------------------------- @@ -1915,11 +1909,11 @@ herr_t H5TBcombine_tables( hid_t loc_id1, */ /* Clone the property list */ - if(( plist_id3 = H5Pcopy( plist_id1 )) < 0) + if((plist_id3 = H5Pcopy(plist_id1)) < 0) goto out; /* Clone the type id */ - if(( type_id3 = H5Tcopy( type_id1 )) < 0) + if((type_id3 = H5Tcopy(type_id1)) < 0) goto out; /*------------------------------------------------------------------------- @@ -1930,18 +1924,18 @@ herr_t H5TBcombine_tables( hid_t loc_id1, dims[0] = 0; /* Create a simple data space with unlimited size */ - if((space_id3 = H5Screate_simple( 1, dims, maxdims )) < 0) + if((space_id3 = H5Screate_simple(1, dims, maxdims)) < 0) return -1; /* Create the dataset */ - if((dataset_id3 = H5Dcreate( loc_id1, dset_name3, type_id3, space_id3, plist_id3 )) < 0) + if((dataset_id3 = H5Dcreate2(loc_id1, dset_name3, type_id3, space_id3, H5P_DEFAULT, plist_id3, H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- * Attach the conforming table attributes *------------------------------------------------------------------------- */ - if(H5TB_attach_attributes( "Merge table", loc_id1, dset_name3, nfields, type_id3 ) < 0) + if(H5TB_attach_attributes("Merge table", loc_id1, dset_name3, nfields, type_id3) < 0) goto out; /*------------------------------------------------------------------------- @@ -1949,13 +1943,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1, *------------------------------------------------------------------------- */ - type_size = H5Tget_size( type_id3 ); + type_size = H5Tget_size(type_id3); /* alloc fill value attribute buffer */ - tmp_fill_buf = (unsigned char *)malloc((size_t) type_size ); + tmp_fill_buf = (unsigned char *)malloc(type_size); /* Get the fill value attributes */ - has_fill=H5TBAget_fill( loc_id1, dset_name1, dataset_id1, tmp_fill_buf ); + has_fill = H5TBAget_fill(loc_id1, dset_name1, dataset_id1, tmp_fill_buf); /*------------------------------------------------------------------------- * Attach the fill attributes from previous table @@ -2312,14 +2306,11 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Insert the old fields, counting with the new one */ for ( i = 0; i < nfields + 1; i++) { - idx = i; if(inserted ) idx = i - 1; - if(i == position ) - { - + if(i == position ) { /* Get the new member size */ new_member_size = H5Tget_size( field_type ); @@ -2332,7 +2323,6 @@ herr_t H5TBinsert_field( hid_t loc_id, inserted = 1; continue; - } /* Get the member name */ @@ -2356,8 +2346,6 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Close the member type */ if(H5Tclose( member_type_id ) < 0) goto out; - - } /* i */ /*------------------------------------------------------------------------- @@ -2366,20 +2354,20 @@ herr_t H5TBinsert_field( hid_t loc_id, */ /* Retrieve the size of chunk */ - if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0) + if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0) goto out; /* Create a new simple data space with unlimited size, using the dimension */ - if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0) + if((space_id2 = H5Screate_simple( 1, dims, maxdims)) < 0) return -1; /* Modify dataset creation properties, i.e. enable chunking */ - plist_id2 = H5Pcreate (H5P_DATASET_CREATE); - if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0) + plist_id2 = H5Pcreate(H5P_DATASET_CREATE); + if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0) return -1; /* Create the dataset. */ - if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0) + if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0) goto out; @@ -2388,20 +2376,20 @@ herr_t H5TBinsert_field( hid_t loc_id, *------------------------------------------------------------------------- */ - tmp_buf = (unsigned char *)calloc((size_t) nrecords, (size_t)total_size ); + tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size); /* Define a hyperslab in the dataset of the size of the records */ offset[0] = 0; count[0] = nrecords; - if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) + if(H5Sselect_hyperslab(space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; /* Create a memory dataspace handle */ mem_size[0] = count[0]; - if((mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0) + if((mem_space_id1 = H5Screate_simple(1, mem_size, NULL)) < 0) goto out; - if(H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0) + if(H5Dread(dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf) < 0) goto out; @@ -2837,12 +2825,11 @@ herr_t H5TBdelete_field( hid_t loc_id, curr_offset += member_size; - free( member_name ); + free(member_name); /* Close the member type */ - if(H5Tclose( member_type_id ) < 0) + if(H5Tclose(member_type_id) < 0) goto out; - } /* i */ /*------------------------------------------------------------------------- @@ -2851,48 +2838,45 @@ herr_t H5TBdelete_field( hid_t loc_id, */ /* Retrieve the size of chunk */ - if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0) + if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0) goto out; /* Create a new simple data space with unlimited size, using the dimension */ - if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0) + if((space_id2 = H5Screate_simple(1, dims, maxdims)) < 0) return -1; /* Modify dataset creation properties, i.e. enable chunking */ - plist_id2 = H5Pcreate (H5P_DATASET_CREATE); - if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0) + plist_id2 = H5Pcreate(H5P_DATASET_CREATE); + if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0) return -1; /* Create the dataset. */ - if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0) + if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- * We have to read field by field of the old dataset and save it into the new one *------------------------------------------------------------------------- */ - for ( i = 0; i < nfields; i++) - { - + for ( i = 0; i < nfields; i++) { /* Get the member name */ - member_name = H5Tget_member_name( type_id1,(unsigned) i ); + member_name = H5Tget_member_name(type_id1, (unsigned)i); /* Skip the field to delete */ - if(H5TB_find_field( member_name, field_name ) > 0 ) - { - free( member_name ); + if(H5TB_find_field(member_name, field_name) > 0) { + free(member_name); continue; } /* Get the member type */ - if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0) + if((member_type_id = H5Tget_member_type(type_id1, (unsigned)i)) < 0) goto out; /* Get the member size */ - member_size = H5Tget_size( member_type_id ); + member_size = H5Tget_size(member_type_id); /* Create a read id */ - if(( read_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0) + if((read_type_id = H5Tcreate(H5T_COMPOUND, member_size)) < 0) goto out; /* Insert it into the new type */ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 604da3a..8fb8604 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -78,14 +78,14 @@ int main(void) { int nerrors=0; - nerrors += test_simple()<0 ?1:0; - nerrors += test_errors()<0 ?1:0; - nerrors += test_rank()<0 ?1:0; - nerrors += test_iterators()<0 ?1:0; - nerrors += test_types()<0 ?1:0; - nerrors += test_data()<0 ?1:0; - - if (nerrors) goto error; + nerrors += test_simple() < 0 ?1:0; + nerrors += test_errors() < 0 ?1:0; + nerrors += test_rank() < 0 ?1:0; + nerrors += test_iterators() < 0 ?1:0; + nerrors += test_types() < 0 ?1:0; + nerrors += test_data() < 0 ?1:0; + + if(nerrors) goto error; printf("All dimension scales tests passed.\n"); return 0; @@ -159,7 +159,7 @@ static int test_simple(void) */ /* create a file using default properties */ - if ((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0) + if((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- @@ -168,27 +168,27 @@ static int test_simple(void) */ /* make a dataset */ - if (H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf)<0) + if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0) goto out; /* make a DS dataset for the first dimension */ - if (H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf)<0) + if(H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf) < 0) goto out; /* make a DS dataset with an alternate scale for the 2nd dimension */ - if (H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf)<0) + if(H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf) < 0) goto out; /* make a DS dataset for the second dimension */ - if (H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf)<0) + if(H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf) < 0) goto out; /* make a DS dataset with an alternate scale for the 2nd dimension */ - if (H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf)<0) + if(H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf) < 0) goto out; /* make a DS dataset with an alternate scale for the 2nd dimension */ - if (H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf)<0) + if(H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf) < 0) goto out; @@ -200,7 +200,7 @@ static int test_simple(void) TESTING2("attach scales"); /* get the dataset id for "dset_a" */ - if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- @@ -209,15 +209,15 @@ static int test_simple(void) */ /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0) goto out; /* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */ - if (H5DSattach_scale(did,dsid,DIM0)<0) + if(H5DSattach_scale(did,dsid,DIM0) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /*------------------------------------------------------------------------- @@ -226,15 +226,15 @@ static int test_simple(void) */ /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0) goto out; /* attach the DS_11_NAME dimension scale to "dset_a" at dimension 0 */ - if (H5DSattach_scale(did,dsid,DIM0)<0) + if(H5DSattach_scale(did,dsid,DIM0) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /*------------------------------------------------------------------------- @@ -243,15 +243,15 @@ static int test_simple(void) */ /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0) goto out; /* attach the "ds2" dimension scale to "dset_a" as the 2nd dimension */ - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /*------------------------------------------------------------------------- @@ -260,15 +260,15 @@ static int test_simple(void) */ /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0) goto out; /* attach the DS_21_NAME dimension scale to "dset_a" as the 2nd dimension */ - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /*------------------------------------------------------------------------- @@ -277,15 +277,15 @@ static int test_simple(void) */ /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0) goto out; /* attach the "ds22" dimension scale to "dset_a" as the 2nd dimension */ - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; @@ -295,37 +295,37 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM0)<=0) + if(H5DSis_attached(did,dsid,DIM0)<=0) goto out; - if (H5Dclose(dsid)) + if(H5Dclose(dsid)) goto out; - if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM1)<=0) + if(H5DSis_attached(did,dsid,DIM1)<=0) goto out; - if (H5Dclose(dsid)) + if(H5Dclose(dsid)) goto out; - if ((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM1)<=0) + if(H5DSis_attached(did,dsid,DIM1)<=0) goto out; - if (H5Dclose(dsid)) + if(H5Dclose(dsid)) goto out; - if ((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM1)<=0) + if(H5DSis_attached(did,dsid,DIM1)<=0) goto out; - if (H5Dclose(dsid)) + if(H5Dclose(dsid)) goto out; /* close dataset ID of "dset_a" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; @@ -345,23 +345,23 @@ static int test_simple(void) */ /* get the dataset id for "dset_a" */ - if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_a" has 1 dimension scale at DIM 0 */ - if ((nscales = H5DSget_num_scales(did,0))<0) + if((nscales = H5DSget_num_scales(did,0)) < 0) goto out; - if (nscales!=2) + if(nscales!=2) goto out; /* verify that "dset_a" has 3 dimension scales at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=3) + if(nscales!=3) goto out; /* close dataset ID of "dset_a" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; @@ -371,11 +371,11 @@ static int test_simple(void) */ /* make a dataset */ - if (H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf)<0) + if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0) goto out; /* make a DS dataset for the first dimension */ - if (H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf)<0) + if(H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf) < 0) goto out; /*------------------------------------------------------------------------- @@ -383,15 +383,15 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,0)<0) + if(H5DSattach_scale(did,dsid,0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -400,23 +400,23 @@ static int test_simple(void) */ /* get the dataset id for "dset_b" */ - if ((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_b" has 1 dimension scale at DIM 0 */ - if ((nscales = H5DSget_num_scales(did,0))<0) + if((nscales = H5DSget_num_scales(did,0)) < 0) goto out; - if (nscales!=1) + if(nscales!=1) goto out; /* verify that "dset_b" has 0 dimension scales at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=0) + if(nscales!=0) goto out; /* close dataset ID of "dset_b" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; PASSED(); @@ -436,23 +436,23 @@ static int test_simple(void) */ /* make a dataset */ - if (H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf)<0) + if(H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf) < 0) goto out; /* make a DS dataset for the first dimension */ - if (H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf)<0) + if(H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf) < 0) goto out; /* make a DS dataset for the second dimension */ - if (H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf)<0) + if(H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf) < 0) goto out; /* make a DS dataset with an alternate scale for the 2nd dimension */ - if (H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf)<0) + if(H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf) < 0) goto out; /* make a DS dataset with an alternate scale for the 2nd dimension */ - if (H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf)<0) + if(H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf) < 0) goto out; @@ -461,38 +461,38 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,0)<0) + if(H5DSattach_scale(did,dsid,0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,1)<0) + if(H5DSattach_scale(did,dsid,1) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,1)<0) + if(H5DSattach_scale(did,dsid,1) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,1)<0) + if(H5DSattach_scale(did,dsid,1) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -500,19 +500,19 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_c" has 1 dimension scale at DIM 0 */ - if ((nscales = H5DSget_num_scales(did,0))<0) + if((nscales = H5DSget_num_scales(did,0)) < 0) goto out; - if (nscales!=1) + if(nscales!=1) goto out; /* verify that "dset_c" has 3 dimension scales at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=3) + if(nscales!=3) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -521,23 +521,23 @@ static int test_simple(void) */ /* get the dataset id for "dset_c" */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0) goto out; /* detach the "ds_c_21" dimension scale to "dset_c" in DIM 1 */ - if (H5DSdetach_scale(did,dsid,1)<0) + if(H5DSdetach_scale(did,dsid,1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_c" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -545,14 +545,14 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_c" has 2 dimension scales at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=2) + if(nscales!=2) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -561,23 +561,23 @@ static int test_simple(void) */ /* get the dataset id for "dset_c" */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0) goto out; /* detach the "ds_c_22" dimension scale to "dset_c" in DIM 1 */ - if (H5DSdetach_scale(did,dsid,1)<0) + if(H5DSdetach_scale(did,dsid,1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_c" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -585,14 +585,14 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_c" has 1 dimension scale at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=1) + if(nscales!=1) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -601,23 +601,23 @@ static int test_simple(void) */ /* get the dataset id for "dset_c" */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0) goto out; /* detach the "ds_c_2" dimension scale to "dset_c" in DIM 1 */ - if (H5DSdetach_scale(did,dsid,1)<0) + if(H5DSdetach_scale(did,dsid,1) < 0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_c" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -625,14 +625,14 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0) goto out; /* verify that "dset_c" has 1 dimension scale at DIM 1 */ - if ((nscales = H5DSget_num_scales(did,1))<0) + if((nscales = H5DSget_num_scales(did,1)) < 0) goto out; - if (nscales!=0) + if(nscales!=0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; @@ -640,34 +640,34 @@ static int test_simple(void) * create 3 datasets: 1 "data" dataset and 2 dimension scales *------------------------------------------------------------------------- */ - if (H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL)<0) + if(H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL) < 0) goto out; - if (H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL)<0) + if(H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL) < 0) goto out; - if (H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL)<0) + if(H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL) < 0) goto out; /*------------------------------------------------------------------------- * attach them *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,0)<0) + if(H5DSattach_scale(did,dsid,0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,1)<0) + if(H5DSattach_scale(did,dsid,1) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -675,24 +675,24 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM0)<=0) + if(H5DSis_attached(did,dsid,DIM0)<=0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM1)<=0) + if(H5DSis_attached(did,dsid,DIM1)<=0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; @@ -702,27 +702,27 @@ static int test_simple(void) */ /* get the dataset id for "dset_d" */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0) goto out; /* detach the dimension scale to "dset_d" in DIM 0 */ - if (H5DSdetach_scale(did,dsid,DIM0)<0) + if(H5DSdetach_scale(did,dsid,DIM0) < 0) goto out; /* verify attach, it must return 0 for no attach */ - if (H5DSis_attached(did,dsid,DIM0)!=0) + if(H5DSis_attached(did,dsid,DIM0)!=0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_d" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -731,33 +731,33 @@ static int test_simple(void) */ /* get the dataset id for "dset_d" */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0) goto out; /* attach "ds_d_1" again in DIM 0 */ - if (H5DSattach_scale(did,dsid,DIM0)<0) + if(H5DSattach_scale(did,dsid,DIM0) < 0) goto out; /* verify attach, it must return 1 for attach */ - if (H5DSis_attached(did,dsid,DIM0)!=1) + if(H5DSis_attached(did,dsid,DIM0)!=1) goto out; /* verify that "ds_d_1" has only 1 scale at DIM0 */ - if ((nscales = H5DSget_num_scales(did,DIM0))<0) + if((nscales = H5DSget_num_scales(did,DIM0)) < 0) goto out; - if (nscales!=1) + if(nscales!=1) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_d" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -766,37 +766,37 @@ static int test_simple(void) */ /* get the dataset id for "dset_d" */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0) goto out; /* detach the "ds_d_2" dimension scale to "dset_d" in DIM 1 */ - if (H5DSdetach_scale(did,dsid,DIM1)<0) + if(H5DSdetach_scale(did,dsid,DIM1) < 0) goto out; /* detach again, it should fail */ - if (H5DSdetach_scale(did,dsid,DIM1)==SUCCEED) + if(H5DSdetach_scale(did,dsid,DIM1)==SUCCEED) goto out; /* verify attach, it must return 0 for no attach */ - if (H5DSis_attached(did,dsid,DIM1)!=0) + if(H5DSis_attached(did,dsid,DIM1)!=0) goto out; /* verify that "ds_d_1" has no scale at DIM1 */ - if ((nscales = H5DSget_num_scales(did,DIM1))<0) + if((nscales = H5DSget_num_scales(did,DIM1)) < 0) goto out; - if (nscales!=0) + if(nscales!=0) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_d" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -805,47 +805,47 @@ static int test_simple(void) */ /* get the dataset id for "dset_d" */ - if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0) goto out; /* get the DS dataset id */ - if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0) goto out; /* attach "ds_d_2" in DIM 1 */ - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; /* verify attach, it must return 1 for attach */ - if (H5DSis_attached(did,dsid,DIM1)!=1) + if(H5DSis_attached(did,dsid,DIM1)!=1) goto out; /* verify that "ds_d_2" has only 1 scale at DIM1 */ - if ((nscales = H5DSget_num_scales(did,DIM0))<0) + if((nscales = H5DSget_num_scales(did,DIM0)) < 0) goto out; - if (nscales!=1) + if(nscales!=1) goto out; /* attach "ds_d_2" again in DIM 1 */ - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; /* verify attach, it must return 1 for attach */ - if (H5DSis_attached(did,dsid,DIM1)!=1) + if(H5DSis_attached(did,dsid,DIM1)!=1) goto out; /* verify that "ds_d_2" has only 1 scale at DIM1 */ - if ((nscales = H5DSget_num_scales(did,DIM0))<0) + if((nscales = H5DSget_num_scales(did,DIM0)) < 0) goto out; - if (nscales!=1) + if(nscales != 1) goto out; /* close DS id */ - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; /* close dataset ID of "dset_d" */ - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; /*------------------------------------------------------------------------- @@ -858,22 +858,21 @@ static int test_simple(void) goto out; /* create the data space for the dataset */ - if ((sid=H5Screate_simple(rank,dims,NULL))<0) + if((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto out; - for (i=0; i<5; i++) - { + for(i = 0; i < 5; i++) { sprintf(dname,"dset_%d",i); - if ((did = H5Dcreate(gid,dname,H5T_NATIVE_INT,sid,H5P_DEFAULT))<0) + if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; sprintf(sname,"ds_%d",i); - if((dsid = H5Dcreate(gid,sname,H5T_NATIVE_INT,sid,H5P_DEFAULT))<0) + if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if(H5DSset_scale(dsid,"scale")<0) + if(H5DSset_scale(dsid,"scale") < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; } @@ -882,22 +881,20 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - for (i=0; i<5; i++) - { - sprintf(dname,"dset_%d",i); - if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0) + for(i = 0; i < 5; i++) { + sprintf(dname, "dset_%d", i); + if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; - for (j=0; j<5; j++) - { - sprintf(sname,"ds_%d",j); - if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0) + for(j = 0; j < 5; j++) { + sprintf(sname, "ds_%d", j); + if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; - if(H5DSattach_scale(did,dsid,DIM0)<0) + if(H5DSattach_scale(did, dsid, DIM0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; } - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; } @@ -906,22 +903,20 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - for (i=0; i<5; i++) - { - sprintf(dname,"dset_%d",i); - if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0) + for(i = 0; i < 5; i++) { + sprintf(dname, "dset_%d", i); + if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; - for (j=0; j<5; j++) - { - sprintf(sname,"ds_%d",j); - if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0) + for(j = 0; j < 5; j++) { + sprintf(sname, "ds_%d", j); + if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; - if(H5DSdetach_scale(did,dsid,DIM0)<0) + if(H5DSdetach_scale(did, dsid, DIM0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; } - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; } @@ -931,29 +926,29 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - for (i=0; i<5; i++) + for(i=0; i<5; i++) { sprintf(dname,"dset_%d",i); - if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0) + if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0) goto out; - for (j=0; j<5; j++) + for(j=0; j<5; j++) { sprintf(sname,"ds_%d",j); - if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0) + if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0) goto out; - if(H5DSattach_scale(did,dsid,DIM0)<0) + if(H5DSattach_scale(did,dsid,DIM0) < 0) goto out; - if (H5Dclose(dsid)<0) + if(H5Dclose(dsid) < 0) goto out; } - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; } /* close */ - if (H5Sclose(sid)<0) + if(H5Sclose(sid) < 0) goto out; - if (H5Gclose(gid)<0) + if(H5Gclose(gid) < 0) goto out; @@ -968,30 +963,30 @@ static int test_simple(void) TESTING2("attach only to 1 dimension"); /* make a dataset */ - if (H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL)<0) + if(H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL) < 0) goto out; /* make a scale */ - if (H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL)<0) + if(H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL) < 0) goto out; /* attach the DS to dimension 1 */ - if ((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT))<0) + if((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT)) < 0) goto out; - if ((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT))<0) + if((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT)) < 0) goto out; - if (H5DSattach_scale(did,dsid,DIM1)<0) + if(H5DSattach_scale(did,dsid,DIM1) < 0) goto out; - if (H5DSis_attached(did,dsid,DIM1)<=0) + if(H5DSis_attached(did,dsid,DIM1)<=0) goto out; /* try to detach all dimensions. for dimensions 0 and 2, it is an error */ - for (i=0; i0); /* Create dataset */ - dsid=H5Dcreate(fid,DEFAULT_DATASET_NAME,DEFAULT_HDF5_DATATYPE,file_sid,dcpl); - assert(dsid>0); + dsid = H5Dcreate2(fid, DEFAULT_DATASET_NAME, DEFAULT_HDF5_DATATYPE, file_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + assert(dsid > 0); /* Close dataset creation property list */ ret=H5Pclose(dcpl); diff --git a/perform/chunk.c b/perform/chunk.c index a3aabe0..2777da0 100644 --- a/perform/chunk.c +++ b/perform/chunk.c @@ -149,29 +149,29 @@ create_dataset (void) /* The data space */ size[0] = size[1] = DS_SIZE * CH_SIZE; - space = H5Screate_simple (2, size, size); + space = H5Screate_simple(2, size, size); /* The storage layout and compression */ - dcpl = H5Pcreate (H5P_DATASET_CREATE); + dcpl = H5Pcreate(H5P_DATASET_CREATE); size[0] = size[1] = CH_SIZE; - H5Pset_chunk (dcpl, 2, size); - H5Zregister (H5Z_COUNTER); - H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL); + H5Pset_chunk(dcpl, 2, size); + H5Zregister(H5Z_COUNTER); + H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL); /* The dataset */ - dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl); - assert (dset>=0); + dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + assert(dset>=0); /* The data */ - buf = calloc (1, SQUARE (DS_SIZE*CH_SIZE)); - H5Dwrite (dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - free (buf); + buf = calloc(1, SQUARE (DS_SIZE*CH_SIZE)); + H5Dwrite(dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + free(buf); /* Close */ - H5Dclose (dset); - H5Sclose (space); - H5Pclose (dcpl); - H5Fclose (file); + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Fclose(file); } diff --git a/perform/iopipe.c b/perform/iopipe.c index 8728fab..d736f17 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -224,12 +224,13 @@ main (void) /* Create the dataset */ file_space = H5Screate_simple (2, size, size); - assert (file_space>=0); - dset = H5Dcreate (file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT); - assert (dset>=0); - the_data = malloc ((size_t)(size[0]*size[1])); - /*initial fill for lazy malloc*/ - memset (the_data, 0xAA, (size_t)(size[0]*size[1])); + assert(file_space >= 0); + dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dset >= 0); + the_data = malloc((size_t)(size[0] * size[1])); + + /* initial fill for lazy malloc */ + memset(the_data, 0xAA, (size_t)(size[0] * size[1])); /* Fill raw */ synchronize (); 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= 0), "H5Fcreate succeeded", H5FATAL); /* define a contiquous dataset of opt_iter*nprocs*opt_block chars */ - dims[0] = opt_iter*nprocs*opt_block; - sid = H5Screate_simple (RANK, dims, NULL); + dims[0] = opt_iter * nprocs * opt_block; + sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL); - dataset = H5Dcreate(fid, "Dataset1", H5T_NATIVE_CHAR, sid, - H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded", H5FATAL); + dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL); /* create the memory dataspace and the file dataspace */ dims[0] = opt_block; - mem_dataspace = H5Screate_simple (RANK, dims, NULL); + mem_dataspace = H5Screate_simple(RANK, dims, NULL); VRFY((mem_dataspace >= 0), "", H5FATAL); - file_dataspace = H5Dget_space (dataset); + file_dataspace = H5Dget_space(dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded", H5FATAL); /* now each process writes a block of opt_block chars in round robbin diff --git a/perform/perf_meta.c b/perform/perf_meta.c index dd73140..572dfff 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -324,14 +324,15 @@ create_dsets(hid_t file) /* * Create a dataset using the default dataset creation properties. */ - for(i=0; ih5fd, dname, ELMT_H5_TYPE, - h5dset_space_id, h5dcpl); + h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, + h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); - if (h5ds_id < 0) { + if(h5ds_id < 0) { fprintf(stderr, "HDF5 Dataset Create failed\n"); GOTOERROR(FAIL); } hrc = H5Pclose(h5dcpl); /* verifying the close of the dcpl */ - if (hrc < 0) { + if(hrc < 0) { fprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 465ac41..d23df69 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -106,9 +106,10 @@ H5D_init_deprec_interface(void) FUNC_LEAVE_NOAPI(H5D_init()) } /* H5D_init_deprec_interface() */ +#ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5Dcreate + * Function: H5Dcreate1 * * Purpose: Creates a new dataset named NAME at LOC_ID, opens the * dataset for access, and associates with that dataset constant @@ -137,7 +138,7 @@ H5D_init_deprec_interface(void) *------------------------------------------------------------------------- */ hid_t -H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, +H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id) { H5G_loc_t loc; /* Object location to insert dataset into */ @@ -145,7 +146,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, const H5S_t *space; /* Dataspace for dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dcreate, FAIL) + FUNC_ENTER_API(H5Dcreate1, FAIL) H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, dcpl_id); /* Check arguments */ @@ -178,9 +179,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) -} /* end H5Dcreate() */ +} /* end H5Dcreate1() */ -#ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- * Function: H5Dopen1 diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index be858ac..d7f6574 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -116,14 +116,6 @@ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t *size); H5_DLL herr_t H5Ddebug(hid_t dset_id); -/* Functions and variables defined for compatibility with previous versions - * of the HDF5 API. - * - * Use of these functions and variables is deprecated. - */ -H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id, - hid_t space_id, hid_t plist_id); - /* Symbols defined for compatibility with previous versions of the HDF5 API. * * Use of these symbols is deprecated. @@ -137,6 +129,8 @@ H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id, /* Function prototypes */ +H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id, + hid_t space_id, hid_t dcpl_id); H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name); H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t *size); diff --git a/src/H5E.c b/src/H5E.c index b97f72f..6e553c6 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -321,8 +321,13 @@ H5E_get_stack(void) /* Set the thread-specific info */ estack->nused = 0; +#ifdef H5_USE_16_API + estack->auto_op.vers = 1; + estack->auto_op.u.func1 = (H5E_auto1_t)H5Eprint1; +#else /* H5_USE_16_API */ estack->auto_op.vers = 2; estack->auto_op.u.func2 = (H5E_auto2_t)H5Eprint2; +#endif /* H5_USE_16_API */ estack->auto_data = NULL; /* (It's not necessary to release this in this API, it is diff --git a/src/H5vers.txt b/src/H5vers.txt index 39f27e4..5745521 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -49,6 +49,7 @@ FUNCTION: H5Acreate; ; v10, v18 FUNCTION: H5Adelete; ; v10, v18 FUNCTION: H5Aiterate; H5A_operator; v10, v18 FUNCTION: H5Arename; ; v16, v18 +FUNCTION: H5Dcreate; ; v10, v18 FUNCTION: H5Dopen; ; v10, v18 FUNCTION: H5Eclear; ; v10, v18 FUNCTION: H5Eget_auto; ; v10, v18 diff --git a/src/H5version.h b/src/H5version.h index 5573e5b..311bb3b 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -54,6 +54,10 @@ #define H5Arename_vers 1 #endif /* !defined(H5Arename_vers) */ +#if !defined(H5Dcreate_vers) +#define H5Dcreate_vers 1 +#endif /* !defined(H5Dcreate_vers) */ + #if !defined(H5Dopen_vers) #define H5Dopen_vers 1 #endif /* !defined(H5Dopen_vers) */ @@ -169,6 +173,17 @@ #error "H5Arename_vers set to invalid value" #endif /* H5Arename_vers */ +#if !defined(H5Dcreate_vers) || H5Dcreate_vers == 2 +#ifndef H5Dcreate_vers +#define H5Dcreate_vers 2 +#endif /* H5Dcreate_vers */ +#define H5Dcreate H5Dcreate2 +#elif H5Dcreate_vers == 1 +#define H5Dcreate H5Dcreate1 +#else /* H5Dcreate_vers */ +#error "H5Dcreate_vers set to invalid value" +#endif /* H5Dcreate_vers */ + #if !defined(H5Dopen_vers) || H5Dopen_vers == 2 #ifndef H5Dopen_vers #define H5Dopen_vers 2 diff --git a/test/Makefile.am b/test/Makefile.am index 8ced149..1406df3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -59,9 +59,9 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat testmeta # --enable-build-all at configure time. # The gen_old_* files can only be compiled with older versions of the library # so do not appear in this list. -BUILD_ALL_PROGS=gen_bogus gen_deflate gen_filters gen_new_array gen_new_fill \ - gen_new_group gen_new_mtime gen_new_super gen_noencoder \ - gen_nullspace space_overflow gen_cross gen_udlinks +BUILD_ALL_PROGS=gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ + gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ + gen_nullspace gen_udlinks space_overflow if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) diff --git a/test/big.c b/test/big.c index 3c9cbd5..fa61a9b 100644 --- a/test/big.c +++ b/test/big.c @@ -295,16 +295,16 @@ writer (char* filename, hid_t fapl, int wrt_n) * We should create a dataset allocating space late and never writing fill values. * EIP 4/8/03 - if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0 || - (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0) { + 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); H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, dcpl)) < 0 || - (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, dcpl)) < 0) { + if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 || + (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { goto error; } diff --git a/test/cache_api.c b/test/cache_api.c index 1b9a37e..a1da62f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1578,13 +1578,13 @@ mdc_api_call_smoke_check(void) if ( pass ) { sprintf(dset_name, "/dset%03d", i); - dataset_ids[i] = H5Dcreate(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, properties); + dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { pass = FALSE; - failure_mssg = "H5Dcreate() failed."; + failure_mssg = "H5Dcreate2() failed."; } } diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 223537d..85c2318 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -229,26 +229,25 @@ test_compound (char *filename, hid_t fapl) } /* Create the memory data type */ - if ((s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t))) < 0) + if((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) goto error; array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL); - if (H5Tinsert (s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "c", HOFFSET(s1_t,c), array_dt) < 0 || - H5Tinsert (s1_tid, "d", HOFFSET(s1_t,d), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "e", HOFFSET(s1_t,e), H5T_NATIVE_INT) < 0) + if(H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), array_dt) < 0 || + H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "e", HOFFSET(s1_t, e), H5T_NATIVE_INT) < 0) goto error; H5Tclose(array_dt); /* Create the dataset */ - if ((dataset = H5Dcreate (file, "s1", s1_tid, space, H5P_DEFAULT)) < 0) { + if((dataset = H5Dcreate2(file, "s1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - } /* Write the data */ - if (H5Dwrite (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) { + if(H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) goto error; - } + PASSED(); /* @@ -1387,7 +1386,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) TESTING("writing data to contiguous and chunked datasets"); /* Create contiguous data set */ - if((dataset = H5Dcreate(file, DSET_NAME[0], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[0], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1402,7 +1401,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) goto error; /* Create chunked data set */ - if((dataset = H5Dcreate(file, DSET_NAME[1], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[1], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1591,7 +1590,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) TESTING("writing data to contiguous and chunked datasets"); /* Create contiguous data set */ - if((dataset = H5Dcreate(file, DSET_NAME[2], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[2], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1606,7 +1605,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) goto error; /* Create chunked data set */ - if((dataset = H5Dcreate(file, DSET_NAME[3], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[3], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ diff --git a/test/dangle.c b/test/dangle.c index 834d659..039c405 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -67,21 +67,21 @@ test_dangle_dataset(H5F_close_degree_t degree) TEST_ERROR; /* Create file access property list */ - if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set file close degree */ - if(H5Pset_fclose_degree(fapl,degree) < 0) + if(H5Pset_fclose_degree(fapl, degree) < 0) TEST_ERROR; h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); - if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; - if((sid = H5Screate (H5S_SCALAR)) < 0) + if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Dclose(dsid) < 0) @@ -89,7 +89,7 @@ test_dangle_dataset(H5F_close_degree_t degree) /* Try creating duplicate dataset */ H5E_BEGIN_TRY { - if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) >= 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) TEST_ERROR; } H5E_END_TRY; @@ -370,7 +370,7 @@ test_dangle_datatype2(H5F_close_degree_t degree) /* Create a dataset that uses the named datatype & leave it open */ if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((did = H5Dcreate(fid, DSETNAME, tid, sid, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Sclose(sid) < 0) TEST_ERROR; @@ -452,7 +452,7 @@ test_dangle_attribute(H5F_close_degree_t degree) if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create an attribute on the dataset */ diff --git a/test/dsets.c b/test/dsets.c index 3e8a25d..8125d75 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -206,9 +206,9 @@ test_create(hid_t file) * Create a dataset using the default dataset creation properties. We're * not sure what they are, so we won't check. */ - dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT); - if (dataset<0) goto error; + dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset < 0) goto error; /* Close the dataset */ if(H5Dclose(dataset) < 0) goto error; @@ -223,8 +223,8 @@ test_create(hid_t file) * reporting. */ H5E_BEGIN_TRY { - dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT); + dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); @@ -267,10 +267,10 @@ test_create(hid_t file) status = H5Pset_chunk(create_parms, 2, csize); assert(status >= 0); H5E_BEGIN_TRY { - dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, - create_parms); + dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT, create_parms, H5P_DEFAULT); } H5E_END_TRY; - if (dataset >= 0) { + if(dataset >= 0) { H5_FAILED(); puts(" Opened a dataset with incorrect chunking parameters."); goto error; @@ -281,10 +281,10 @@ test_create(hid_t file) status = H5Pset_chunk(create_parms, 2, csize); assert(status >= 0); - dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, - create_parms); - if (dataset < 0) goto error; - H5Pclose (create_parms); + dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT, create_parms, H5P_DEFAULT); + if(dataset < 0) goto error; + H5Pclose(create_parms); /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; @@ -292,7 +292,7 @@ test_create(hid_t file) /* * Close the chunked dataset. */ - if (H5Dclose(dataset) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; /* * Create a compact dataset, then close it. @@ -304,11 +304,11 @@ test_create(hid_t file) status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); assert(status >= 0); - dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, - small_space, create_parms); + dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, + small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT); if(dataset < 0) goto error; H5Pclose(create_parms); - if(H5Dclose(dataset) <0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); return 0; @@ -353,33 +353,33 @@ test_simple_io(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); /* Initialize the dataset */ - for (i = n = 0; i < DSET_DIM1; i++) - for (j = 0; j < DSET_DIM2; j++) + for(i = n = 0; i < DSET_DIM1; i++) + for(j = 0; j < DSET_DIM2; j++) points[i][j] = n++; - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; - if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; /* Create a small conversion buffer to test strip mining */ tconv_buf = HDmalloc((size_t)1000); - xfer = H5Pcreate (H5P_DATASET_XFER); - assert (xfer>=0); - if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; + xfer = H5Pcreate(H5P_DATASET_XFER); + assert(xfer>=0); + if(H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space, - H5P_DEFAULT)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Test dataset address. Should be undefined. */ - if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; + if(H5Dget_offset(dataset) != HADDR_UNDEF) goto error; /* Write the data to the dataset */ - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0) goto error; /* Test dataset address in file. Open the same file as a C file, seek @@ -388,13 +388,13 @@ test_simple_io(hid_t fapl) if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error; /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0) + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i = 0; i < DSET_DIM1; i++) { - for (j = 0; j < DSET_DIM2; j++) { - if (points[i][j] != check[i][j]) { + for(i = 0; i < DSET_DIM1; i++) { + for(j = 0; j < DSET_DIM2; j++) { + if(points[i][j] != check[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); @@ -412,9 +412,9 @@ test_simple_io(hid_t fapl) HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2); /* Check that the values read are the same as the values written */ - for (i = 0; i < DSET_DIM1; i++) { - for (j = 0; j < DSET_DIM2; j++) { - if (points[i][j] != rdata[i][j]) { + for(i = 0; i < DSET_DIM1; i++) { + for(j = 0; j < DSET_DIM2; j++) { + if(points[i][j] != rdata[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); @@ -468,26 +468,26 @@ test_userblock_offset(hid_t fapl) if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error; - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) goto error; /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; - if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space, - H5P_DEFAULT)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) goto error; /* Test dataset address in file. Open the same file as a C file, seek * the data position as H5Dget_offset points to, read the dataset, and * compare it with the data written in.*/ - if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error; + if((offset = H5Dget_offset(dataset)) == HADDR_UNDEF) goto error; if(H5Dclose(dataset) < 0) goto error; if(H5Fclose(file) < 0) goto error; @@ -497,9 +497,9 @@ test_userblock_offset(hid_t fapl) HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2); /* Check that the values read are the same as the values written */ - for (i = 0; i < DSET_DIM1; i++) { - for (j = 0; j < DSET_DIM2; j++) { - if (points[i][j] != rdata[i][j]) { + for(i = 0; i < DSET_DIM1; i++) { + for(j = 0; j < DSET_DIM2; j++) { + if(points[i][j] != rdata[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); @@ -570,11 +570,11 @@ test_compact_io(hid_t fapl) if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR /* Create and write to a compact dataset */ - if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist)) < 0) + if((dataset = H5Dcreate2(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0) TEST_ERROR /* Test dataset address. Should be undefined. */ - if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR + if(H5Dget_offset(dataset) != HADDR_UNDEF) TEST_ERROR if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR @@ -601,7 +601,7 @@ test_compact_io(hid_t fapl) /* Check that the values read are the same as the values written */ for(i = 0; i < 16; i++) for(j = 0; j < 8; j++) - if (rbuf[i][j] != wbuf[i][j]) { + if(rbuf[i][j] != wbuf[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); @@ -679,7 +679,7 @@ test_max_compact(hid_t fapl) assert(status >= 0); /* Create and write to a compact dataset */ - if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, plist)) < 0) + if((dataset = H5Dcreate2(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0) goto error; if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) @@ -736,7 +736,7 @@ test_max_compact(hid_t fapl) /* Create and write to a compact dataset */ H5E_BEGIN_TRY { - H5Dcreate(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, plist); + H5Dcreate2(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT); } H5E_END_TRY; /* Close file */ @@ -805,15 +805,15 @@ test_conv_buffer(hid_t fid) cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField)); /* Populate the data members */ - for (j = 0; j < DIM1; j++) - for (k = 0; k < DIM2; k++) - for (l = 0; l < DIM3; l++) + for(j = 0; j < DIM1; j++) + for(k = 0; k < DIM2; k++) + for(l = 0; l < DIM3; l++) cf->a[j][k][l] = 10*(j+1) + l + k; - for (j = 0; j < DIM2; j++) + for(j = 0; j < DIM2; j++) cf->b[j] = (float)(100.*(j+1) + 0.01*j); - for (j = 0; j < DIM3; j++) + for(j = 0; j < DIM3; j++) cf->c[j] = 100.*(j+1) + 0.02*j; @@ -839,7 +839,7 @@ test_conv_buffer(hid_t fid) if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3) < 0) goto error; /* Create the dataset */ - if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT)) < 0) goto error; + if((dataset = H5Dcreate2(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf) < 0) goto error; if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR))) < 0) goto error; @@ -863,7 +863,7 @@ test_conv_buffer(hid_t fid) H5E_BEGIN_TRY { status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR); } H5E_END_TRY; - if (status >= 0) { + if(status >= 0) { H5_FAILED(); puts(" Library shouldn't allow conversion buffer too small"); goto error; @@ -932,7 +932,7 @@ test_tconv(hid_t file) TESTING("data type conversion"); /* Initialize the dataset */ - for (i = 0; i < 1000000; i++) { + for(i = 0; i < 1000000; i++) { out[i*4+0] = 0x11; out[i*4+1] = 0x22; out[i*4+2] = 0x33; @@ -941,23 +941,24 @@ test_tconv(hid_t file) /* Create the data space */ dims[0] = 1000000; - if ((space = H5Screate_simple (1, dims, NULL)) < 0) goto error; + if((space = H5Screate_simple (1, dims, NULL)) < 0) goto error; /* Create the data set */ - if ((dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space, - H5P_DEFAULT)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_TCONV_NAME, H5T_STD_I32LE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; /* Write the data to the dataset */ - if (H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - out) < 0) goto error; + if(H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, out) < 0) + goto error; /* Read data with byte order conversion */ - if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0) + if(H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0) goto error; /* Check */ - for (i = 0; i < 1000000; i++) { - if (in[4*i+0]!=out[4*i+3] || + for(i = 0; i < 1000000; i++) { + if(in[4*i+0]!=out[4*i+3] || in[4*i+1]!=out[4*i+2] || in[4*i+2]!=out[4*i+1] || in[4*i+3]!=out[4*i+0]) { @@ -967,7 +968,7 @@ test_tconv(hid_t file) } } - if (H5Dclose(dataset) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; free (out); free (in); puts(" PASSED"); @@ -1134,7 +1135,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, /* Check if this filter is supposed to do something */ if(cd_values[2]>0) { /* Check whether we are "uncompressing" */ - if (flags & H5Z_FLAG_REVERSE) { + if(flags & H5Z_FLAG_REVERSE) { /* Do nothing */ } /* end if */ /* "Compressing" */ @@ -1199,7 +1200,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, unsigned int value; void *data; - if (cd_nelmts!=3 || !cd_values) + if(cd_nelmts!=3 || !cd_values) return 0; offset = cd_values[0]; length = cd_values[1]; @@ -1210,7 +1211,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, data = HDmalloc((size_t)length); HDmemset(data, (int)value, (size_t)length); - if (flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */ + if(flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */ dst += offset; if(HDmemcmp(data, dst, (size_t)length)!=0) return 0; *buf_size = nbytes; @@ -1315,18 +1316,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, herr_t status; /* Error status */ /* Create the data space */ - if ((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; /* * Create a small conversion buffer to test strip mining. We * might as well test all we can! */ - if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; tconv_buf = HDmalloc((size_t)1000); - if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; - if ((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; + if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; - if (if_fletcher32==DISABLE_FLETCHER32) { + if(if_fletcher32==DISABLE_FLETCHER32) { if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC) < 0) goto error; if(H5Z_DISABLE_EDC != H5Pget_edc_check(dxpl)) @@ -1343,8 +1344,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } /* end if */ /* Create the dataset */ - if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid, - dcpl)) < 0) goto error; + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, + dcpl, H5P_DEFAULT)) < 0) goto error; + PASSED(); /*---------------------------------------------------------------------- @@ -1353,12 +1355,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, */ TESTING(" filters (uninitialized read)"); - if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + if(H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) goto error; - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (0!=check[i][j]) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(0!=check[i][j]) { H5_FAILED(); printf(" Read a non-zero value.\n"); printf(" At index %lu,%lu\n", @@ -1376,13 +1378,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, */ TESTING(" filters (write)"); - for (i=n=0; i=0) TEST_ERROR; } else { - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - for (i=0; i=0) TEST_ERROR; } else { /* Read the dataset back and check it */ - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - for (i=0; i=0) TEST_ERROR; } else { - if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) + if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)hs_size[0]; i++) { - for (j=0; j<(size_t)hs_size[1]; j++) { - if (points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != + for(i=0; i<(size_t)hs_size[0]; i++) { + for(j=0; j<(size_t)hs_size[1]; j++) { + if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { H5_FAILED(); fprintf(stderr," Read different values than written.\n"); @@ -1616,9 +1618,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Get the storage size of the dataset */ if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; /* Clean up objects used for this test */ - if (H5Dclose (dataset) < 0) goto error; - if (H5Sclose (sid) < 0) goto error; - if (H5Pclose (dxpl) < 0) goto error; + if(H5Dclose (dataset) < 0) goto error; + if(H5Sclose (sid) < 0) goto error; + if(H5Pclose (dxpl) < 0) goto error; free (tconv_buf); return(0); @@ -1709,10 +1711,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) if(space_id < 0) goto error; H5E_BEGIN_TRY{ - test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id); + test_dset_id = H5Dcreate2(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); }H5E_END_TRY - if (test_dset_id >= 0) goto error; + if(test_dset_id >= 0) goto error; /* Attempt to extend the dataset. This should fail because * the dataset has a fill value and is instructed to fill on @@ -1745,15 +1747,15 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) error: H5_FAILED(); - if (dset_id != -1) + if(dset_id != -1) H5Dclose(dset_id); - if (test_dset_id != -1) + if(test_dset_id != -1) H5Dclose(test_dset_id); - if (space_id != -1) + if(space_id != -1) H5Sclose(space_id); - if (dcpl_id != -1) + if(dcpl_id != -1) H5Pclose(dcpl_id); - if (file_id != -1) + if(file_id != -1) H5Fclose(file_id); return -1; } @@ -1827,13 +1829,13 @@ test_get_filter_info(void) /* Verify that get_filter_info throws an error when given a bad filter */ /* (Depends on 1.6 compatibility flag) */ #ifdef H5_WANT_H5_V1_6_COMPAT - if (H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR - if (flags != 0) TEST_ERROR + if(H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR + if(flags != 0) TEST_ERROR #else /* H5_WANT_H5_V1_6_COMPAT */ H5E_BEGIN_TRY { err = H5Zget_filter_info(-1, &flags); } H5E_END_TRY; - if (err >= 0) TEST_ERROR + if(err >= 0) TEST_ERROR #endif /* H5_WANT_H5_V1_6_COMPAT */ PASSED(); @@ -1894,7 +1896,7 @@ UNUSED hsize_t shuffle_size; /* Size of dataset with shuffle filter */ #endif /* H5_HAVE_FILTER_SHUFFLE */ -#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */ #endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ @@ -1907,14 +1909,14 @@ UNUSED */ puts("Testing 'null' filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Zregister (H5Z_BOGUS) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Zregister (H5Z_BOGUS) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error; if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; /*---------------------------------------------------------- * STEP 1: Test Fletcher32 Checksum by itself. @@ -1923,7 +1925,7 @@ UNUSED #ifdef H5_HAVE_FILTER_FLETCHER32 puts("Testing Fletcher32 checksum(enabled for read)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error; /* Enable checksum during read */ @@ -1951,7 +1953,7 @@ UNUSED /* Temporarily disable this test because the changes in chunk caching conflicts with * the way this test is conducted. -slu 2007/7/20 */ - if (H5Zregister (H5Z_CORRUPT) < 0) goto error; + if(H5Zregister (H5Z_CORRUPT) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_CORRUPT, 0, (size_t)3, data_corrupt) < 0) goto error; if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { @@ -1961,7 +1963,7 @@ UNUSED } /* end if */ /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_FLETCHER32 */ TESTING("fletcher32 checksum"); @@ -1976,12 +1978,12 @@ UNUSED #ifdef H5_HAVE_FILTER_DEFLATE puts("Testing deflate filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_deflate (dc, 6) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_deflate (dc, 6) < 0) goto error; if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_DEFLATE */ TESTING("deflate filter"); SKIPPED(); @@ -1994,21 +1996,21 @@ UNUSED */ #ifdef H5_HAVE_FILTER_SZIP TESTING("szip filter (with encoder)"); - if ( h5_szip_can_encode() == 1) { + if( h5_szip_can_encode() == 1) { if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; puts(""); - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error; - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; } else { SKIPPED(); } TESTING("szip filter (without encoder)"); - if ( h5_szip_can_encode() != 1) { + if( h5_szip_can_encode() != 1) { puts(""); if(test_filter_noencoder(NOENCODER_SZIP_DATASET, fapl) < 0) goto error; } else { @@ -2028,8 +2030,8 @@ UNUSED #ifdef H5_HAVE_FILTER_SHUFFLE puts("Testing shuffle filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error; if(shuffle_size!=null_size) { @@ -2039,7 +2041,7 @@ UNUSED } /* end if */ /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_SHUFFLE */ TESTING("shuffle filter"); SKIPPED(); @@ -2053,27 +2055,27 @@ UNUSED #if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 puts("Testing shuffle+deflate+checksum filters(checksum first)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_fletcher32 (dc) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; - if (H5Pset_deflate (dc, 6) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_fletcher32 (dc) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_deflate (dc, 6) < 0) goto error; if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; puts("Testing shuffle+deflate+checksum filters(checksum last)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; - if (H5Pset_deflate (dc, 6) < 0) goto error; - if (H5Pset_fletcher32 (dc) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_deflate (dc, 6) < 0) goto error; + if(H5Pset_fletcher32 (dc) < 0) goto error; if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ TESTING("shuffle+deflate+fletcher32 filters"); SKIPPED(); @@ -2088,14 +2090,14 @@ UNUSED TESTING("shuffle+szip+checksum filters(checksum first, with encoder)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_fletcher32 (dc) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_fletcher32 (dc) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if( h5_szip_can_encode() == 1) { puts(""); - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; } else { SKIPPED(); @@ -2103,31 +2105,31 @@ UNUSED TESTING("shuffle+szip+checksum filters(checksum first, without encoder)"); - if ( h5_szip_can_encode() != 1) { + if( h5_szip_can_encode() != 1) { puts(""); - if (test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error; + if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error; } else { SKIPPED(); } /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; TESTING("shuffle+szip+checksum filters(checksum last, with encoder)"); /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if( h5_szip_can_encode() == 1) { puts(""); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; - if (H5Pset_fletcher32 (dc) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(H5Pset_fletcher32 (dc) < 0) goto error; if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; } else { SKIPPED(); @@ -2185,7 +2187,7 @@ test_missing_filter(hid_t file) } /* end if */ /* Unregister deflate filter (use internal function) */ - if (H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) { + if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) { H5_FAILED(); printf(" Line %d: Can't unregister deflate filter\n",__LINE__); goto error; @@ -2229,28 +2231,28 @@ test_missing_filter(hid_t file) } /* end if */ /* Create the data space */ - if ((sid = H5Screate_simple(2, dims, NULL)) < 0) { + if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create new dataset */ - if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) { + if((dsid = H5Dcreate2(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ - if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { + if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); printf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Flush the file (to clear the cache) */ - if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { + if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { H5_FAILED(); printf(" Line %d: Error flushing file\n",__LINE__); goto error; @@ -2272,7 +2274,7 @@ test_missing_filter(hid_t file) } /* end if */ /* Read data */ - if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { + if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); printf(" Line %d: Error reading dataset data\n",__LINE__); goto error; @@ -2280,9 +2282,9 @@ test_missing_filter(hid_t file) /* Compare data */ /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)dims[0]; i++) { - for (j=0; j<(size_t)dims[1]; j++) { - if (points[i][j] != check[i][j]) { + for(i=0; i<(size_t)dims[0]; i++) { + for(j=0; j<(size_t)dims[1]; j++) { + if(points[i][j] != check[i][j]) { H5_FAILED(); printf(" Line %d: Read different values than written.\n",__LINE__); printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); @@ -2342,7 +2344,7 @@ test_missing_filter(hid_t file) H5E_BEGIN_TRY { ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check); } H5E_END_TRY; - if (ret>=0) { + if(ret>=0) { H5_FAILED(); printf(" Line %d: Should not be able to read dataset data\n", __LINE__); goto error; @@ -2429,19 +2431,19 @@ test_onebyte_shuffle(hid_t file) #ifdef H5_HAVE_FILTER_SHUFFLE /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use shuffling algorithm with 8-bit */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if (H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; - for (i= 0;i< 10; i++) - for (j = 0; j < 20; j++) + for(i= 0;i< 10; i++) + for(j = 0; j < 20; j++) orig_data[i][j] = (unsigned char)HDrandom(); PASSED(); @@ -2458,7 +2460,7 @@ test_onebyte_shuffle(hid_t file) TESTING("8-bit shuffling (write)"); #ifdef H5_HAVE_FILTER_SHUFFLE - if (H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; @@ -2476,14 +2478,14 @@ test_onebyte_shuffle(hid_t file) #ifdef H5_HAVE_FILTER_SHUFFLE /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (new_data[i][j] != orig_data[i][j]) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", @@ -2497,8 +2499,8 @@ test_onebyte_shuffle(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Pclose (dc) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Pclose (dc) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2562,20 +2564,20 @@ test_nbit_int(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_INT_NAME, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_INT_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of int */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision - 1))) << offset); @@ -2598,7 +2600,7 @@ test_nbit_int(hid_t file) TESTING(" nbit int (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -2615,7 +2617,7 @@ test_nbit_int(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -2623,9 +2625,9 @@ test_nbit_int(hid_t file) * Use mask for checking the significant bits, ignoring the padding bits */ mask = ~(~0 << (precision + offset)) & (~0 << offset); - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if ((new_data[i][j] & mask) != (orig_data[i][j] & mask)) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if((new_data[i][j] & mask) != (orig_data[i][j] & mask)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -2638,11 +2640,11 @@ test_nbit_int(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Tclose(mem_datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Tclose(mem_datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2703,16 +2705,16 @@ test_nbit_float(hid_t file) if(H5Tset_ebias(datatype, (size_t)31) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_FLOAT_NAME, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_FLOAT_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; PASSED(); #else SKIPPED(); @@ -2727,7 +2729,7 @@ test_nbit_float(hid_t file) TESTING(" nbit float (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; @@ -2745,17 +2747,17 @@ test_nbit_float(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written * Assume size of int = size of float */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */ - if (new_data[i][j] != orig_data[i][j]) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */ + if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -2768,10 +2770,10 @@ test_nbit_float(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2836,16 +2838,16 @@ test_nbit_double(hid_t file) if(H5Tset_ebias(datatype, (size_t)255) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_DOUBLE_NAME, datatype, - space, dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_DOUBLE_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; PASSED(); #else @@ -2861,7 +2863,7 @@ test_nbit_double(hid_t file) TESTING(" nbit double (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -2878,17 +2880,17 @@ test_nbit_double(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written * Assume size of long_long = size of double */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */ - if (new_data[i][j] != orig_data[i][j]) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */ + if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -2901,10 +2903,10 @@ test_nbit_double(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2974,22 +2976,22 @@ test_nbit_array(hid_t file) mem_array_datatype = H5Tarray_create(mem_base_datatype, 2, adims, NULL); /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_ARRAY_NAME, array_datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_ARRAY_NAME, array_datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of unsigned int */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) - for (m = 0; m < (size_t)adims[0]; m++) - for (n = 0; n < (size_t)adims[1]; n++) + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) + for(m = 0; m < (size_t)adims[0]; m++) + for(n = 0; n < (size_t)adims[1]; n++) orig_data[i][j][m][n] = (unsigned int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)precision)) << offset); PASSED(); @@ -3006,7 +3008,7 @@ test_nbit_array(hid_t file) TESTING(" nbit array (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; @@ -3024,17 +3026,17 @@ test_nbit_array(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)size[0]; i++) - for (j=0; j<(size_t)size[1]; j++) - for (m = 0; m < (size_t)adims[0]; m++) - for (n = 0; n < (size_t)adims[1]; n++) { - if (new_data[i][j][m][n]!= orig_data[i][j][m][n]) { + for(i=0; i<(size_t)size[0]; i++) + for(j=0; j<(size_t)size[1]; j++) + for(m = 0; m < (size_t)adims[0]; m++) + for(n = 0; n < (size_t)adims[1]; n++) { + if(new_data[i][j][m][n]!= orig_data[i][j][m][n]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu,%lu,%lu\n", @@ -3047,13 +3049,13 @@ test_nbit_array(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(array_datatype) < 0) goto error; - if (H5Tclose(base_datatype) < 0) goto error; - if (H5Tclose(mem_array_datatype) < 0) goto error; - if (H5Tclose(mem_base_datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(array_datatype) < 0) goto error; + if(H5Tclose(base_datatype) < 0) goto error; + if(H5Tclose(mem_array_datatype) < 0) goto error; + if(H5Tclose(mem_base_datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3156,20 +3158,20 @@ test_nbit_compound(hid_t file) if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of member datatypes */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j].i = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); orig_data[i][j].c = (char)(((long_long)HDrandom() % @@ -3199,7 +3201,7 @@ test_nbit_compound(hid_t file) TESTING(" nbit compound (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -3216,7 +3218,7 @@ test_nbit_compound(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -3226,9 +3228,9 @@ test_nbit_compound(hid_t file) i_mask = ~(~0 << (precision[0] + offset[0])) & (~0 << offset[0]); c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]); s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]); - for (i=0; i= size of member datatypes */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j].a.i = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); orig_data[i][j].a.c = (char)(((long_long)HDrandom() % @@ -3459,7 +3461,7 @@ test_nbit_compound_2(hid_t file) TESTING(" nbit compound complex (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -3476,7 +3478,7 @@ test_nbit_compound_2(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -3487,8 +3489,8 @@ test_nbit_compound_2(hid_t file) c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]); s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]); b_mask = ~(~0 << (precision[4] + offset[4])) & (~0 << offset[4]); - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { b_failed = 0; d_failed = 0; @@ -3529,22 +3531,22 @@ test_nbit_compound_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(i_tid) < 0) goto error; - if (H5Tclose(c_tid) < 0) goto error; - if (H5Tclose(s_tid) < 0) goto error; - if (H5Tclose(f_tid) < 0) goto error; - if (H5Tclose(v_tid) < 0) goto error; - if (H5Tclose(cmpd_tid2) < 0) goto error; - if (H5Tclose(cmpd_tid1) < 0) goto error; - if (H5Tclose(mem_cmpd_tid2) < 0) goto error; - if (H5Tclose(mem_cmpd_tid1) < 0) goto error; - if (H5Tclose(array_tid) < 0) goto error; - if (H5Tclose(base_tid) < 0) goto error; - if (H5Tclose(array_cmplx_tid) < 0) goto error; - if (H5Tclose(mem_array_cmplx_tid) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(i_tid) < 0) goto error; + if(H5Tclose(c_tid) < 0) goto error; + if(H5Tclose(s_tid) < 0) goto error; + if(H5Tclose(f_tid) < 0) goto error; + if(H5Tclose(v_tid) < 0) goto error; + if(H5Tclose(cmpd_tid2) < 0) goto error; + if(H5Tclose(cmpd_tid1) < 0) goto error; + if(H5Tclose(mem_cmpd_tid2) < 0) goto error; + if(H5Tclose(mem_cmpd_tid1) < 0) goto error; + if(H5Tclose(array_tid) < 0) goto error; + if(H5Tclose(base_tid) < 0) goto error; + if(H5Tclose(array_cmplx_tid) < 0) goto error; + if(H5Tclose(mem_array_cmplx_tid) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3627,20 +3629,20 @@ test_nbit_compound_3(hid_t file) if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(1, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(1, size, NULL)) < 0) goto error; /* Use nbit filter */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if (H5Pset_chunk(dc, 1, chunk_size) < 0) goto error; - if (H5Pset_nbit(dc) < 0) goto error; + if(H5Pset_chunk(dc, 1, chunk_size) < 0) goto error; + if(H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid, - space, dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Create the dataset object reference points to */ - if ((obj_ref_dataset = H5Dcreate(file, "nbit_obj_ref", H5T_NATIVE_INT, - space, H5P_DEFAULT)) < 0) goto error; + if((obj_ref_dataset = H5Dcreate2(file, "nbit_obj_ref", H5T_NATIVE_INT, + space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Initialize data */ for(i = 0; i < (size_t)size[0]; i++) { @@ -3672,7 +3674,7 @@ test_nbit_compound_3(hid_t file) TESTING(" nbit compound with no-op type (write)"); #ifdef H5_HAVE_FILTER_NBIT - if (H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -3689,12 +3691,12 @@ test_nbit_compound_3(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ - if (H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i = 0; i < (size_t)size[0]; i++) { + for(i = 0; i < (size_t)size[0]; i++) { if(new_data[i].i != orig_data[i].i || strcmp(new_data[i].str, orig_data[i].str) !=0 || strcmp(new_data[i].vl_str, orig_data[i].vl_str) !=0 || @@ -3730,18 +3732,18 @@ test_nbit_compound_3(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error; - if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error; - if (H5Tclose(i_tid) < 0) goto error; - if (H5Tclose(str_tid) < 0) goto error; - if (H5Tclose(vl_str_tid) < 0) goto error; - if (H5Tclose(v_tid) < 0) goto error; - if (H5Tclose(o_tid) < 0) goto error; - if (H5Tclose(cmpd_tid) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(obj_ref_dataset) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error; + if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error; + if(H5Tclose(i_tid) < 0) goto error; + if(H5Tclose(str_tid) < 0) goto error; + if(H5Tclose(vl_str_tid) < 0) goto error; + if(H5Tclose(v_tid) < 0) goto error; + if(H5Tclose(o_tid) < 0) goto error; + if(H5Tclose(cmpd_tid) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(obj_ref_dataset) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3795,25 +3797,25 @@ test_scaleoffset_int(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; + if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, let library calculate minbits */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = HDrandom() % 10000; /* even-numbered values are negtive */ @@ -3835,7 +3837,7 @@ test_scaleoffset_int(hid_t file) TESTING(" scaleoffset int without fill value (write)"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -3851,13 +3853,13 @@ test_scaleoffset_int(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (new_data[i][j] != orig_data[i][j]) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -3870,10 +3872,10 @@ test_scaleoffset_int(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3930,25 +3932,25 @@ test_scaleoffset_int_2(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000; - if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error; + if(H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, let library calculate minbits */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME_2, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME_2, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -3961,7 +3963,7 @@ test_scaleoffset_int_2(hid_t file) stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ - for (j = 0; j < (size_t)size[1]; j++) { + for(j = 0; j < (size_t)size[1]; j++) { orig_data[0][j] = (int)HDrandom() % 10000; /* even-numbered values are negtive */ @@ -3984,7 +3986,7 @@ test_scaleoffset_int_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ - if (H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -4000,12 +4002,12 @@ test_scaleoffset_int_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (j=0; j<(size_t)size[1]; j++) { - if (new_data[0][j] != orig_data[0][j]) { + for(j=0; j<(size_t)size[1]; j++) { + if(new_data[0][j] != orig_data[0][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -4017,10 +4019,10 @@ test_scaleoffset_int_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4072,27 +4074,27 @@ test_scaleoffset_float(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; + if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = (float)((HDrandom() % 100000) / (float)1000.0); /* even-numbered values are negtive */ @@ -4114,7 +4116,7 @@ test_scaleoffset_float(hid_t file) TESTING(" scaleoffset float without fill value, D-scaling (write)"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -4130,13 +4132,13 @@ test_scaleoffset_float(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4149,10 +4151,10 @@ test_scaleoffset_float(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4209,27 +4211,27 @@ test_scaleoffset_float_2(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000.0; - if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error; + if(H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -4242,7 +4244,7 @@ test_scaleoffset_float_2(hid_t file) stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ - for (j = 0; j < (size_t)size[1]; j++) { + for(j = 0; j < (size_t)size[1]; j++) { orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0); /* even-numbered values are negtive */ @@ -4265,7 +4267,7 @@ test_scaleoffset_float_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ - if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -4281,12 +4283,12 @@ test_scaleoffset_float_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (j=0; j<(size_t)size[1]; j++) { - if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) { + for(j=0; j<(size_t)size[1]; j++) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -4297,10 +4299,10 @@ test_scaleoffset_float_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4352,27 +4354,27 @@ test_scaleoffset_double(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; + if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Initialize data */ - for (i= 0;i< (size_t)size[0]; i++) - for (j = 0; j < (size_t)size[1]; j++) { + for(i= 0;i< (size_t)size[0]; i++) + for(j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0; /* even-numbered values are negtive */ @@ -4394,7 +4396,7 @@ test_scaleoffset_double(hid_t file) TESTING(" scaleoffset double without fill value, D-scaling (write)"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -4410,13 +4412,13 @@ test_scaleoffset_double(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)size[0]; i++) { - for (j=0; j<(size_t)size[1]; j++) { - if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) { + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4429,10 +4431,10 @@ test_scaleoffset_double(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4489,27 +4491,27 @@ test_scaleoffset_double_2(hid_t file) if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000.0; - if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error; + if(H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; + if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype, - space,dc)) < 0) goto error; + if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype, + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -4522,7 +4524,7 @@ test_scaleoffset_double_2(hid_t file) stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ - for (j = 0; j < (size_t)size[1]; j++) { + for(j = 0; j < (size_t)size[1]; j++) { orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0; /* even-numbered values are negtive */ @@ -4545,7 +4547,7 @@ test_scaleoffset_double_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ - if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, + if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); #else @@ -4561,12 +4563,12 @@ test_scaleoffset_double_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, + if(H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written */ - for (j=0; j<(size_t)size[1]; j++) { - if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) { + for(j=0; j<(size_t)size[1]; j++) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -4578,10 +4580,10 @@ test_scaleoffset_double_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype) < 0) goto error; - if (H5Pclose(dc) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Dclose(dataset) < 0) goto error; + if(H5Tclose(datatype) < 0) goto error; + if(H5Pclose(dc) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4627,7 +4629,7 @@ test_multiopen (hid_t file) if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl, 1, cur_size) < 0) goto error; if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if((dset1 = H5Dcreate(file, "multiopen", H5T_NATIVE_INT, space, dcpl)) < 0) goto error; + if((dset1 = H5Dcreate2(file, "multiopen", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if((dset2 = H5Dopen2(dset1, ".", H5P_DEFAULT)) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -4692,61 +4694,61 @@ test_types(hid_t file) /* bitfield_1 */ nelmts = sizeof(buf); - if ((type=H5Tcopy(H5T_STD_B8LE)) < 0 || + if((type=H5Tcopy(H5T_STD_B8LE)) < 0 || (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT)) < 0) + (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - for (i=0; i=0) { + if(dsid >=0) { H5_FAILED(); printf(" Line %d: Shouldn't have created dataset!\n",__LINE__); H5Dclose(dsid); @@ -4841,21 +4843,21 @@ test_can_apply(hid_t file) } /* end if */ /* Create new dataset */ - if ((dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) { + if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ - if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { + if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); printf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Flush the file (to clear the cache) */ - if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { + if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { H5_FAILED(); printf(" Line %d: Error flushing file\n",__LINE__); goto error; @@ -4876,7 +4878,7 @@ test_can_apply(hid_t file) } /* end if */ /* Read data */ - if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { + if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); printf(" Line %d: Error reading dataset data\n",__LINE__); goto error; @@ -4884,9 +4886,9 @@ test_can_apply(hid_t file) /* Compare data */ /* Check that the values read are the same as the values written */ - for (i=0; i<(size_t)dims[0]; i++) { - for (j=0; j<(size_t)dims[1]; j++) { - if (points[i][j] != check[i][j]) { + for(i=0; i<(size_t)dims[0]; i++) { + for(j=0; j<(size_t)dims[1]; j++) { + if(points[i][j] != check[i][j]) { H5_FAILED(); printf(" Line %d: Read different values than written.\n",__LINE__); printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); @@ -4965,9 +4967,9 @@ file) #ifdef H5_HAVE_FILTER_SZIP - if (h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { /* Create the data space */ - if ((sid = H5Screate_simple(2, dims, NULL)) < 0) { + if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataspace\n",__LINE__); goto error; @@ -5019,9 +5021,9 @@ file) /* (Should succeed; according to the new algorithm, scanline should be reset to 2*128 satisfying 'maximum blocks per scanline' condition) */ H5E_BEGIN_TRY { - dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl); + dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - if (dsid <=0) { + if(dsid <=0) { H5_FAILED(); printf(" Line %d: Should have created dataset!\n",__LINE__); goto error; @@ -5049,7 +5051,7 @@ file) } /* end if */ /* Create another data space */ - if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) { + if((sid = H5Screate_simple(2, dims2, NULL)) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataspace\n",__LINE__); goto error; @@ -5078,9 +5080,9 @@ file) /* Create new dataset */ /* (Should fail because the 'can apply' filter should indicate inappropriate combination) */ H5E_BEGIN_TRY { - dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl); + dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - if (dsid >=0) { + if(dsid >=0) { H5_FAILED(); printf(" Line %d: Shouldn't have created dataset!\n",__LINE__); H5Dclose(dsid); @@ -5166,14 +5168,14 @@ test_set_local(hid_t fapl) /* Initialize the integer & floating-point dataset */ n=1.0; - for (i = 0; i < DSET_DIM1; i++) - for (j = 0; j < DSET_DIM2; j++) { + for(i = 0; i < DSET_DIM1; i++) + for(j = 0; j < DSET_DIM2; j++) { points[i][j] = (int)n++; points_dbl[i][j] = (double)1.5*n++; } /* Open file */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { H5_FAILED(); printf(" Line %d: Can't open file\n",__LINE__); goto error; @@ -5202,21 +5204,21 @@ test_set_local(hid_t fapl) } /* Create the data space */ - if ((sid = H5Screate_simple(2, dims, NULL)) < 0) { + if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create new dataset */ - if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) { + if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ - if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { + if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); printf(" Line %d: Error writing dataset data\n",__LINE__); goto error; @@ -5231,14 +5233,14 @@ test_set_local(hid_t fapl) /* Create new dataset */ /* (Shouldn't get modified by output filter) */ - if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, dcpl)) < 0) { + if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ - if (H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) { + if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) { H5_FAILED(); printf(" Line %d: Error writing dataset data\n",__LINE__); goto error; @@ -5309,9 +5311,9 @@ test_set_local(hid_t fapl) /* Compare data */ /* Check that the values read are the modified version of what was written */ - for (i=0; i=0) { + if(ret >=0) { H5_FAILED(); printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); goto error; @@ -5567,13 +5569,13 @@ test_filter_delete(hid_t file) *---------------------------------------------------------------------- */ /* delete all filters */ - if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error; + if(H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error; /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error; + if((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error; /* check if filters were deleted */ - if (nfilters)goto error; + if(nfilters)goto error; /*---------------------------------------------------------------------- * close @@ -5581,10 +5583,10 @@ test_filter_delete(hid_t file) */ /* clean up objects used for this test */ - if (H5Pclose (dcpl) < 0) goto error; - if (H5Pclose (dcpl1) < 0) goto error; - if (H5Dclose (dsid) < 0) goto error; - if (H5Sclose (sid) < 0) goto error; + if(H5Pclose (dcpl) < 0) goto error; + if(H5Pclose (dcpl1) < 0) goto error; + if(H5Dclose (dsid) < 0) goto error; + if(H5Sclose (sid) < 0) goto error; PASSED(); #else @@ -5683,7 +5685,7 @@ error: H5Dclose(dset_id); H5Tclose(ftype_id); H5Tclose(mtype_id); - if (buf) + if(buf) free(buf); } H5E_END_TRY; return -1; @@ -5718,7 +5720,7 @@ test_filters_endianess(hid_t fapl) char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - for (i=0; i<2; i++){ + for(i=0; i<2; i++){ buf[i]=1; } @@ -5733,25 +5735,25 @@ test_filters_endianess(hid_t fapl) if((fid = H5Fcreate("test_filters.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* create a data space */ - if ((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error; + if((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error; /* create dcpl */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl,rank,chunk_dims) < 0) goto error; - if (H5Pset_fletcher32 (dcpl) < 0) goto error; + if(H5Pset_fletcher32 (dcpl) < 0) goto error; /* create a dataset */ - if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error; + if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) goto error; /* close */ - if (H5Pclose (dcpl) < 0) goto error; - if (H5Dclose (dsid) < 0) goto error; - if (H5Sclose (sid) < 0) goto error; - if (H5Fclose (fid) < 0) goto error; + if(H5Pclose (dcpl) < 0) goto error; + if(H5Dclose (dsid) < 0) goto error; + if(H5Sclose (sid) < 0) goto error; + if(H5Fclose (fid) < 0) goto error; /*------------------------------------------------------------------------- * step 2: open a file written on a little-endian machine in step 1 @@ -5760,7 +5762,7 @@ test_filters_endianess(hid_t fapl) /* compose the name of the file to open, using the srcdir, if appropriate */ HDstrcpy(data_file, ""); - if ( srcdir ) { + if( srcdir ) { HDstrcpy(data_file, srcdir); HDstrcat(data_file, "/"); } @@ -5770,10 +5772,10 @@ test_filters_endianess(hid_t fapl) if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error; /* read */ - if (auxread_fdata(fid,"dset") < 0) goto error; + if(auxread_fdata(fid,"dset") < 0) goto error; /* close */ - if (H5Fclose(fid) < 0) goto error; + if(H5Fclose(fid) < 0) goto error; /*------------------------------------------------------------------------- * step 3: open a file written on a big-endian machine in step 1 @@ -5782,7 +5784,7 @@ test_filters_endianess(hid_t fapl) /* compose the name of the file to open, using the srcdir, if appropriate */ HDstrcpy(data_file, ""); - if ( srcdir ) { + if( srcdir ) { HDstrcpy(data_file, srcdir); HDstrcat(data_file, "/"); } @@ -5792,10 +5794,10 @@ test_filters_endianess(hid_t fapl) if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error; /* read */ - if (auxread_fdata(fid,"dset") < 0) goto error; + if(auxread_fdata(fid,"dset") < 0) goto error; /* close */ - if (H5Fclose(fid) < 0) goto error; + if(H5Fclose(fid) < 0) goto error; PASSED(); #else @@ -5840,7 +5842,7 @@ test_zero_dims(hid_t file) if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR; if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; if(H5Pset_chunk(dcpl, 1, &csize) < 0) TEST_ERROR; - if((d = H5Dcreate(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR; + if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) TEST_ERROR; @@ -5912,14 +5914,14 @@ test_missing_chunk(hid_t file) if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL) < 0) TEST_ERROR; /* Create dataset */ - if((d = H5Dcreate(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR; + if((d = H5Dcreate2(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Select elements in every other chunk */ hs_start[0]=0; hs_stride[0]=10; hs_count[0]=10; hs_block[0]=5; - if (H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count, + if(H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count, hs_block) < 0) TEST_ERROR; /* Write selected data */ @@ -6000,7 +6002,7 @@ test_random_chunks(void) assert(NPOINTS < 100); /* Create file for first test */ - if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + if((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create dataspace */ if((s = H5Screate_simple(2, dsize, NULL)) < 0) TEST_ERROR; @@ -6012,18 +6014,18 @@ test_random_chunks(void) if(H5Pset_chunk(dcpl, 2, csize) < 0) TEST_ERROR; /* Set early allocation time */ - if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR; + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR; /* Create dataset */ - if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR; + if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Initialization of check array for repeated coordinates */ - for (i=0; i= 0) { @@ -6285,7 +6287,7 @@ test_deprec(hid_t file) status = H5Pset_chunk(create_parms, 2, csize); assert(status >= 0); H5E_BEGIN_TRY { - dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, + dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms); } H5E_END_TRY; if(dataset >= 0) { @@ -6299,13 +6301,13 @@ test_deprec(hid_t file) status = H5Pset_chunk(create_parms, 2, csize); assert(status >= 0); - if((dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error; + if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error; H5Pclose(create_parms); /* * Close the chunked dataset. */ - if (H5Dclose(dataset) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; /* @@ -6325,7 +6327,7 @@ test_deprec(hid_t file) status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); assert(status >= 0); - if(( dataset = H5Dcreate(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error; + if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error; H5Pclose(create_parms); if(H5Dclose(dataset) < 0) goto error; diff --git a/test/dtransform.c b/test/dtransform.c index 3b53aed..b1bca24 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -107,28 +107,28 @@ const int transformData[ROWS][COLS] = hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset; \ hsize_t dim[2] = {ROWS, COLS}; \ \ - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \ - if((dset = H5Dcreate(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT))<0) TEST_ERROR; \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ + if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \ \ if(SIGNED) \ { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ } \ else \ { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ } \ \ \ TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \ \ - if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -138,15 +138,15 @@ const int transformData[ROWS][COLS] = { \ TESTING("contiguous, with type conversion (float->"TEST_STR")") \ \ - if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ } \ \ - if(H5Dclose(dset)<0) TEST_ERROR; \ - if(H5Sclose(dataspace)<0) TEST_ERROR; \ + if(H5Dclose(dset) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ } #define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ @@ -161,35 +161,35 @@ const int transformData[ROWS][COLS] = hsize_t offset[2] = {0, 0}; \ \ \ - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ \ cparms = H5Pcreate(H5P_DATASET_CREATE); \ if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \ \ - if((dset_chunk = H5Dcreate(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, cparms))<0) TEST_ERROR; \ + if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \ filespace = H5Dget_space (dset_chunk); \ memspace = H5Screate_simple(2, dim, NULL); \ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \ \ if(SIGNED) \ { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ } \ else \ { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ } \ \ \ TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \ \ - if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -199,7 +199,7 @@ const int transformData[ROWS][COLS] = { \ TESTING("chunked, with type conversion (float->"TEST_STR")") \ \ - if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -207,15 +207,15 @@ const int transformData[ROWS][COLS] = } \ \ \ - if(H5Pclose(cparms)<0) TEST_ERROR; \ - if(H5Dclose(dset_chunk)<0) TEST_ERROR; \ - if(H5Sclose(dataspace)<0) TEST_ERROR; \ - if(H5Sclose(memspace)<0) TEST_ERROR; \ + if(H5Pclose(cparms) < 0) TEST_ERROR; \ + if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ + if(H5Sclose(memspace) < 0) TEST_ERROR; \ } #define INVALID_SET_TEST(TRANSFORM) \ { \ - if(H5Pset_data_transform(dxpl_id, TRANSFORM)<0) \ + if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \ { \ PASSED(); \ } \ @@ -237,16 +237,16 @@ int main(void) /* inverses the utrans transform in init_test to get back original array */ const char* utrans_inv = "(x/3)*4 - 100"; - if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR; - - if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_polynomial, polynomial)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_simple, simple)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv)<0) TEST_ERROR; + if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + + if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_polynomial, polynomial) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_simple, simple) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv) < 0) TEST_ERROR; if((dxpl_id_polynomial_copy = H5Pcopy(dxpl_id_polynomial)) < 0) TEST_ERROR; if((dxpl_id_c_to_f_copy = H5Pcopy(dxpl_id_c_to_f)) < 0) TEST_ERROR; @@ -317,17 +317,17 @@ int main(void) if(test_getset(dxpl_id_c_to_f) < 0) TEST_ERROR; /* Close the objects we opened/created */ - if(H5Dclose(dset_id_int)<0) TEST_ERROR; - if(H5Dclose(dset_id_int_chunk)<0) TEST_ERROR; - if(H5Dclose(dset_id_float)<0) TEST_ERROR; - if(H5Dclose(dset_id_float_chunk)<0) TEST_ERROR; - if(H5Fclose(file_id)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_c_to_f)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_c_to_f_copy)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_polynomial)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_polynomial_copy)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_simple)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_utrans_inv)<0) TEST_ERROR; + if(H5Dclose(dset_id_int) < 0) TEST_ERROR; + if(H5Dclose(dset_id_int_chunk) < 0) TEST_ERROR; + if(H5Dclose(dset_id_float) < 0) TEST_ERROR; + if(H5Dclose(dset_id_float_chunk) < 0) TEST_ERROR; + if(H5Fclose(file_id) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_c_to_f) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_c_to_f_copy) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_polynomial) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_polynomial_copy) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_simple) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_utrans_inv) < 0) TEST_ERROR; return 0; @@ -346,43 +346,43 @@ int init_test(hid_t file_id) hsize_t dim[2] = {ROWS, COLS}; hsize_t offset[2] = {0, 0}; - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; cparms = H5Pcreate(H5P_DATASET_CREATE); - if(H5Pset_chunk(cparms, 2, dim)<0) TEST_ERROR; + if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; TESTING("Intializing test...") - if((dset_id_int = H5Dcreate(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; - if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_int = H5Dcreate2(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_float = H5Dcreate(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; - if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_float = H5Dcreate2(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_int_chunk = H5Dcreate(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, cparms))<0) TEST_ERROR; + if((dset_id_int_chunk = H5Dcreate2(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; filespace = H5Dget_space (dset_id_int_chunk); if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; - if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_float_chunk = H5Dcreate(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, cparms))<0) TEST_ERROR; - if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_float_chunk = H5Dcreate2(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; PASSED(); - if(H5Pclose(cparms)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; - if(H5Sclose(dataspace)<0) TEST_ERROR; + if(H5Pclose(cparms) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; + if(H5Sclose(dataspace) < 0) TEST_ERROR; return 0; error: @@ -407,7 +407,7 @@ int test_poly(const hid_t dxpl_id_polynomial) } TESTING("data transform, polynomial transform (int->float)") - if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread)<0) TEST_ERROR; + if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0) TEST_ERROR; COMPARE(float, polyflread, polyflres, 2.0) @@ -421,7 +421,7 @@ int test_poly(const hid_t dxpl_id_polynomial) } TESTING("data transform, polynomial transform (float->int)") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread) < 0) TEST_ERROR; COMPARE(int, polyintread, polyflres, 4) return 0; @@ -449,11 +449,11 @@ int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_co TESTING("data transform, linear transform w/ copied property") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread) < 0) TEST_ERROR; COMPARE(int, windchillFintread, windchillFfloat, 2) TESTING("data transform, polynomial transform w/ copied property") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread) < 0) TEST_ERROR; COMPARE(int, polyintread, polyflres, 2) return 0; @@ -469,7 +469,7 @@ int test_trivial(const hid_t dxpl_id_simple) int row, col; TESTING("data transform, trivial transform, without type conversion") - if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread) < 0) TEST_ERROR; for(row = 0; row=0) { + if(dset >= 0) { H5_FAILED(); puts(" Small external file succeeded instead of failing."); goto error; } - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; @@ -246,21 +247,23 @@ test_1c(hid_t file) hsize_t max_size[1]; /*maximum data space size */ TESTING("extendible dataspace, exact external size"); - if((dcpl=H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = 100; max_size[0] = 200; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error; - if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error; - if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl)) < 0) + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, + (hsize_t)(max_size[0] * sizeof(int))) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset3", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dclose (dset) < 0) goto error; - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Dclose(dset); H5Pclose(dcpl); @@ -297,22 +300,24 @@ test_1d(hid_t file) hsize_t max_size[1]; /*maximum data space size */ TESTING("extendible dataspace, external storage is too small"); - if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = 100; max_size[0] = 200; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error; - if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, + (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; H5E_BEGIN_TRY { - dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - if (dset>=0) { + if(dset >= 0) { H5_FAILED(); puts(" Small external file succeeded instead of failing."); goto error; } - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; @@ -364,7 +369,7 @@ test_1e(hid_t file) cur_size[0] = 100; max_size[0] = H5S_UNLIMITED; if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if((dset = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0) + if((dset = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(dset) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -437,26 +442,28 @@ test_1f(hid_t file) hsize_t max_size[1]; /*data space maximum size */ TESTING("multiple external files"); - if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = max_size[0] = 100; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext2.data", (off_t)0, + if(H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext3.data", (off_t)0, + if(H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext4.data", (off_t)0, + if(H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl)) < 0) + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset6", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dclose(dset) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Pclose(dcpl) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Dclose(dset); H5Pclose(dcpl); @@ -638,33 +645,32 @@ test_2 (hid_t fapl) goto error; cur_size = 100; if((space = H5Screate_simple(1, &cur_size, NULL)) < 0) goto error; - if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* * Read the entire dataset and compare with the original */ memset(whole, 0, sizeof(whole)); if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0) goto error; - for(i = 0; i < 100; i++) { - if (whole[i]!=(signed)i) { + for(i = 0; i < 100; i++) + if(whole[i] != (signed)i) { H5_FAILED(); puts(" Incorrect value(s) read."); goto error; - } - } + } /* end if */ /* * Read the middle of the dataset */ - if ((hs_space=H5Scopy(space)) < 0) goto error; - if (H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL, + if((hs_space = H5Scopy(space)) < 0) goto error; + if(H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL) < 0) goto error; - memset(whole, 0, sizeof(whole)); - if (H5Dread (dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT, + HDmemset(whole, 0, sizeof(whole)); + if(H5Dread(dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT, whole) < 0) goto error; - if (H5Sclose (hs_space) < 0) goto error; - for (i=hs_start; i0); /* Create dataset */ - did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did>0); /* Close the dataset */ diff --git a/test/gen_old_array.c b/test/gen_old_array.c index 9163ac7..a4162f2 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -107,7 +107,7 @@ main(void) printf("field 3 insert<0!\n"); /* Create the dataset with compound non-array fields */ - dset = H5Dcreate(file, "Dataset1", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); @@ -141,7 +141,7 @@ main(void) printf("field 4 insert<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset2", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 1533f8e..312ee58 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -82,7 +82,7 @@ main(void) printf("H5Pset_alloc_time() failed!\n"); /* Create the dataset with deferred storage allocation */ - dset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index 999184c..ca6012a 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -63,7 +63,7 @@ main(void) printf("space<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/getname.c b/test/getname.c index 670489f..685bfbf 100644 --- a/test/getname.c +++ b/test/getname.c @@ -181,17 +181,17 @@ test_main(hid_t file_id, hid_t fapl) /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Dcreate + * Test H5Iget_name with H5Dcreate2 *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Dcreate"); + TESTING("H5Iget_name with H5Dcreate2"); /* Create the dataspace */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR @@ -203,7 +203,7 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset inside "g1" */ - if((dataset_id = H5Dcreate(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR @@ -265,7 +265,7 @@ test_main(hid_t file_id, hid_t fapl) /* Create a dataset */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR - if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -646,8 +646,8 @@ test_main(hid_t file_id, hid_t fapl) /* Create two datasets "g11/d" and "g11/g/d"*/ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR - if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -688,7 +688,7 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create the dataset */ - if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -990,7 +990,7 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -1064,10 +1064,10 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -1105,10 +1105,10 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -1198,7 +1198,7 @@ test_main(hid_t file_id, hid_t fapl) } /* Close */ - H5Gclose(group_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1218,7 +1218,7 @@ test_main(hid_t file_id, hid_t fapl) if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file_id , "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR { char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */ @@ -1235,9 +1235,9 @@ test_main(hid_t file_id, hid_t fapl) } /* Close */ - H5Dclose(dataset_id); - H5Sclose(space_id); - H5Tclose(type_id); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1256,7 +1256,7 @@ test_main(hid_t file_id, hid_t fapl) /* Also create a dataset and a datatype */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR - if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -2394,13 +2394,13 @@ test_obj_ref(hid_t fapl) /* Create a single dataset inside the second file, which will be mounted * and used to mask objects in the first file */ - if((dataset = H5Dcreate(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Create a dataset(inside Group1) */ - if((dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Initialize data buffer */ @@ -2416,7 +2416,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create another dataset(inside Group1) */ - if((dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close Dataset */ @@ -2451,7 +2451,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create dataset in that group */ - if((dataset = H5Dcreate(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close Dataset */ @@ -2467,7 +2467,7 @@ test_obj_ref(hid_t fapl) /* Open up that hard link and make a new dataset there */ if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((dataset = H5Dcreate(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) @@ -2477,7 +2477,7 @@ test_obj_ref(hid_t fapl) /* Create a dataset to store references */ - if((dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create reference to dataset */ @@ -2674,7 +2674,7 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Create integer dataset */ - if((dsetv_id = H5Dcreate(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) + if((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Write data to the dataset */ @@ -2684,7 +2684,7 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Dataset with references */ - if((dsetr_id = H5Dcreate(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) + if((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* diff --git a/test/istore.c b/test/istore.c index 657e150..dfe5c41 100644 --- a/test/istore.c +++ b/test/istore.c @@ -123,24 +123,24 @@ new_object(hid_t f, const char *name, int ndims, hsize_t dims[], hsize_t cdims[] hid_t dcpl; /* Dataset creation property list ID */ /* Create the dataset creation property list */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR; + if ((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set the chunk dimensions */ if(H5Pset_chunk(dcpl, ndims, cdims) < 0) TEST_ERROR; /* Create the dataspace */ - if((space = H5Screate_simple(ndims, dims, NULL))<0) TEST_ERROR; + if((space = H5Screate_simple(ndims, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate (f, name, TEST_DATATYPE, space, dcpl))<0) TEST_ERROR; + if((dataset = H5Dcreate2(f, name, TEST_DATATYPE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Clean up */ /* Close property lists */ - if(H5Pclose(dcpl)<0) TEST_ERROR; + if(H5Pclose(dcpl) < 0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; return dataset; @@ -187,7 +187,7 @@ test_create(hid_t f, const char *prefix) return FAIL; /* Close dataset created */ - if(H5Dclose(dataset)<0) + if(H5Dclose(dataset) < 0) return FAIL; } @@ -268,7 +268,7 @@ test_extend(hid_t f, const char *prefix, } /* Get dataset's dataspace */ - if((fspace=H5Dget_space(dataset))<0) TEST_ERROR; + if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; H5V_vector_lt_u((unsigned)ndims, max_corner, whole_size); @@ -316,13 +316,13 @@ test_extend(hid_t f, const char *prefix, HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); /* Create dataspace for selection in memory */ - if((mspace=H5Screate_simple(1,&nelmts,NULL))<0) TEST_ERROR; + if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR; /* Select region in file dataspace */ - if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR; + if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; /* Write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf)<0) { + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { H5_FAILED(); fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); goto error; @@ -330,7 +330,7 @@ test_extend(hid_t f, const char *prefix, /* Read from disk */ HDmemset(check, 0xff, (size_t)nelmts); - if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check)<0) { + if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { H5_FAILED(); fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); goto error; @@ -348,7 +348,7 @@ test_extend(hid_t f, const char *prefix, } /* Close memory dataspace */ - if(H5Sclose(mspace)<0) TEST_ERROR; + if(H5Sclose(mspace) < 0) TEST_ERROR; /* Write to `whole' buffer for later checking */ H5V_hyper_copy((unsigned)ndims, size, @@ -362,7 +362,7 @@ test_extend(hid_t f, const char *prefix, /* Now read the entire array back out and check it */ HDmemset(buf, 0xff, nx * ny * nz); - if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) { + if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5_FAILED(); fprintf(stderr," Read failed for whole array.\n"); goto error; @@ -390,10 +390,10 @@ test_extend(hid_t f, const char *prefix, } /* Close dataset's dataspace */ - if(H5Sclose(fspace)<0) TEST_ERROR; + if(H5Sclose(fspace) < 0) TEST_ERROR; /* Close dataset */ - if(H5Dclose(dataset)<0) TEST_ERROR; + if(H5Dclose(dataset) < 0) TEST_ERROR; /* Free memory used */ HDfree(buf); @@ -482,10 +482,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, } /* Get dataset's dataspace */ - if((fspace=H5Dget_space(dataset))<0) TEST_ERROR; + if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; /* Create dataspace for memory buffer */ - if((mspace=H5Screate_simple(ndims,size,NULL))<0) TEST_ERROR; + if((mspace=H5Screate_simple(ndims,size,NULL)) < 0) TEST_ERROR; for (ctr=0; ctrshared->lf, H5FD_MEM_DEFAULT, addr)<0) { + if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr) < 0) { printf("Cannot create large file family\n"); exit(1); } diff --git a/test/links.c b/test/links.c index 487bcee..52d76cd 100644 --- a/test/links.c +++ b/test/links.c @@ -134,7 +134,7 @@ mklinks(hid_t fapl, hbool_t new_format) if(H5Gclose(grp) < 0) TEST_ERROR /* Create a dataset */ - if((d1 = H5Dcreate(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR + if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(d1) < 0) TEST_ERROR /* Create a hard link */ @@ -208,8 +208,8 @@ new_links(hid_t fapl, hbool_t new_format) if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create datasets */ - if((dset1 = H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR - if((dset2 = H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create links within a file. Both of source and destination use * H5L_SAME_LOC. Both hard and soft links should fail. */ @@ -3411,7 +3411,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) /* Test creating each kind of object */ if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - if((did = H5Dcreate(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close objects */ if(H5Gclose(gid) < 0) TEST_ERROR if(H5Tclose(tid) < 0) TEST_ERROR @@ -5087,7 +5087,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) dims[0] = 2; dims[1] = 2; if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - if((did = H5Dcreate(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR /* Close group */ @@ -5199,7 +5199,7 @@ linkinfo(hid_t fapl, hbool_t new_format) if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR - if((did = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Lcreate_ud(fid, "ud_link", UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR diff --git a/test/mount.c b/test/mount.c index 6330504..e5e0d0a 100644 --- a/test/mount.c +++ b/test/mount.c @@ -874,7 +874,7 @@ test_interlink(hid_t fapl) if(H5Tcommit2(file1, "/type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(1, cur_dims, NULL)) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { - dset = H5Dcreate(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(dset >= 0) { H5_FAILED(); @@ -1128,7 +1128,7 @@ test_mount_after_close(hid_t fapl) if((gidX = H5Gcreate2(fid2, "/X", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((did = H5Dcreate2(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Soft link */ if(H5Lcreate_soft("./Y", gidX, "T", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR diff --git a/test/mtime.c b/test/mtime.c index d6eed1f..1969af2 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -77,7 +77,7 @@ main(void) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; if((space = H5Screate_simple(1, size, NULL)) < 0) TEST_ERROR; - if((dset = H5Dcreate(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT)) < 0) + if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; now = HDtime(NULL); if(H5Dclose(dset) < 0) TEST_ERROR; diff --git a/test/ntypes.c b/test/ntypes.c index 2535ce1..2f5dd5d 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -104,8 +104,8 @@ test_atomic_dtype(hid_t file) /*------------------- Test data values ------------------------*/ /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dataset */ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) @@ -146,16 +146,14 @@ test_atomic_dtype(hid_t file) TEST_ERROR; /* Check that the values read are the same as the values written */ - for (i = 0; i < DIM0; i++) { - for (j = 0; j < DIM1; j++) { + for(i = 0; i < DIM0; i++) + for(j = 0; j < DIM1; j++) if(ipoints2[i][j] != icheck2[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); goto error; - } - } - } + } /* end if */ if(H5Dclose(dataset) < 0) TEST_ERROR; if(H5Tclose(native_type) < 0) TEST_ERROR; @@ -164,12 +162,12 @@ test_atomic_dtype(hid_t file) /*------------------ Test different data types ----------------*/ /* Create the dataset of H5T_STD_I64LE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -186,12 +184,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_STD_I8LE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -208,12 +206,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_IEEE_F32BE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -230,12 +228,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_IEEE_F64BE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -243,7 +241,7 @@ test_atomic_dtype(hid_t file) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F64BE)) TEST_ERROR; - if(H5T_FLOAT!=H5Tget_class(native_type)) + if(H5T_FLOAT != H5Tget_class(native_type)) TEST_ERROR; if(H5Dclose(dataset) < 0) TEST_ERROR; @@ -343,9 +341,9 @@ test_compound_dtype2(hid_t file) /* Insert and pack members */ if(H5Tinsert(tid2, "c2", 0, H5T_STD_I16BE) < 0) TEST_ERROR; -#if H5_SIZEOF_LONG==4 +#if H5_SIZEOF_LONG == 4 if(H5Tinsert(tid2, "l2", 2, H5T_STD_I32LE) < 0) TEST_ERROR; -#elif H5_SIZEOF_LONG==8 +#elif H5_SIZEOF_LONG == 8 if(H5Tinsert(tid2, "l2", 2, H5T_STD_I64LE) < 0) TEST_ERROR; #else #error "Unknown 'long' size" @@ -354,21 +352,21 @@ test_compound_dtype2(hid_t file) if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; if(H5Tinsert(tid, "i", 1, H5T_STD_I32LE) < 0) TEST_ERROR; if(H5Tinsert(tid, "st", 5, tid2) < 0) TEST_ERROR; -#if H5_SIZEOF_LONG==4 +#if H5_SIZEOF_LONG == 4 if(H5Tinsert(tid, "l", 11, H5T_STD_U64BE) < 0) TEST_ERROR; -#elif H5_SIZEOF_LONG==8 +#elif H5_SIZEOF_LONG == 8 if(H5Tinsert(tid, "l", 15, H5T_STD_U64BE) < 0) TEST_ERROR; #else #error "Unknown 'long' size" #endif /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_2, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_2, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for memory */ - if((tid_m2=H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR; - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m2 = H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid_m2, "c2", HOFFSET(s2, c2), H5T_NATIVE_SHORT) < 0) TEST_ERROR; @@ -558,17 +556,16 @@ test_compound_dtype(hid_t file) /* Allocate space for the points & check arrays */ if((points=malloc(sizeof(s1)*DIM0*DIM1))==NULL) TEST_ERROR; - if((check=calloc(sizeof(s1),DIM0*DIM1))==NULL) + if((check = calloc(sizeof(s1), DIM0 * DIM1)) == NULL) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->i = n++; temp_point->l = (i*10+j*100)*n; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -576,7 +573,7 @@ test_compound_dtype(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -584,11 +581,11 @@ test_compound_dtype(hid_t file) if(H5Tinsert(tid, "l", 5, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid2=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid2, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR; if(H5Tinsert(tid2, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -736,14 +733,13 @@ test_compound_dtype3(hid_t file) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->l = (i*10+j*100)*n; - for (k = 0; k < 5; k++) + for(k = 0; k < 5; k++) (temp_point->a)[k] = n++; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -754,7 +750,7 @@ test_compound_dtype3(hid_t file) if((tid2 = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -762,14 +758,14 @@ test_compound_dtype3(hid_t file) if(H5Tinsert(tid, "l", 21, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_3, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create array datatype */ if((tid_m2 = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "a", HOFFSET(s1, a), tid_m2) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -935,14 +931,13 @@ test_compound_opaque(hid_t file) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->l = (i*10+j*100)*n; - for (k = 0; k < 5; k++) + for(k = 0; k < 5; k++) (temp_point->o)[k] = n++; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -950,11 +945,11 @@ test_compound_opaque(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Create opaque datatype */ - if((tid2=H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR; if(H5Tset_tag(tid2, "testing opaque field") < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -962,11 +957,11 @@ test_compound_opaque(hid_t file) if(H5Tinsert(tid, "l", 6, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_4, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "o", HOFFSET(s1, o), tid2) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -1120,10 +1115,9 @@ test_enum_dtype(hid_t file) TESTING("enum datatype"); /* Initialize the dataset */ - for (i = 0; i < DIM0; i++) { - for (j=0, n=0; j < DIM1; j++, n++) + for(i = 0; i < DIM0; i++) + for(j = 0, n = 0; j < DIM1; j++, n++) spoints2[i][j] = (i*10+j*100+n)%8; - } /* Create the data space */ dims[0] = DIM0; @@ -1131,17 +1125,17 @@ test_enum_dtype(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Construct enum type based on native type */ - if((tid=H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR; + if((tid = H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR; - for (i = 0; i < 8; i++) { - sub_colors[i*2]=i; - sub_colors[i*2+1]=0; + for(i = 0; i < 8; i++) { + sub_colors[i * 2] = i; + sub_colors[i * 2 + 1] = 0; if(H5Tenum_insert(tid, mname[i], &(sub_colors[i*2])) < 0) TEST_ERROR; - } + } /* end for */ /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ENUM_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Construct enum type based on native type in memory */ if((tid_m = H5Tenum_create(H5T_NATIVE_SHORT)) < 0) TEST_ERROR; @@ -1149,7 +1143,7 @@ test_enum_dtype(hid_t file) for(i = 0; i < 8; i++) { colors[i] = i; if(H5Tenum_insert(tid_m, mname[i], &(colors[i])) < 0) TEST_ERROR; - } + } /* end for */ /* Write the data to the dataset */ if(H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2) < 0) @@ -1266,7 +1260,7 @@ test_array_dtype(hid_t file) if((space = H5Screate_simple(2, space_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid2=H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid2, "c", 0, H5T_STD_U8BE) < 0) TEST_ERROR; @@ -1277,11 +1271,11 @@ test_array_dtype(hid_t file) if((tid = H5Tarray_create(tid2, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ARRAY_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid3=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid3 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid3, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid3, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR; if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -1405,8 +1399,8 @@ test_array_dtype2(hid_t file) if((tid = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ARRAY2_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create array datatype for memory */ if((tid_m = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR; @@ -1537,7 +1531,7 @@ test_vl_dtype(hid_t file) if((tid = H5Tvlen_create(tid2)) < 0) TEST_ERROR /* Create a dataset */ - if((dataset = H5Dcreate(file, DSET_VL_NAME, tid, space, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(file, DSET_VL_NAME, tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create a base VL datatype for memory */ @@ -1682,10 +1676,10 @@ test_vlstr_dtype(hid_t file) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file,DSET_VLSTR_NAME,tid1,sid1,H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_VLSTR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write dataset to disk */ - if(H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata) < 0) TEST_ERROR; + if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR; /* Close Dataset */ if(H5Dclose(dataset) < 0) TEST_ERROR; @@ -1791,7 +1785,7 @@ test_str_dtype(hid_t file) if(H5T_STRING != H5Tget_class(tid1)) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write dataset to disk */ if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR; @@ -1934,7 +1928,7 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create reference to named datatype */ @@ -2058,22 +2052,22 @@ test_refer_dtype2(hid_t file) TESTING("dataset region reference"); /* Allocate write & read buffers */ - dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + dwbuf = malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ if((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) TEST_ERROR; /* Create a dataset */ - if((dset2=H5Dcreate(file,"Dataset2",H5T_STD_U8LE,sid2,H5P_DEFAULT)) < 0) + if((dset2 = H5Dcreate2(file, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - for(tu8=dwbuf,i=0; ist1h_id, space_id, H5P_DEFAULT); - CHECK(dataset_id,FAIL,"H5Dcreate"); + dataset_id = H5Dcreate2(loc_id, MISC5_DSETNAME, str1hndl->st1h_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Create the variable-length buffer */ - buf.len=MISC5_DBGNELM1; - buf.p=malloc((buf.len)*sizeof(misc5_struct1)); - CHECK(buf.p,NULL,"malloc"); + buf.len = MISC5_DBGNELM1; + buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + CHECK(buf.p, NULL, "malloc"); /* Create the top-level VL information */ - for(i=0; ist1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf); - CHECK(ret,FAIL,"H5Dwrite"); + ret = H5Dwrite(dataset_id, str1hndl->st1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf); + CHECK(ret, FAIL, "H5Dwrite"); /* Release the top-level VL information */ - for(j=0; j=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1523,15 +1523,15 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation late */ - did = H5Dcreate(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1539,13 +1539,13 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after only four chunks are written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1583,15 +1583,15 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ - did = H5Dcreate(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1599,13 +1599,13 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after only four chunks are written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1716,11 +1716,11 @@ test_misc10(void) MESSAGE(5, ("Testing using old dataset creation property list\n")); /* Generate the correct name for the test file, by prepending the source path */ - if (srcdir && ((strlen(srcdir) + strlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) { - strcpy(testfile, srcdir); - strcat(testfile, "/"); + if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) { + HDstrcpy(testfile, srcdir); + HDstrcat(testfile, "/"); } - strcat(testfile, MISC10_FILE_OLD); + HDstrcat(testfile, MISC10_FILE_OLD); /* * Open the old file and the dataset and get old settings. @@ -1743,29 +1743,29 @@ test_misc10(void) file_new = H5Fcreate(MISC10_FILE_NEW, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); CHECK(file_new, FAIL, "H5Fcreate"); - dataset_new = H5Dcreate(file_new, MISC10_DSETNAME, type, space, dcpl); - CHECK(dataset_new, FAIL, "H5Dcreate"); + dataset_new = H5Dcreate2(file_new, MISC10_DSETNAME, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset_new, FAIL, "H5Dcreate2"); /* Close new dataset & file */ - ret=H5Dclose(dataset_new); + ret = H5Dclose(dataset_new); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Fclose(file_new); + ret = H5Fclose(file_new); CHECK(ret, FAIL, "H5Fclose"); /* Close old dataset information */ - ret=H5Tclose(type); + ret = H5Tclose(type); CHECK(ret, FAIL, "H5Tclose"); - ret=H5Sclose(space); + ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Pclose(dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); /* Close old file information */ - ret=H5Fclose(file); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - ret=H5Pclose(fcpl); + ret = H5Pclose(fcpl); CHECK(ret, FAIL, "H5Pclose"); } /* end test_misc10() */ @@ -1992,8 +1992,8 @@ test_misc12(void) CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a dataset */ - dataset = H5Dcreate(fid1, MISC12_DSET_NAME, tid1, sid1, cparms); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, MISC12_DSET_NAME, tid1, sid1, H5P_DEFAULT, cparms, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -2017,7 +2017,7 @@ test_misc12(void) CHECK(ret, FAIL, "H5Dwrite"); /* Read all data back */ - ret= H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); for(i = 0; i < MISC12_SPACE1_DIM1; i++) @@ -2083,14 +2083,14 @@ create_dataset(hid_t loc_id, const char *name, hid_t dcpl) herr_t ret; /* Generic return value */ /* Create dataspace for use with dataset */ - dims[0]=MISC13_DIM1; - dims[1]=MISC13_DIM2; - sid=H5Screate_simple(MISC13_RANK, dims, NULL); + dims[0] = MISC13_DIM1; + dims[1] = MISC13_DIM2; + sid = H5Screate_simple(MISC13_RANK, dims, NULL); CHECK(sid, FAIL, "H5Screate_simple"); /* Create contiguous dataset in root group */ - dsid = H5Dcreate(loc_id, name, H5T_NATIVE_UINT, sid, dcpl); - CHECK(dsid, FAIL, "H5Dcreate"); + dsid = H5Dcreate2(loc_id, name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Write some data to dataset */ ret = H5Dwrite(dsid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, m13_data); @@ -2435,10 +2435,10 @@ test_misc14(void) /* Increase the metadata block size */ /* (This makes certain that all the data blocks are allocated together) */ - fapl=H5Pcreate(H5P_FILE_ACCESS); + fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret=H5Pset_meta_block_size(fapl,(hsize_t)MISC14_METADATA_SIZE); + ret = H5Pset_meta_block_size(fapl, (hsize_t)MISC14_METADATA_SIZE); CHECK(ret, FAIL, "H5Pset_meta_block_size"); /* Create dataspace to use */ @@ -2450,15 +2450,15 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset (to be unlinked). */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); @@ -2466,7 +2466,7 @@ test_misc14(void) /* Check data from first dataset */ ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); CHECK(ret, FAIL, "H5Dread"); - if(!DBL_ABS_EQUAL(rdata,data1)) + if(!DBL_ABS_EQUAL(rdata, data1)) TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__); /* Unlink second dataset */ @@ -2498,15 +2498,15 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); @@ -2546,22 +2546,22 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); /* Create third dataset */ - Dataset3 = H5Dcreate(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset3 = H5Dcreate2(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data3); CHECK(ret, FAIL, "H5Dwrite"); @@ -2709,24 +2709,24 @@ test_misc16(void) CHECK(ret, FAIL, "H5Tset_strpad");*/ /* Create a dataset */ - dataset=H5Dcreate(file,MISC16_DSET_NAME,tid,sid,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC16_DSET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - for(i=0; i 24) { - if (correct <= 32) correct=32; - else if (correct <= 64) correct=64; - } + if(offsets[k] == 0) + correct = prec[j]; + else + correct = H5Tget_size(idts[i]) * 8; + if(correct > 24) { + if(correct <= 32) + correct = 32; + else if(correct <= 64) + correct = 64; + } /* end if */ /* Create the dataset */ - dsid = H5Dcreate(fid, MISC22_DSET_NAME, dtype, sid, dcpl); - CHECK(dsid, FAIL, "H5Dwrite"); + dsid = H5Dcreate2(fid, MISC22_DSET_NAME, dtype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Write out the whole dataset */ ret = H5Dwrite(dsid, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -3721,7 +3722,7 @@ test_misc22(void) dcpl2 = H5Dget_create_plist(dsid); CHECK(dcpl2, FAIL, "H5Dget_create_plist"); - ret= H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags, + ret = H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags, &cd_nelmts, cd_values, 0, NULL , NULL); CHECK(ret, FAIL, "H5Pget_filter_by_id"); @@ -3789,38 +3790,40 @@ test_misc23(void) CHECK(type_id, FAIL, "H5Tcopy"); +#ifndef H5_NO_DEPRECATED_SYMBOLS /********************************************************************** - * test the old APIs - **********************************************************************/ + * test the old APIs + **********************************************************************/ H5E_BEGIN_TRY { - tmp_id = H5Gcreate2(file_id, "/A/B00a/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + tmp_id = H5Gcreate1(file_id, "/A/B00a/grp", (size_t)0); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gcreate2"); + VERIFY(tmp_id, FAIL, "H5Gcreate1"); - tmp_id = H5Gcreate2(file_id, "/A/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(tmp_id, FAIL, "H5Gcreate2"); + tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0); + CHECK(tmp_id, FAIL, "H5Gcreate1"); status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); H5E_BEGIN_TRY { - tmp_id = H5Dcreate(file_id, "/A/B00c/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate1(file_id, "/A/B00c/dset", type_id, space_id, create_id); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Dcreate"); + VERIFY(tmp_id, FAIL, "H5Dcreate1"); - tmp_id = H5Dcreate(file_id, "/A/dset", type_id, space_id, create_id); - CHECK(tmp_id, FAIL, "H5Dcreate"); + tmp_id = H5Dcreate1(file_id, "/A/dset", type_id, space_id, create_id); + CHECK(tmp_id, FAIL, "H5Dcreate1"); status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /********************************************************************** - * test H5Gcreate2() - **********************************************************************/ + * test H5Gcreate2() + **********************************************************************/ /* Create link creation property list */ create_id = H5Pcreate(H5P_LINK_CREATE); @@ -3887,8 +3890,8 @@ test_misc23(void) /********************************************************************** - * test H5Dcreate2() - **********************************************************************/ + * test H5Dcreate2() + **********************************************************************/ /* Create link creation property list */ create_id = H5Pcreate(H5P_LINK_CREATE); @@ -4044,8 +4047,8 @@ test_misc24(void) group_id = H5Gcreate2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate2"); - dset_id = H5Dcreate(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); type_id = H5Tcopy(H5T_NATIVE_INT); CHECK(type_id, FAIL, "H5Tcopy"); @@ -4624,8 +4627,8 @@ test_misc25c(void) CHECK(sid, FAIL, "H5Screate"); /* Create the dataset */ - did = H5Dcreate(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Create an extra group */ gid2 = H5Gcreate2(fid, MISC25C_GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4763,18 +4766,18 @@ test_misc26(void) sid = H5Screate_simple(1, dims, dims); CHECK(sid, FAIL, "H5Screate_simple"); - did = H5Dcreate(fid, "dataset1", H5T_NATIVE_FLOAT, sid, dcpl1); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset1", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl1, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); - did = H5Dcreate(fid, "dataset2", H5T_NATIVE_FLOAT, sid, dcpl2); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset2", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl2, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); - did = H5Dcreate(fid, "dataset3", H5T_NATIVE_FLOAT, sid, dcpl3); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset3", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl3, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); diff --git a/test/trefer.c b/test/trefer.c index baa0bcd..6c88a60 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -115,8 +115,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Oset_comment"); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) *tu32++=i*3; @@ -130,8 +130,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Dclose"); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -164,8 +164,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Gclose"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -354,8 +354,8 @@ test_reference_region(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset2 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT); - CHECK(dset2, FAIL, "H5Dcreate"); + dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) *tu8++ = i * 3; @@ -373,8 +373,8 @@ test_reference_region(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create references */ @@ -626,8 +626,8 @@ test_reference_region_1D(void) CHECK(sid3, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset3 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT); - CHECK(dset3, FAIL, "H5Dcreate"); + dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) *tu8++ = i * 3; @@ -645,8 +645,8 @@ test_reference_region_1D(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create references */ @@ -877,16 +877,16 @@ test_reference_obj_deleted(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset to reference (deleted later) */ - dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, -1); @@ -1031,7 +1031,7 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gclose"); /* Create bottom dataset */ - did = H5Dcreate(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did > 0); ret = H5Dclose(did); assert(ret >= 0); @@ -1040,8 +1040,8 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gclose"); /* Create dataset */ - did = H5Dcreate(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Create reference to group */ ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, -1); @@ -1166,16 +1166,16 @@ test_reference_compat(void) CHECK(group, FAIL, "H5Gcreate2"); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -1209,8 +1209,8 @@ test_reference_compat(void) /* Create a dataset with object reference datatype */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -1238,8 +1238,8 @@ test_reference_compat(void) /* Create a dataset with region reference datatype */ - dataset = H5Dcreate(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Select 6x6 hyperslab for first reference */ start[0] = 2; start[1] = 2; diff --git a/test/tselect.c b/test/tselect.c index a6b885f..fd577ca 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -283,7 +283,7 @@ test_select_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -543,7 +543,7 @@ test_select_point(hid_t xfer_plist) HDmemcpy(pi.coord,coord2,sizeof(coord2)); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -713,7 +713,7 @@ test_select_all(hid_t xfer_plist) VERIFY(ext_type, H5S_SIMPLE, "H5Sget_simple_extent_type"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,xfer_plist,wbuf); @@ -812,7 +812,7 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -957,7 +957,7 @@ test_select_combo(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1115,7 +1115,7 @@ test_select_hyper_stride(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1240,7 +1240,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1365,7 +1365,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1489,7 +1489,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1633,7 +1633,7 @@ test_select_hyper_copy(void) CHECK(sid3, FAIL, "H5Scopy"); /* Create a dataset */ - data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1644,7 +1644,7 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Sclose"); /* Create another dataset */ - data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf); @@ -1802,7 +1802,7 @@ test_select_point_copy(void) CHECK(sid3, FAIL, "H5Scopy"); /* Create a dataset */ - data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1813,7 +1813,7 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Sclose"); /* Create another dataset */ - data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf); @@ -1990,7 +1990,7 @@ test_select_hyper_offset(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2123,7 +2123,7 @@ test_select_hyper_offset2(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2273,7 +2273,7 @@ test_select_point_offset(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2425,7 +2425,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2518,7 +2518,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2603,7 +2603,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2692,8 +2692,8 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); xfer = H5Pcreate (H5P_DATASET_XFER); CHECK(xfer, FAIL, "H5Pcreate"); @@ -2789,7 +2789,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2911,8 +2911,8 @@ test_select_hyper_union_stagger(void) CHECK(dataspace, FAIL, "H5Screate_simple"); /* Create File Dataset */ - dset_id=H5Dcreate(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id=H5Dcreate2(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write File Dataset */ error=H5Dwrite(dset_id,H5T_NATIVE_INT,dataspace,dataspace,H5P_DEFAULT,data); @@ -3138,7 +3138,7 @@ test_select_hyper_union_3d(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,tmp2_space,sid1,H5P_DEFAULT,wbuf); @@ -3282,7 +3282,7 @@ test_select_hyper_and_2d(void) VERIFY(npoints, 5*5, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3408,7 +3408,7 @@ test_select_hyper_xor_2d(void) VERIFY(npoints, 150, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3536,7 +3536,7 @@ test_select_hyper_notb_2d(void) VERIFY(npoints, 75, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3663,7 +3663,7 @@ test_select_hyper_nota_2d(void) VERIFY(npoints, 75, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3789,8 +3789,8 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write entire dataset to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); @@ -3997,8 +3997,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(plist, FAIL, "H5Pcreate"); status = H5Pset_chunk (plist, RANK_F, chunk_dimsf); CHECK(status, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, plist); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, plist, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* * Define hyperslab in the dataset. @@ -4225,8 +4225,8 @@ test_select_point_chunk(void) CHECK(dcpl, FAIL, "H5Pcreate"); ret = H5Pset_chunk (dcpl, SPACE7_RANK, chunk_dimsf); CHECK(ret, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create 1st point selection */ pnt1_space = H5Scopy (dataspace); @@ -4384,8 +4384,8 @@ test_select_scalar_chunk(void) sid = H5Screate_simple(1, dims, maxdims); CHECK(sid, FAIL, "H5Screate_simple"); - dsid = H5Dcreate(file_id, "dset", H5T_NATIVE_UINT, sid, dcpl); - CHECK(dsid, FAIL, "H5Dcreate"); + dsid = H5Dcreate2(file_id, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Select scalar area (offset 0, count 1) */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL); @@ -5468,8 +5468,8 @@ test_select_none(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Make "none" selection in both disk and memory datasets */ ret = H5Sselect_none(sid1); @@ -5571,8 +5571,8 @@ test_scalar_select(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Select one element in memory with a point selection */ coord1[0]=0; coord1[1]= 2; @@ -7305,8 +7305,8 @@ test_select_hyper_chunk_offset(void) CHECK(sid, FAIL, "H5Screate_simple"); /* Create the dataset */ - did = H5Dcreate (fid, "fooData", H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2 (fid, "fooData", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close the dataspace */ ret = H5Sclose(sid); @@ -7500,8 +7500,8 @@ test_select_hyper_chunk_offset2(void) CHECK(status, FAIL, "H5Pset_chunk"); /* Create dataset */ - dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close DCPL */ status = H5Pclose(dcpl); diff --git a/test/tsohm.c b/test/tsohm.c index c0b9848..e99a1f1 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -586,7 +586,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos dim1[0] = 1; if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) TEST_ERROR - if((dset_id = H5Dcreate(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Test writing and reading */ if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) TEST_ERROR @@ -606,7 +606,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos } /* Create more datasets with the same datatype */ - if((dset_id = H5Dcreate(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -614,7 +614,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR } - if((dset_id = H5Dcreate(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -622,7 +622,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR } - if((dset_id = H5Dcreate(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Write data to dataset 3 for later */ if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) TEST_ERROR @@ -658,7 +658,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos /* Create several copies of the dataset (this increases the amount of space saved by sharing the datatype message) */ for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) { - if((dset_id = H5Dcreate(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -1477,8 +1477,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size * and filter pipeline. */ for(x = 0; x < NUM_DATASETS; ++x) { - dset_id = H5Dcreate(file_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); @@ -1526,8 +1526,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Create NUM_DATASETS datasets in the new group */ for(x=0; x=0); + dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); /* initialize data for dataset and write value to dataset */ data = NUM_THREADS; - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data); - assert(ret>=0); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data); + assert(ret >= 0); /* * Simultaneously create a large number of attributes to be associated diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 92eff41..1cc2e8c 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -30,7 +30,7 @@ * ttsafe_cancel.h5 * * HDF5 APIs exercised in thread: - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose, * H5Dwrite, H5Dread, H5Diterate, H5Tclose, H5Sclose. * * Created: May 15 2000 @@ -130,18 +130,18 @@ void *tts_cancel_thread(void UNUSED *arg) /* define dataspace for dataset */ dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); /* define datatype for the data using native little endian integers */ datatype = H5Tcopy(H5T_NATIVE_INT); - assert(datatype>=0); - ret=H5Tset_order(datatype, H5T_ORDER_LE); - assert(ret>=0); + assert(datatype >= 0); + ret = H5Tset_order(datatype, H5T_ORDER_LE); + assert(ret >= 0); /* create a new dataset within the file */ - dataset = H5Dcreate(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT); - assert(dataset>=0); + dataset = H5Dcreate2(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); /* If thread is cancelled, make cleanup call */ cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t)); diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index 4faf2bc..35453ad 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -26,7 +26,7 @@ * ttsafe_dcreate.h5 * * HDF5 APIs exercised in thread: - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dwrite, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dwrite, H5Dclose, * H5Tclose, H5Sclose. * * Created: Apr 28 2000 @@ -163,39 +163,40 @@ void tts_dcreate(void) void *tts_dcreate_creator(void *_thread_data) { - hid_t dataspace, dataset; - herr_t ret; - hsize_t dimsf[1]; /* dataset dimensions */ - struct thread_info thread_data; - - memcpy(&thread_data,_thread_data,sizeof(struct thread_info)); - - /* define dataspace for dataset */ - dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); - - /* create a new dataset within the file */ - dataset = H5Dcreate(thread_data.file, thread_data.dsetname, - H5T_NATIVE_INT, dataspace, H5P_DEFAULT); - assert(dataset>=0); - - /* initialize data for dataset and write value to dataset */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - H5P_DEFAULT, &thread_data.id); - assert(ret>=0); - - /* close dataset and dataspace resources */ - ret=H5Dclose(dataset); - assert(ret>=0); - ret=H5Sclose(dataspace); - assert(ret>=0); - - return NULL; + hid_t dataspace, dataset; + herr_t ret; + hsize_t dimsf[1]; /* dataset dimensions */ + struct thread_info thread_data; + + memcpy(&thread_data, _thread_data, sizeof(struct thread_info)); + + /* define dataspace for dataset */ + dimsf[0] = 1; + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); + + /* create a new dataset within the file */ + dataset = H5Dcreate2(thread_data.file, thread_data.dsetname, + H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); + + /* initialize data for dataset and write value to dataset */ + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, &thread_data.id); + assert(ret >= 0); + + /* close dataset and dataspace resources */ + ret = H5Dclose(dataset); + assert(ret >= 0); + ret = H5Sclose(dataspace); + assert(ret >= 0); + + return NULL; } void cleanup_dcreate(void) { - HDunlink(FILENAME); + HDunlink(FILENAME); } #endif /*H5_HAVE_THREADSAFE*/ + diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 3989e73..7659a3e 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -29,7 +29,7 @@ * * HDF5 APIs exercised in thread: * - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose, * H5Tclose, H5Sclose. * * Created: Apr 28 2000 @@ -176,26 +176,26 @@ void *tts_error_thread(void UNUSED *arg) /* define dataspace for dataset */ dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); /* define datatype for the data using native little endian integers */ datatype = H5Tcopy(H5T_NATIVE_INT); - assert(datatype>=0); + assert(datatype >= 0); H5Tset_order(datatype, H5T_ORDER_LE); /* create a new dataset within the file */ - dataset = H5Dcreate(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT); - if (dataset >= 0) { /* not an error */ + dataset = H5Dcreate2(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset >= 0) { /* not an error */ value = WRITE_NUMBER; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value); H5Dclose(dataset); - } + } /* end if */ - ret=H5Tclose(datatype); - assert(ret>=0); - ret=H5Sclose(dataspace); - assert(ret>=0); + ret = H5Tclose(datatype); + assert(ret >= 0); + ret = H5Sclose(dataspace); + assert(ret >= 0); /* turn our error stack handler off */ H5Eset_auto2(H5E_DEFAULT, old_error_cb, old_error_client_data); diff --git a/test/tunicode.c b/test/tunicode.c index f34e19f..873918a 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -68,7 +68,7 @@ void dump_string(const char * string); void test_fl_string(hid_t fid, const char *string) { hid_t dtype_id, space_id, dset_id; - hsize_t dims=1; + hsize_t dims = 1; char read_buf[MAX_STRING_LENGTH]; H5T_cset_t cset; herr_t ret; @@ -80,19 +80,20 @@ void test_fl_string(hid_t fid, const char *string) CHECK(dtype_id, FAIL, "H5Tcopy"); ret = H5Tset_size(dtype_id, (size_t)MAX_STRING_LENGTH); CHECK(ret, FAIL, "H5Tset_size"); - cset=H5Tget_cset(dtype_id); + cset = H5Tget_cset(dtype_id); VERIFY(cset, H5T_CSET_ASCII, "H5Tget_cset"); - ret=H5Tset_cset(dtype_id, H5T_CSET_UTF8); + ret = H5Tset_cset(dtype_id, H5T_CSET_UTF8); CHECK(ret, FAIL, "H5Tset_cset"); - cset=H5Tget_cset(dtype_id); + cset = H5Tget_cset(dtype_id); VERIFY(cset, H5T_CSET_UTF8, "H5Tget_cset"); /* Create dataspace for a dataset */ space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); + /* Create a dataset */ - dset_id=H5Dcreate(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write UTF-8 string to dataset */ ret = H5Dwrite(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, string); @@ -102,15 +103,15 @@ void test_fl_string(hid_t fid, const char *string) ret = H5Dread(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dread"); - VERIFY(strcmp(string, read_buf), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf), 0, "strcmp"); /* Close all */ - ret=H5Dclose(dset_id); + ret = H5Dclose(dset_id); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Tclose(dtype_id); + ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); - ret=H5Sclose(space_id); + ret = H5Sclose(space_id); CHECK(ret, FAIL, "H5Sclose"); } @@ -322,7 +323,7 @@ void test_strpad(hid_t UNUSED fid, const char *string) void test_vl_string(hid_t fid, const char *string) { hid_t type_id, space_id, dset_id; - hsize_t dims=1; + hsize_t dims = 1; hsize_t size; /* Number of bytes used */ char *read_buf[1]; herr_t ret; @@ -338,27 +339,27 @@ void test_vl_string(hid_t fid, const char *string) CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dset_id=H5Dcreate(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string); + ret = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string); CHECK(ret, FAIL, "H5Dwrite"); /* Make certain the correct amount of memory will be used */ - ret=H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size); + ret = H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size); CHECK(ret, FAIL, "H5Dvlen_get_buf_size"); - VERIFY(size, (hsize_t)strlen(string) + 1, "H5Dvlen_get_buf_size"); + VERIFY(size, (hsize_t)HDstrlen(string) + 1, "H5Dvlen_get_buf_size"); /* Read dataset from disk */ - ret=H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); + ret = H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - VERIFY(strcmp(string, read_buf[0]), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf[0]), 0, "strcmp"); /* Reclaim the read VL data */ - ret=H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf); + ret = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Close all */ @@ -405,7 +406,7 @@ void test_objnames(hid_t fid, const char* string) ret = H5Gclose(grp_id); CHECK(ret, FAIL, "H5Gclose"); - VERIFY(strcmp(string, read_buf), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf), 0, "strcmp"); /* Create a new dataset with a UTF-8 name */ grp1_id = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -413,8 +414,8 @@ void test_objnames(hid_t fid, const char* string) space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id = H5Dcreate(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Make sure that dataset can be opened again */ ret = H5Dclose(dset_id); @@ -450,8 +451,8 @@ void test_objnames(hid_t fid, const char* string) space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id=H5Dcreate(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to named datatype */ ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, -1); @@ -599,8 +600,8 @@ void test_compound(hid_t fid, const char * string) CHECK(ret, FAIL, "H5Tinsert"); /* Check that the field name was stored correctly */ - readbuf=H5Tget_member_name(s1_tid, 0); - ret = strcmp(readbuf, string); + readbuf = H5Tget_member_name(s1_tid, 0); + ret = HDstrcmp(readbuf, string); VERIFY(ret, 0, "strcmp"); free(readbuf); @@ -621,8 +622,8 @@ void test_compound(hid_t fid, const char * string) /* Create the dataspace and dataset. */ space_id = H5Screate_simple(1, &dim, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id = H5Dcreate(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write data to the dataset. */ ret = H5Dwrite(dset_id, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &s1); diff --git a/test/tvlstr.c b/test/tvlstr.c index b1ba48e..a6d3851 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -152,29 +152,29 @@ test_vlstrings_basic(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tcopy (H5T_C_S1); + tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid1,H5T_VARIABLE); + ret = H5Tset_size(tid1,H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); dataspace = H5Screate(H5S_SCALAR); - dataset2=H5Dcreate(fid1,"Dataset2",tid1,dataspace,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); wdata2 = (char*)HDcalloc((size_t)65534, sizeof(char)); HDmemset(wdata2, 'A', (size_t)65533); - ret=H5Dwrite(dataset2,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata2); + ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2); CHECK(ret, FAIL, "H5Dwrite"); H5Sclose(dataspace); @@ -182,7 +182,7 @@ test_vlstrings_basic(void) HDfree(wdata2); /* Change to the custom memory allocation routines for reading VL string */ - xfer_pid=H5Pcreate(H5P_DATASET_XFER); + xfer_pid = H5Pcreate(H5P_DATASET_XFER); CHECK(xfer_pid, FAIL, "H5Pcreate"); ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used); @@ -281,51 +281,51 @@ test_vlstrings_special(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tcopy (H5T_C_S1); + tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid1,H5T_VARIABLE); + ret = H5Tset_size(tid1,H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset3",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i= 0) { H5Dclose(dataset); @@ -1185,7 +1185,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create datasets to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a dataspace for the attributes */ if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR @@ -1853,7 +1853,7 @@ test_resurrect_dataset(hid_t fapl) /* Create a dataset in the file */ if((s = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR - if((d = H5Dcreate(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((d = H5Dcreate2(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Sclose(s) < 0) FAIL_STACK_ERROR /* Unlink the dataset while it's open (will mark it for deletion when closed) */ @@ -2065,19 +2065,19 @@ test_unlink_chunked_dataset(hid_t fapl) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create the dataspace */ - if((space_id = H5Screate_simple(FILESPACE_NDIMS,dims,max_dims)) < 0) FAIL_STACK_ERROR + if((space_id = H5Screate_simple(FILESPACE_NDIMS, dims, max_dims)) < 0) FAIL_STACK_ERROR /* Create the dataset creation filter */ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR /* Set to chunked storage */ - if(H5Pset_chunk(dcpl_id,FILESPACE_NDIMS,chunk_dims) < 0) FAIL_STACK_ERROR + if(H5Pset_chunk(dcpl_id, FILESPACE_NDIMS, chunk_dims) < 0) FAIL_STACK_ERROR /* Set to early space allocation */ - if(H5Pset_alloc_time(dcpl_id,H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR + if(H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR /* Create the dataset */ - if((dset_id = H5Dcreate(file_id,DATASETNAME,H5T_NATIVE_INT,space_id,dcpl_id)) < 0) FAIL_STACK_ERROR + if((dset_id = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close the dataspace */ if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR diff --git a/test/vfd.c b/test/vfd.c index a8e90c6..4ae4fc1 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -243,7 +243,7 @@ test_direct(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -278,7 +278,7 @@ test_direct(void) TEST_ERROR; /* Create the dset2 */ - if((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0) + if((dset2 = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -438,7 +438,7 @@ test_core(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -482,7 +482,7 @@ test_core(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -706,7 +706,7 @@ test_family(void) if (H5Pclose(access_fapl) < 0) TEST_ERROR; - if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) + if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i=0; i HADDR_MAX/2) TEST_ERROR; - if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) + if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i=0; i= 0), "H5Fcreate"); /* Modify dataset creation properties, i.e. enable chunking */ - cparms = H5Pcreate (H5P_DATASET_CREATE); + cparms = H5Pcreate(H5P_DATASET_CREATE); VRFY((cparms >= 0), ""); hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY); VRFY((hrc >= 0), ""); - hrc = H5Pset_chunk ( cparms, 1, chunk_dims); + hrc = H5Pset_chunk(cparms, 1, chunk_dims); VRFY((hrc >= 0), ""); /* Create a new dataset within the file using cparms creation properties. */ - dataset = H5Dcreate (file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, cparms); + dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); VRFY((dataset >= 0), ""); - switch (write_pattern) { - - /* writes only the second to last chunk */ - case sec_last: - - memset(buffer, 100, CHUNKSIZE); - - count[0] = 1; - stride[0] = 1; - block[0] = chunk_dims[0]; - offset[0] = (nchunks-2)*chunk_dims[0]; - - hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); - VRFY((hrc >= 0), ""); + if(write_pattern == sec_last) { + HDmemset(buffer, 100, CHUNKSIZE); - /* Write sec_last chunk */ - hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); - VRFY((hrc >= 0), "H5Dwrite"); + count[0] = 1; + stride[0] = 1; + block[0] = chunk_dims[0]; + offset[0] = (nchunks-2)*chunk_dims[0]; - break; - - - /* doesn't write anything */ - case none: + hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); + VRFY((hrc >= 0), ""); - break; - } + /* Write sec_last chunk */ + hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); + VRFY((hrc >= 0), "H5Dwrite"); + } /* end if */ /* Close resources */ hrc = H5Dclose (dataset); @@ -187,7 +175,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char); + est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); } diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 46dfff1..7886066 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -598,14 +598,14 @@ coll_chunktest(const char* filename, /* allocate memory for data buffer */ - data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); file_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((file_dataspace >= 0),"file dataspace created succeeded"); + VRFY((file_dataspace >= 0), "file dataspace created succeeded"); crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); @@ -619,29 +619,29 @@ coll_chunktest(const char* filename, status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); - dataset = H5Dcreate(file,DSET_COLLECTIVE_CHUNK_NAME,H5T_NATIVE_INT, - file_dataspace,crp_plist); + dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); VRFY((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); - VRFY((status >= 0),""); + VRFY((status >= 0), ""); /*put some trivial data in the data array */ - ccdataset_fill(start, stride,count,block, data_array1); + ccdataset_fill(start, stride, count,block, data_array1); MESG("data_array initialized"); - status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((status >= 0),"hyperslab selection succeeded"); /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY((xfer_plist >= 0), ""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO); VRFY((status>= 0),"set independent IO collectively succeeded"); } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 2d02cdb..c8dd00e 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -58,7 +58,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], count[1] = 1; start[0] = mpi_rank*block[0]; start[1] = 0; -if (VERBOSE_MED) printf("slab_set BYROW\n"); +if(VERBOSE_MED) printf("slab_set BYROW\n"); break; case BYCOL: /* Each process takes a block of columns. */ @@ -70,7 +70,7 @@ if (VERBOSE_MED) printf("slab_set BYROW\n"); count[1] = 1; start[0] = 0; start[1] = mpi_rank*block[1]; -if (VERBOSE_MED) printf("slab_set BYCOL\n"); +if(VERBOSE_MED) printf("slab_set BYCOL\n"); break; case ZROW: /* Similar to BYROW except process 0 gets 0 row */ @@ -82,7 +82,7 @@ if (VERBOSE_MED) printf("slab_set BYCOL\n"); count[1] = 1; start[0] = (mpi_rank? mpi_rank*block[0] : 0); start[1] = 0; -if (VERBOSE_MED) printf("slab_set ZROW\n"); +if(VERBOSE_MED) printf("slab_set ZROW\n"); break; case ZCOL: /* Similar to BYCOL except process 0 gets 0 column */ @@ -94,7 +94,7 @@ if (VERBOSE_MED) printf("slab_set ZROW\n"); count[1] = 1; start[0] = 0; start[1] = (mpi_rank? mpi_rank*block[1] : 0); -if (VERBOSE_MED) printf("slab_set ZCOL\n"); +if(VERBOSE_MED) printf("slab_set ZCOL\n"); break; default: /* Unknown mode. Set it to cover the whole dataset. */ @@ -107,10 +107,10 @@ if (VERBOSE_MED) printf("slab_set ZCOL\n"); count[1] = 1; start[0] = 0; start[1] = 0; -if (VERBOSE_MED) printf("slab_set wholeset\n"); +if(VERBOSE_MED) printf("slab_set wholeset\n"); break; } -if (VERBOSE_MED){ +if(VERBOSE_MED){ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n", (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], @@ -176,7 +176,7 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] int vrfyerrs; /* print it if VERBOSE_MED */ - if (VERBOSE_MED) { + if(VERBOSE_MED) { printf("dataset_vrfy dumping:::\n"); printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], @@ -190,8 +190,8 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] vrfyerrs = 0; for (i=0; i < block[0]; i++){ for (j=0; j < block[1]; j++){ - if (*dataset != *original){ - if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + if(*dataset != *original){ + if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), @@ -202,9 +202,9 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] } } } - if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) + if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); - if (vrfyerrs) + if(vrfyerrs) printf("%d errors found in dataset_vrfy\n", vrfyerrs); return(vrfyerrs); } @@ -247,7 +247,7 @@ dataset_writeInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -266,11 +266,11 @@ dataset_writeInd(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -286,14 +286,14 @@ dataset_writeInd(void) /* create a dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, - H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, - H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* @@ -312,7 +312,7 @@ dataset_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -329,18 +329,18 @@ dataset_writeInd(void) VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); /* setup dimensions again to write with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeInd by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeInd by some with zero row"); -if ((mpi_rank/2)*2 != mpi_rank){ +if((mpi_rank/2)*2 != mpi_rank){ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1); VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded"); @@ -353,9 +353,9 @@ MPI_Barrier(MPI_COMM_WORLD); H5Sclose(file_dataspace); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* release all IDs created */ @@ -365,7 +365,7 @@ MPI_Barrier(MPI_COMM_WORLD); H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -393,7 +393,7 @@ dataset_readInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -415,7 +415,7 @@ dataset_readInd(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -433,7 +433,7 @@ dataset_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -450,7 +450,7 @@ dataset_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* read data independently */ ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -459,12 +459,12 @@ dataset_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); /* release all IDs created */ @@ -474,8 +474,8 @@ dataset_readInd(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); } @@ -519,7 +519,7 @@ dataset_writeAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective write test on file %s\n", filename); /* set up MPI parameters */ @@ -538,11 +538,11 @@ dataset_writeAll(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -558,20 +558,20 @@ dataset_writeAll(void) /* create a dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another dataset collectively */ datatype = H5Tcopy(H5T_NATIVE_INT); ret = H5Tset_order(datatype, H5T_ORDER_LE); VRFY((ret >= 0), "H5Tset_order succeeded"); - dataset2 = H5Dcreate(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dcreate 2 succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 2 succeeded"); /* create a third dataset collectively */ - dataset3 = H5Dcreate(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset3 >= 0), "H5Dcreate succeeded"); + dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset3 >= 0), "H5Dcreate2 succeeded"); /* release 2-D space ID created */ H5Sclose(sid); @@ -581,8 +581,8 @@ dataset_writeAll(void) VRFY((sid >= 0), "H5Screate succeeded"); /* create a fourth dataset collectively */ - dataset4 = H5Dcreate(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset4 >= 0), "H5Dcreate succeeded"); + dataset4 = H5Dcreate2(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset4 >= 0), "H5Dcreate2 succeeded"); /* release scalar space ID created */ H5Sclose(sid); @@ -597,7 +597,7 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -607,7 +607,7 @@ dataset_writeAll(void) /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -615,7 +615,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -630,14 +630,14 @@ dataset_writeAll(void) VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); /* setup dimensions again to writeAll with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeAll by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeAll by some with zero row"); @@ -658,7 +658,7 @@ dataset_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -666,7 +666,7 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -676,7 +676,7 @@ dataset_writeAll(void) /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -684,7 +684,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -698,14 +698,14 @@ dataset_writeAll(void) VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); /* setup dimensions again to writeAll with zero columns for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeAll by some with zero col\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeAll by some with zero col"); @@ -727,27 +727,27 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset3); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if (MAINPROCESS) { - ret=H5Sselect_none(file_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded"); } /* end else */ /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); VRFY((mem_dataspace >= 0), ""); - if (MAINPROCESS) { - ret=H5Sselect_none(mem_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded"); } /* end if */ /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } /* end if */ @@ -755,7 +755,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -788,31 +788,31 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset4); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if (MAINPROCESS) { - ret=H5Sselect_none(file_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_all(file_dataspace); + ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } /* end else */ /* create a memory dataspace independently */ mem_dataspace = H5Screate(H5S_SCALAR); VRFY((mem_dataspace >= 0), ""); - if (MAINPROCESS) { - ret=H5Sselect_none(mem_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_all(mem_dataspace); + ret = H5Sselect_all(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } /* end else */ /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } /* end if */ @@ -820,7 +820,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -849,20 +849,20 @@ dataset_writeAll(void) /* * All writes completed. Close datasets collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); - ret=H5Dclose(dataset3); + ret = H5Dclose(dataset3); VRFY((ret >= 0), "H5Dclose3 succeeded"); - ret=H5Dclose(dataset4); + ret = H5Dclose(dataset4); VRFY((ret >= 0), "H5Dclose3 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* @@ -899,7 +899,7 @@ dataset_readAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective read test on file %s\n", filename); /* set up MPI parameters */ @@ -924,7 +924,7 @@ dataset_readAll(void) VRFY((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -949,7 +949,7 @@ dataset_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -959,7 +959,7 @@ dataset_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_origin1); } @@ -967,7 +967,7 @@ dataset_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -982,17 +982,17 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* setup dimensions again to readAll with zero columns for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("readAll by some with zero col\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("readAll by some with zero col"); @@ -1002,7 +1002,7 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* release all temporary handles. */ /* Could have used them for dataset2 but it is cleaner */ @@ -1017,7 +1017,7 @@ dataset_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -1027,7 +1027,7 @@ dataset_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_origin1); } @@ -1035,7 +1035,7 @@ dataset_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1050,17 +1050,17 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* setup dimensions again to readAll with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("readAll by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("readAll by some with zero row"); @@ -1070,7 +1070,7 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -1081,17 +1081,17 @@ dataset_readAll(void) /* * All reads completed. Close datasets collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); } @@ -1137,7 +1137,7 @@ extend_writeInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -1169,19 +1169,19 @@ extend_writeInd(void) size_t rdcc_nbytes; double rdcc_w0; - ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); + ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); VRFY((ret >= 0), "H5Pget_cache succeeded"); mdc_nelmts=4; - ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); + ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); VRFY((ret >= 0), "H5Pset_cache succeeded"); } /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -1190,7 +1190,7 @@ extend_writeInd(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -1204,12 +1204,12 @@ extend_writeInd(void) VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -1226,7 +1226,7 @@ extend_writeInd(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1244,7 +1244,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1266,7 +1266,7 @@ extend_writeInd(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1283,7 +1283,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently. Should fail. */ @@ -1304,7 +1304,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1313,23 +1313,23 @@ extend_writeInd(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* @@ -1361,7 +1361,7 @@ extend_writeInd2(void) herr_t ret; /* Generic return value */ filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test #2 on file %s\n", filename); /* set up MPI parameters */ @@ -1376,11 +1376,11 @@ extend_writeInd2(void) VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -1399,11 +1399,11 @@ extend_writeInd2(void) VRFY((fs >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, fs, dcpl); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, fs, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreat2e succeeded"); /* release resource */ - ret=H5Pclose(dcpl); + ret = H5Pclose(dcpl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -1415,12 +1415,12 @@ extend_writeInd2(void) VRFY((ms >= 0), "H5Screate_simple succeeded"); /* put some trivial data in the data_array */ - for (i=0; i<(int)orig_size; i++) + for(i = 0; i < (int)orig_size; i++) written[i] = i; MESG("data array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("writing at offset zero: "); - for (i=0; i<(int)orig_size; i++) + for(i = 0; i < (int)orig_size; i++) printf("%s%d", i?", ":"", written[i]); printf("\n"); } @@ -1438,7 +1438,7 @@ extend_writeInd2(void) i,written[i], i,retrieved[i]); nerrors++; } - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("read at offset zero: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", retrieved[i]); @@ -1461,7 +1461,7 @@ extend_writeInd2(void) for (i=0; i<(int)orig_size; i++) written[i] = orig_size + i; MESG("data array re-initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("writing at offset 10: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", written[i]); @@ -1483,7 +1483,7 @@ extend_writeInd2(void) i,written[i], i,retrieved[i]); nerrors++; } - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("read at offset 10: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", retrieved[i]); @@ -1492,7 +1492,7 @@ extend_writeInd2(void) /* Close dataset collectively */ - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); /* Close the file collectively */ @@ -1527,7 +1527,7 @@ extend_readInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -1554,7 +1554,7 @@ extend_readInd(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -1590,7 +1590,7 @@ extend_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -1599,7 +1599,7 @@ extend_readInd(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1612,7 +1612,7 @@ extend_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset1 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); @@ -1625,7 +1625,7 @@ extend_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -1634,7 +1634,7 @@ extend_readInd(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1647,15 +1647,15 @@ extend_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset2 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); @@ -1663,9 +1663,9 @@ extend_readInd(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_array2) free(data_array2); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_array2) free(data_array2); + if(data_origin1) free(data_origin1); } /* @@ -1711,7 +1711,7 @@ extend_writeAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -1743,19 +1743,19 @@ extend_writeAll(void) size_t rdcc_nbytes; double rdcc_w0; - ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); + ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); VRFY((ret >= 0), "H5Pget_cache succeeded"); mdc_nelmts=4; - ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); + ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); VRFY((ret >= 0), "H5Pset_cache succeeded"); } /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -1764,7 +1764,7 @@ extend_writeAll(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -1778,12 +1778,12 @@ extend_writeAll(void) VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -1800,7 +1800,7 @@ extend_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1818,13 +1818,13 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1852,7 +1852,7 @@ extend_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1864,7 +1864,7 @@ extend_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1880,7 +1880,7 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently. Should fail. */ @@ -1901,7 +1901,7 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1910,25 +1910,25 @@ extend_writeAll(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -1959,7 +1959,7 @@ extend_readAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -1986,7 +1986,7 @@ extend_readAll(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -2022,7 +2022,7 @@ extend_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -2031,7 +2031,7 @@ extend_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -2039,7 +2039,7 @@ extend_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2055,7 +2055,7 @@ extend_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset1 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); @@ -2069,7 +2069,7 @@ extend_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -2078,7 +2078,7 @@ extend_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -2086,7 +2086,7 @@ extend_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2102,16 +2102,16 @@ extend_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset2 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); H5Pclose(xfer_plist); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); @@ -2119,9 +2119,9 @@ extend_readAll(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_array2) free(data_array2); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_array2) free(data_array2); + if(data_origin1) free(data_origin1); } /* @@ -2152,7 +2152,7 @@ compress_readAll(void) herr_t ret; /* Generic return value */ filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective chunked dataset read test on file %s\n", filename); /* Retrieve MPI parameters */ @@ -2181,15 +2181,15 @@ compress_readAll(void) dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl > 0), "H5Pcreate succeeded"); - ret=H5Pset_layout(dcpl, H5D_CHUNKED); + ret = H5Pset_layout(dcpl, H5D_CHUNKED); VRFY((ret >= 0), "H5Pset_layout succeeded"); /* Use eight chunks */ - chunk_dim=dim/8; - ret=H5Pset_chunk(dcpl, rank, &chunk_dim); + chunk_dim = dim / 8; + ret = H5Pset_chunk(dcpl, rank, &chunk_dim); VRFY((ret >= 0), "H5Pset_chunk succeeded"); - ret=H5Pset_deflate(dcpl, 9); + ret = H5Pset_deflate(dcpl, 9); VRFY((ret >= 0), "H5Pset_deflate succeeded"); /* Create dataspace */ @@ -2197,21 +2197,21 @@ compress_readAll(void) VRFY((dataspace > 0), "H5Screate_simple succeeded"); /* Create dataset */ - dataset = H5Dcreate(fid, "compressed_data", H5T_NATIVE_INT, dataspace, dcpl); - VRFY((dataset > 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, "compressed_data", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset > 0), "H5Dcreate2 succeeded"); /* Write compressed data */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Close objects */ - ret=H5Pclose(dcpl); + re = =H5Pclose(dcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - ret=H5Sclose(dataspace); + ret = H5Sclose(dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Fclose(fid); + ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); } @@ -2231,7 +2231,7 @@ compress_readAll(void) VRFY((fid > 0), "H5Fopen succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -2245,7 +2245,7 @@ compress_readAll(void) xfer_plist = H5Pcreate(H5P_DATASET_XFER); VRFY((xfer_plist > 0), "H5Pcreate succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2254,7 +2254,7 @@ compress_readAll(void) /* Try reading the data */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* Verify data read */ @@ -2267,22 +2267,22 @@ compress_readAll(void) /* Writing to the compressed, chunked dataset in parallel should fail */ H5E_BEGIN_TRY { - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); } H5E_END_TRY; VRFY((ret < 0), "H5Dwrite failed"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); } /* end if */ - ret=H5Fclose(fid); + ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); /* release data buffers */ - if (data_read) HDfree(data_read); - if (data_orig) HDfree(data_orig); + if(data_read) HDfree(data_read); + if(data_orig) HDfree(data_orig); } #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -2329,7 +2329,7 @@ none_selection_chunk(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -2348,11 +2348,11 @@ none_selection_chunk(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* -------------------------------------------------------------- @@ -2360,7 +2360,7 @@ none_selection_chunk(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -2370,16 +2370,16 @@ none_selection_chunk(void) /* setup dimensionality object */ dims[0] = dim0; dims[1] = dim1; - sid = H5Screate_simple (RANK, dims, NULL); + sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -2393,7 +2393,7 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ - if (mpi_rank) { + if(mpi_rank) { data_origin = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE)); VRFY((data_origin != NULL), "data_origin malloc succeeded"); @@ -2404,7 +2404,7 @@ none_selection_chunk(void) mstart[0] = mstart[1] = 0; dataset_fill(mstart, block, data_origin); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(mstart, block, data_origin); } @@ -2415,7 +2415,7 @@ none_selection_chunk(void) VRFY((mem_dataspace >= 0), ""); /* Process 0 has no selection */ - if (!mpi_rank) { + if(!mpi_rank) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } @@ -2423,11 +2423,11 @@ none_selection_chunk(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* Process 0 has no selection */ - if (!mpi_rank) { + if(!mpi_rank) { ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } @@ -2435,7 +2435,7 @@ none_selection_chunk(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write data collectively */ @@ -2449,15 +2449,15 @@ none_selection_chunk(void) VRFY((ret >= 0), ""); /* verify the read data with original expected data */ - if (mpi_rank) { + if(mpi_rank) { ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin); - if (ret) nerrors++; + if(ret) nerrors++; } /* ------------------------- * Test independent writing to dataset2 * -------------------------*/ - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write data collectively */ @@ -2471,30 +2471,30 @@ none_selection_chunk(void) VRFY((ret >= 0), ""); /* verify the read data with original expected data */ - if (mpi_rank) { + if(mpi_rank) { ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin); - if (ret) nerrors++; + if(ret) nerrors++; } /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_origin) free(data_origin); - if (data_array) free(data_array); + if(data_origin) free(data_origin); + if(data_array) free(data_array); } diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index e255c73..e2d39c3 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -86,35 +86,33 @@ filter_read_internal(const char *filename, hid_t dcpl, VRFY(sid>=0, "H5Screate_simple"); /* Create buffers */ - points = (int *)HDmalloc(size[0]*size[1]*sizeof(int)); + points = (int *)HDmalloc(size[0] * size[1] * sizeof(int)); VRFY(points!=NULL, "HDmalloc"); - check = (int *)HDmalloc(hs_size[0]*hs_size[1]*sizeof(int)); + check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int)); VRFY(check!=NULL, "HDmalloc"); /* Initialize writing buffer with random data */ - for (i=0; i=0, "H5Fcreate"); /* Create the dataset */ - dataset = H5Dcreate(file, name, H5T_NATIVE_INT, sid, dcpl); - VRFY(dataset>=0, "H5Dcreate"); + dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY(dataset>=0, "H5Dcreate2"); hrc = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points); VRFY(hrc>=0, "H5Dwrite"); - *dset_size=H5Dget_storage_size(dataset); + *dset_size = H5Dget_storage_size(dataset); VRFY(*dset_size>0, "H5Dget_storage_size"); hrc = H5Dclose (dataset); @@ -153,7 +151,7 @@ filter_read_internal(const char *filename, hid_t dcpl, /* Check that the values read are the same as the values written */ for (i=0; i=0, "H5Pcreate"); @@ -424,7 +422,7 @@ test_filter_read(void) VRFY(hrc>=0, "H5Pset_shuffle"); /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block); VRFY(hrc>=0, "H5Pset_szip"); @@ -437,7 +435,7 @@ test_filter_read(void) /* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */ /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0, "H5Pcreate"); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 2fb2aef..b2ae824 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -50,12 +50,12 @@ int get_size(void) int mpi_size; int size = SIZE; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */ - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - if ( mpi_size > size ) { + if(mpi_size > size ) { - if ( (mpi_size % 2) == 0 ) { + if((mpi_size % 2) == 0 ) { size = mpi_size; @@ -105,59 +105,59 @@ void multiple_dset_write(void) size = get_size(); - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); VRFY((plist>=0), "create_faccess_plist succeeded"); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); VRFY((iof>=0), "H5Fcreate succeeded"); - ret = H5Pclose (plist); + ret = H5Pclose(plist); VRFY((ret>=0), "H5Pclose succeeded"); /* decide the hyperslab according to process number. */ get_slab(chunk_origin, chunk_dims, count, file_dims, size); - memspace = H5Screate_simple (DIM, chunk_dims, NULL); - filespace = H5Screate_simple (DIM, file_dims, NULL); - ret = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); + memspace = H5Screate_simple(DIM, chunk_dims, NULL); + filespace = H5Screate_simple(DIM, file_dims, NULL); + ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); VRFY((ret>=0), "mdata hyperslab selection"); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl>=0), "dataset creation property list succeeded"); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill); VRFY((ret>=0), "set fill-value succeeded"); - for (n = 0; n < ndatasets; n++) { - sprintf (dname, "dataset %d", n); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); + for(n = 0; n < ndatasets; n++) { + sprintf(dname, "dataset %d", n); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); VRFY((dataset > 0), dname); /* calculate data to write */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) outme [(i * size) + j] = n*1000 + mpi_rank; - H5Dwrite (dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme); + H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme); - H5Dclose (dataset); + H5Dclose(dataset); #ifdef BARRIER_CHECKS - if (! ((n+1) % 10)) { + if(!((n+1) % 10)) { printf("created %d datasets\n", n+1); MPI_Barrier(MPI_COMM_WORLD); } #endif /* BARRIER_CHECKS */ } - H5Sclose (filespace); - H5Sclose (memspace); - H5Pclose (dcpl); - H5Fclose (iof); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Fclose(iof); HDfree(outme); } @@ -185,13 +185,11 @@ void compact_dataset(void) size = get_size(); - for ( i = 0; i < DIM; i++ ) - { + for(i = 0; i < DIM; i++ ) file_dims[i] = size; - } - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); @@ -203,46 +201,46 @@ void compact_dataset(void) VRFY((mpi_size <= size), "mpi_size <= size"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ - filespace = H5Screate_simple (DIM, file_dims, NULL); + filespace = H5Screate_simple(DIM, file_dims, NULL); /* Create a compact dataset */ dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl>=0), "dataset creation property list succeeded"); - ret=H5Pset_layout(dcpl, H5D_COMPACT); + ret = H5Pset_layout(dcpl, H5D_COMPACT); VRFY((dcpl >= 0), "set property list for compact dataset"); - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); VRFY((ret >= 0), "set space allocation time for compact dataset"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); + ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO); VRFY((ret>= 0),"set independent IO collectively succeeded"); } /* Recalculate data to write. Each process writes the same data. */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) - outme[(i * size) + j] = (i+j)*1000; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] =(i + j) * 1000; - ret=H5Dwrite (dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme); + ret = H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme); VRFY((ret >= 0), "H5Dwrite succeeded"); - H5Pclose (dcpl); - H5Pclose (plist); - H5Dclose (dataset); - H5Sclose (filespace); - H5Fclose (iof); + H5Pclose(dcpl); + H5Pclose(plist); + H5Dclose(dataset); + H5Sclose(filespace); + H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); @@ -250,9 +248,9 @@ void compact_dataset(void) VRFY((iof >= 0), "H5Fopen succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -267,9 +265,9 @@ void compact_dataset(void) VRFY((ret >= 0), "H5Dread succeeded"); /* Verify data value */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) - if ( inme[(i * size) + j] != outme[(i * size) + j]) + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + if(inme[(i * size) + j] != outme[(i * size) + j]) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]); @@ -306,54 +304,54 @@ void null_dataset(void) herr_t ret; const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); filename = GetTestParameters(); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ sid = H5Screate(H5S_NULL); /* Check that the null dataspace actually has 0 elements */ nelem = H5Sget_simple_extent_npoints(sid); - VRFY((nelem== 0), "H5Sget_simple_extent_npoints"); + VRFY((nelem == 0), "H5Sget_simple_extent_npoints"); /* Create a compact dataset */ - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); + ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO); VRFY((ret>= 0),"set independent IO collectively succeeded"); } - /* Write "nothing" to the dataset (with type conversion) */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval); + /* Write "nothing" to the dataset(with type conversion) */ + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Create an attribute for the group */ attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((attr >= 0), "H5Acreate2"); - /* Write "nothing" to the attribute (with type conversion) */ + /* Write "nothing" to the attribute(with type conversion) */ ret = H5Awrite(attr, H5T_NATIVE_INT, &val); VRFY((ret >= 0), "H5Awrite"); - H5Aclose (attr); - H5Dclose (dataset); - H5Pclose (plist); - H5Sclose (sid); - H5Fclose (iof); + H5Aclose(attr); + H5Dclose(dataset); + H5Pclose(plist); + H5Sclose(sid); + H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); @@ -361,9 +359,9 @@ void null_dataset(void) VRFY((iof >= 0), "H5Fopen succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -374,7 +372,7 @@ void null_dataset(void) dataset = H5Dopen2(iof, dname, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); - /* Try reading from the dataset (make certain our buffer is unmodified) */ + /* Try reading from the dataset(make certain our buffer is unmodified) */ ret = H5Dread(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, dxpl, &uval); VRFY((ret>=0), "H5Dread"); VRFY((uval==2), "H5Dread"); @@ -383,20 +381,20 @@ void null_dataset(void) attr = H5Aopen(dataset, ".", attr_name, H5P_DEFAULT, H5P_DEFAULT); VRFY((attr >= 0), "H5Aopen"); - /* Try reading from the attribute (make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val); + /* Try reading from the attribute(make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val); VRFY((ret>=0), "H5Aread"); VRFY((val==1), "H5Aread"); H5Pclose(plist); H5Pclose(dxpl); - H5Aclose (attr); + H5Aclose(attr); H5Dclose(dataset); H5Fclose(iof); } -/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB) +/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB) * Actual data is _not_ written to these datasets. Dataspaces are exact - * sizes (2GB, 4GB, etc.), but the metadata for the file pushes the file over + * sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over * the boundary of interest. * * Changes: Removed the assert that mpi_size <= the SIZE #define. @@ -421,11 +419,11 @@ void big_dataset(void) herr_t ret; /* Generic return value */ const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); /* Verify MPI_Offset can handle larger than 2GB sizes */ - VRFY((sizeof(MPI_Offset)>4), "sizeof(MPI_Offset)>4"); + VRFY((sizeof(MPI_Offset) > 4), "sizeof(MPI_Offset)>4"); filename = GetTestParameters(); @@ -435,7 +433,7 @@ void big_dataset(void) /* * Create >2GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 2GB dataspace */ @@ -443,30 +441,30 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 2147485696ULL), "File is correct size (~2GB)"); + VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)"); #endif /* * Create >4GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 4GB dataspace */ @@ -474,30 +472,30 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 4294969344ULL), "File is correct size (~4GB)"); + VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)"); #endif /* * Create >8GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 8GB dataspace */ @@ -505,28 +503,28 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 8589936640ULL), "File is correct size (~8GB)"); + VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)"); #endif /* Close fapl */ - ret=H5Pclose (fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); } @@ -566,8 +564,8 @@ void dataset_fillvalue(void) herr_t ret; /* Generic return value */ const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); filename = GetTestParameters(); @@ -588,14 +586,14 @@ void dataset_fillvalue(void) /* * Create HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); filespace = H5Screate_simple(4, dset_dims, NULL); VRFY((filespace >= 0), "File H5Screate_simple succeeded"); - dataset = H5Dcreate(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); memspace = H5Screate_simple(4, dset_dims, NULL); VRFY((memspace >= 0), "Memory H5Screate_simple succeeded"); @@ -606,19 +604,19 @@ void dataset_fillvalue(void) /* set entire read buffer with the constant 2 */ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int))); /* Independently read the entire dataset back */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); VRFY((ret >= 0), "H5Dread succeeded"); /* Verify all data read are the fill value 0 */ - trdata=rdata; - err_num=0; - for (i=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) - if( *trdata != 0) + trdata = rdata; + err_num = 0; + for(i = 0; i < (int)dset_dims[0]; i++) + for(j = 0; j < (int)dset_dims[1]; j++) + for(k = 0; k < (int)dset_dims[2]; k++) + for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++) + if(*trdata != 0) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata); + printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata); if(err_num > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); if(err_num){ @@ -634,16 +632,16 @@ void dataset_fillvalue(void) */ /* Create hyperslabs in memory and file dataspaces */ req_start[0]=mpi_rank; - ret=H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); + ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); - ret=H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); + ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); /* Create DXPL for collective I/O */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), "H5Pcreate succeeded"); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -653,14 +651,14 @@ void dataset_fillvalue(void) /* Fill write buffer with some values */ twdata=wdata; - for (i=0, acc=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++) + for(i=0, acc=0; i<(int)dset_dims[0]; i++) + for(j=0; j<(int)dset_dims[1]; j++) + for(k=0; k<(int)dset_dims[2]; k++) + for(l=0; l<(int)dset_dims[3]; l++) *twdata++ = acc++; /* Collectively write a hyperslab of data to the dataset */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Barrier here, to allow MPI-posix I/O to sync */ @@ -672,24 +670,24 @@ void dataset_fillvalue(void) /* set entire read buffer with the constant 2 */ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int))); /* Independently read the entire dataset back */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); VRFY((ret >= 0), "H5Dread succeeded"); /* Verify correct data read */ twdata=wdata; trdata=rdata; err_num=0; - for (i=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) + for(i=0; i<(int)dset_dims[0]; i++) + for(j=0; j<(int)dset_dims[1]; j++) + for(k=0; k<(int)dset_dims[2]; k++) + for(l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) if(i= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Close memory dataspace */ - ret=H5Sclose (memspace); + ret = H5Sclose(memspace); VRFY((ret >= 0), "H5Sclose succeeded"); /* Close dxpl */ - ret=H5Pclose (dxpl); + ret = H5Pclose(dxpl); VRFY((ret >= 0), "H5Pclose succeeded"); /* Close fapl */ - ret=H5Pclose (fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); /* free the buffers */ @@ -759,8 +757,8 @@ void collective_group_write(void) size = get_size(); - chunk_size[0] = (hsize_t)(size / 2); - chunk_size[1] = (hsize_t)(size / 2); + chunk_size[0] =(hsize_t)(size / 2); + chunk_size[1] =(hsize_t)(size / 2); outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); @@ -786,7 +784,7 @@ void collective_group_write(void) VRFY((ret2>=0), "mgroup filespace selection"); dcpl = H5Pcreate(H5P_DATASET_CREATE); - ret1 = H5Pset_chunk (dcpl, 2, chunk_size); + ret1 = H5Pset_chunk(dcpl, 2, chunk_size); VRFY((dcpl>=0), "dataset creation property"); VRFY((ret1>=0), "set chunk for dataset creation property"); @@ -798,12 +796,12 @@ void collective_group_write(void) VRFY((gid > 0), gname); sprintf(dname, "dataset%d", m); - did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, dcpl); + did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); VRFY((did > 0), dname); - for(i=0; i < size; i++) - for(j=0; j < size; j++) - outme[(i * size) + j] = (i+j)*1000 + mpi_rank; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] =(i + j) * 1000 + mpi_rank; H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); @@ -812,7 +810,7 @@ void collective_group_write(void) H5Gclose(gid); #ifdef BARRIER_CHECKS - if(! ((m+1) % 10)) { + if(!((m+1) % 10)) { printf("created %d groups\n", m+1); MPI_Barrier(MPI_COMM_WORLD); } @@ -885,10 +883,10 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); /* open every group under root group. */ @@ -906,7 +904,7 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m) /* this is the original value */ for(i=0; i 0), dname); - for(i=0; i < size; i++) - for(j=0; j < size; j++) - outme[(i * size) + j] = n*1000 + mpi_rank; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] = n * 1000 + mpi_rank; - H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, - outme); + H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); /* create attribute for these datasets.*/ write_attribute(did, is_dset, n); @@ -1094,7 +1090,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #ifdef BARRIER_CHECKS - if(! ((counter+1) % 10)) { + if(!((counter+1) % 10)) { printf("created %dth child groups\n", counter+1); MPI_Barrier(MPI_COMM_WORLD); } @@ -1107,7 +1103,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, /* write datasets in parallel. */ write_dataset(memspace, filespace, gid); - if( counter < GROUP_DEPTH ) + if(counter < GROUP_DEPTH ) create_group_recursive(memspace, filespace, child_gid, counter+1); H5Gclose(child_gid); @@ -1168,12 +1164,12 @@ void multiple_group_read(void) /* check the data. */ if(m != 0) - if( (error_num = read_dataset(memspace, filespace, gid))>0) + if((error_num = read_dataset(memspace, filespace, gid))>0) nerrors += error_num; /* check attribute.*/ error_num = 0; - if( (error_num = read_attribute(gid, is_group, m))>0 ) + if((error_num = read_attribute(gid, is_group, m))>0 ) nerrors += error_num; H5Gclose(gid); @@ -1218,10 +1214,10 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); for(n=0; n0 ) + if((attr_errors = read_attribute(did, is_dset, n))>0 ) vrfy_errors += attr_errors; H5Dclose(did); @@ -1273,10 +1269,10 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, MPI_Barrier(MPI_COMM_WORLD); #endif /* BARRIER_CHECKS */ - if( (err_num = read_dataset(memspace, filespace, gid)) ) + if((err_num = read_dataset(memspace, filespace, gid)) ) nerrors += err_num; - if( counter < GROUP_DEPTH ) { + if(counter < GROUP_DEPTH ) { sprintf(gname, "%dth_child_group", counter+1); child_gid = H5Gopen2(gid, gname, H5P_DEFAULT); VRFY((child_gid>0), gname); @@ -1377,9 +1373,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size) outdata += chunk_origin[0]*size; for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++) for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) { - if( *indata != *outdata ) + if(*indata != *outdata ) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata); + printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n",(unsigned long)i,(unsigned long)j,(unsigned long)i,(unsigned long)j, *outdata, *indata); } if(err_num > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); @@ -1409,7 +1405,7 @@ void get_slab(hsize_t chunk_origin[], MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); if(chunk_origin != NULL) { - chunk_origin[0] = mpi_rank * (size/mpi_size); + chunk_origin[0] = mpi_rank *(size/mpi_size); chunk_origin[1] = 0; } if(chunk_dims != NULL) { @@ -1424,7 +1420,7 @@ void get_slab(hsize_t chunk_origin[], /* * This function is based on bug demonstration code provided by Thomas - * Guignon (thomas.guignon@ifp.fr), and is intended to verify the + * Guignon(thomas.guignon@ifp.fr), and is intended to verify the * correctness of my fix for that bug. * * In essence, the bug appeared when at least one process attempted to @@ -1495,115 +1491,98 @@ void io_mode_confusion(void) * Set up file access property list with parallel I/O access */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Setting up property list.\n", mpi_rank, fcn_name); plist_id = H5Pcreate(H5P_FILE_ACCESS); - VRFY((plist_id != -1), "H5Pcreate() failed"); status = H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, MPI_INFO_NULL); - - VRFY(( status >= 0 ), "H5Pset_fapl_mpio() failed"); + VRFY((status >= 0 ), "H5Pset_fapl_mpio() failed"); /* * Create a new file collectively and release property list identifier. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating new file.\n", mpi_rank, fcn_name); file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); - - VRFY(( file_id >= 0 ), "H5Fcreate() failed"); + VRFY((file_id >= 0 ), "H5Fcreate() failed"); status = H5Pclose(plist_id); - - VRFY(( status >= 0 ), "H5Pclose() failed"); + VRFY((status >= 0 ), "H5Pclose() failed"); /* * Create the dataspace for the dataset. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating the dataspace for the dataset.\n", mpi_rank, fcn_name); dimsf[0] = N; - filespace = H5Screate_simple(rank, dimsf, NULL); - - VRFY(( filespace >= 0 ), "H5Screate_simple() failed."); + VRFY((filespace >= 0 ), "H5Screate_simple() failed."); /* * Create the dataset with default properties and close filespace. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating the dataset, and closing filespace.\n", mpi_rank, fcn_name); - dset_id = H5Dcreate(file_id, dataset_name, H5T_NATIVE_INT, filespace, - H5P_DEFAULT); - - VRFY(( dset_id >= 0 ), "H5Dcreate() failed"); + dset_id = H5Dcreate2(file_id, dataset_name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dset_id >= 0 ), "H5Dcreate2() failed"); status = H5Sclose(filespace); - - VRFY(( status >= 0 ), "H5Sclose() failed"); + VRFY((status >= 0 ), "H5Sclose() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Screate_simple().\n", - mpi_rank, fcn_name); + mpi_rank, fcn_name); memspace = H5Screate_simple(rank, dimsf, NULL); - - VRFY(( memspace >= 0 ), "H5Screate_simple() failed."); + VRFY((memspace >= 0 ), "H5Screate_simple() failed."); - if( mpi_rank == 0 ) { - - if ( verbose ) + if(mpi_rank == 0 ) { + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_all(memspace).\n", mpi_rank, fcn_name); status = H5Sselect_all(memspace); - - VRFY(( status >= 0 ), "H5Sselect_all() failed"); - + VRFY((status >= 0 ), "H5Sselect_all() failed"); } else { - - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none(memspace).\n", mpi_rank, fcn_name); status = H5Sselect_none(memspace); - - VRFY(( status >= 0 ), "H5Sselect_none() failed"); - + VRFY((status >= 0 ), "H5Sselect_none() failed"); } - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Dget_space().\n", mpi_rank, fcn_name); filespace = H5Dget_space(dset_id); - - VRFY(( filespace >= 0 ), "H5Dget_space() failed"); + VRFY((filespace >= 0 ), "H5Dget_space() failed"); start[0] = 0L; @@ -1611,102 +1590,90 @@ void io_mode_confusion(void) count[0] = 1; block[0] = N; - if ( mpi_rank == 0 ) { - - /* select all */ - - if ( verbose ) + /* select all */ + if(mpi_rank == 0 ) { + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_elements() -- set up hang?\n", mpi_rank, fcn_name); status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, - (const hsize_t **)&coord); - - VRFY(( status >= 0 ), "H5Sselect_elements() failed"); - - } else { - - /* select nothing */ - - if ( verbose ) + (const hsize_t **)&coord); + VRFY((status >= 0 ), "H5Sselect_elements() failed"); + } else { /* select nothing */ + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none().\n", mpi_rank, fcn_name); status = H5Sselect_none(filespace); - - VRFY(( status >= 0 ), "H5Sselect_none() failed"); - + VRFY((status >= 0 ), "H5Sselect_none() failed"); } - - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Pcreate().\n", mpi_rank, fcn_name); plist_id = H5Pcreate(H5P_DATASET_XFER); - - VRFY(( plist_id != -1 ), "H5Pcreate() failed"); + VRFY((plist_id != -1 ), "H5Pcreate() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Pset_dxpl_mpio().\n", mpi_rank, fcn_name); status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); - VRFY(( status >= 0 ), "H5Pset_dxpl_mpio() failed"); + VRFY((status >= 0 ), "H5Pset_dxpl_mpio() failed"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - status = H5Pset_dxpl_mpio_collective_opt(plist_id,H5FD_MPIO_INDIVIDUAL_IO); + status = H5Pset_dxpl_mpio_collective_opt(plist_id, H5FD_MPIO_INDIVIDUAL_IO); VRFY((status>= 0),"set independent IO collectively succeeded"); } - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Dwrite() -- hang here?.\n", mpi_rank, fcn_name); status = H5Dwrite(dset_id, H5T_NATIVE_INT, memspace, filespace, plist_id, data); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Returned from H5Dwrite(), status=%d.\n", mpi_rank, fcn_name, status); - - VRFY(( status >= 0 ), "H5Dwrite() failed"); + VRFY((status >= 0 ), "H5Dwrite() failed"); /* * Close/release resources. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Cleaning up from test.\n", mpi_rank, fcn_name); status = H5Dclose(dset_id); - VRFY(( status >= 0 ), "H5Dclose() failed"); + VRFY((status >= 0 ), "H5Dclose() failed"); status = H5Sclose(filespace); - VRFY(( status >= 0 ), "H5Dclose() failed"); + VRFY((status >= 0 ), "H5Dclose() failed"); status = H5Sclose(memspace); - VRFY(( status >= 0 ), "H5Sclose() failed"); + VRFY((status >= 0 ), "H5Sclose() failed"); status = H5Pclose(plist_id); - VRFY(( status >= 0 ), "H5Pclose() failed"); + VRFY((status >= 0 ), "H5Pclose() failed"); status = H5Fclose(file_id); - VRFY(( status >= 0 ), "H5Fclose() failed"); + VRFY((status >= 0 ), "H5Fclose() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Done.\n", mpi_rank, fcn_name); return; @@ -1718,3 +1685,4 @@ void io_mode_confusion(void) /*============================================================================= * End of t_mdset.c *===========================================================================*/ + 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= 0),"Fill value creation property list succeeded"); if(chunk_factor != 0) { - chunk_dims[0] = fsdim[0]/chunk_factor; - chunk_dims[1] = fsdim[1]/chunk_factor; + chunk_dims[0] = fsdim[0] / chunk_factor; + chunk_dims[1] = fsdim[1] / chunk_factor; ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); } @@ -333,10 +333,10 @@ void coll_write_test(int chunk_factor) * Create dataset in the file. Notice that creation * property list dcrt_plist is used. */ - datasetc = H5Dcreate(file, "collect_write", H5T_NATIVE_INT, fspaceid, dcrt_plist); + datasetc = H5Dcreate2(file, "collect_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT); VRFY((datasetc >= 0),"dataset created succeeded"); - dataseti = H5Dcreate(file, "independ_write", H5T_NATIVE_INT, fspaceid, dcrt_plist); + dataseti = H5Dcreate2(file, "independ_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT); VRFY((dataseti >= 0),"dataset created succeeded"); /* The First selection for FILE @@ -349,7 +349,7 @@ void coll_write_test(int chunk_factor) */ start[0] = FHSTART0; - start[1] = FHSTART1+mpi_rank*FHSTRIDE1*FHCOUNT1; + start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1; stride[0] = FHSTRIDE0; stride[1] = FHSTRIDE1; count[0] = FHCOUNT0; diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 6d07ae7..52467d7 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -49,7 +49,7 @@ static void gent_simple(hid_t loc_id) sid = H5Screate_simple(1, dims, NULL); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(loc_id, DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* write */ H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -81,7 +81,7 @@ static void gent_chunked(hid_t loc_id) H5Pset_chunk(pid, 1, chunk_dims); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_CHUNK, H5T_NATIVE_INT, sid, pid); + did = H5Dcreate2(loc_id, DATASET_CHUNK, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); /* write */ H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -114,7 +114,7 @@ static void gent_compact(hid_t loc_id) H5Pset_layout (pid,H5D_COMPACT); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_COMPACT, H5T_NATIVE_INT, sid, pid); + did = H5Dcreate2(loc_id, DATASET_COMPACT, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); /* write */ H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -156,7 +156,7 @@ static void gent_compound(hid_t loc_id) H5Tinsert(tid_c, "str2", HOFFSET(s_t,str2), tid_s); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_COMPOUND, tid_c, sid, H5P_DEFAULT); + did = H5Dcreate2(loc_id, DATASET_COMPOUND, tid_c, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* write */ H5Dwrite(did, tid_c, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -195,7 +195,7 @@ static void gent_compressed(hid_t loc_id) #endif /* create dataset */ - did = H5Dcreate(loc_id, DATASET_COMPRESSED, H5T_NATIVE_INT, sid, pid); + did = H5Dcreate2(loc_id, DATASET_COMPRESSED, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); /* write */ H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -239,7 +239,7 @@ static void gent_named_vl(hid_t loc_id) H5Tcommit2(loc_id, "vl", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT); + did = H5Dcreate2(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* write */ H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -292,7 +292,7 @@ static void gent_nested_vl(hid_t loc_id) tid2 = H5Tvlen_create(tid1); /* create dataset */ - did = H5Dcreate(loc_id, DATASET_NESTED_VL, tid2, sid, H5P_DEFAULT); + did = H5Dcreate2(loc_id, DATASET_NESTED_VL, tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* write */ H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index ba8b222..436e7fd 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -618,14 +618,14 @@ int test_attributes(const char *file, herr_t status; /* Create a file */ - if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ - sid = H5Screate_simple(1,dims,NULL); - did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - status = H5Sclose(sid); - assert(status>=0); + sid = H5Screate_simple(1, dims, NULL); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Sclose(sid); + assert(status >= 0); /* Create groups */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -643,15 +643,15 @@ int test_attributes(const char *file, /* Close */ status = H5Dclose(did); - assert(status>=0); + assert(status >= 0); status = H5Gclose(gid); - assert(status>=0); + assert(status >= 0); status = H5Gclose(root_id); - assert(status>=0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - assert(status>=0); + assert(status >= 0); return status; } @@ -678,19 +678,19 @@ int test_datasets(const char *file, herr_t status; int buf[2]={1,2}; - if (make_diffs) - memset(buf,0,sizeof buf); + if(make_diffs) + memset(buf, 0, sizeof buf); /* Create a file */ - if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ - sid = H5Screate_simple(1,dims,NULL); - did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); - status = H5Sclose(sid); - assert(status>=0); + sid = H5Screate_simple(1, dims, NULL); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + status = H5Sclose(sid); + assert(status >= 0); /* Create a group */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -704,13 +704,13 @@ int test_datasets(const char *file, /* Close */ status = H5Dclose(did); - assert(status>=0); + assert(status >= 0); status = H5Gclose(gid); - assert(status>=0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - assert(status>=0); + assert(status >= 0); return status; } @@ -1916,20 +1916,19 @@ void write_dset_in(hid_t loc_id, ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; - if (make_diffs) - { - ((int *)buf5[0].p)[0]=0; - ((int *)buf5[1].p)[0]=0; + if(make_diffs) { + ((int *)buf5[0].p)[0] = 0; + ((int *)buf5[1].p)[0] = 0; ((int *)buf5[1].p)[1]=0; } - sid = H5Screate_simple(1,dims,NULL); + sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -2063,25 +2062,27 @@ void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + n = 0; + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) { int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; - for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf52[i][j].p)[l] = 0; - else ((int *)buf52[i][j].p)[l] = n++; + for(l = 0; l < i + 1; l++) + if (make_diffs) + ((int *)buf52[i][j].p)[l] = 0; + else + ((int *)buf52[i][j].p)[l] = n++; } - } - sid = H5Screate_simple(2,dims2,NULL); + sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -2107,18 +2108,17 @@ void write_dset_in(hid_t loc_id, */ - if (make_diffs) - { - memset(buf72,0,sizeof buf72); - memset(buf82,0,sizeof buf82); + if (make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue); - sid = H5Screate_simple(2,dims2,NULL); - did = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,sid,dcpl); - status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72); + sid = H5Screate_simple(2, dims2, NULL); + did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); status = H5Pclose(dcpl); status = H5Dclose(did); status = H5Sclose(sid); @@ -2243,26 +2243,27 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) { int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; - for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0; - else ((int *)buf53[i][j][k].p)[l] = n++; + for(l = 0; l < i + 1; l++) + if(make_diffs) + ((int *)buf53[i][j][k].p)[l] = 0; + else + ((int *)buf53[i][j][k].p)[l] = n++; } - } - } - sid = H5Screate_simple(3,dims3,NULL); + sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -2339,41 +2340,38 @@ void gen_datareg(hid_t fid, int i; /* allocate the buffer for write the references */ - rbuf=calloc(2,sizeof(hdset_reg_ref_t)); + rbuf = calloc(2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf=malloc(10*10*sizeof(int)); + buf = malloc(10 * 10 * sizeof(int)); - for (i=0; i<10*10; i++) - { - buf[i]=i; - } + for(i = 0; i < 10 * 10; i++) + buf[i] = i; /* create the data dataset */ - sid1 = H5Screate_simple(2,dims1,NULL); - did1 = H5Dcreate(fid,"dsetref",H5T_NATIVE_INT,sid1,H5P_DEFAULT); - status = H5Dwrite(did1,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + sid1 = H5Screate_simple(2, dims1, NULL); + did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); /* create the reference dataset */ - sid2 = H5Screate_simple(1,dims2,NULL); - did2 = H5Dcreate(fid,"refreg",H5T_STD_REF_DSETREG,sid2,H5P_DEFAULT); + sid2 = H5Screate_simple(1, dims2, NULL); + did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* create the references */ /* select hyperslab for first reference */ - start[0]=2; start[1]=2; - count[0]=6; count[1]=6; - if (make_diffs) - { - start[0]=0; start[1]=0; - count[0]=3; count[1]=3; + start[0] = 2; start[1] = 2; + count[0] = 6; count[1] = 6; + if(make_diffs) { + start[0] = 0; start[1] = 0; + count[0] = 3; count[1] = 3; } - status = H5Sselect_hyperslab(sid1,H5S_SELECT_SET,start,NULL,count,NULL); + status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); H5Sget_select_npoints(sid1); /* store first dataset region */ - status = H5Rcreate(&rbuf[0],fid,"dsetref",H5R_DATASET_REGION,sid1); + status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); /* select sequence of five points for second reference */ coord[0][0]=6; coord[0][1]=9; @@ -2437,43 +2435,39 @@ int test_hyperslab(const char *fname, char c; /* create */ - fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) goto out; if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if ((f_sid = H5Screate_simple(1,dims,NULL)) < 0) + if((f_sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if ((did = H5Dcreate(fid,"big",H5T_NATIVE_CHAR,f_sid,dcpl)) < 0) + if((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) + if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - if ((tid = H5Dget_type(did)) < 0) + if((tid = H5Dget_type(did)) < 0) goto out; - if ((size = H5Tget_size(tid))<=0) + if((size = H5Tget_size(tid)) <= 0) goto out; /* create a evenly divided buffer from 0 to 127 */ - buf=(char *) HDmalloc((unsigned)(nelmts*size)); - s = 1024*1024 / 127; - for (i=0, j=0, c=0; i<1024*1024; j++, i++) - { - if ( j==s) - { + buf = (char *)HDmalloc((unsigned)(nelmts * size)); + s = 1024 * 1024 / 127; + for(i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { + if(j == s) { c++; - j=0; - }; + j = 0; + } /* set the hyperslab values */ HDmemset(buf, c, nelmts); /* make a different hyperslab at this position */ - if (make_diffs && i==512*512) - { + if(make_diffs && i == 512 * 512) HDmemset(buf, 0, nelmts); - } hs_start[0] = i * GBLL/(1024*1024); if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0) @@ -2573,32 +2567,29 @@ int write_dset( hid_t loc_id, hid_t tid, void *buf ) { - hid_t did; - hid_t sid; + hid_t did; + hid_t sid; - /* create a space */ - if (( sid = H5Screate_simple(rank,dims,NULL)) < 0 ) - goto out; + /* create a space */ + if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + goto out; - /* create the dataset */ - if (( did = H5Dcreate(loc_id,name,tid,sid,H5P_DEFAULT)) < 0 ) - goto out; + /* create the dataset */ + if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - /* write */ - if ( buf ) - { - if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 ) - goto out; - } + /* write */ + if(buf) + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto out; - /* close */ - H5Dclose(did); - H5Sclose(sid); + /* close */ + H5Dclose(did); + H5Sclose(sid); - return SUCCEED; + return SUCCEED; out: - - return FAIL; + return FAIL; } diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 101e230..0a6b607 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -288,11 +288,11 @@ gent_dataset(void) /* dset1 */ dims[0] = 10; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 20; j++) - dset1[i][j] = j+i; + for(i = 0; i < 10; i++) + for(j = 0; j < 20; j++) + dset1[i][j] = j + i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -301,11 +301,11 @@ gent_dataset(void) /* dset2 */ dims[0] = 30; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 30; i++) - for (j = 0; j < 20; j++) - dset2[i][j] = 0.0001*j+i; + for(i = 0; i < 30; i++) + for(j = 0; j < 20; j++) + dset2[i][j] = 0.0001 * j + i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -333,10 +333,10 @@ gent_dataset2(void) dims[0] = 10; dims[1] = 20; maxdims[0] = H5S_UNLIMITED; maxdims[1] = 20; space = H5Screate_simple(2, dims, maxdims); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, create_plist); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 20; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 20; j++) dset1[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); @@ -347,10 +347,10 @@ gent_dataset2(void) dims[0] = 30; dims[1] = 10; maxdims[0] = 30; maxdims[1] = H5S_UNLIMITED; space = H5Screate_simple(2, dims, maxdims); - dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, create_plist); + dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); - for (i = 0; i < 30; i++) - for (j = 0; j < 10; j++) + for(i = 0; i < 30; i++) + for(j = 0; j < 10; j++) dset2[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -390,7 +390,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) data[i] = i+1; + for(i = 0; i < 10; i++) data[i] = i+1; H5Awrite(attr, H5T_NATIVE_INT, data); H5Sclose(space); @@ -401,7 +401,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, ".", "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) d[i] = 0.1 * i; + for(i = 0; i < 10; i++) d[i] = 0.1 * i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space); @@ -463,9 +463,9 @@ static void gent_hardlink(void) fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(1, &dim, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 5; i++) dset[i] = i; + for(i = 0; i < 5; i++) dset[i] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); H5Sclose(space); @@ -567,7 +567,7 @@ static void gent_compound_dt(void) { /* test compound data type */ hsize_t dset3_dim[2]; - for (i = 0; i < (int)sdim; i++) { + for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); @@ -595,7 +595,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tinsert(type2, "a_name", HOFFSET(dset1_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "b_name", HOFFSET(dset1_t, b), H5T_NATIVE_FLOAT); H5Tinsert(type2, "c_name", HOFFSET(dset1_t, c), H5T_NATIVE_DOUBLE); - dataset = H5Dcreate(fid, "/dset1", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Tclose(type2); H5Tclose(type); @@ -611,7 +611,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); H5Tclose(type2); H5Tclose(type); @@ -647,16 +647,15 @@ static void gent_compound_dt(void) { /* test compound data type */ dset3_dim[0] = 3; dset3_dim[1] = 6; space3 = H5Screate_simple(2, dset3_dim, NULL); - dataset = H5Dcreate(group, "dset3", type, space3, H5P_DEFAULT); - for (i = 0; i < (int)dset3_dim[0]; i++) { - for (j = 0; j < (int)dset3_dim[1]; j++) { - for (k = 0; k < 4; k++) - dset3[i][j].a[k] = k+j+i; - for (k = 0; k < 5; k++) - for (l = 0; l < 6; l++) - dset3[i][j].b[k][l] = (float)((k+1)+l+j+i); + dataset = H5Dcreate2(group, "dset3", type, space3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < (int)dset3_dim[0]; i++) + for(j = 0; j < (int)dset3_dim[1]; j++) { + for(k = 0; k < 4; k++) + dset3[i][j].a[k] = k + j + i; + for(k = 0; k < 5; k++) + for(l = 0; l < 6; l++) + dset3[i][j].b[k][l] = (float)((k + 1) + l + j + i); } - } H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); H5Sclose(space3); H5Tclose(type); @@ -671,7 +670,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset4_t, b), H5T_NATIVE_FLOAT); - dataset = H5Dcreate(group, "dset4", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset4); H5Tclose(type); @@ -690,7 +689,7 @@ static void gent_compound_dt(void) { /* test compound data type */ type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT); - dataset = H5Dcreate(group, "dset5", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset5); H5Ldelete(group, "type4", H5P_DEFAULT); @@ -753,7 +752,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ hsize_t sdim, maxdim; sdim = 10; - for (i = 0; i < (int)sdim; i++) { + for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); @@ -786,7 +785,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32BE); H5Tinsert(type, "c_name", HOFFSET(dset1_t, c), H5T_IEEE_F64BE); - dataset = H5Dcreate(fid, "/dset1", type, space, create_plist); + dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); @@ -814,7 +813,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", type, space, create_plist); + dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT); @@ -848,7 +847,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE); H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset4", type, space, create_plist); + dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t)); H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT); @@ -868,7 +867,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE); H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset5", type, space, create_plist); + dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT); @@ -952,10 +951,10 @@ static void gent_all(void) /* dset1.1.1 */ dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) - dset1[i][j] = j*i; + dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) + dset1[i][j] = j * i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -981,8 +980,8 @@ static void gent_all(void) /* dset1.1.2 */ dims[0] = 20; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 20; i++) + dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 20; i++) dset2[i] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); H5Sclose(space); @@ -1003,9 +1002,9 @@ static void gent_all(void) /* dset2.1 */ dims[0] = 10; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - dset2_1[i] = (float)(i*0.1+1); + dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + dset2_1[i] = (float)(i * 0.1 + 1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); @@ -1013,10 +1012,10 @@ static void gent_all(void) /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 3; i++) - for (j = 0; j < 5; j++) - dset2_2[i][j] = (float)((i+1)*j*0.1); + dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 3; i++) + for(j = 0; j < 5; j++) + dset2_2[i][j] = (float)((i + 1) * j * 0.1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); H5Sclose(space); H5Dclose(dataset); @@ -1160,7 +1159,7 @@ static void gent_many(void) sdim = 6; maxdim = H5S_UNLIMITED; space = H5Screate_simple(1, &sdim, &maxdim); - dataset = H5Dcreate(group, "dset1", type, space, create_plist); + dataset = H5Dcreate2(group, "dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); /* add attributes to dset1 */ dims[0] = 10; @@ -1182,17 +1181,17 @@ static void gent_many(void) dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, ".", "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) + for(i = 0; i < 10; i++) d[i] = 0.1 * i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space2); H5Aclose(attr); - for (j=0; j<(int)sdim; j++) { - for (i3 = 0; i3 < 2; i3++) { - for (i2 = 0; i2 < 2; i2++) { - for (i1 = 0; i1 < 2; i1++) { - for (i0 = 0; i0 < 2; i0++) { + for(j=0; j<(int)sdim; j++) { + for(i3 = 0; i3 < 2; i3++) { + for(i2 = 0; i2 < 2; i2++) { + for(i1 = 0; i1 < 2; i1++) { + for(i0 = 0; i0 < 2; i0++) { dset1[j].a[i3][i2][i1][i0] = i0+j; dset1[j].b[i3][i2][i1][i0] = (double)(i0+j); #ifdef _WIN32 @@ -1232,9 +1231,9 @@ static void gent_many(void) dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) + dataset = H5Dcreate2(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) dset2[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -1255,9 +1254,9 @@ static void gent_many(void) dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) + dataset = H5Dcreate2(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) dset3[i][j] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); @@ -1294,9 +1293,9 @@ static void gent_many(void) static hid_t mkstr(int size, H5T_str_t pad) { hid_t type; - if ((type=H5Tcopy(H5T_C_S1))<0) return -1; - if (H5Tset_size(type, (size_t)size)<0) return -1; - if (H5Tset_strpad(type, pad)<0) return -1; + if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; + if(H5Tset_size(type, (size_t)size) < 0) return -1; + if(H5Tset_strpad(type, pad) < 0) return -1; return type; } @@ -1345,7 +1344,7 @@ static void gent_str(void) { space = H5Screate_simple(2, dims1, NULL); f_type = mkstr(5, H5T_STR_NULLTERM); m_type = mkstr(3, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string1", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1); H5Tclose(m_type); H5Tclose(f_type); @@ -1356,7 +1355,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims2, NULL); f_type = mkstr(11, H5T_STR_SPACEPAD); m_type = mkstr(10, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string2", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2); H5Tclose(m_type); H5Tclose(f_type); @@ -1367,7 +1366,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims3, NULL); f_type = mkstr(8, H5T_STR_NULLPAD); m_type = mkstr(6, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string3", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3); H5Tclose(m_type); H5Tclose(f_type); @@ -1378,7 +1377,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims4, NULL); f_type = mkstr(168, H5T_STR_SPACEPAD); m_type = mkstr(21, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string4", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4); H5Tclose(m_type); H5Tclose(f_type); @@ -1414,16 +1413,16 @@ static void gent_str(void) { H5Tclose(array_dt); H5Tclose(str_type); - for (i = 0; i < 3; i++) - for (j = 0; j < 6; j++) { - for (k = 0 ; k < 8; k++) - for (l = 0; l < 10; l++) - comp1[i][j].a[k][l] = (l+j+k) * (l+j+k); - for (k = 0 ; k < 12; k++) + for(i = 0; i < 3; i++) + for(j = 0; j < 6; j++) { + for(k = 0 ; k < 8; k++) + for(l = 0; l < 10; l++) + comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); + for(k = 0 ; k < 12; k++) strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); } - dataset = H5Dcreate(fid, "/comp1", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); H5Tclose(f_type); @@ -1478,7 +1477,7 @@ hsize_t sdim; /* dset1 */ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset1", fxdlenstr, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset1", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* add attributes to dset1 */ @@ -1502,25 +1501,25 @@ hsize_t sdim; count[0]=1; block[0]=1; - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); @@ -1533,28 +1532,28 @@ hsize_t sdim; H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD); group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset3", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0;(hsize_t) i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0;(hsize_t) i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset4", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); @@ -1566,28 +1565,28 @@ hsize_t sdim; H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD); group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset5", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset6", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); @@ -1623,8 +1622,8 @@ static void gent_enum(void) H5Tcommit2(file, "enum normal", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(1,size,NULL); - dset = H5Dcreate(file,"table",type, space, H5P_DEFAULT); - H5Dwrite(dset,type,space,space,H5P_DEFAULT,data); + dset = H5Dcreate2(file,"table",type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dset, type, space, space, H5P_DEFAULT, data); H5Dclose(dset); H5Sclose(space); @@ -1666,7 +1665,7 @@ static void gent_objref(void) H5Oset_comment(group, ".", write_comment, H5P_DEFAULT); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu32 = (uint32_t *)((void*)wbuf), i = 0; i < SPACE1_DIM1; i++) *tu32++ = i * 3; @@ -1678,7 +1677,7 @@ static void gent_objref(void) H5Dclose(dataset); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Close Dataset */ H5Dclose(dataset); @@ -1703,7 +1702,7 @@ static void gent_objref(void) H5Gclose(group); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create reference to dataset */ H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -1771,13 +1770,13 @@ static void gent_datareg(void) sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); /* Create a dataset */ - dset2=H5Dcreate(fid1,"Dataset2",H5T_STD_U8BE,sid2,H5P_DEFAULT); + dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for(tu8=dwbuf,i=0; i=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { - int j; + int j; wdata[i].p = malloc((i + 1) * sizeof(float)); wdata[i].len = i + 1; - for (j = 0; j < i + 1; j++) + for(j = 0; j < i + 1; j++) ((float *)wdata[i].p)[j] = (float)(i * 10 + ((float)j) / 10.0); } /* write out the floats in little-endian format */ space = H5Screate_simple(SPACE1_RANK, dims, NULL); type = H5Tvlen_create(H5T_NATIVE_FLOAT); - dset = H5Dcreate(file, "Dataset2.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ adata.p = malloc(37 * sizeof(int)); adata.len = 37; - for (i = 0; i < 37; i++) + for(i = 0; i < 37; i++) ((int *)adata.p)[i] = i * 2; /* write out scalar VL dataset in little-endian format */ space = H5Screate_simple(0, NULL, NULL); type = H5Tvlen_create(H5T_NATIVE_INT); - dset = H5Dcreate(file, "Dataset3.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(file); - assert(ret>=0); + assert(ret >= 0); } static void gent_vldatatypes2(void) @@ -2167,33 +2168,33 @@ static void gent_vldatatypes2(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); /* Create a VL datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); /* Create the base VL type */ - tid2 = H5Tvlen_create (tid1); + tid2 = H5Tvlen_create(tid1); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } @@ -2230,41 +2231,41 @@ static void gent_vldatatypes3(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); /* Create a VL datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); /* Create the base compound type */ tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1)); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - assert(ret>=0); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret>=0); - ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_vldatatypes4(void) @@ -2302,36 +2303,36 @@ static void gent_vldatatypes4(void) tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1)); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - assert(ret>=0); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (tid2); + tid1 = H5Tvlen_create(tid2); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } /* Generate a variable-length dataset with NULL values in it */ @@ -2361,38 +2362,38 @@ static void gent_vldatatypes5(void) } /* end for */ /* Create file */ - fid1 = H5Fcreate (FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid1>0); /* Create dataspace for datasets */ - sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL); + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); assert(sid1>0); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); assert(tid1>0); /* Create a dataset */ - dataset = H5Dcreate (fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(dataset>0); - ret = H5Dwrite (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); - ret = H5Dclose (dataset); - assert(ret>=0); + ret = H5Dclose(dataset); + assert(ret >= 0); - ret = H5Dvlen_reclaim (tid1, sid1, H5P_DEFAULT, wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); - ret = H5Tclose (tid1); - assert(ret>=0); + ret = H5Tclose(tid1); + assert(ret >= 0); ret = H5Sclose (sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose (fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array1(void) @@ -2422,21 +2423,21 @@ static void gent_array1(void) tid1 = H5Tarray_create(H5T_NATIVE_INT, ARRAY1_RANK, tdims1, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array2(void) @@ -2468,21 +2469,21 @@ static void gent_array2(void) tid = H5Tarray_create(H5T_NATIVE_INT, ARRAY2_RANK, tdims2, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid,"Dataset1",tid,sid,H5P_DEFAULT); + dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid); - assert(ret>=0); + assert(ret >= 0); } static void gent_array3(void) @@ -2519,23 +2520,23 @@ static void gent_array3(void) tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid,"Dataset1",tid1,sid,H5P_DEFAULT); + dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid); - assert(ret>=0); + assert(ret >= 0); } static void gent_array4(void) @@ -2572,36 +2573,36 @@ static void gent_array4(void) tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); /* Insert integer field */ - ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); + assert(ret >= 0); /* Insert float field */ - ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), H5T_NATIVE_FLOAT); - assert(ret>=0); + ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close compound datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array5(void) @@ -2641,42 +2642,42 @@ static void gent_array5(void) /* Insert integer field */ ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT); - assert(ret>=0); + assert(ret >= 0); /* Create an array of floats datatype */ tid3 = H5Tarray_create(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1, NULL); /* Insert float array field */ ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), tid3); - assert(ret>=0); + assert(ret >= 0); /* Close array of floats field datatype */ - ret=H5Tclose(tid3); - assert(ret>=0); + ret = H5Tclose(tid3); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close compound datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array6(void) @@ -2714,29 +2715,29 @@ static void gent_array6(void) tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close VL datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array7(void) @@ -2776,36 +2777,36 @@ static void gent_array7(void) tid2 = H5Tvlen_create(tid3); /* Close nested array datatype */ - ret=H5Tclose(tid3); - assert(ret>=0); + ret = H5Tclose(tid3); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close VL datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_empty(void) @@ -2825,51 +2826,51 @@ static void gent_empty(void) /* write out an empty vlen dataset */ type = H5Tvlen_create(H5T_NATIVE_INT); - dset = H5Dcreate(file, "Dataset1.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); /* write out an empty native integer dataset dataset */ - dset = H5Dcreate(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); /* write out an empty native floating-point dataset dataset */ - dset = H5Dcreate(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); /* write out an empty array dataset */ type = H5Tarray_create(H5T_NATIVE_INT, SPACE1_RANK, dims, NULL); - dset = H5Dcreate(file, "Dataset4.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); /* write out an empty compound dataset */ type = H5Tcreate(H5T_COMPOUND,sizeof(empty_struct)); H5Tinsert(type, "a", HOFFSET(empty_struct, a),H5T_NATIVE_INT); H5Tinsert(type, "b", HOFFSET(empty_struct, b),H5T_NATIVE_FLOAT); H5Tinsert(type, "c", HOFFSET(empty_struct, c),H5T_NATIVE_CHAR); - dset = H5Dcreate(file, "Dataset5.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(file); - assert(ret>=0); + assert(ret >= 0); } static void @@ -2960,10 +2961,10 @@ void gent_split_file(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -2992,10 +2993,10 @@ void gent_family(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -3030,7 +3031,7 @@ void gent_multi(void) assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); - for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; memb_map[mt] = mt; sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); @@ -3049,10 +3050,10 @@ void gent_multi(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -3105,11 +3106,11 @@ static void gent_vlstr(void) /* Create a VL string datatype to refer to */ tid1 = H5Tcopy (H5T_C_S1); - H5Tset_size (tid1,H5T_VARIABLE); + H5Tset_size (tid1, H5T_VARIABLE); /* Create a dataset and write VL string to it. */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); H5Dclose(dataset); /* Create a named VL string type. Change padding of datatype */ @@ -3153,7 +3154,7 @@ static void gent_char(void) sid1 = H5Screate_simple(1, dims1, NULL); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write some characters to it. */ H5Dwrite(dataset, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -3287,7 +3288,7 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); @@ -3392,10 +3393,10 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); } } @@ -3477,9 +3478,9 @@ static void write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf23[i][j][k]=n++; } } @@ -3503,9 +3504,9 @@ static void write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf33[i][j][k].a=n++; buf33[i][j][k].b=n++; } @@ -3522,11 +3523,11 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); } } @@ -3579,8 +3580,8 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for(i = 0; i < 24; i++) { + for(j = 0; j < (int)dimarray[0]; j++) { buf63[i][j]=n++; } } @@ -3594,9 +3595,9 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf73[i][j][k]=n++; buf83[i][j][k]=f++; } @@ -3731,7 +3732,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); @@ -3763,13 +3764,13 @@ static void write_dset_in(hid_t loc_id, ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; - sid = H5Screate_simple(1,dims,NULL); + sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -3836,10 +3837,10 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); } } @@ -3863,23 +3864,23 @@ static void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) { int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; - for (l = 0; l < i + 1; l++) - ((int *)buf52[i][j].p)[l] = n++; + for(l = 0; l < i + 1; l++) + ((int *)buf52[i][j].p)[l] = n++; } - } - sid = H5Screate_simple(2,dims2,NULL); + sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -3889,7 +3890,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_dset(loc_id,2,dims2,"array2D",tid,buf62); + write_dset(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -3898,9 +3899,9 @@ static void write_dset_in(hid_t loc_id, */ plist_id = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); - sid = H5Screate_simple(2,dims2,NULL); - did = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,sid,plist_id); - status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72); + sid = H5Screate_simple(2, dims2, NULL); + did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT); + status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); status = H5Pclose(plist_id); status = H5Dclose(did); status = H5Sclose(sid); @@ -3910,7 +3911,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); + write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- @@ -3933,9 +3934,9 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf23[i][j][k]=n++; } } @@ -3959,9 +3960,9 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf33[i][j][k].a=n++; buf33[i][j][k].b=n++; } @@ -3978,11 +3979,11 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); } } @@ -4005,26 +4006,25 @@ static void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + n = 0; + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) { int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; - for (l = 0; l < i + 1; l++) - ((int *)buf53[i][j][k].p)[l] = n++; + for(l = 0; l < i + 1; l++) + ((int *)buf53[i][j][k].p)[l] = n++; } - } - } - sid = H5Screate_simple(3,dims3,NULL); + sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4034,8 +4034,8 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for(i = 0; i < 24; i++) { + for(j = 0; j < (int)dimarray[0]; j++) { buf63[i][j]=n++; } } @@ -4049,9 +4049,9 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf73[i][j][k]=n++; buf83[i][j][k]=f++; } @@ -4086,17 +4086,17 @@ static void gent_attr_all(void) hid_t group2_id; hid_t root_id; hid_t sid; - hsize_t dims[1]={2}; + hsize_t dims[1] = {2}; herr_t status; /* Create a file and a dataset */ - fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create a 1D dataset */ sid = H5Screate_simple(1,dims,NULL); - did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - status = H5Sclose(sid); - assert(status>=0); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Sclose(sid); + assert(status >= 0); /* Create groups */ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4121,17 +4121,17 @@ static void gent_attr_all(void) /* Close */ status = H5Dclose(did); - assert(status>=0); + assert(status >= 0); status = H5Gclose(group_id); - assert(status>=0); + assert(status >= 0); status = H5Gclose(group2_id); - assert(status>=0); + assert(status >= 0); status = H5Gclose(root_id); - assert(status>=0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - assert(status>=0); + assert(status >= 0); } @@ -4190,26 +4190,25 @@ static int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t tid, void *buf ) { - hid_t did; - hid_t sid; - herr_t status; - - /* Create a buf space */ - sid = H5Screate_simple(rank,dims,NULL); + hid_t did; + hid_t sid; + herr_t status; - /* Create a dataset */ - did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT); + /* Create a buf space */ + sid = H5Screate_simple(rank, dims, NULL); - /* Write the buf */ - if ( buf ) - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + /* Create a dataset */ + did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - /* Close */ - status = H5Dclose(did); - status = H5Sclose(sid); + /* Write the buf */ + if(buf) + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - return status; + /* Close */ + status = H5Dclose(did); + status = H5Sclose(sid); + return status; } @@ -4256,26 +4255,26 @@ static void gent_compound_complex(void) int m, n, o; /* Array init loop vars */ /* Initialize the data in the arrays/datastructure */ - for (m = 0; m< F41_LENGTH; m++) { + for(m = 0; m< F41_LENGTH; m++) { Array1[m].a = m; - for (n = 0; n < F41_DIMb; n++) { + for(n = 0; n < F41_DIMb; n++) { Array1[m].b[n] = quote[n]; } - for (n = 0; n < F41_ARRAY_DIMc; n++) { + for(n = 0; n < F41_ARRAY_DIMc; n++) { Array1[m].c[n] = chararray[n]; } - for (n = 0; n < F41_ARRAY_DIMd1; n++) { - for (o = 0; o < F41_ARRAY_DIMd2; o++){ + for(n = 0; n < F41_ARRAY_DIMd1; n++) { + for(o = 0; o < F41_ARRAY_DIMd2; o++){ Array1[m].d[n][o] = m + n + o; } } Array1[m].e = (float)( m * .96 ); - for (n = 0; n < F41_ARRAY_DIMf; n++) { + for(n = 0; n < F41_ARRAY_DIMf; n++) { Array1[m].f[n] = ( m * 1024.9637 ); } @@ -4284,110 +4283,110 @@ static void gent_compound_complex(void) /* Create the dataspace */ dataspace = H5Screate_simple(F41_RANK, dim, NULL); - assert (dataspace >= 0); + assert(dataspace >= 0); /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert (datafile >= 0); + assert(datafile >= 0); /* Copy the array data type for the string array */ array_tid = H5Tcopy (H5T_C_S1); - assert (array_tid >= 0); + assert(array_tid >= 0); /* Set the string array size to Variable */ status = H5Tset_size (array_tid,H5T_VARIABLE); - assert (status >= 0); + assert(status >= 0); /* Create the array data type for the string array */ str_array_id = H5Tarray_create(array_tid, F41_ARRAY_RANK, array_dimb, NULL); - assert (str_array_id >= 0); + assert(str_array_id >= 0); /* Copy the array data type for the character array */ array1_tid = H5Tcopy (H5T_C_S1); - assert (array1_tid >= 0); + assert(array1_tid >= 0); /* Set the character array size */ status = H5Tset_size (array1_tid, F41_ARRAY_DIMc); - assert (status >= 0); + assert(status >= 0); /* Create the array data type for the character array */ array2_tid = H5Tarray_create(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd, NULL); - assert (array2_tid >= 0); + assert(array2_tid >= 0); /* Create the array data type for the character array */ array4_tid = H5Tarray_create(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf, NULL); - assert (array4_tid >= 0); + assert(array4_tid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate (H5T_COMPOUND, sizeof(Array1Struct)); - assert (Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", HOFFSET(Array1Struct, a), H5T_NATIVE_INT); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", HOFFSET(Array1Struct, b), str_array_id); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", HOFFSET(Array1Struct, c), array1_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", HOFFSET(Array1Struct, d), array2_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", HOFFSET(Array1Struct, f), array4_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); - assert (status >= 0); + assert(status >= 0); /* Create the dataset */ - dataset = H5Dcreate(datafile, F41_DATASETNAME, Array1Structid, - dataspace, H5P_DEFAULT); + dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - assert (status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array1_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array2_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array4_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(str_array_id); - assert (status >= 0); + assert(status >= 0); status = H5Sclose(dataspace); - assert (status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - assert (status >= 0); + assert(status >= 0); status = H5Fclose(datafile); - assert (status >= 0); + assert(status >= 0); } @@ -4437,7 +4436,7 @@ static void gent_named_dtype_attr(void) */ /* Create dataset */ - did = H5Dcreate(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did > 0); /* Create attribute on dataset */ @@ -4471,24 +4470,24 @@ static void gent_named_dtype_attr(void) */ /* Close attribute */ - ret=H5Aclose(aid); - assert(ret>=0); + ret = H5Aclose(aid); + assert(ret >= 0); /* Close dataset */ - ret=H5Dclose(did); - assert(ret>=0); + ret = H5Dclose(did); + assert(ret >= 0); /* Close dataspace */ - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); /* Close datatype */ - ret=H5Tclose(tid); - assert(ret>=0); + ret = H5Tclose(tid); + assert(ret >= 0); /* Close file */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -4511,7 +4510,7 @@ static void gent_null_space(void) space = H5Screate(H5S_NULL); /* dataset */ - dataset = H5Dcreate(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* nothing should be written */ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); @@ -4543,26 +4542,27 @@ int make_dset(hid_t loc_id, hid_t dcpl, void *buf) { - hid_t dsid; + hid_t dsid; - /* create the dataset */ - if((dsid = H5Dcreate (loc_id,name,tid,sid,dcpl))<0) - return -1; + /* create the dataset */ + if((dsid = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + return -1; - /* write */ - if(H5Dwrite(dsid,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) - goto out; + /* write */ + if(H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto out; - /* close */ - if(H5Dclose(dsid)<0) - return -1; + /* close */ + if(H5Dclose(dsid) < 0) + return -1; - return 0; - out: - H5E_BEGIN_TRY { - H5Dclose(dsid); - } H5E_END_TRY; - return -1; + return 0; + +out: + H5E_BEGIN_TRY { + H5Dclose(dsid); + } H5E_END_TRY; + return -1; } @@ -4588,27 +4588,27 @@ make_external(hid_t fid) cur_size[0] = max_size[0] = 100; size = (max_size[0]*sizeof(int)/2); - dcpl=H5Pcreate(H5P_DATASET_CREATE); - ret=H5Pset_external(dcpl,"ext1.bin",(off_t)0,size); - assert(ret>=0); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); + assert(ret >= 0); - ret=H5Pset_external(dcpl,"ext2.bin",(off_t)0,size); - assert(ret>=0); + ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); + assert(ret >= 0); - sid=H5Screate_simple(1, cur_size, max_size); - assert(ret>=0); + sid = H5Screate_simple(1, cur_size, max_size); + assert(ret >= 0); - dsid=H5Dcreate(fid, "external", H5T_NATIVE_INT, sid, dcpl); - assert(ret>=0); + dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + assert(ret >= 0); H5Dclose(dsid); - assert(ret>=0); + assert(ret >= 0); H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -4633,8 +4633,8 @@ static void gent_filters(void) int buf1[DIM1][DIM2]; int i, j, n, ret; - for (i=n=0; i=0); + ret = H5Pset_layout(dcpl, H5D_COMPACT); + assert(ret >= 0); ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); assert(ret >= 0); - ret=H5Pset_layout(dcpl, H5D_CONTIGUOUS); - assert(ret>=0); + ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); + assert(ret >= 0); ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); assert(ret >= 0); - ret=H5Pset_layout(dcpl, H5D_CHUNKED); - assert(ret>=0); + ret = H5Pset_layout(dcpl, H5D_CHUNKED); + assert(ret >= 0); - ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret>=0); + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + assert(ret >= 0); ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); assert(ret >= 0); @@ -4690,25 +4690,25 @@ static void gent_filters(void) */ /* set up chunk */ - ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret>=0); + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + assert(ret >= 0); /*------------------------------------------------------------------------- * SZIP *------------------------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set szip data */ - ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret>=0); + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + assert(ret >= 0); ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ @@ -4718,15 +4718,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set deflate data */ - ret=H5Pset_deflate(dcpl, 9); - assert(ret>=0); + ret = H5Pset_deflate(dcpl, 9); + assert(ret >= 0); ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif @@ -4736,15 +4736,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_SHUFFLE) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the shuffle filter */ - ret=H5Pset_shuffle(dcpl); - assert(ret>=0); + ret = H5Pset_shuffle(dcpl); + assert(ret >= 0); ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif @@ -4754,15 +4754,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_FLETCHER32) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the checksum filter */ - ret=H5Pset_fletcher32(dcpl); - assert(ret>=0); + ret = H5Pset_fletcher32(dcpl); + assert(ret >= 0); ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4771,17 +4771,17 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_NBIT) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the checksum filter */ - ret=H5Pset_nbit(dcpl); - assert(ret>=0); + ret = H5Pset_nbit(dcpl); + assert(ret >= 0); tid=H5Tcopy(H5T_NATIVE_INT); H5Tset_precision(tid,H5Tget_size(tid)-1); ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4790,15 +4790,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_SCALEOFFSET) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the scaleoffset filter */ - ret=H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); - assert(ret>=0); + ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); + assert(ret >= 0); ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4806,44 +4806,44 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); #if defined (H5_HAVE_FILTER_SHUFFLE) /* set the shuffle filter */ - ret=H5Pset_shuffle(dcpl); - assert(ret>=0); + ret = H5Pset_shuffle(dcpl); + assert(ret >= 0); #endif #ifdef H5_HAVE_FILTER_SZIP - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; /* set szip data */ - ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret>=0); + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ #if defined (H5_HAVE_FILTER_DEFLATE) /* set deflate data */ - ret=H5Pset_deflate(dcpl, 5); - assert(ret>=0); + ret = H5Pset_deflate(dcpl, 5); + assert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_FLETCHER32) /* set the checksum filter */ - ret=H5Pset_fletcher32(dcpl); - assert(ret>=0); + ret = H5Pset_fletcher32(dcpl); + assert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_NBIT) /* set the nbit filter */ - ret=H5Pset_nbit(dcpl); - assert(ret>=0); + ret = H5Pset_nbit(dcpl); + assert(ret >= 0); #endif ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- @@ -4851,21 +4851,21 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); - ret=H5Zregister (H5Z_MYFILTER); - assert(ret>=0); + ret = H5Zregister (H5Z_MYFILTER); + assert(ret >= 0); - ret=H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); - assert(ret>=0); + ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); + assert(ret >= 0); ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /*------------------------------------------------------------------------- * make an external dataset @@ -4877,28 +4877,28 @@ static void gent_filters(void) * H5D_ALLOC_TIME_EARLY *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * commit a H5G_TYPE type with a comment @@ -4911,21 +4911,21 @@ static void gent_filters(void) ret = H5Oset_comment(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); assert(ret >= 0); - ret=H5Tclose(tid); - assert(ret>=0); + ret = H5Tclose(tid); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); - ret=H5Pclose(dcpl); - assert(ret>=0); + ret = H5Pclose(dcpl); + assert(ret >= 0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -4962,16 +4962,16 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid) /* Get the filter's current parameters */ #ifdef H5_WANT_H5_V1_6_COMPAT - if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0) + if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL) < 0) #else - if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL)<0) + if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL) < 0) #endif /* H5_WANT_H5_V1_6_COMPAT */ return(FAIL); cd_nelmts=2; /* Modify the filter's parameters for this dataset */ - if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values)<0) + if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values) < 0) return(FAIL); return(SUCCEED); @@ -5027,31 +5027,31 @@ static void gent_fcontents(void) /* hard link to "dset" */ - ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* hard link to "dset" */ - ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* soft link to itself */ - ret=H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* soft link to "dset" */ - ret=H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* dangling external link */ - ret=H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* dangling udlink */ - ret=H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /*------------------------------------------------------------------------- * datatypes @@ -5081,8 +5081,8 @@ static void gent_fcontents(void) */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); /* create a file for the bootblock test */ @@ -5090,8 +5090,8 @@ static void gent_fcontents(void) assert(fid>=0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5142,43 +5142,43 @@ static void gent_fvalues(void) * H5D_FILL_TIME_IFSET *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_NEVER *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_ALLOC *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); - ret=H5Pclose(dcpl); - assert(ret>=0); + ret = H5Pclose(dcpl); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with no fill value @@ -5194,14 +5194,14 @@ static void gent_fvalues(void) tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); - ret=H5Pset_fill_value(dcpl, tid, &fillval2); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, tid, &fillval2); + assert(ret >= 0); ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); - ret=H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); + ret = H5Pclose(dcpl); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_VLEN fill value @@ -5211,26 +5211,26 @@ static void gent_fvalues(void) buf3[0].p = malloc( 1 * sizeof(int)); ((int *)buf3[0].p)[0]=1; buf3[1].len = 2; - buf3[1].p = malloc( 2 * sizeof(int)); - ((int *)buf3[1].p)[0]=2; - ((int *)buf3[1].p)[1]=3; + buf3[1].p = malloc(2 * sizeof(int)); + ((int *)buf3[1].p)[0] = 2; + ((int *)buf3[1].p)[1] = 3; tid = H5Tvlen_create(H5T_NATIVE_INT); dcpl = H5Pcreate(H5P_DATASET_CREATE); fillval3.p=NULL; fillval3.len=0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); - assert(ret>=0); + assert(ret >= 0); - did = H5Dcreate(fid,"fill_vlen",tid,sid,H5P_DEFAULT); - ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf3); - assert(ret>=0); - ret = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf3); - assert(ret>=0); + did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); + assert(ret >= 0); + ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3); + assert(ret >= 0); ret = H5Dclose(did); ret = H5Tclose(tid); ret = H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_ARRAY fill value @@ -5245,10 +5245,10 @@ static void gent_fvalues(void) * close *------------------------------------------------------------------------- */ - ret=H5Sclose(sid); - assert(ret>=0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5299,30 +5299,30 @@ static void gent_string(void) */ tid=H5Tcopy(H5T_C_S1); - ret=H5Tset_size(tid, sizeof(buf1)); - assert(ret>=0); + ret = H5Tset_size(tid, sizeof(buf1)); + assert(ret >= 0); write_dset(fid,1,dims1,"str1",tid,buf1); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); + ret = H5Tclose(tid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str2 *------------------------------------------------------------------------- */ sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); - tid = H5Tcopy (H5T_C_S1); - ret = H5Tset_size (tid,H5T_VARIABLE); - assert(ret>=0); - did = H5Dcreate(fid,"str2",tid,sid,H5P_DEFAULT); - ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); - ret=H5Dclose(did); - assert(ret>=0); - ret=H5Sclose(sid); - assert(ret>=0); + tid = H5Tcopy(H5T_C_S1); + ret = H5Tset_size(tid, H5T_VARIABLE); + assert(ret >= 0); + did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); + assert(ret >= 0); + ret = H5Tclose(tid); + assert(ret >= 0); + ret = H5Dclose(did); + assert(ret >= 0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str3 @@ -5335,13 +5335,13 @@ static void gent_string(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(str_tid); - assert(ret>=0); - ret=H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str4 @@ -5349,15 +5349,15 @@ static void gent_string(void) */ sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5432,8 +5432,8 @@ static void gent_aindices(void) * close *------------------------------------------------------------------------- */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5505,31 +5505,31 @@ static int gent_ldouble(void) hsize_t dims[1] = {3}; long double buf[3] = {1,2,3}; - if ((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) + if((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if ((sid = H5Screate_simple(1, dims, NULL))<0) + if((sid = H5Screate_simple(1, dims, NULL)) < 0) goto error; - if ((tid = H5Tcopy(H5T_NATIVE_LDOUBLE))<0) + if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) goto error; - if ((size = H5Tget_size(tid))==0) + if((size = H5Tget_size(tid)) == 0) goto error; - if ((did = H5Dcreate(fid, "dset", tid, sid, H5P_DEFAULT))<0) + if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if (H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; - if (H5Sclose(sid)<0) + if(H5Sclose(sid) < 0) goto error; - if (H5Tclose(tid)<0) + if(H5Tclose(tid) < 0) goto error; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto error; - if (H5Fclose(fid)<0) + if(H5Fclose(fid) < 0) goto error; return 0; @@ -5573,7 +5573,7 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); H5Dclose(did); H5Sclose(sid); @@ -5583,7 +5583,7 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); H5Dclose(did); H5Sclose(sid); @@ -5594,7 +5594,7 @@ gent_binary(void) */ tid = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL); sid = H5Screate_simple(1, dimarray, NULL); - did = H5Dcreate(fid, "array", tid, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "array", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, abuf); H5Dclose(did); H5Tclose(tid); @@ -5605,10 +5605,9 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dimsl, NULL); - did = H5Dcreate(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT); - dbuf=calloc(100000,sizeof(double)); - if (dbuf!=NULL) - { + did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dbuf = calloc(100000, sizeof(double)); + if(dbuf != NULL) { H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); free(dbuf); } @@ -5653,22 +5652,22 @@ gent_bigdims(void) /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + assert(fid >= 0); /* create dataset */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue)<0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0) goto out; - if (H5Pset_chunk(dcpl, 1, chunk_dims)<0) + if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if ((f_sid = H5Screate_simple(1,dims,NULL))<0) + if((f_sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if ((did = H5Dcreate(fid,"dset4gb",H5T_NATIVE_SCHAR,f_sid,dcpl))<0) + if((did = H5Dcreate2(fid, "dset4gb", H5T_NATIVE_SCHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if ((tid = H5Dget_type(did))<0) + if((tid = H5Dget_type(did)) < 0) goto out; - if ((size = H5Tget_size(tid))<=0) + if((size = H5Tget_size(tid)) <= 0) goto out; /* select an hyperslab */ @@ -5676,19 +5675,19 @@ gent_bigdims(void) hs_start[0] = GB4LL - 10; hs_size[0] = nelmts; - if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0) + if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; buf=(char *) malloc((unsigned)(nelmts*size)); - for (i=0, c=0; i=0); + ret = H5Fclose(fid); + assert(ret >= 0); return; @@ -5741,7 +5740,7 @@ gent_hyperslab(void) int i, ret; buf = malloc(32 * 4097 * sizeof(double) ); - for (i = 0; i < 32 * 4097; i++) + for(i = 0; i < 32 * 4097; i++) buf[i] = 1; /* create a file */ @@ -5750,8 +5749,8 @@ gent_hyperslab(void) write_dset(fid,2,dims,"stripmine",H5T_NATIVE_DOUBLE,buf); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); free(buf); } @@ -5772,13 +5771,13 @@ gent_group_creation_order(void) hid_t gcpl_id; /* group creation property list ID */ hid_t fcpl_id; /* file creation property list ID (to set root group order) */ - if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) + if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) goto out; - if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0) + if(H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0) goto out; - if ((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0) goto out; @@ -5792,40 +5791,40 @@ gent_group_creation_order(void) */ - if ((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; @@ -5837,48 +5836,48 @@ gent_group_creation_order(void) goto out; - if ((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if (H5Pclose(gcpl_id) < 0) + if(H5Pclose(gcpl_id) < 0) goto out; - if (H5Pclose(fcpl_id) < 0) + if(H5Pclose(fcpl_id) < 0) goto out; - if (H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) goto out; return; @@ -5956,12 +5955,11 @@ gent_attr_creation_order(void) */ /* create a dataset */ - if((did = H5Dcreate(fid, "dset", H5T_NATIVE_UCHAR, sid, dcpl_id)) < 0) + if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ - for(i = 0; i < 3; i++) - { + for(i = 0; i < 3; i++) { if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; @@ -5970,7 +5968,7 @@ gent_attr_creation_order(void) goto out; } /* end for */ - if (H5Dclose(did) < 0) + if(H5Dclose(did) < 0) goto out; @@ -5980,22 +5978,22 @@ gent_attr_creation_order(void) *------------------------------------------------------------------------- */ - if ((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; /*------------------------------------------------------------------------- @@ -6003,25 +6001,25 @@ gent_attr_creation_order(void) *------------------------------------------------------------------------- */ - if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) goto out; - if ((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0) + if((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Tclose(tid) < 0) + if(H5Tclose(tid) < 0) goto out; /*------------------------------------------------------------------------- * add some attributes to the root group @@ -6033,16 +6031,16 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; @@ -6057,9 +6055,9 @@ gent_attr_creation_order(void) goto out; if(H5Pclose(gcpl_id) < 0) goto out; - if (H5Pclose(tcpl_id) < 0) + if(H5Pclose(tcpl_id) < 0) goto out; - if (H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) goto out; diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 1babd9e..1424ac2 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -871,26 +871,25 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id) /*enable error reporting */ } H5E_END_TRY; - if (( space_id = H5Screate_simple(1,dims,NULL)) < 0 ) + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if (( mspace_id = H5Screate(H5S_SCALAR)) < 0 ) + if((mspace_id = H5Screate(H5S_SCALAR)) < 0) goto out; - if (( dset_id = H5Dcreate(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT)) < 0) + if((dset_id = H5Dcreate2(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; line = 0; - while ( !feof( *strm ) ) - { - c = fgetc( *strm ); + while(!feof(*strm)) { + c = fgetc(*strm); - str[ i ] = c; + str[i] = c; i++; - if ( c == 10 ) /* eol */ + if(c == 10) /* eol */ { char *str2 = str; hid_t fspace_id; @@ -2497,21 +2496,16 @@ process(struct Options *opt) } /* create dataspace */ - if (in->configOptionVector[EXTEND] == 1) - { + if(in->configOptionVector[EXTEND] == 1) dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, in->maxsizeOfDimension); - } else - { dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL); - } /* disable error reporting */ H5E_BEGIN_TRY { /* create data set */ - if ((dataset = H5Dcreate(handle, in->path.group[j], outtype, dataspace, proplist)) < 0) - { - (void) fprintf(stderr, err5); + if((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) { + (void)fprintf(stderr, err5); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); @@ -2522,8 +2516,7 @@ process(struct Options *opt) } H5E_END_TRY; /* write dataset */ - if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) - { + if(H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) { (void) fprintf(stderr, err6); H5Dclose(dataset); H5Pclose(proplist); diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index 846d300..06aaaf1 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -228,7 +228,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) /* dset1.1.1 */ dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for (i = 0; i < 10; i++) for (j = 0; j < 10; j++) dset1[i][j] = j*i; @@ -257,7 +257,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) /* dset1.1.2 */ dims[0] = 20; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for (i = 0; i < 20; i++) dset2[i] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -279,7 +279,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) /* dset2.1 */ dims[0] = 10; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for (i = 0; i < 10; i++) dset2_1[i] = (float)(i*0.1+1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); @@ -289,7 +289,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for (i = 0; i < 3; i++) for (j = 0; j < 5; j++) dset2_2[i][j] = (float)((i+1)*j*0.1); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index fcb0854..b1417e1 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -529,13 +529,12 @@ int do_copy_objects(hid_t fidin, *------------------------------------------------------------------------- */ H5E_BEGIN_TRY { - dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_out); + dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT); } H5E_END_TRY; - if (dset_out==FAIL) - { - if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_id)) < 0) + if(dset_out == FAIL) { + if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto error; - apply_f=0; + apply_f = 0; } /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index a1e9fb5..595c32d 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -204,7 +204,7 @@ int do_copy_refobjs(hid_t fidin, * create/write dataset/close *------------------------------------------------------------------------- */ - if((dset_out = H5Dcreate(fidout, travt->objs[i].name, mtype_id, space_id, dcpl_id)) < 0) + if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto error; if(nelmts) if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0) @@ -283,7 +283,7 @@ int do_copy_refobjs(hid_t fidin, * create/write dataset/close *------------------------------------------------------------------------- */ - if((dset_out = H5Dcreate(fidout, travt->objs[i].name, mtype_id, space_id, dcpl_id)) < 0) + if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto error; if(nelmts) if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 16ed995..59cbbf6 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1595,8 +1595,8 @@ int make_all_objects(hid_t loc_id) * H5G_DATASET *------------------------------------------------------------------------- */ - space_id = H5Screate_simple(1,dims,NULL); - dset_id = H5Dcreate(loc_id,"dset_referenced",H5T_NATIVE_INT,space_id,H5P_DEFAULT); + space_id = H5Screate_simple(1, dims, NULL); + dset_id = H5Dcreate2(loc_id, "dset_referenced", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Sclose(space_id); /*------------------------------------------------------------------------- @@ -1670,8 +1670,8 @@ int make_attributes(hid_t loc_id) *------------------------------------------------------------------------- */ - space_id = H5Screate_simple(1,dims,NULL); - dset_id = H5Dcreate(loc_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT); + space_id = H5Screate_simple(1, dims, NULL); + dset_id = H5Dcreate2(loc_id, "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Sclose(space_id); /*------------------------------------------------------------------------- @@ -2065,42 +2065,36 @@ int make_nbit(hid_t loc_id) goto out; } -#if defined (H5_HAVE_FILTER_NBIT) +#if defined H5_HAVE_FILTER_NBIT /* remove the filters from the dcpl */ - if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) + if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) { H5Tclose(dtid); goto out; } - if (H5Pset_nbit(dcpl) < 0) - { + if(H5Pset_nbit(dcpl) < 0) { H5Tclose(dtid); goto out; } - if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0) - { + if((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5Tclose(dtid); goto out; } - if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - { + if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5Tclose(dtid); goto out; } H5Dclose(dsid); - if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) - { + if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) { H5Tclose(dtid); goto out; } - if((dsid = H5Dcreate (loc_id,"dset_int31",dtid,sid,dcpl)) < 0) - { + if((dsid = H5Dcreate2(loc_id, "dset_int31", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5Tclose(dtid); goto out; } - if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - { + if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5Tclose(dtid); goto out; } @@ -2166,34 +2160,28 @@ int make_scaleoffset(hid_t loc_id) #if defined (H5_HAVE_FILTER_SCALEOFFSET) /* remove the filters from the dcpl */ - if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) - { + if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) { H5Tclose(dtid); goto out; } - if (H5Pset_scaleoffset(dcpl,H5Z_SO_INT,31) < 0) - { + if(H5Pset_scaleoffset(dcpl, H5Z_SO_INT, 31) < 0) { H5Tclose(dtid); goto out; } - if((dsid = H5Dcreate (loc_id,"dset_scaleoffset",dtid,sid,dcpl)) < 0) - { + if((dsid = H5Dcreate2(loc_id, "dset_scaleoffset", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5Tclose(dtid); goto out; } - if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - { + if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5Tclose(dtid); goto out; } H5Dclose(dsid); - if((dsid = H5Dcreate (loc_id,"dset_none",dtid,sid,H5P_DEFAULT)) < 0) - { + if((dsid = H5Dcreate2(loc_id, "dset_none", dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Tclose(dtid); goto out; } - if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - { + if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5Tclose(dtid); goto out; } @@ -2369,16 +2357,16 @@ if (szip_can_encode) { */ #if defined (H5_HAVE_FILTER_NBIT) /* remove the filters from the dcpl */ - if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) + if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) goto out; /* set the shuffle filter */ - if (H5Pset_nbit(dcpl) < 0) + if(H5Pset_nbit(dcpl) < 0) goto out; dtid = H5Tcopy(H5T_NATIVE_INT); - H5Tset_precision(dtid,(H5Tget_precision(dtid)-1)); - if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0) + H5Tset_precision(dtid, (H5Tget_precision(dtid) - 1)); + if((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) + if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; /* close */ @@ -2446,7 +2434,7 @@ int make_early(void) for(i = 0; i < iter; i++) { if((fid = H5Fopen(FNAME5, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) goto out; - if((dset_id = H5Dcreate(fid, "early", H5T_NATIVE_DOUBLE, sid, dcpl)) < 0) + if((dset_id = H5Dcreate2(fid, "early", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; @@ -2609,21 +2597,21 @@ int make_fill(hid_t loc_id) hid_t dcpl; hsize_t dims[2]={3,2}; int buf[3][2]= {{1,1},{1,2},{2,2}}; - int fillvalue=2; + int fillvalue = 2; /*------------------------------------------------------------------------- * H5T_INTEGER, write a fill value *------------------------------------------------------------------------- */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue) < 0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue) < 0) goto out; - if ((sid = H5Screate_simple(2,dims,NULL)) < 0) + if((sid = H5Screate_simple(2,dims,NULL)) < 0) goto out; - if ((did = H5Dcreate(loc_id,"dset_fill",H5T_NATIVE_INT,sid,dcpl)) < 0) + if((did = H5Dcreate2(loc_id, "dset_fill", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; /* close */ @@ -2676,21 +2664,21 @@ int make_big(hid_t loc_id) hs_size[0] = 1024; /* create */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0) goto out; if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if ((f_sid = H5Screate_simple(1,dims,NULL)) < 0) + if((f_sid = H5Screate_simple(1,dims,NULL)) < 0) goto out; - if ((did = H5Dcreate(loc_id,"dset",H5T_NATIVE_SCHAR,f_sid,dcpl)) < 0) + if((did = H5Dcreate2(loc_id, "dset", H5T_NATIVE_SCHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) + if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - if ((tid = H5Dget_type(did)) < 0) + if((tid = H5Dget_type(did)) < 0) goto out; - if ((size = H5Tget_size(tid))<=0) + if((size = H5Tget_size(tid))<=0) goto out; /* initialize buffer to 0 */ @@ -2750,15 +2738,15 @@ int make_external(hid_t loc_id) size = max_size[0] * sizeof(int); /* create */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size) < 0) + if(H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size) < 0) goto out; - if ((sid = H5Screate_simple(1,cur_size, max_size)) < 0) + if((sid = H5Screate_simple(1,cur_size, max_size)) < 0) goto out; - if ((did = H5Dcreate(loc_id,"external",H5T_NATIVE_INT,sid,dcpl)) < 0) + if((did = H5Dcreate2(loc_id, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; /* close */ @@ -3115,23 +3103,22 @@ void write_dset_in(hid_t loc_id, ((int *)buf5[0].p)[0]=1; buf5[1].len = 2; buf5[1].p = malloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; + ((int *)buf5[1].p)[0] = 2; + ((int *)buf5[1].p)[1] = 3; - if (make_diffs) - { - ((int *)buf5[0].p)[0]=0; - ((int *)buf5[1].p)[0]=0; - ((int *)buf5[1].p)[1]=0; + if(make_diffs) { + ((int *)buf5[0].p)[0] = 0; + ((int *)buf5[1].p)[0] = 0; + ((int *)buf5[1].p)[1] = 0; } - space_id = H5Screate_simple(1,dims,NULL); + space_id = H5Screate_simple(1, dims, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - dset_id = H5Dcreate(loc_id,"vlen",type_id,space_id,H5P_DEFAULT); - status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5); - assert(status>=0); - status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf5); - assert(status>=0); + dset_id = H5Dcreate2(loc_id, "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5); + assert(status >= 0); status = H5Dclose(dset_id); status = H5Tclose(type_id); status = H5Sclose(space_id); @@ -3261,25 +3248,27 @@ void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + n = 0; + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) { int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; - for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf52[i][j].p)[l] = 0; - else ((int *)buf52[i][j].p)[l] = n++; + for(l = 0; l < i + 1; l++) + if(make_diffs) + ((int *)buf52[i][j].p)[l] = 0; + else + ((int *)buf52[i][j].p)[l] = n++; } - } - space_id = H5Screate_simple(2,dims2,NULL); + space_id = H5Screate_simple(2, dims2, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); - status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52); - assert(status>=0); - status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf52); - assert(status>=0); + dset_id = H5Dcreate2(loc_id, "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52); + assert(status >= 0); status = H5Dclose(dset_id); status = H5Tclose(type_id); status = H5Sclose(space_id); @@ -3305,17 +3294,16 @@ void write_dset_in(hid_t loc_id, */ - if (make_diffs) - { - memset(buf72,0,sizeof buf72); - memset(buf82,0,sizeof buf82); + if(make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } plist_id = H5Pcreate(H5P_DATASET_CREATE); - space_id = H5Screate_simple(2,dims2,NULL); - dset_id = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,space_id,plist_id); - status = H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72); + space_id = H5Screate_simple(2, dims2, NULL); + dset_id = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); + status = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); status = H5Pclose(plist_id); status = H5Dclose(dset_id); status = H5Sclose(space_id); @@ -3434,27 +3422,28 @@ void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + n = 0; + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) { int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; - for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0; - else ((int *)buf53[i][j][k].p)[l] = n++; + for(l = 0; l < i + 1; l++) + if(make_diffs) + ((int *)buf53[i][j][k].p)[l] = 0; + else + ((int *)buf53[i][j][k].p)[l] = n++; } - } - } - space_id = H5Screate_simple(3,dims3,NULL); + space_id = H5Screate_simple(3, dims3, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); - status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53); - assert(status>=0); - status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf53); - assert(status>=0); + dset_id = H5Dcreate2(loc_id, "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53); + assert(status >= 0); status = H5Dclose(dset_id); status = H5Tclose(type_id); status = H5Sclose(space_id); @@ -3535,20 +3524,20 @@ void make_dset_reg_ref(hid_t loc_id) herr_t ret; /* Generic return value */ /* Allocate write & read buffers */ - wbuf=(hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - dwbuf=(int *)malloc(sizeof(int)*SPACE2_DIM1*SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); /* Create a dataset */ - dset2=H5Dcreate(loc_id,"dsetreg",H5T_NATIVE_UCHAR,sid2,H5P_DEFAULT); + dset2 = H5Dcreate2(loc_id, "dsetreg", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for(i=0; i