diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-05-13 17:51:11 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-05-13 17:51:11 (GMT) |
commit | e21e5e0f2a43259b535c73d1b05d816fe4d9206e (patch) | |
tree | eade4013722654698ab2380605bbb0371f13b7da | |
parent | e399be1e9156840aa0664323dfc00a93ac43575c (diff) | |
parent | 3e628120ceee554636eda775269b4f0ca914c140 (diff) | |
download | hdf5-e21e5e0f2a43259b535c73d1b05d816fe4d9206e.zip hdf5-e21e5e0f2a43259b535c73d1b05d816fe4d9206e.tar.gz hdf5-e21e5e0f2a43259b535c73d1b05d816fe4d9206e.tar.bz2 |
Merge pull request #2572 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_12 to hdf5_1_12
* commit '3e628120ceee554636eda775269b4f0ca914c140':
Whitespace changes
Whitespace updates
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup
Whitespace cleanup compared to develop
Whitespace cleanup compared to develop
364 files changed, 5009 insertions, 5008 deletions
diff --git a/Makefile.am b/Makefile.am index d96ffe3..47da74d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ ## Makefile.am ## Run automake to generate a Makefile.in from this file. ## -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. @@ -45,7 +45,7 @@ include $(top_srcdir)/config/commence.am # Since we're explicitly listing DIST_SUBDIRS, we also need to list # directories that are only conditionally built (so that their Makefiles # are cleaned as well). -# Note that `make clean' will not affect the examples or doc directories. +# Note that `make clean' will not affect the examples or doc directories. # Conditionals. These conditionals are defined during configure # Define each variable to empty if it is not used to placate pmake @@ -133,7 +133,7 @@ mostlyclean-local: # 'make install' will now install examples, the same as 'make install-all'. # 'make-install-all' will be redundant but will still work. install: install-recursive install-examples -uninstall: uninstall-recursive uninstall-examples +uninstall: uninstall-recursive uninstall-examples # 'make install-all' also installs examples install-all: @@ -154,7 +154,7 @@ install-doc: uninstall-doc: @echo "docs no longer live in this tree. Use install-examples to install examples." -# `make check-install' or `make installcheck' checks that examples can +# `make check-install' or `make installcheck' checks that examples can # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ @@ -7,8 +7,8 @@ Please refer to the release_docs/INSTALL file for installation instructions. THE HDF GROUP --------------- -The HDF Group is the developer of HDF5®, a high-performance software library and -data format that has been adopted across multiple industries and has become a +The HDF Group is the developer of HDF5®, a high-performance software library and +data format that has been adopted across multiple industries and has become a de facto standard in scientific and research communities. More information about The HDF Group, the HDF5 Community and the HDF5 software @@ -19,21 +19,21 @@ project, tools and services can be found at the Group's website. DOCUMENTATION ------------- -This release is fully functional for the API described in the documentation. +This release is fully functional for the API described in the documentation. https://portal.hdfgroup.org/display/HDF5/The+HDF5+API Full Documentation and Programming Resources for this release can be found at https://portal.hdfgroup.org/display/HDF5 -See the RELEASE.txt file in the release_docs/ directory for information specific -to the features and updates included in this release of the library. +See the RELEASE.txt file in the release_docs/ directory for information specific +to the features and updates included in this release of the library. -Several more files are located within the release_docs/ directory with specific +Several more files are located within the release_docs/ directory with specific details for several common platforms and configurations. INSTALL - Start Here. General instructions for compiling and installing the library INSTALL_CMAKE - instructions for building with CMake (Kitware.com) - INSTALL_parallel - instructions for building and configuring Parallel HDF5 + INSTALL_parallel - instructions for building and configuring Parallel HDF5 INSTALL_Windows and INSTALL_Cygwin - MS Windows installations. @@ -48,7 +48,7 @@ Information regarding Help Desk and Support services is available at FORUM and NEWS -------------- -The following public forums are provided for public announcements and discussions +The following public forums are provided for public announcements and discussions of interest to the general HDF5 Community. Homepage of the Forum @@ -59,10 +59,10 @@ of interest to the general HDF5 Community. HDF5 and HDF4 Topics https://forum.hdfgroup.org/c/hdf5 - -These forums are provided as an open and public service for searching and reading. -Posting requires completing a simple registration and allows one to join in the -conversation. Please read the following instructions pertaining to the Forum's + +These forums are provided as an open and public service for searching and reading. +Posting requires completing a simple registration and allows one to join in the +conversation. Please read the following instructions pertaining to the Forum's use and configuration https://forum.hdfgroup.org/t/quickstart-guide-welcome-to-the-new-hdf-forum diff --git a/bin/batch/ctestP.sl.in.cmake b/bin/batch/ctestP.sl.in.cmake index 6399de7..1069fa9 100644 --- a/bin/batch/ctestP.sl.in.cmake +++ b/bin/batch/ctestP.sl.in.cmake @@ -10,5 +10,5 @@ cd @HDF5_BINARY_DIR@ ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out -echo "Done running ctestP.sl" +echo "Done running ctestP.sl" diff --git a/bin/h5cc.in b/bin/h5cc.in index d6b7a12..62a0884 100644 --- a/bin/h5cc.in +++ b/bin/h5cc.in @@ -83,10 +83,10 @@ CLINKERBASE="@CC@" # CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's -# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and -# before the hdf5 libraries in $link_args, followed by any external library -# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in # from the hdf5 build. The order of the flags is intended to give precedence # to the user's flags. H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" @@ -102,9 +102,9 @@ LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" # If a static library is available, the default will be to use it. If the only -# available library is shared, it will be used by default. The user can +# available library is shared, it will be used by default. The user can # override either default, although choosing an unavailable library will result -# in link errors. +# in link errors. STATIC_AVAILABLE="@enable_static@" if test "${STATIC_AVAILABLE}" = "yes"; then USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" @@ -140,7 +140,7 @@ usage() { echo " HDF5_CC - use a different C compiler" echo " HDF5_CLINKER - use a different linker" echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library" - echo " [default: no except when built with only" + echo " [default: no except when built with only" echo " shared libraries]" echo " " echo " You can also add or change paths and flags to the compile line using" @@ -318,7 +318,7 @@ fi if test "x$do_link" = "xyes"; then shared_link="" -# conditionnaly link with the hl library +# conditionnaly link with the hl library if test "X$HL" = "Xhl"; then libraries=" $libraries -lhdf5_hl -lhdf5 " else @@ -379,10 +379,10 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's - # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and - # before the hdf5 libraries in $link_args, followed by any external library - # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in # from the hdf5 build. The order of the flags is intended to give precedence # to the user's flags. $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link diff --git a/c++/Makefile.am b/c++/Makefile.am index 319ce6e..6bd682d 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -14,7 +14,7 @@ ## Run automake to generate a Makefile.in from this file. # # Top-level HDF5-C++ Makefile(.in) -# +# include $(top_srcdir)/config/commence.am diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index 9531bdd..e3cf978 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -42,7 +42,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. @@ -60,9 +60,9 @@ int main (void) // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; // unsigned szip_pixels_per_block = 16; // plist->setSzip(szip_options_mask, szip_pixels_per_block); - - // Create the dataset. - DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, + + // Create the dataset. + DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, PredType::STD_I32BE, *dataspace, *plist) ); for (i = 0; i< DIM0; i++) @@ -79,10 +79,10 @@ int main (void) file.close(); // ----------------------------------------------- - // Re-open the file and dataset, retrieve filter + // Re-open the file and dataset, retrieve filter // information for dataset and read the data back. // ----------------------------------------------- - + int rbuf[DIM0][DIM1]; int numfilt; size_t nelmts={1}, namelen={1}; @@ -113,7 +113,7 @@ int main (void) cout << "H5Z_FILTER_DEFLATE" << endl; break; case H5Z_FILTER_SZIP: - cout << "H5Z_FILTER_SZIP" << endl; + cout << "H5Z_FILTER_SZIP" << endl; break; default: cout << "Other filter type included." << endl; @@ -123,7 +123,7 @@ int main (void) // Read data. dataset->read(rbuf, PredType::NATIVE_INT); - delete plist; + delete plist; delete dataset; file.close(); // can be skipped diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index fcf6c27..409bd62 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -31,7 +31,7 @@ int main (void) { int attr_data[2] = { 100, 200}; hsize_t dims[1] = { DIM1 }; - + // Try block to detect exceptions raised by any of the calls inside it try @@ -47,11 +47,11 @@ int main (void) // Create the data space for the attribute. DataSpace attr_dataspace = DataSpace (1, dims ); - // Create a dataset attribute. - Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, + // Create a dataset attribute. + Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, attr_dataspace); - - // Write the attribute data. + + // Write the attribute data. attribute.write( PredType::NATIVE_INT, attr_data); } // end of try block diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index 985f6ac..3257223 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -37,7 +37,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. @@ -46,7 +46,7 @@ int main (void) dims[1] = NY; DataSpace dataspace(RANK, dims); - // Create the dataset. + // Create the dataset. DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace); } // end of try block diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index e35cb46..43af08a 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -37,12 +37,12 @@ int main(void) // Create a new file using default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); - + // Create a group named "/MygGroup" in the file Group group(file.createGroup("/MyGroup")); // File and group will be closed as their instances go out of scope. - + } // end of try block // catch failure caused by the H5File operations @@ -57,6 +57,6 @@ int main(void) error.printErrorStack(); return -1; } - + return 0; } diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index 76ec9e5..15cf1df 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -32,7 +32,7 @@ int main(void) // Try block to detect exceptions raised by any of the calls inside it try { - + // Turn off the auto-printing when failure occurs so that we can // handle the errors appropriately. @@ -43,26 +43,26 @@ int main(void) H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create group "MyGroup" in the root group using an absolute name. - + Group group1(file.createGroup( "/MyGroup")); - + // Create group "Group_A" in group "MyGroup" using an // absolute name. - Group group2(file.createGroup("/MyGroup/Group_A")); + Group group2(file.createGroup("/MyGroup/Group_A")); // Create group "Group_B" in group "MyGroup" using a // relative name. - + Group group3(group1.createGroup ("Group_B")); - + // Close the groups and file. group1.close(); group2.close(); group3.close(); file.close(); - + } // end of try block // catch failure caused by the File operations diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index e3bb1b1..c28b666 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -45,12 +45,12 @@ int main(void) // handle the errors appropriately Exception::dontPrint(); - // Initialize the first dataset. + // Initialize the first dataset. for (i = 0; i < D1DIM1; i++) for (j = 0; j < D1DIM2; j++) dset1_data[i][j] = j + 1; - // Initialize the second dataset. + // Initialize the second dataset. for (i = 0; i < D2DIM1; i++) for (j = 0; j < D2DIM2; j++) dset2_data[i][j] = j + 1; @@ -69,7 +69,7 @@ int main(void) // Create the dataset in group "MyGroup". Same note as for the // dataspace above. - DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, + DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, PredType::STD_I32BE, *dataspace)); // Write the data to the dataset using default memory space, file @@ -89,7 +89,7 @@ int main(void) Group group(file.openGroup("/MyGroup/Group_A")); // Create the second dataset in group "Group_A". - dataset = new DataSet (group.createDataSet(DATASET_NAME2, + dataset = new DataSet (group.createDataSet(DATASET_NAME2, PredType::STD_I32BE, *dataspace)); // Write the data to the dataset using default memory space, file @@ -100,7 +100,7 @@ int main(void) delete dataspace; delete dataset; group.close(); - + } // end of try block // catch failure caused by the H5File operations @@ -129,6 +129,6 @@ int main(void) error.printErrorStack(); return -1; } - + return 0; } diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index b6927ea..94e9acf 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -30,17 +30,17 @@ const H5std_string DATASETNAME("ExtendibleArray"); int main (void) { hsize_t dims[2] = {3,3}; // dataset dimensions at creation - hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; - int data[3][3] = { {1, 1, 1}, // data to write + int data[3][3] = { {1, 1, 1}, // data to write {1, 1, 1}, {1, 1, 1} }; - // Variables used in extending and writing to the extended portion of dataset + // Variables used in extending and writing to the extended portion of dataset hsize_t size[2]; hsize_t offset[2]; - hsize_t dimsext[2] = {7, 3}; // extend dimensions + hsize_t dimsext[2] = {7, 3}; // extend dimensions int dataext[7][3] = { {2, 3, 4}, {2, 3, 4}, {2, 3, 4}, @@ -56,7 +56,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. Note the use of pointer @@ -70,23 +70,23 @@ int main (void) prop.setChunk(2, chunk_dims); // Create the chunked dataset. Note the use of pointer. - DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, + DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, PredType::STD_I32BE, *dataspace, prop) ); - + // Write data to dataset. dataset->write(data, PredType::NATIVE_INT); // Extend the dataset. Dataset becomes 10 x 3. size[0] = dims[0] + dimsext[0]; size[1] = dims[1]; - dataset->extend(size); + dataset->extend(size); // Select a hyperslab in extended portion of the dataset. DataSpace *filespace = new DataSpace(dataset->getSpace ()); offset[0] = 3; offset[1] = 0; filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset); - + // Define memory space. DataSpace *memspace = new DataSpace(2, dimsext, NULL); @@ -101,9 +101,9 @@ int main (void) delete dataset; file.close(); - // --------------------------------------- + // --------------------------------------- // Re-open the file and read the data back - // --------------------------------------- + // --------------------------------------- int rdata[10][3]; int i,j, rank, rank_chunk; @@ -111,7 +111,7 @@ int main (void) // Open the file and dataset. file.openFile(FILE_NAME, H5F_ACC_RDONLY); - dataset = new DataSet(file.openDataSet( DATASETNAME)); + dataset = new DataSet(file.openDataSet( DATASETNAME)); // Get the dataset's dataspace and creation property list. filespace = new DataSpace(dataset->getSpace()); @@ -127,7 +127,7 @@ int main (void) memspace = new DataSpace(rank, dimsr, NULL); dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace); - + cout << endl; for (j = 0; j < dimsr[0]; j++) { for (i = 0; i < dimsr[1]; i++) @@ -141,7 +141,7 @@ int main (void) delete memspace; delete dataset; file.close(); - + } // end of try block // catch failure caused by the H5File operations diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index f17e6a5..e9b76ad 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -28,9 +28,9 @@ const int DIM1 = 6; int main (void) { - + // Data initialization. - + int i, j; int data[DIM0][DIM1]; // buffer for data to write diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index 0747880..f7d0513 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -46,19 +46,19 @@ int main (void) Exception::dontPrint(); // --------------------------------------------------- - // Create a new file using the default property lists. - // Then create a dataset and write data to it. + // Create a new file using the default property lists. + // Then create a dataset and write data to it. // Close the file and dataset. // --------------------------------------------------- - + H5File file(FILE_NAME, H5F_ACC_TRUNC); - hsize_t dims[2]; + hsize_t dims[2]; dims[0] = DIM0; dims[1] = DIM1; DataSpace dataspace = DataSpace (RANK, dims); - DataSet dataset(file.createDataSet( DATASET_NAME, + DataSet dataset(file.createDataSet( DATASET_NAME, PredType::STD_I32BE, dataspace) ); @@ -94,7 +94,7 @@ int main (void) file.openFile(FILE_NAME, H5F_ACC_RDWR); dataset = file.openDataSet(DATASET_NAME); - // Specify size and shape of subset to write. + // Specify size and shape of subset to write. offset[0] = 1; offset[1] = 2; @@ -107,7 +107,7 @@ int main (void) block[0] = 1; block[1] = 1; - + // Define Memory Dataspace. Get file dataspace and select // a subset from the file dataspace. @@ -117,7 +117,7 @@ int main (void) DataSpace memspace(RANK, dimsm, NULL); dataspace = dataset.getSpace(); - dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); + dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); // Write a subset of data to the dataset, then read the // entire dataset back from the file. @@ -127,15 +127,15 @@ int main (void) for (j = 0; j < DIM0_SUB; j++) { for (i = 0; i < DIM1_SUB; i++) sdata[j][i] = 5; - } - + } + dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace); dataset.read(rdata, PredType::NATIVE_INT); - + cout << endl << "Data in File after Subset is Written:" << endl; for (i = 0; i < DIM0; i++) { - for (j = 0; j < DIM1; j++) + for (j = 0; j < DIM1; j++) cout << " " << rdata[i][j]; cout << endl; } diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 03e1eac..7ff8506 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -141,5 +141,5 @@ rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 5e80408..1108181 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -25,7 +25,7 @@ * \section intro_sec Introduction * * The C++ API provides C++ wrappers for the HDF5 C Library. - * + * * It is assumed that the user has knowledge of the HDF5 file format and its * components. For more information on the HDF5 C Library, please refer to * the HDF5 Software Documentation page. @@ -54,9 +54,9 @@ * \section install_sec Installation * * The HDF5 C++ API is included with the HDF5 source code. - * - * Please refer to the release_docs/INSTALL file under the top directory - * of the HDF5 source code for information about installing, building, + * + * Please refer to the release_docs/INSTALL file under the top directory + * of the HDF5 source code for information about installing, building, * and testing the C++ API. * * <br /> diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 081cc03..0472975 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -122,7 +122,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } - */ + */ //-------------------------------------------------------------------------- // Function: DataType copy constructor diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index cf9e577..7431e6c 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -60,7 +60,7 @@ H5std_string Exception::getMajorString(hid_t err_major) const { // Preliminary call to H5Eget_msg() to get the length of the message ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); - + // If H5Eget_msg() returns a negative value, raise an exception, if (mesg_size < 0) throw IdComponentException("Exception::getMajorString", diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 49c638e..01c20e9 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -83,7 +83,7 @@ IntType::IntType(const DataSet& dataset) : AtomType() { // Calls C function H5Dget_type to get the id of the datatype id = H5Dget_type(dataset.getId()); - + if (id < 0) { throw DataSetIException("IntType constructor", "H5Dget_type failed"); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 764aa12..89a7890 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -568,7 +568,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t { p_setId(p_dereference(attr.getId(), ref, ref_type, plist, "dereference")); } - */ + */ #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 3bad8bc..3c30715 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -72,7 +72,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Creates a reference to a named object or to a dataset region // in this object. - void reference(void* ref, const char* name, + void reference(void* ref, const char* name, H5R_type_t ref_type = H5R_OBJECT) const; void reference(void* ref, const H5std_string& name, H5R_type_t ref_type = H5R_OBJECT) const; diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 033b1b7..a63229c 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -31,7 +31,7 @@ namespace H5 { H5Object is H5File is not an HDF5 object, and renaming H5Object to H5Location will risk breaking user applications. -BMR - Apr 2, 2014: Added wrapper getObjName for H5Iget_name + Apr 2, 2014: Added wrapper getObjName for H5Iget_name Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back into H5Object. This way, C functions that takes attribute id can be in H5Location and those that cannot take attribute id diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index f068f51..5a542f9 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -311,7 +311,7 @@ fi if test "x$do_link" = "xyes"; then shared_link="" - # conditionally link with the hl library + # conditionally link with the hl library if test "X$HL" = "Xhl"; then libraries=" $libraries -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5 " else diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index fc29307..76e4424 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -268,7 +268,7 @@ static herr_t test_simple_io( H5File& file) /*------------------------------------------------------------------------- * Function: test_datasize * - * Purpose Tests DataSet::getInMemDataSize(). + * Purpose Tests DataSet::getInMemDataSize(). * * Return Success: 0 * @@ -901,7 +901,7 @@ static herr_t test_multiopen (H5File& file) if (cur_size[0]!=tmp_size[0]) { cerr << " Got " << static_cast<int>(tmp_size[0]) - << " instead of " << static_cast<int>(cur_size[0]) + << " instead of " << static_cast<int>(cur_size[0]) << "!" << endl; throw Exception("test_multiopen", "Failed in multi-open with extending"); } diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 18fd44f..6664d0c 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -55,7 +55,7 @@ class TestFailedException : public Exception { // Overloaded/Template functions to verify values and display proper info -// Verifies +// Verifies void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name); template <class Type1, class Type2> diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 69c58f8..d80de16 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -210,7 +210,7 @@ static void test_array_compound_array() // Verify the compound datatype info CompType ctype_check(base_type.getId()); base_type.close(); - + // Check the number of members nmemb = ctype_check.getNmembers(); verify_val(nmemb, 2, "ctype_check.getNmembers", __LINE__, __FILE__); @@ -282,11 +282,11 @@ static void test_array_compound_array() */ H5::DataType getArr() { - hsize_t *dims = new hsize_t; - *dims = 5; - H5::ArrayType ret; - ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); - delete dims; + hsize_t *dims = new hsize_t; + *dims = 5; + H5::ArrayType ret; + ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); + delete dims; return ret; } diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 9485ec6..f432723 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -282,7 +282,7 @@ static void test_attr_getname() if (attr_exists == false) throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); - // Open attribute + // Open attribute Attribute fattr1(fid1.openAttribute(FATTR1_NAME)); // A. Get attribute name with @@ -1221,7 +1221,7 @@ static void test_attr_delete() attr_name = fattr.getName(); verify_val(attr_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__); fattr.close(); - + // Test deleting non-existing attribute // Open the dataset diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index a0231a6..f5625a3 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -633,7 +633,7 @@ static void test_file_attribute() verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); num_objs = file5.getObjCount(H5F_OBJ_FILE); verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); - + // Get the file name using the attributes H5std_string fname = fattr1.getFileName(); verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); @@ -984,7 +984,7 @@ static void test_file_info() /* ret=H5Pget_shared_mesg_nindexes(fcpl2,&nindexes); CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes"); VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); - */ + */ // Get and verify the file space info from the creation property list */ fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold); diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index c689087..d69e8d2 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -400,7 +400,7 @@ static void test_HDFFV_9920() { int attr_data[2] = { 100, 200}; hsize_t dims[1] = { DIM1 }; - + try { // Create a new file and a group in it @@ -414,13 +414,13 @@ static void test_HDFFV_9920() DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); - // Create a file attribute and a group attribute. - Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, + // Create a file attribute and a group attribute. + Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, dspace); - Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, + Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, dspace); - - // Write the attribute data. + + // Write the attribute data. fa1.write( PredType::NATIVE_INT, attr_data); ga1.write( PredType::NATIVE_INT, attr_data); diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 8a6fb51..b46ae29 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -476,7 +476,7 @@ static void test_reference_group() // Check getting file name given the group dereferenced via constructor H5std_string fname = refgroup.getFileName(); verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - + // Check getting file name given the group dereferenced by ::reference fname = group.getFileName(); verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 81ad983..b8846f4 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -54,7 +54,7 @@ using namespace H5; H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) #endif /* #include "H5Tpkg.h" - */ + */ const char *FILENAME[] = { "dtypes1.h5", @@ -392,7 +392,7 @@ static void test_vltype() try { VarLenType vltype(PredType::NATIVE_INT); - + bool in_class = vltype.detectClass(H5T_VLEN); verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN", __LINE__, __FILE__); in_class = vltype.detectClass(H5T_INTEGER); diff --git a/config/cmake/PkgInfo.in b/config/cmake/PkgInfo.in index e530f88..ae54035 100644 --- a/config/cmake/PkgInfo.in +++ b/config/cmake/PkgInfo.in @@ -1 +1 @@ -FMWK????
\ No newline at end of file +FMWK???? diff --git a/config/commence.am b/config/commence.am index 830c494..41e0f3f 100644 --- a/config/commence.am +++ b/config/commence.am @@ -44,15 +44,15 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la # Install directories that automake doesn't know about docdir = $(exec_prefix)/doc -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -62,11 +62,11 @@ H5CC_PP=${DESTDIR}$(bindir)/h5pcc H5FC=${DESTDIR}$(bindir)/h5fc H5FC_PP=${DESTDIR}$(bindir)/h5pfc H5CPP=${DESTDIR}$(bindir)/h5c++ - + # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. diff --git a/config/conclude.am b/config/conclude.am index 58c2934..3f05a69 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -25,8 +25,8 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) -TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -198,7 +198,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ fi; \ fi - + # The dummysh.chkexe here prevents the target from being # empty if there are no tests in the current directory. # $${log} is the log file. diff --git a/config/examples.am b/config/examples.am index 247dfa8..e06f4ea 100644 --- a/config/examples.am +++ b/config/examples.am @@ -33,7 +33,7 @@ ## INSTALL_TOP_FILES ## ## EXAMPLEDIR -## The directory into which examples should be installed. +## The directory into which examples should be installed. ## ## Build rules for $(EXTRA_PROG). ## Dependencies for example programs. @@ -62,7 +62,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -109,7 +109,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/examples/Attributes.txt b/examples/Attributes.txt index 0f25f68..6cba42b 100644 --- a/examples/Attributes.txt +++ b/examples/Attributes.txt @@ -1,4 +1,4 @@ -Attribute Examples: +Attribute Examples: H5Acreate2 example: Show how to create an attribute for a dataset and a group ---------------- @@ -19,7 +19,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group rank=2; dimsf[0] = H5S_UNLIMITED; dimsf[1] = H5S_UNLIMITED; - dataspace = H5Screate_simple(rank, dimsf, NULL); + dataspace = H5Screate_simple(rank, dimsf, NULL); /* Create a dataset */ dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -122,7 +122,7 @@ H5Alink Example: Shows how to share an attribute between two datasets. /* Get the OID of the attribute */ attr=H5Aopen(dataset1, "Foo", H5P_DEFAULT); - /* + /* * Create an attribute in the second dataset to the attribute in dataset1, * changing the name of the attribute information in dataset2. */ diff --git a/examples/Makefile.am b/examples/Makefile.am index 5b428cd..b7850a7 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -39,7 +39,7 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ h5_ref2reg_deprec h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \ h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \ h5_vds-percival-unlim h5_vds-percival-unlim-maxmin -TEST_SCRIPT=testh5cc.sh +TEST_SCRIPT=testh5cc.sh TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES) # Install files diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index b51ec44..5feadd3 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -11,10 +11,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example illustrates how to create a compressed dataset. * It is used in the HDF5 Tutorial. - */ + */ #include "hdf5.h" @@ -22,11 +22,11 @@ #define RANK 2 #define DIM0 100 #define DIM1 20 - + int main () { hid_t file_id, dataset_id, dataspace_id; /* identifiers */ - hid_t plist_id; + hid_t plist_id; size_t nelmts; unsigned flags, filter_info; @@ -35,12 +35,12 @@ int main () { herr_t status; hsize_t dims[2]; hsize_t cdims[2]; - + int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; - /* Uncomment these variables to use SZIP compression + /* Uncomment these variables to use SZIP compression unsigned szip_options_mask; unsigned szip_pixels_per_block; */ @@ -62,21 +62,21 @@ int main () { status = H5Pset_chunk (plist_id, 2, cdims); /* Set ZLIB / DEFLATE Compression using compression level 6. - * To use SZIP Compression comment out these lines. - */ - status = H5Pset_deflate (plist_id, 6); + * To use SZIP Compression comment out these lines. + */ + status = H5Pset_deflate (plist_id, 6); - /* Uncomment these lines to set SZIP Compression + /* Uncomment these lines to set SZIP Compression szip_options_mask = H5_SZIP_NN_OPTION_MASK; szip_pixels_per_block = 16; status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block); */ - - dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); - for (i = 0; i< DIM0; i++) - for (j=0; j<DIM1; j++) + dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE, + dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); + + for (i = 0; i< DIM0; i++) + for (j=0; j<DIM1; j++) buf[i][j] = i+j; status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -92,10 +92,10 @@ int main () { /* Retrieve filter information. */ plist_id = H5Dget_create_plist (dataset_id); - + numfilt = H5Pget_nfilters (plist_id); printf ("Number of filters associated with dataset: %i\n", numfilt); - + for (i=0; i<numfilt; i++) { nelmts = 0; filter_type = H5Pget_filter2 (plist_id, 0, &flags, &nelmts, NULL, 0, NULL, @@ -113,9 +113,9 @@ int main () { } } - status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - H5P_DEFAULT, rbuf); - + status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, rbuf); + status = H5Dclose (dataset_id); status = H5Pclose (plist_id); status = H5Fclose (file_id); diff --git a/examples/h5_crtatt.c b/examples/h5_crtatt.c index ade17ba..aa997e7 100644 --- a/examples/h5_crtatt.c +++ b/examples/h5_crtatt.c @@ -41,7 +41,7 @@ int main() { dataspace_id = H5Screate_simple(1, &dims, NULL); /* Create a dataset attribute. */ - attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id, + attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT); /* Write the attribute data. */ diff --git a/examples/h5_crtdat.c b/examples/h5_crtdat.c index 4a876d2..9fcb186 100644 --- a/examples/h5_crtdat.c +++ b/examples/h5_crtdat.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This example illustrates how to create a dataset that is a 4 x 6 + * This example illustrates how to create a dataset that is a 4 x 6 * array. It is used in the HDF5 Tutorial. */ @@ -29,18 +29,18 @@ int main() { file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create the data space for the dataset. */ - dims[0] = 4; - dims[1] = 6; + dims[0] = 4; + dims[1] = 6; dataspace_id = H5Screate_simple(2, dims, NULL); /* Create the dataset. */ - dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, + dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* End access to the dataset and release resources used by it. */ status = H5Dclose(dataset_id); - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ status = H5Sclose(dataspace_id); /* Close the file. */ diff --git a/examples/h5_crtgrpar.c b/examples/h5_crtgrpar.c index 6f8c6e8..21a37c5 100644 --- a/examples/h5_crtgrpar.c +++ b/examples/h5_crtgrpar.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This example illustrates the creation of groups using absolute and + * This example illustrates the creation of groups using absolute and * relative names. It is used in the HDF5 Tutorial. */ diff --git a/examples/h5_crtgrpd.c b/examples/h5_crtgrpd.c index 35c4389..d0d535b 100644 --- a/examples/h5_crtgrpd.c +++ b/examples/h5_crtgrpd.c @@ -67,7 +67,7 @@ int main() { dataspace_id = H5Screate_simple(2, dims, NULL); /* Create the second dataset in group "Group_A". */ - dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id, + dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write the second dataset. */ diff --git a/examples/h5_extend.c b/examples/h5_extend.c index 6e3cff2..6018e65 100644 --- a/examples/h5_extend.c +++ b/examples/h5_extend.c @@ -12,9 +12,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This example how to work with extendible datasets. The dataset + * This example how to work with extendible datasets. The dataset * must be chunked in order to be extendible. - * + * * It is used in the HDF5 Tutorial. */ @@ -29,28 +29,28 @@ int main (void) { hid_t file; /* handles */ - hid_t dataspace, dataset; + hid_t dataspace, dataset; hid_t filespace, memspace; - hid_t prop; + hid_t prop; - hsize_t dims[2] = {3, 3}; /* dataset dimensions at creation time */ + hsize_t dims[2] = {3, 3}; /* dataset dimensions at creation time */ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; - herr_t status; + herr_t status; hsize_t chunk_dims[2] = {2, 5}; int data[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1} }; /* Variables used in extending and writing to the extended portion of dataset */ hsize_t size[2]; hsize_t offset[2]; hsize_t dimsext[2] = {7, 3}; /* extend dimensions */ - int dataext[7][3] = { {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, + int dataext[7][3] = { {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, {2, 3, 4} }; /* Variables used in reading data back */ @@ -58,11 +58,11 @@ main (void) hsize_t dimsr[2]; hsize_t i, j; int rdata[10][3]; - herr_t status_n; + herr_t status_n; int rank, rank_chunk; /* Create the data space with unlimited dimensions. */ - dataspace = H5Screate_simple (RANK, dims, maxdims); + dataspace = H5Screate_simple (RANK, dims, maxdims); /* Create a new file. If file exists its contents will be overwritten. */ file = H5Fcreate (FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -71,7 +71,7 @@ main (void) prop = H5Pcreate (H5P_DATASET_CREATE); status = H5Pset_chunk (prop, RANK, chunk_dims); - /* Create a new dataset within the file using chunk + /* Create a new dataset within the file using chunk creation properties. */ dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, prop, H5P_DEFAULT); @@ -90,10 +90,10 @@ main (void) offset[0] = 3; offset[1] = 0; status = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, offset, NULL, - dimsext, NULL); + dimsext, NULL); /* Define memory space */ - memspace = H5Screate_simple (RANK, dimsext, NULL); + memspace = H5Screate_simple (RANK, dimsext, NULL); /* Write the data to the extended portion of dataset */ status = H5Dwrite (dataset, H5T_NATIVE_INT, memspace, filespace, @@ -120,7 +120,7 @@ main (void) prop = H5Dget_create_plist (dataset); - if (H5D_CHUNKED == H5Pget_layout (prop)) + if (H5D_CHUNKED == H5Pget_layout (prop)) rank_chunk = H5Pget_chunk (prop, rank, chunk_dimsr); memspace = H5Screate_simple (rank, dimsr, NULL); diff --git a/examples/h5_rdwt.c b/examples/h5_rdwt.c index 6cd7f0f..f7196c0 100644 --- a/examples/h5_rdwt.c +++ b/examples/h5_rdwt.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example illustrates how to write and read data in an existing * dataset. It is used in the HDF5 Tutorial. */ @@ -37,10 +37,10 @@ int main() { dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT); /* Write the dataset. */ - status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); - status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); /* Close the dataset. */ diff --git a/examples/h5_ref_extern.c b/examples/h5_ref_extern.c index 17082ba..5403814 100644 --- a/examples/h5_ref_extern.c +++ b/examples/h5_ref_extern.c @@ -14,7 +14,7 @@ * The example below illustrates the use of the new API with files that are * opened read-only. Created references to the objects in that file are * stored into a separate file, and accessed from that file, without the user - * explicitly opening the original file that was referenced. + * explicitly opening the original file that was referenced. */ #include <stdlib.h> diff --git a/examples/h5_subset.c b/examples/h5_subset.c index 904d3f8..ad2eaba 100644 --- a/examples/h5_subset.c +++ b/examples/h5_subset.c @@ -11,44 +11,44 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This example illustrates how to read/write a subset of data (a slab) +/* + * This example illustrates how to read/write a subset of data (a slab) * from/to a dataset in an HDF5 file. It is used in the HDF5 Tutorial. */ - + #include "hdf5.h" #define FILE "subset.h5" -#define DATASETNAME "IntArray" +#define DATASETNAME "IntArray" #define RANK 2 -#define DIM0_SUB 3 /* subset dimensions */ -#define DIM1_SUB 4 +#define DIM0_SUB 3 /* subset dimensions */ +#define DIM1_SUB 4 -#define DIM0 8 /* size of dataset */ -#define DIM1 10 +#define DIM0 8 /* size of dataset */ +#define DIM1 10 int main (void) { - hsize_t dims[2], dimsm[2]; + hsize_t dims[2], dimsm[2]; int data[DIM0][DIM1]; /* data to write */ int sdata[DIM0_SUB][DIM1_SUB]; /* subset to write */ int rdata[DIM0][DIM1]; /* buffer for read */ - + hid_t file_id, dataset_id; /* handles */ - hid_t dataspace_id, memspace_id; + hid_t dataspace_id, memspace_id; + + herr_t status; - herr_t status; - hsize_t count[2]; /* size of subset in the file */ hsize_t offset[2]; /* subset offset in the file */ hsize_t stride[2]; hsize_t block[2]; int i, j; - + /***************************************************************** * Create a new file with default creation and access properties.* * Then create a dataset and write data to it and close the file * @@ -59,7 +59,7 @@ main (void) dims[0] = DIM0; dims[1] = DIM1; - dataspace_id = H5Screate_simple (RANK, dims, NULL); + dataspace_id = H5Screate_simple (RANK, dims, NULL); dataset_id = H5Dcreate2 (file_id, DATASETNAME, H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -71,7 +71,7 @@ main (void) data[j][i] = 1; else data[j][i] = 2; - } + } status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); @@ -89,7 +89,7 @@ main (void) /***************************************************** * Reopen the file and dataset and write a subset of * - * values to the dataset. + * values to the dataset. *****************************************************/ file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT); @@ -100,7 +100,7 @@ main (void) offset[0] = 1; offset[1] = 2; - count[0] = DIM0_SUB; + count[0] = DIM0_SUB; count[1] = DIM1_SUB; stride[0] = 1; @@ -109,18 +109,18 @@ main (void) block[0] = 1; block[1] = 1; - /* Create memory space with size of subset. Get file dataspace + /* Create memory space with size of subset. Get file dataspace and select subset from file dataspace. */ dimsm[0] = DIM0_SUB; dimsm[1] = DIM1_SUB; - memspace_id = H5Screate_simple (RANK, dimsm, NULL); + memspace_id = H5Screate_simple (RANK, dimsm, NULL); dataspace_id = H5Dget_space (dataset_id); status = H5Sselect_hyperslab (dataspace_id, H5S_SELECT_SET, offset, stride, count, block); - /* Write a subset of data to the dataset, then read the + /* Write a subset of data to the dataset, then read the entire dataset back from the file. */ printf ("\nWrite subset to file specifying:\n"); @@ -128,11 +128,11 @@ main (void) for (j = 0; j < DIM0_SUB; j++) { for (i = 0; i < DIM1_SUB; i++) sdata[j][i] = 5; - } + } status = H5Dwrite (dataset_id, H5T_NATIVE_INT, memspace_id, dataspace_id, H5P_DEFAULT, sdata); - + status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); @@ -147,5 +147,5 @@ main (void) status = H5Sclose (dataspace_id); status = H5Dclose (dataset_id); status = H5Fclose (file_id); - + } diff --git a/examples/h5_vds-eiger.c b/examples/h5_vds-eiger.c index 13b5d93..a02f4f8 100644 --- a/examples/h5_vds-eiger.c +++ b/examples/h5_vds-eiger.c @@ -12,7 +12,7 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Eiger use case. Every 5 frames 10x10 are in the source + Eiger use case. Every 5 frames 10x10 are in the source dataset "/A" in file with the name f-<#>.h5 This file is intended for use with HDF5 Library version 1.10 @@ -25,13 +25,13 @@ #define FILE "vds-eiger.h5" #define DATASET "VDS-Eiger" -#define VDSDIM0 5 -#define VDSDIM1 10 -#define VDSDIM2 10 -#define DIM0 5 -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define VDSDIM0 5 +#define VDSDIM1 10 +#define VDSDIM2 10 +#define DIM0 5 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 int main (void) @@ -69,7 +69,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -85,13 +85,13 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, "f-%b.h5", "/A", src_space); - + /* Create a virtual dataset */ @@ -100,8 +100,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -123,7 +123,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -134,15 +134,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %d\n", (int)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index aaf1fa8..b113c36 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -24,16 +24,16 @@ #define FILE "vds-exc.h5" #define DATASET "VDS-Excalibur" -#define VDSDIM0 0 -#define VDSDIM1 15 -#define VDSDIM2 6 -#define KDIM0 0 -#define KDIM1 2 -#define KDIM2 6 -#define NDIM0 0 -#define NDIM1 3 -#define NDIM2 6 -#define RANK 3 +#define VDSDIM0 0 +#define VDSDIM1 15 +#define VDSDIM2 6 +#define KDIM0 0 +#define KDIM1 2 +#define KDIM2 6 +#define NDIM0 0 +#define NDIM1 3 +#define NDIM2 6 +#define RANK 3 const char *SRC_FILE[] = { "a.h5", @@ -96,7 +96,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -109,7 +109,7 @@ main (void) block[1] = k; block[2] = VDSDIM2; - /* + /* * Build the mappings for A, C and E source datasets. * Unlimited hyperslab selection is the same in the source datasets. * Unlimited hyperslab selections in the virtual dataset have different offsets. @@ -124,7 +124,7 @@ main (void) /* Reinitialize start[1] and block[1] to build the second set of mappings. */ start[1] = 0; block[1] = n; - /* + /* * Build the mappings for B, D and F source datasets. * Unlimited hyperslab selection is the same in the source datasets. * Unlimited hyperslab selections in the virtual dataset have different offsets. @@ -143,8 +143,8 @@ main (void) status = H5Sclose (nsrc_space); status = H5Sclose (ksrc_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -166,7 +166,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf("Wrong layout found \n"); @@ -177,15 +177,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); @@ -209,7 +209,7 @@ main (void) /* Get selection in the source dataset */ printf(" Selection in the source dataset \n"); src_space = H5Pget_virtual_srcspace (dcpl, (size_t)i); - if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (src_space, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-exclim.c b/examples/h5_vds-exclim.c index fea096a..152731c 100644 --- a/examples/h5_vds-exclim.c +++ b/examples/h5_vds-exclim.c @@ -25,16 +25,16 @@ #define FILE "vds-exclim.h5" #define DATASET "VDS-Excaliburlim" -#define VDSDIM0 3 -#define VDSDIM1 15 -#define VDSDIM2 6 -#define KDIM0 3 -#define KDIM1 2 -#define KDIM2 6 -#define NDIM0 3 -#define NDIM1 3 -#define NDIM2 6 -#define RANK 3 +#define VDSDIM0 3 +#define VDSDIM1 15 +#define VDSDIM2 6 +#define KDIM0 3 +#define KDIM1 2 +#define KDIM2 6 +#define NDIM0 3 +#define NDIM1 3 +#define NDIM2 6 +#define RANK 3 const char *SRC_FILE[] = { "a.h5", @@ -94,7 +94,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -107,7 +107,7 @@ main (void) block[1] = k; block[2] = VDSDIM2; - /* + /* * Build the mappings for A, C and E source datasets. * */ @@ -121,7 +121,7 @@ main (void) /* Reinitialize start[0] and block[1] */ start[0] = 0; block[1] = n; - /* + /* * Build the mappings for B, D and F source datasets. * */ @@ -139,8 +139,8 @@ main (void) status = H5Sclose (nsrc_space); status = H5Sclose (ksrc_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -162,7 +162,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf("Wrong layout found \n"); @@ -173,15 +173,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-percival-unlim-maxmin.c b/examples/h5_vds-percival-unlim-maxmin.c index 0273bbc..7b0d532 100644 --- a/examples/h5_vds-percival-unlim-maxmin.c +++ b/examples/h5_vds-percival-unlim-maxmin.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. There are 4 source datasets total. Each of the source datasets is extended to different sizes. VDS access property can be used to get max and min extent. @@ -28,15 +28,15 @@ #define VFILE "vds-percival-unlim-maxmin.h5" #define DATASET "VDS-Percival-unlim-maxmin" -#define VDSDIM0 H5S_UNLIMITED -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM1 10 +#define VDSDIM2 10 -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED #define DIM0_1 4 /* Initial size of the source datasets */ -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -61,7 +61,7 @@ main (void) hid_t dcpl, dapl; herr_t status; hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0_1, DIM1, DIM2}, memdims[3] = {DIM0_1, DIM1, DIM2}, extdims[3] = {0, DIM1, DIM2}, /* Dimensions of the extended source datasets */ @@ -96,7 +96,7 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -112,7 +112,7 @@ main (void) status = H5Pclose (dcpl); status = H5Dclose (dset); status = H5Fclose (file); - } + } vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -124,7 +124,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -143,18 +143,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -174,14 +174,14 @@ main (void) for (j = 0; j < (i+1)*DIM1*DIM2; j++) wdata[j] = 10*(i+1); /* - * Open the source files and datasets. Appen data to each dataset and + * Open the source files and datasets. Appen data to each dataset and * close all resources. */ file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT); dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT); extdims[0] = DIM0_1+i+1; - status = H5Dset_extent (dset, extdims); + status = H5Dset_extent (dset, extdims); src_space = H5Dget_space (dset); start[0] = DIM0_1; start[1] = 0; @@ -194,7 +194,7 @@ main (void) block[2] = DIM2; memdims[0] = i+1; - mem_space = H5Screate_simple(RANK, memdims, NULL); + mem_space = H5Screate_simple(RANK, memdims, NULL); status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block); status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT, wdata); @@ -204,8 +204,8 @@ main (void) } status = H5Dclose (vdset); - status = H5Fclose (vfile); - + status = H5Fclose (vfile); + /* * Now we begin the read section of this example. */ @@ -214,8 +214,8 @@ main (void) * Open file and dataset using the default properties. */ vfile = H5Fopen (VFILE, H5F_ACC_RDONLY, H5P_DEFAULT); - - /* + + /* * Open VDS using different access properties to use max or * min extents depending on the sizes of the underlying datasets */ @@ -252,7 +252,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -263,15 +263,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-percival-unlim.c b/examples/h5_vds-percival-unlim.c index f6a5f50..0823f40 100644 --- a/examples/h5_vds-percival-unlim.c +++ b/examples/h5_vds-percival-unlim.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. There are 4 source datasets total. This file is intended for use with HDF5 Library version 1.10 @@ -26,15 +26,15 @@ #define VFILE "vds-percival-unlim.h5" #define DATASET "VDS-Percival-unlim" -#define VDSDIM0 H5S_UNLIMITED -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM1 10 +#define VDSDIM2 10 -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED #define DIM0_1 10 /* Initial size of the datasets */ -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -59,7 +59,7 @@ main (void) hid_t dcpl; herr_t status; hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0_1, DIM1, DIM2}, extdims[3] = {2*DIM0_1, DIM1, DIM2}, chunk_dims[3] = {DIM0_1, DIM1, DIM2}, @@ -95,7 +95,7 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -111,7 +111,7 @@ main (void) status = H5Pclose (dcpl); status = H5Dclose (dset); status = H5Fclose (file); - } + } vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -123,7 +123,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -142,18 +142,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -179,13 +179,13 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = 10*(i+1); /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT); dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT); - status = H5Dset_extent (dset, extdims); + status = H5Dset_extent (dset, extdims); src_space = H5Dget_space (dset); start[0] = DIM0_1; start[1] = 0; @@ -197,7 +197,7 @@ main (void) block[1] = DIM1; block[2] = DIM2; - mem_space = H5Screate_simple(RANK, dims, NULL); + mem_space = H5Screate_simple(RANK, dims, NULL); status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block); status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT, wdata); @@ -207,8 +207,8 @@ main (void) } status = H5Dclose (vdset); - status = H5Fclose (vfile); - + status = H5Fclose (vfile); + /* * Now we begin the read section of this example. */ @@ -229,7 +229,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -240,15 +240,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); @@ -300,7 +300,7 @@ main (void) /* Read all VDS data */ /* EIP We should be able to do it by using H5S_ALL instead of making selection - * or using H5Sselect_all from vspace. + * or using H5Sselect_all from vspace. */ start[0] = 0; start[1] = 0; @@ -315,12 +315,12 @@ main (void) status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, NULL, count, block); mem_space = H5Screate_simple(RANK, vdsdims_out, NULL); status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT, - rdata); + rdata); printf (" All data: \n"); for (i=0; i < (int)vdsdims_out[0]; i++) { for (j=0; j < (int)vdsdims_out[1]; j++) { printf ("(%d, %d, 0)", i, j); - for (k=0; k < (int)vdsdims_out[2]; k++) + for (k=0; k < (int)vdsdims_out[2]; k++) printf (" %d ", rdata[i][j][k]); printf ("\n"); } @@ -338,16 +338,16 @@ main (void) block[0] = 1; block[1] = vdsdims_out[1]; block[2] = vdsdims_out[2]; - dims[0] = 2*DIM0_1; + dims[0] = 2*DIM0_1; status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); mem_space = H5Screate_simple(RANK, dims, NULL); status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT, - a_rdata); + a_rdata); printf (" All data: \n"); for (i=0; i < 2*DIM0_1; i++) { for (j=0; j < (int)vdsdims_out[1]; j++) { printf ("(%d, %d, 0)", i, j); - for (k=0; k < (int)vdsdims_out[2]; k++) + for (k=0; k < (int)vdsdims_out[2]; k++) printf (" %d ", a_rdata[i][j][k]); printf ("\n"); } diff --git a/examples/h5_vds-percival.c b/examples/h5_vds-percival.c index 11a974b..aeca368 100644 --- a/examples/h5_vds-percival.c +++ b/examples/h5_vds-percival.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. EIP: For now we will use finite dimension. There are 4 source datasets total. This file is intended for use with HDF5 Library version 1.10 @@ -28,18 +28,18 @@ #define FILE "vds-percival.h5" #define DATASET "VDS-Percival" /* later -#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM0 H5S_UNLIMITED */ #define VDSDIM0 40 -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM1 10 +#define VDSDIM2 10 /* later -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED */ -#define DIM0 10 -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM0 10 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -64,7 +64,7 @@ main (void) hid_t dcpl; herr_t status; hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0, DIM1, DIM2}, dims_max[3] = {DIM0, DIM1, DIM2}, start[3], /* Hyperslab start parameter for VDS */ @@ -94,7 +94,7 @@ main (void) for (j = 0; j < DIM0*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -107,7 +107,7 @@ main (void) status = H5Sclose (src_space); status = H5Dclose (dset); status = H5Fclose (file); - } + } file = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -119,7 +119,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -144,18 +144,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ dset = H5Dcreate2 (file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -163,8 +163,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -185,7 +185,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -196,15 +196,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-simpleIO.c b/examples/h5_vds-simpleIO.c index 56fa72b..5fd5c52 100644 --- a/examples/h5_vds-simpleIO.c +++ b/examples/h5_vds-simpleIO.c @@ -14,7 +14,7 @@ This example illustrates the concept of virtual dataset I/O The program creates 2-dim source dataset and writes data to it. Then it creates 2-dim virtual dataset that has - the same dimension sizes and maps the all elements of the + the same dimension sizes and maps the all elements of the virtual dataset to all elements of the source dataset. Then VDS is read back. @@ -30,7 +30,7 @@ #define FILE "vds-simpleIO.h5" #define DATASET "VDS" #define DIM1 6 -#define DIM0 4 +#define DIM0 4 #define RANK 2 #define SRC_FILE "a.h5" @@ -40,27 +40,27 @@ int main (void) { - hid_t file, space, src_space, vspace, dset; /* Handles */ + hid_t file, space, src_space, vspace, dset; /* Handles */ hid_t dcpl; herr_t status; hsize_t vdsdims[2] = {DIM0, DIM1}, /* Virtual dataset dimension */ dims[2] = {DIM0, DIM1}; /* Source dataset dimensions */ int wdata[DIM0][DIM1], /* Write buffer for source dataset */ rdata[DIM0][DIM1], /* Read buffer for virtual dataset */ - i, j; + i, j; H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ ssize_t len; /* Length of the string; also a return value */ - char *filename; + char *filename; char *dsetname; /* * Initialize data. */ - for (i = 0; i < DIM0; i++) + for (i = 0; i < DIM0; i++) for (j = 0; j < DIM1; j++) wdata[i][j] = i+1; - + /* - * Create the source file and the dataset. Write data to the source dataset + * Create the source file and the dataset. Write data to the source dataset * and close all resources. */ @@ -82,12 +82,12 @@ main (void) /* Set VDS creation property. */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - - /* + + /* * Build the mappings. * Selections in the source datasets are H5S_ALL. - * In the virtual dataset we select the first, the second and the third rows - * and map each row to the data in the corresponding source dataset. + * In the virtual dataset we select the first, the second and the third rows + * and map each row to the data in the corresponding source dataset. */ src_space = H5Screate_simple (RANK, dims, NULL); status = H5Pset_virtual (dcpl, vspace, SRC_FILE, SRC_DATASET, src_space); @@ -98,8 +98,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -118,7 +118,7 @@ main (void) * Get storage layout. */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -129,10 +129,10 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset "); /* Get selection in the virttual dataset */ diff --git a/examples/h5_vds.c b/examples/h5_vds.c index 76b849a..cce7b88 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -16,15 +16,15 @@ This example illustrates the concept of virtual dataset. The program creates three 1-dim source datasets and writes data to them. Then it creates a 2-dim virtual dataset and - maps the first three rows of the virtual dataset to the data - in the source datasets. Elements of a row are mapped to all + maps the first three rows of the virtual dataset to the data + in the source datasets. Elements of a row are mapped to all elements of the corresponding source dataset. - The fourth row is not mapped and will be filled with the fill - values when virtual dataset is read back. - + The fourth row is not mapped and will be filled with the fill + values when virtual dataset is read back. + The program closes all datasets, and then reopens the virtual dataset, and finds and prints its creation properties. - Then it reads the values. + Then it reads the values. This file is intended for use with HDF5 Library version 1.10 @@ -37,9 +37,9 @@ #define FILE "vds.h5" #define DATASET "VDS" -#define VDSDIM1 6 -#define VDSDIM0 4 -#define DIM0 6 +#define VDSDIM1 6 +#define VDSDIM0 4 +#define DIM0 6 #define RANK1 1 #define RANK2 2 @@ -58,7 +58,7 @@ const char *SRC_DATASET[] = { int main (void) { - hid_t file, space, src_space, vspace, dset; /* Handles */ + hid_t file, space, src_space, vspace, dset; /* Handles */ hid_t dcpl; herr_t status; hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */ @@ -73,12 +73,12 @@ main (void) block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ - i, j, k, l; + i, j, k, l; int fill_value = -1; /* Fill value for VDS */ H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ ssize_t len; /* Length of the string; also a return value */ - char *filename; + char *filename; char *dsetname; hsize_t nblocks; hsize_t *buf; /* Buffer to hold hyperslab coordinates */ @@ -91,9 +91,9 @@ main (void) * Initialize data for i-th source dataset. */ for (j = 0; j < DIM0; j++) wdata[j] = i+1; - + /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -117,7 +117,7 @@ main (void) /* Set VDS creation property. */ dcpl = H5Pcreate (H5P_DATASET_CREATE); status = H5Pset_fill_value (dcpl, H5T_NATIVE_INT, &fill_value); - + /* Initialize hyperslab values. */ start[0] = 0; start[1] = 0; @@ -126,11 +126,11 @@ main (void) block[0] = 1; block[1] = VDSDIM1; - /* + /* * Build the mappings. * Selections in the source datasets are H5S_ALL. - * In the virtual dataset we select the first, the second and the third rows - * and map each row to the data in the corresponding source dataset. + * In the virtual dataset we select the first, the second and the third rows + * and map each row to the data in the corresponding source dataset. */ src_space = H5Screate_simple (RANK1, dims, NULL); for (i = 0; i < 3; i++) { @@ -146,8 +146,8 @@ main (void) status = H5Sclose (space); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -167,7 +167,7 @@ main (void) * Get storage layout. */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -178,26 +178,26 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset "); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); /* Make sure that this is a hyperslab selection and then print information. */ - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { nblocks = H5Sget_select_hyper_nblocks (vspace); buf = (hsize_t *)malloc(sizeof(hsize_t)*2*RANK2*nblocks); status = H5Sget_select_hyper_blocklist (vspace, (hsize_t)0, nblocks, buf); for (l=0; l<nblocks; l++) { printf("("); - for (k=0; k<RANK2-1; k++) + for (k=0; k<RANK2-1; k++) printf("%d,", (int)buf[k]); printf("%d ) - (", (int)buf[k]); - for (k=0; k<RANK2-1; k++) + for (k=0; k<RANK2-1; k++) printf("%d,", (int)buf[RANK2+k]); printf("%d)\n", (int)buf[RANK2+k]); } diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 90d5c6a..b649d98 100644 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -53,7 +53,7 @@ fi ) # Where the tool is installed. -# default is relative path to installed location of the tools +# default is relative path to installed location of the tools prefix="${prefix:-../${prefix_relto_examplesdir}}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" @@ -179,5 +179,5 @@ rm *.h5 rm -rf red blue u2w echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 40ca466..9f766dd 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -100,9 +100,9 @@ main (void) printf("HDF5 C Sample program ran successfully. File %s generated.\n", H5FILE_NAME); remove(H5FILE_NAME); - + return 0; -} +} EOF # generate prog1 @@ -143,7 +143,7 @@ main (void) remove(H5FILE_NAME); return 0; -} +} EOF # Generate HDF5 v1.6 Main Program: diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/fortran/examples/compound_complex_fortran2003.f90 index 6d0f291..9f0cc9f 100644 --- a/fortran/examples/compound_complex_fortran2003.f90 +++ b/fortran/examples/compound_complex_fortran2003.f90 @@ -11,8 +11,8 @@ ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! This example shows how to create an array of a compound datatype which -! contains an array of type complex and how to write it to hdf5 +! This example shows how to create an array of a compound datatype which +! contains an array of type complex and how to write it to hdf5 ! and how to read it back into a compound datatype for hdf5. ! @@ -85,7 +85,7 @@ PROGRAM compound_complex_fortran2003 ! Open the file and the dataset. ! CALL H5Fopen_f("test.h5", H5F_ACC_RDONLY_F, file_id, error) - + CALL H5Dopen_f(file_id, "samples", dset_id, error) ! ! Create the memory data type. diff --git a/fortran/examples/compound_fortran2003.f90 b/fortran/examples/compound_fortran2003.f90 index 0168177..09e1b04 100644 --- a/fortran/examples/compound_fortran2003.f90 +++ b/fortran/examples/compound_fortran2003.f90 @@ -77,10 +77,10 @@ PROGRAM main INTEGER(SIZE_T) :: offset, sizeof_compound INTEGER :: hdferr TYPE(C_PTR) :: f_ptr - - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */ INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/13/) ! @@ -133,7 +133,7 @@ PROGRAM main ! ! Write data to the dataset ! - + f_ptr = C_LOC(s1(1)) CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr) @@ -150,7 +150,7 @@ PROGRAM main ! CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr) - + CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr) ! diff --git a/fortran/examples/h5_cmprss.f90 b/fortran/examples/h5_cmprss.f90 index 61dd7b0..f543024 100644 --- a/fortran/examples/h5_cmprss.f90 +++ b/fortran/examples/h5_cmprss.f90 @@ -10,17 +10,17 @@ ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! +! ! This example illustrates how to create a compressed dataset. ! It is used in the HDF5 Tutorial. -! +! PROGRAM h5_cmprss - USE HDF5 ! This module contains all necessary modules + USE HDF5 ! This module contains all necessary modules IMPLICIT NONE ! - ! The dataset is stored in file "h5_cmprss.h5" + ! The dataset is stored in file "h5_cmprss.h5" ! CHARACTER(LEN=12), PARAMETER :: filename = "h5_cmprss.h5" INTEGER, PARAMETER :: rank = 2 ! Rank of the data set @@ -33,7 +33,7 @@ PROGRAM h5_cmprss INTEGER :: error INTEGER(hsize_t), DIMENSION(1:rank) :: dims ! dimensions of data INTEGER(hsize_t), DIMENSION(1:rank) :: cdims ! sizes of chunked data - + INTEGER :: i,j, numfilt INTEGER, DIMENSION(1:dim0,1:dim1) :: buf ! write buffer INTEGER, DIMENSION(1:dim0,1:dim1) :: rbuf ! read buffer @@ -63,15 +63,15 @@ PROGRAM h5_cmprss CALL h5screate_simple_f(rank, dims, dataspace_id, error) CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) ! - ! Dataset must be chunked for compression + ! Dataset must be chunked for compression cdims(1:2) = 20 CALL h5pset_chunk_f(plist_id, 2, cdims, error) ! Set ZLIB / DEFLATE Compression using compression level 6. - ! To use SZIP Compression comment out these lines. + ! To use SZIP Compression comment out these lines. CALL h5pset_deflate_f(plist_id, 6, error) - ! Uncomment these lines to set SZIP Compression + ! Uncomment these lines to set SZIP Compression !szip_options_mask = H5_SZIP_NN_OM_F !szip_pixels_per_block = 16 !CALL H5Pset_szip_f(plist_id, szip_options_mask, szip_pixels_per_block, error) @@ -86,7 +86,7 @@ PROGRAM h5_cmprss ENDDO ENDDO - data_dims(1:2) = (/dim0,dim1/) + data_dims(1:2) = (/dim0,dim1/) CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, buf, data_dims, error) ! Close resources @@ -99,12 +99,12 @@ PROGRAM h5_cmprss CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error) CALL h5dopen_f(file_id, "Compressed_Data", dataset_id, error) - ! Retrieve filter information. + ! Retrieve filter information. CALL h5dget_create_plist_f(dataset_id, plist_id, error) - + CALL h5pget_nfilters_f(plist_id, numfilt, error) WRITE(*,'(A, I0)') "Number of filters associated with dataset: ", numfilt - + DO i = 1, numfilt nelmts = 1 CALL h5pget_filter_f(plist_id, 0, flags, nelmts, cd_values, & @@ -121,7 +121,7 @@ PROGRAM h5_cmprss ENDDO data_dims(1:2) = (/dim0,dim1/) CALL h5dread_f(dataset_id, H5T_NATIVE_INTEGER, rbuf, data_dims, error) - + CALL h5dclose_f(dataset_id, error) CALL h5pclose_f(plist_id, error) CALL h5fclose_f(file_id, error) diff --git a/fortran/examples/h5_extend.f90 b/fortran/examples/h5_extend.f90 index 20b91ff..93bfea8 100644 --- a/fortran/examples/h5_extend.f90 +++ b/fortran/examples/h5_extend.f90 @@ -15,12 +15,12 @@ PROGRAM H5_EXTEND - USE HDF5 ! This module contains all necessary modules + USE HDF5 ! This module contains all necessary modules IMPLICIT NONE ! - !the dataset is stored in file "extend.h5" + !the dataset is stored in file "extend.h5" ! CHARACTER(LEN=9), PARAMETER :: filename = "extend.h5" @@ -30,11 +30,11 @@ PROGRAM H5_EXTEND CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" INTEGER :: RANK = 2 - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier - INTEGER(HID_T) :: memspace ! Memory dataspace identifier - INTEGER(HID_T) :: crp_list ! Dataset creation property identifier + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! Memory dataspace identifier + INTEGER(HID_T) :: crp_list ! Dataset creation property identifier ! !dataset dimensions at creation time @@ -42,7 +42,7 @@ PROGRAM H5_EXTEND INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/3,3/) ! - !data dimensions + !data dimensions ! INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsc = (/2,5/) INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/3,7/) @@ -50,49 +50,49 @@ PROGRAM H5_EXTEND ! !Maximum dimensions ! - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims INTEGER(HSIZE_T), DIMENSION(1:2) :: offset - INTEGER(HSIZE_T), DIMENSION(1:2) :: count + INTEGER(HSIZE_T), DIMENSION(1:2) :: count ! - ! Variables for reading and writing + ! Variables for reading and writing ! - INTEGER, DIMENSION(1:3,1:3) :: data1 + INTEGER, DIMENSION(1:3,1:3) :: data1 INTEGER, DIMENSION(1:21) :: data2 = & (/2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4/) INTEGER(HSIZE_T), DIMENSION(1:2) :: data_dims ! - !Size of data in the file + !Size of data in the file ! INTEGER(HSIZE_T), DIMENSION(1:2) :: size ! - !general purpose integer + !general purpose integer ! INTEGER(HSIZE_T) :: i, j ! - !flag to check operation success + !flag to check operation success ! - INTEGER :: error + INTEGER :: error ! !Variables used in reading data back - ! + ! INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsr, maxdimsr INTEGER :: rankr - INTEGER, DIMENSION(1:3,1:10) :: rdata + INTEGER, DIMENSION(1:3,1:10) :: rdata ! !Initialize FORTRAN predifined datatypes ! - CALL h5open_f(error) + CALL h5open_f(error) ! !Create a new file using default properties. - ! + ! CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) ! @@ -117,7 +117,7 @@ PROGRAM H5_EXTEND CALL h5sclose_f(dataspace, error) ! - !Fill data array with 1's + !Fill data array with 1's ! DO i = 1, dims(1) DO j = 1, dims(2) @@ -128,7 +128,7 @@ PROGRAM H5_EXTEND ! !Write data array to dataset ! - data_dims(1:2) = (/3,3/) + data_dims(1:2) = (/3,3/) CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data1, data_dims, error) ! @@ -144,7 +144,7 @@ PROGRAM H5_EXTEND ! !Write to 3x7 extended part of dataset - ! + ! CALL h5dget_space_f(dset_id, dataspace, error) CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, & offset, count, error) @@ -185,7 +185,7 @@ PROGRAM H5_EXTEND ! !Get dataspace's dimensions. - ! + ! CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error) ! @@ -204,15 +204,15 @@ PROGRAM H5_EXTEND CALL h5screate_simple_f(rankr, dimsr, memspace, error) ! - !Read data + !Read data ! data_dims(1:2) = (/3,10/) CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, & error, memspace, dataspace) - WRITE(*,'(A)') "Dataset:" + WRITE(*,'(A)') "Dataset:" DO i = 1, dimsr(1) - WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2)) + WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2)) END DO ! diff --git a/fortran/examples/h5_subset.f90 b/fortran/examples/h5_subset.f90 index ab33c86..9bebce5 100644 --- a/fortran/examples/h5_subset.f90 +++ b/fortran/examples/h5_subset.f90 @@ -11,23 +11,23 @@ ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! This example shows how to write and read a hyperslab. +! This example shows how to write and read a hyperslab. ! It is used in the HDF5 Tutorial. ! -PROGRAM H5_SUBSET +PROGRAM H5_SUBSET - USE HDF5 ! This module contains all necessary modules + USE HDF5 ! This module contains all necessary modules IMPLICIT NONE CHARACTER(LEN=9), PARAMETER :: filename = "subset.h5" ! File name CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier - INTEGER(HID_T) :: memspace ! memspace identifier + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memspace identifier ! ! To change the subset size, modify size of dimsm, sdata, dim0_sub, @@ -35,57 +35,57 @@ PROGRAM H5_SUBSET ! INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/4,3/) ! Dataset dimensions INTEGER, DIMENSION(1:4,1:3) :: sdata ! Subset buffer - INTEGER :: dim0_sub = 4 - INTEGER :: dim1_sub = 3 + INTEGER :: dim0_sub = 4 + INTEGER :: dim1_sub = 3 INTEGER(HSIZE_T), DIMENSION(1:2) :: count = (/4,3/) ! Size of hyperslab INTEGER(HSIZE_T), DIMENSION(1:2) :: offset = (/2,1/) ! Hyperslab offset - INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride - INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size + INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride + INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsf = (/10,8/) ! Dataset dimensions INTEGER, DIMENSION(1:10,1:8) :: data ! Data to write - INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read + INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read INTEGER :: rank = 2 ! Dataset rank ( in file ) INTEGER :: dim0 = 10 ! Dataset size in file - INTEGER :: dim1 = 8 + INTEGER :: dim1 = 8 - INTEGER :: i, j + INTEGER :: i, j INTEGER :: error ! Error flag INTEGER(HSIZE_T), DIMENSION(2) :: data_dims ! - ! Write data to the HDF5 file. + ! Write data to the HDF5 file. ! ! - ! Data initialization. + ! Data initialization. ! - DO i = 1, dim0 + DO i = 1, dim0 DO j = 1, dim1 IF (i .LE. (dim0 / 2)) THEN - data(i,j) = 1 - ELSE - data(i,j) = 2 + data(i,j) = 1 + ELSE + data(i,j) = 2 END IF END DO END DO ! - ! Initialize FORTRAN interface. + ! Initialize FORTRAN interface. ! - CALL h5open_f(error) + CALL h5open_f(error) ! ! Create a new file using default properties. - ! + ! CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) ! - ! Create the data space for the dataset. + ! Create the data space for the dataset. ! CALL h5screate_simple_f(rank, dimsf, dataspace, error) @@ -98,12 +98,12 @@ PROGRAM H5_SUBSET ! ! Write the dataset. ! - data_dims(1) = dim0 - data_dims(2) = dim1 + data_dims(1) = dim0 + data_dims(2) = dim1 CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error) ! - ! Data Written to File + ! Data Written to File ! WRITE(*,'(/,A)') "Original Data Written to File:" DO i = 1, dim0 @@ -138,7 +138,7 @@ PROGRAM H5_SUBSET ! CALL h5dget_space_f(dset_id, dataspace, error) CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, & - offset, count, error, stride, BLOCK) + offset, count, error, stride, BLOCK) ! ! Create memory dataspace. ! @@ -148,9 +148,9 @@ PROGRAM H5_SUBSET WRITE(*,'(A,/)') " offset=2x1 stride=1x1 count=4x3 block=1x1" ! - ! Write subset to dataset + ! Write subset to dataset ! - data_dims(1:2) = (/dim0_sub, dim1_sub/) + data_dims(1:2) = (/dim0_sub, dim1_sub/) CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, sdata, data_dims, error, & memspace, dataspace) @@ -158,10 +158,10 @@ PROGRAM H5_SUBSET CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, error) ! - ! Read entire dataset back + ! Read entire dataset back ! WRITE(*,'(A)') "Data in File after Subset Written:" - DO i = 1, dim0 + DO i = 1, dim0 WRITE(*,'(100(1X,I0,1X))') rdata(i,1:dim1) END DO PRINT *, " " diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90 index 68354ac..651830c 100644 --- a/fortran/examples/nested_derived_type.f90 +++ b/fortran/examples/nested_derived_type.f90 @@ -1,4 +1,4 @@ -! +! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by the Board of Trustees of the University of Illinois. * ! All rights reserved. * @@ -82,10 +82,10 @@ PROGRAM main INTEGER(SIZE_T) :: offset, sizeof_compound INTEGER :: hdferr TYPE(C_PTR) :: f_ptr - - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */ INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/7/) INTEGER(HSIZE_T), DIMENSION(1) :: tdims1a=(/4/) @@ -136,7 +136,7 @@ PROGRAM main ! ! Write data to the dataset ! - + f_ptr = C_LOC(s1(1)) CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr) @@ -153,7 +153,7 @@ PROGRAM main ! CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr) - + CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr) ! ! Create a data type for s2 diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90 index 36ebf0d..f79c8fe 100644 --- a/fortran/examples/rwdset_fortran2003.f90 +++ b/fortran/examples/rwdset_fortran2003.f90 @@ -1,4 +1,4 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * ! All rights reserved. * @@ -9,12 +9,12 @@ ! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! -! The following example shows how to write and read to/from an existing dataset. -! It opens the file created in the previous example, obtains the dataset -! identifier, writes the data to the dataset in the file, +! The following example shows how to write and read to/from an existing dataset. +! It opens the file created in the previous example, obtains the dataset +! identifier, writes the data to the dataset in the file, ! then reads the dataset to memory. Uses updated Fortran 2003 interface ! with different KINDs of integers and reals. ! @@ -22,8 +22,8 @@ PROGRAM RWDSET_FORTRAN2003 USE ISO_C_BINDING - USE HDF5 ! This module contains all necessary modules - + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors @@ -42,13 +42,13 @@ PROGRAM RWDSET_FORTRAN2003 CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id1 ! Dataset identifier - INTEGER(HID_T) :: dset_id4 ! Dataset identifier - INTEGER(HID_T) :: dset_id8 ! Dataset identifier - INTEGER(HID_T) :: dset_id16 ! Dataset identifier - INTEGER(HID_T) :: dset_idr4 ! Dataset identifier - INTEGER(HID_T) :: dset_idr8 ! Dataset identifier + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id1 ! Dataset identifier + INTEGER(HID_T) :: dset_id4 ! Dataset identifier + INTEGER(HID_T) :: dset_id8 ! Dataset identifier + INTEGER(HID_T) :: dset_id16 ! Dataset identifier + INTEGER(HID_T) :: dset_idr4 ! Dataset identifier + INTEGER(HID_T) :: dset_idr8 ! Dataset identifier INTEGER :: error ! Error flag INTEGER :: i @@ -65,15 +65,15 @@ PROGRAM RWDSET_FORTRAN2003 REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7 REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15 - INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/) + INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/) INTEGER(HID_T) :: dspace_id ! Dataspace identifier - + TYPE(C_PTR) :: f_ptr ! ! Initialize FORTRAN interface. ! - CALL h5open_f(error) + CALL h5open_f(error) ! ! Initialize the dset_data array. ! @@ -130,7 +130,7 @@ PROGRAM RWDSET_FORTRAN2003 ! ! Read the dataset. ! - ! Read data back into an integer size that is larger then the original size used for + ! Read data back into an integer size that is larger then the original size used for ! writing the data f_ptr = C_LOC(data_out_i8a(1)) CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) @@ -172,5 +172,5 @@ PROGRAM RWDSET_FORTRAN2003 END PROGRAM RWDSET_FORTRAN2003 - + diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in index f384909..200f311 100644 --- a/fortran/examples/testh5fc.sh.in +++ b/fortran/examples/testh5fc.sh.in @@ -71,13 +71,13 @@ temp_FILES="a.out $applib" # An application Main that calls hdf5 and application's own functions. cat > $appmain <<EOF PROGRAM FILEEXAMPLE - USE HDF5 ! This module contains all necessary modules - + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name INTEGER(HID_T) :: file_id ! File identifier - + INTEGER :: error ! Error flag CALL sub1 @@ -86,7 +86,7 @@ cat > $appmain <<EOF CALL h5fclose_f(file_id, error) CALL h5close_f(error) CALL sub2 - END PROGRAM FILEEXAMPLE + END PROGRAM FILEEXAMPLE EOF # generate prog1 @@ -107,20 +107,20 @@ EOF # An HDF5 sample program that calls hdf5 functions. cat > $hdf5main <<EOF PROGRAM FILEEXAMPLE - USE HDF5 ! This module contains all necessary modules - + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name INTEGER(HID_T) :: file_id ! File identifier - + INTEGER :: error ! Error flag CALL h5open_f (error) CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) CALL h5fclose_f(file_id, error) CALL h5close_f(error) - END PROGRAM FILEEXAMPLE + END PROGRAM FILEEXAMPLE EOF diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 827baa1..8ef7936 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1286,16 +1286,16 @@ h5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) * PURPOSE * Call H5Treclaim * INPUTS - * type_id - Identifier of the datatype. - * space_id - Identifier of the dataspace. - * plist_id - Identifier of the property list used to create the buffer. - * buf - Pointer to the buffer to be reclaimed. + * type_id - Identifier of the datatype. + * space_id - Identifier of the dataspace. + * plist_id - Identifier of the property list used to create the buffer. + * buf - Pointer to the buffer to be reclaimed. * * RETURNS * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January 15, 2011 + * January 15, 2011 * * SOURCE */ diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 0a2f2a3..6631d3a 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -164,7 +164,7 @@ h5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) size_t c_namelen = (size_t)*namelen; int_f ret_value = 0; - if(c_namelen > 0) + if(c_namelen > 0) c_name = (char *)HDmalloc(c_namelen + 1); if(!c_name) @@ -212,7 +212,7 @@ h5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) size_t c_namelen = (size_t)*namelen; int_f ret_value = 0; - if(c_namelen > 0) + if(c_namelen > 0) c_name = (char *)HDmalloc(c_namelen + 1); if(!c_name) @@ -242,7 +242,7 @@ done: * estack_id - Error stack identifier. * func - Function to be called upon an error condition. * client_data - Data passed to the error function. - * + * * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 12fb7ed..7123f1d 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -486,11 +486,11 @@ h5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * Changed type of max_obj to size_t_f; added parameter for the * number of open objects * Thursday, September 25, 2008 EIP - * + * * SOURCE */ int_f -h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, +h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) /******/ { @@ -693,7 +693,7 @@ h5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f /* * Call h5fget_file_image function */ - + if ( (c_buf_req = H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index b5ff7f2..1fee5e8 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -939,7 +939,7 @@ int_f h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, void *linkval_buff, hid_t_f *lapl_id) /******/ -{ +{ char *c_link_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 9780814..edbfcbe 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -27,7 +27,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info); int_f fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) { - /* This function does not used the field parameter because we want + /* This function does not used the field parameter because we want * this function to fill the unfilled fields with C's default values. */ @@ -184,7 +184,7 @@ h5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_ * PURPOSE * Call H5Oclose * INPUTS - * object_id - Object identifier + * object_id - Object identifier * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -197,10 +197,10 @@ h5oclose_c ( hid_t_f *object_id ) /******/ { int_f ret_value=0; /* Return value */ - + if (H5Oclose((hid_t)*object_id) < 0) HGOTO_DONE(FAIL); - + done: return ret_value; } @@ -312,7 +312,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ H5O_info2_t Oinfo; - + /* * Convert FORTRAN name to C name */ @@ -356,7 +356,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l * SOURCE */ int_f -h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, +h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields) /******/ { @@ -432,12 +432,12 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields) * H5Ocopy_c * PURPOSE * Calls H5Ocopy - * INPUTS - * src_loc_id - Object identifier indicating the location of the source object to be copied - * src_name - Name of the source object to be copied + * INPUTS + * src_loc_id - Object identifier indicating the location of the source object to be copied + * src_name - Name of the source object to be copied * src_name_len - Length of src_name - * dst_loc_id - Location identifier specifying the destination - * dst_name - Name to be assigned to the new copy + * dst_loc_id - Location identifier specifying the destination + * dst_name - Name to be assigned to the new copy * dst_name_len - Length of dst_name * ocpypl_id - Object copy property list * lcpl_id - Link creation property list for the new hard link @@ -451,15 +451,15 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields) */ int_f h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, - hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ) /******/ { char *c_src_name = NULL; /* Buffer to hold C string */ char *c_dst_name = NULL; /* Buffer to hold C string */ - + int_f ret_value = 0; /* Return value */ - + /* * Convert FORTRAN name to C name */ @@ -471,7 +471,7 @@ h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, /* * Call H5Ocopy function. */ - if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, + if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, (hid_t)*ocpypl_id, (hid_t)*lcpl_id) < 0) HGOTO_DONE(FAIL); @@ -689,8 +689,8 @@ h5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) * Calls H5Oset_comment_by_name * INPUTS * object_id - Identifier of the target object. - * name - Name of the object whose comment is to be set or reset, - * specified as a path relative to loc_id. + * name - Name of the object whose comment is to be set or reset, + * specified as a path relative to loc_id. * namelen - Length of the name. * comment - The new comment. * commentlen - Length of the comment. @@ -757,7 +757,7 @@ h5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fc * SOURCE */ int_f -h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id) /******/ { @@ -765,7 +765,7 @@ h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f ret_value = 0; H5_index_t c_index_type; H5_iter_order_t c_order; - + /* * Convert FORTRAN string to C string */ @@ -818,13 +818,13 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi /* * Allocate buffer to hold comment name */ - + if(NULL == (c_comment = (char *)HDmalloc(c_commentsize))) HGOTO_DONE(FAIL); /* * Call H5Oget_comment function. - */ + */ if((*bufsize = (hssize_t_f)H5Oget_comment((hid_t)*object_id, c_comment, (size_t)*commentsize)) < 0) HGOTO_DONE(FAIL); @@ -862,7 +862,7 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi * SOURCE */ int_f -h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, +h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id) /******/ { @@ -883,13 +883,13 @@ h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, /* * Allocate buffer to hold comment name */ - + if(NULL == (c_comment = (char *)HDmalloc(c_commentsize))) HGOTO_DONE(FAIL); /* * Call H5Oget_comment_by_name function. - */ + */ if((c_bufsize = H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a931903..7cb3db8 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1831,7 +1831,7 @@ DONE: * Wednesday, February 23, 2000 * HISTORY * Changed type of 'offset' from int_f to off_t_f -- MSB January 9, 2012 - * + * * SOURCE */ int_f @@ -3153,7 +3153,7 @@ h5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) char *c_name; /* - * Call H5Pget_class_name function. c_name is allocated by the library, + * Call H5Pget_class_name function. c_name is allocated by the library, * has to be freed by application. */ if(NULL == (c_name = H5Pget_class_name((hid_t)*cls))) @@ -3216,7 +3216,7 @@ DONE: * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * Output: + * Output: * value - property value * RETURNS * 0 on success, -1 on failure @@ -5177,7 +5177,7 @@ h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby * * Inputs: * fapl_id - File access property list identifier - * buf_ptr - Pointer to the initial file image, + * buf_ptr - Pointer to the initial file image, * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * @@ -5207,7 +5207,7 @@ h5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len) * Inputs: * fapl_id - File access property list identifier * Outputs: - * buf_ptr - Pointer to the initial file image, + * buf_ptr - Pointer to the initial file image, * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 6a3181f..df2ded4 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -351,7 +351,7 @@ h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_ * OUTPUTS * obj_type - Type of referenced object. These are defined in H5Opublic.h, * enum H5O_type_t - * + * * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index fb5c734..2db6678 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -101,7 +101,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes if (sizeof(int_f) == sizeof(long long)) { if ((types[5] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* Find appropriate size to store Fortran REAL */ if(sizeof(real_f)==sizeof(float)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; @@ -230,7 +230,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value; if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; - if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; + if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; if ((integertypes[17] = (hid_t_f)H5Tcopy(H5T_STD_B8BE)) < 0) return ret_value; if ((integertypes[18] = (hid_t_f)H5Tcopy(H5T_STD_B8LE)) < 0) return ret_value; if ((integertypes[19] = (hid_t_f)H5Tcopy(H5T_STD_B16BE)) < 0) return ret_value; @@ -359,12 +359,12 @@ h5close_types_c( hid_t_f * types, int_f *lentypes, * SOURCE */ int_f -h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, +h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, - int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, + int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags) /******/ diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 8921493..71eb936 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -12,7 +12,7 @@ ! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure ! The script to replace the defines in H5config_f.inc.in is -! located in configure.ac in the Fortran section. +! located in configure.ac in the Fortran section. ! Define if we have parallel support #undef HAVE_PARALLEL @@ -47,7 +47,7 @@ ! If C has quad precision #undef HAVE_FLOAT128 -! Define if INTEGER*16 is available +! Define if INTEGER*16 is available #undef HAVE_Fortran_INTEGER_SIZEOF_16 ! Maximum decimal precision for C diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index fe616d3..695efcd 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -160,9 +160,9 @@ H5_FCDLL int_f h5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *spac H5_FCDLL int_f h5dget_space_status_c( hid_t_f *dset_id, int_f *flag); H5_FCDLL int_f h5dcreate_anon_c(hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); -H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); H5_FCDLL int_f h5dvlen_reclaim_c(hid_t_f *type_id , hid_t_f *space_id, hid_t_f *plist_id, void *buf); @@ -323,22 +323,22 @@ H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5 H5_FCDLL int_f h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order, H5O_iterate2_t op, void *op_data, hid_t_f *lapl_id, int_f *fields ); H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields); -H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, +H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields); H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields); H5_FCDLL int_f h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, - hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ); H5_FCDLL int_f h5odecr_refcount_c(hid_t_f *object_id); H5_FCDLL int_f h5oincr_refcount_c(hid_t_f *object_id); H5_FCDLL int_f h5oexists_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id); H5_FCDLL int_f h5oset_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentlen); H5_FCDLL int_f h5oset_comment_by_name_c(hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id); -H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id); H5_FCDLL int_f h5oget_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize); -H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size, +H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id); H5_FCDLL int_f h5otoken_cmp_c(hid_t_f *loc_id, H5O_token_t *token1, H5O_token_t *token2, int_f *cmp_value); @@ -528,12 +528,12 @@ H5_FCDLL int_f h5open_c(void); H5_FCDLL int_f h5close_c(void); H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); -H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, +H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, - int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, + int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags); H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags); diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index ec2d66f..231b90d 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -150,7 +150,7 @@ int main(void) int RealKinds[] = H5_FORTRAN_REAL_KINDS; int RealKinds_SizeOf[] = H5_FORTRAN_REAL_KINDS_SIZEOF; char Real_C_TYPES[10][32]; - + int FORTRAN_NUM_INTEGER_KINDS=H5_FORTRAN_NUM_INTEGER_KINDS; int H5_FORTRAN_NUM_REAL_KINDS; #if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 @@ -208,13 +208,13 @@ int main(void) } else if(sizeof(double) == RealKinds_SizeOf[i]) { writeTypedef("float", "double", RealKinds[i]); - strcpy(Real_C_TYPES[i], "C_DOUBLE"); + strcpy(Real_C_TYPES[i], "C_DOUBLE"); } #if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) { writeTypedef("float", "long double", RealKinds[i]); strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); - found_long_double = 1; + found_long_double = 1; } # ifdef H5_HAVE_FLOAT128 /* Don't select a higher precision than Fortran can support */ @@ -329,7 +329,7 @@ int main(void) /* Defined different KINDs of integers */ fprintf(fort_header," INTEGER, DIMENSION(1:%d), PARAMETER :: Fortran_INTEGER_AVAIL_KINDS = (/", FORTRAN_NUM_INTEGER_KINDS); - + for(i=0;i<FORTRAN_NUM_INTEGER_KINDS;i++) { fprintf(fort_header,"%d",(int)IntKinds[i]); if(i==FORTRAN_NUM_INTEGER_KINDS-1) { @@ -337,7 +337,7 @@ int main(void) } else { fprintf(fort_header,","); } - + } /* real_4, real_8, real_16 */ diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 4009439..f8ef02b 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -48,7 +48,7 @@ libhdf5_fortran_la_SOURCES=H5f90global.F90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c HDF5.F90 -# HDF5 Fortran library depends on HDF5 Library. +# HDF5 Fortran library depends on HDF5 Library. libhdf5_fortran_la_LIBADD=$(LIBHDF5) # h5fc is generated during configure. diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 29ef83f..080f7ff 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -75,12 +75,12 @@ SHOW="eval" FCBASE="@FC@" FLINKERBASE="@FC@" -# FCFLAGS and LDFLAGS are reserved for use by the script user. +# FCFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just -# before clibpath, user's LIBS come after $link_objs and before the hdf5 -# libraries in $link_args, followed by any external library paths and libraries +# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just +# before clibpath, user's LIBS come after $link_objs and before the hdf5 +# libraries in $link_args, followed by any external library paths and libraries # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. # The order of the flags is intended to give precedence to the user's flags. H5BLD_FCFLAGS="@AM_FCFLAGS@ @FCFLAGS@" @@ -358,9 +358,9 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just - # before clibpath, user's LIBS come after $link_objs and before the hdf5 - # libraries in $link_args, followed by any external library paths and libraries + # User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just + # before clibpath, user's LIBS come after $link_objs and before the hdf5 + # libraries in $link_args, followed by any external library paths and libraries # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. # The order of the flags is intended to give precedence to the user's flags. $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index f0d7f03..0236e19 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -91,7 +91,7 @@ tf_gen.F90: H5_test_buildiface$(EXEEXT) H5_test_buildiface_SOURCES = H5_test_buildiface.F90 -# The build of the H5_test_buildiface does not depend on any libraries, so set it +# The build of the H5_test_buildiface does not depend on any libraries, so set it # to nothing. H5_test_buildiface_LDADD = diff --git a/fortran/testpar/hyper.f90 b/fortran/testpar/hyper.f90 index c07636f..605d69b 100644 --- a/fortran/testpar/hyper.f90 +++ b/fortran/testpar/hyper.f90 @@ -135,7 +135,7 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors) ! Collective metadata READ API calling requirement CALL h5pset_all_coll_metadata_ops_f(fapl_id, is_coll_true, hdferror) CALL check("h5pset_all_coll_metadata_ops_f", hdferror, nerrors) - + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, hdferror, access_prp = fapl_id) CALL check("h5fcreate_f", hdferror, nerrors) @@ -144,7 +144,7 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors) CALL check("h5pclose_f", hdferror, nerrors) CALL h5fget_access_plist_f(file_id, fapl_id, hdferror) CALL check("h5fget_access_plist_f", hdferror, nerrors) - + ! verify settings for file access properties ! Collective metadata writes diff --git a/fortran/testpar/ptest.f90 b/fortran/testpar/ptest.f90 index 3b07f21..0721244 100644 --- a/fortran/testpar/ptest.f90 +++ b/fortran/testpar/ptest.f90 @@ -18,8 +18,8 @@ PROGRAM parallel_test USE HDF5 USE MPI - USE TH5_MISC - + USE TH5_MISC + IMPLICIT NONE INTEGER :: mpierror ! MPI hdferror flag diff --git a/hl/Makefile.am b/hl/Makefile.am index ded7aa0..0bf8dac 100644 --- a/hl/Makefile.am +++ b/hl/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/hl/c++/Makefile.am b/hl/c++/Makefile.am index f9ea328..6239a4c 100644 --- a/hl/c++/Makefile.am +++ b/hl/c++/Makefile.am @@ -14,7 +14,7 @@ ## Run automake to generate a Makefile.in from this file. # # High-Level API C++ Makefile(.in) -# +# include $(top_srcdir)/config/commence.am diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index 43831f5..4aa231f 100644 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -98,5 +98,5 @@ rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index e6d0cc9..f2eec5d 100644 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -138,5 +138,5 @@ rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/hl/fortran/Makefile.am b/hl/fortran/Makefile.am index 7d24770..801702c 100644 --- a/hl/fortran/Makefile.am +++ b/hl/fortran/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 index 14e2b0c..b31ac8e 100644 --- a/hl/fortran/examples/ex_ds1.f90 +++ b/hl/fortran/examples/ex_ds1.f90 @@ -18,7 +18,7 @@ PROGRAM example_ds IMPLICIT NONE - INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset + INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset INTEGER, PARAMETER :: DIM_DATA = 12 INTEGER, PARAMETER :: DIM1_SIZE = 3 INTEGER, PARAMETER :: DIM2_SIZE = 4 @@ -33,13 +33,13 @@ PROGRAM example_ds INTEGER(hid_t) :: fid ! file ID INTEGER(hid_t) :: did ! dataset ID INTEGER(hid_t) :: dsid ! DS dataset ID - INTEGER :: rankds = 1 ! rank of DS dataset - INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of data dataset - INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! data of data dataset - INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset - INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset - REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! data of DS 1 dataset - REAL, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! data of DS 2 dataset + INTEGER :: rankds = 1 ! rank of DS dataset + INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of data dataset + INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! data of data dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset + REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! data of DS 1 dataset + REAL, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! data of DS 2 dataset INTEGER :: err INTEGER :: num_scales INTEGER(size_t) :: name_len @@ -56,7 +56,7 @@ PROGRAM example_ds ! create a file using default properties CALL H5Fcreate_f("ex_ds1.h5",H5F_ACC_TRUNC_F, fid, err) - ! make a dataset + ! make a dataset CALL H5LTmake_dataset_int_f(fid, DSET_NAME, rank,dims,buf, err) ! make a DS dataset for the first dimension @@ -69,7 +69,7 @@ PROGRAM example_ds ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1 ! and then detach it. !------------------------------------------------------------------------- - + ! get the dataset id for DSET_NAME CALL H5Dopen_f(fid, DSET_NAME, did, err) @@ -82,11 +82,11 @@ PROGRAM example_ds ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1 CALL H5DSattach_scale_f(did, dsid, DIM1, err) - ! Test if dimension Scale Attached + ! Test if dimension Scale Attached CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) WRITE(*,'(/,5X,3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),& 'attached to dimension',DIM1,' ... ',is_attached - + ! Check to see how many Dimension Scales are attached @@ -103,11 +103,11 @@ PROGRAM example_ds CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) WRITE(*,'(/,5X,3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),& 'attached to dimension',DIM1,' ... ',is_attached - + !------------------------------------------------------------------------- ! set the DS_1_NAME dimension scale to DSET_NAME at dimension 1 !------------------------------------------------------------------------- - + WRITE(*,'(/,5A,I0)') & 'Set Dimension Scale "', TRIM(DS_1_NAME), '" to "', TRIM(DSET_NAME), '" at dimension ', DIM1 @@ -123,11 +123,11 @@ PROGRAM example_ds name = '' CALL H5DSget_scale_name_f(dsid, name, name_len, err) - WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) + WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) ! Setting Dimension Scale Label - WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""X"" for dimension ", DIM1 + WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""X"" for dimension ", DIM1 CALL H5DSset_label_f(did, DIM1, "X", err) @@ -139,11 +139,11 @@ PROGRAM example_ds ! close DS id CALL H5Dclose_f(dsid, err) - + !------------------------------------------------------------------------- ! attach the DS_2_NAME dimension scale to DSET_NAME !------------------------------------------------------------------------- - + ! get the DS dataset id CALL H5Dopen_f(fid, DS_2_NAME, dsid, err) @@ -163,7 +163,7 @@ PROGRAM example_ds name = '' CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) - WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) + WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) ! Setting Dimension Scale Label @@ -177,13 +177,13 @@ PROGRAM example_ds label_len = 25 label = '' CALL H5DSget_label_f(did, DIM2, label, label_len, err) - + WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len) ! close DS id CALL H5Dclose_f(dsid, err) - ! close file + ! close file CALL H5Fclose_f(fid, err) END PROGRAM example_ds diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index d7de8e3..86acd27 100644 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -80,5 +80,5 @@ rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index 0bb594d..f99fa4d 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -33,15 +33,15 @@ *------------------------------------------------------------------------- */ int_f -h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) +h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) { char *c_dimname = NULL; int_f ret_value = 0; - + /* * convert FORTRAN name to C name */ - + if(*dimnamelen != 0) if(NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen))) HGOTO_DONE(FAIL) @@ -78,17 +78,17 @@ h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) *------------------------------------------------------------------------- */ int_f -h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) { int_f ret_value = 0; - + /* * call H5DSset_scale function. */ - + if(H5DSattach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) HGOTO_DONE(FAIL) - + done: return ret_value; @@ -111,17 +111,17 @@ h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) *------------------------------------------------------------------------- */ int_f -h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) { int_f ret_value = 0; - + /* * call H5DSset_scale function. */ - + if(H5DSdetach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) HGOTO_DONE(FAIL) - + done: return ret_value; @@ -144,11 +144,11 @@ h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) *------------------------------------------------------------------------- */ int_f -h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) +h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) { int_f ret_value = 0; htri_t c_is_attached; - + /* * call H5DSis_attached function. */ @@ -157,7 +157,7 @@ h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) HGOTO_DONE(FAIL) *is_attached = (int_f)c_is_attached; - + done: return ret_value; @@ -179,20 +179,20 @@ h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) *------------------------------------------------------------------------- */ int_f -h5dsis_scale_c( hid_t_f *did, int_f *is_scale) +h5dsis_scale_c( hid_t_f *did, int_f *is_scale) { int_f ret_value = 0; htri_t c_is_scale; - + /* * call H5DSis_scale function. */ - + if((c_is_scale=H5DSis_scale( (hid_t)*did )) < 0) HGOTO_DONE(FAIL) *is_scale = (int_f)c_is_scale; - + done: return ret_value; @@ -215,15 +215,15 @@ h5dsis_scale_c( hid_t_f *did, int_f *is_scale) *------------------------------------------------------------------------- */ int_f -h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) +h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) { char *c_label = NULL; int_f ret_value = 0; - + /* * convert FORTRAN name to C name */ - + if(NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen))) HGOTO_DONE(FAIL) @@ -258,7 +258,7 @@ h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) *------------------------------------------------------------------------- */ int_f -h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) +h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) { char *c_label = NULL; ssize_t size_c = -1; @@ -273,18 +273,18 @@ h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) /* * call H5DSget_label function. */ - + if( (size_c = H5DSget_label( (hid_t)*did, (unsigned)*idx, c_label, (size_t)*size+1)) < 0) HGOTO_DONE(FAIL) /* * Convert C name to FORTRAN and place it in the given buffer */ - + HD5packFstring(c_label, _fcdtocp(label), (size_t)*size); done: - *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the + *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the * trailing NULL in the length calculation, Ref. HDFFV-7596 */ if(c_label) HDfree(c_label); return ret_value; @@ -307,7 +307,7 @@ done: *------------------------------------------------------------------------- */ int_f -h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) +h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) { char *c_scale_name = NULL; ssize_t size_c = -1; @@ -322,7 +322,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) /* * call H5DSget_scale_name function. */ - + if( (size_c = H5DSget_scale_name( (hid_t)*did, c_scale_name, (size_t)*size+1)) < 0) HGOTO_DONE(FAIL) @@ -354,17 +354,17 @@ done: *------------------------------------------------------------------------- */ int_f -h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) +h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) { int_f ret_value = 0; - + /* * call H5DSset_scale function. */ - + if( (*num_scales = (int_f)H5DSget_num_scales( (hid_t)*did, (unsigned)*idx)) < 0) HGOTO_DONE(FAIL) - + done: return ret_value; diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 031db2c..44a2fee 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -174,9 +174,9 @@ h5ltread_dataset_string_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -h5ltpath_valid_c(hid_t_f *loc_id, - _fcd path, - size_t_f *pathlen, +h5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + size_t_f *pathlen, int_f *check_object_valid_c); /*------------------------------------------------------------------------- @@ -429,7 +429,7 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen2, size_t_f *lenmax, _fcd field_names, - size_t_f *maxlen_out); + size_t_f *maxlen_out); #endif /* _H5LTf90proto_H */ diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 0f8a58f..3597c3a 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -438,7 +438,7 @@ h5ltget_attribute_c(hid_t_f *loc_id, else goto done; } - + if (ret < 0) goto done; @@ -512,7 +512,7 @@ h5ltget_attribute_string_c(hid_t_f *loc_id, /* * Convert C name to FORTRAN and place it in the given buffer */ - HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size); + HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size); ret_value = 0; @@ -893,9 +893,9 @@ done: */ int_f -h5ltpath_valid_c(hid_t_f *loc_id, - _fcd path, - size_t_f *pathlen, +h5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + size_t_f *pathlen, int_f *check_object_valid_c) { htri_t ret = -1; @@ -907,7 +907,7 @@ h5ltpath_valid_c(hid_t_f *loc_id, */ if( NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen))) goto done; - + check_object_valid = FALSE; if(*check_object_valid_c == 1) check_object_valid = TRUE; diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 331f0bc..285cd84 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -142,7 +142,7 @@ int_f h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, - void *fill_data, int_f *compress, + void *fill_data, int_f *compress, size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, @@ -233,7 +233,7 @@ done: /*------------------------------------------------------------------------- * Function: h5tbread_table_c * -* Purpose: Call H5TBread_table using F2003 features +* Purpose: Call H5TBread_table using F2003 features * * Return: Success: 0, Failure: -1 * @@ -261,7 +261,7 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel */ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) HGOTO_DONE(FAIL) - + if(NULL == (c_dst_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) if(NULL == (c_dst_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) @@ -270,7 +270,7 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel for(i = 0; i < c_nfields; i++) { c_dst_offset[i] = (size_t)dst_offset[i]; c_dst_sizes[i] = (size_t)dst_sizes[i]; - } /* end for */ + } /* end for */ /* * call H5TBread_table function. @@ -514,7 +514,7 @@ h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name * call H5TBinsert_field function. */ - if(H5TBinsert_field((hid_t)*loc_id, c_name, c_name1, (hid_t)*field_type, + if(H5TBinsert_field((hid_t)*loc_id, c_name, c_name1, (hid_t)*field_type, (hsize_t)*position, NULL, buf) < 0) HGOTO_DONE(FAIL) @@ -683,7 +683,7 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n if(H5TBget_field_info((hid_t)*loc_id, c_name, c_field_names, c_field_sizes, c_field_offsets, &c_type_size) < 0) HGOTO_DONE(FAIL) - + /* return values */ /* names array */ @@ -709,7 +709,7 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n field_offsets[i] = (size_t_f)c_field_offsets[i]; } /* end for */ - *maxlen_out = (size_t_f)length; + *maxlen_out = (size_t_f)length; done: if(c_name) diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am index 0552aaa..5d1ab2e 100644 --- a/hl/fortran/test/Makefile.am +++ b/hl/fortran/test/Makefile.am @@ -36,7 +36,7 @@ check_PROGRAMS=$(TEST_PROG) LIBOBJS=$(top_builddir)/fortran/test/tf_gen.o -LDADD=$(LIBOBJS) $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) +LDADD=$(LIBOBJS) $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) # Source files for the programs tstds_SOURCES=tstds.F90 diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 057c43b..0fbdab3 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -90,7 +90,7 @@ H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fi * This routine is copied from the fast forward feature branch: features/hdf5_ff * src/H5FF.c:H5DOappend() with the following modifications: * 1) Remove and replace macro calls such as - * FUNC_ENTER_API, H5TRACE, HGOTO_ERROR + * FUNC_ENTER_API, H5TRACE, HGOTO_ERROR * accordingly because hl does not have these macros * 2) Replace H5I_get_type() by H5Iget_type() * 3) Replace H5P_isa_class() by H5Pisa_class() @@ -103,7 +103,7 @@ H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fi *------------------------------------------------------------------------- */ herr_t -H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, +H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t memtype, const void *buf) { hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ @@ -161,7 +161,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, if(H5Sget_simple_extent_dims(space_id, size, NULL) < 0) goto done; - /* Adjust the dimension size of the requested dimension, + /* Adjust the dimension size of the requested dimension, * but first record the old dimension size */ old_size = size[axis]; diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index a4818b8..2a7ed9b 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -44,7 +44,7 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, hsize_t dims[IMAGE8_RANK]; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Initialize the image dimensions */ @@ -104,9 +104,9 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, hsize_t dims[IMAGE24_RANK]; /* check the arguments */ - if (interlace == NULL) + if (interlace == NULL) return -1; - if (dset_name == NULL) + if (dset_name == NULL) return -1; @@ -180,7 +180,7 @@ static herr_t find_palette(hid_t loc_id, int ret = H5_ITER_CONT; /* check the arguments */ - if (name == NULL) + if (name == NULL) return -1; /* Shut compiler up */ @@ -261,9 +261,9 @@ herr_t H5IMget_image_info( hid_t loc_id, int has_attr; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; - if (interlace == NULL) + if (interlace == NULL) return -1; /*assume initially we have no palettes attached*/ @@ -430,7 +430,7 @@ herr_t H5IMread_image( hid_t loc_id, hid_t did; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -483,7 +483,7 @@ herr_t H5IMmake_palette( hid_t loc_id, int has_pal; /* check the arguments */ - if (pal_name == NULL) + if (pal_name == NULL) return -1; /* Check if the dataset already exists */ @@ -548,11 +548,11 @@ herr_t H5IMlink_palette( hid_t loc_id, hsize_t dim_ref; int ok_pal; - + /* check the arguments */ - if (image_name == NULL) + if (image_name == NULL) return -1; - if (pal_name == NULL) + if (pal_name == NULL) return -1; /* The image dataset may or may not have the attribute "PALETTE" @@ -717,9 +717,9 @@ herr_t H5IMunlink_palette( hid_t loc_id, int ok_pal, has_pal; /* check the arguments */ - if(image_name == NULL) + if(image_name == NULL) return -1; - if(pal_name == NULL) + if(pal_name == NULL) return -1; /* Try to find the palette dataset */ @@ -818,7 +818,7 @@ herr_t H5IMget_npalettes( hid_t loc_id, int has_pal; /* check the arguments */ - if(image_name == NULL) + if(image_name == NULL) return -1; /*assume initially we have no palettes attached*/ @@ -916,7 +916,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, hsize_t pal_maxdims[2]; /* check the arguments */ - if (image_name == NULL) + if (image_name == NULL) return -1; /* Open the dataset. */ @@ -1030,9 +1030,9 @@ herr_t H5IMget_palette( hid_t loc_id, hid_t pal_id; /* check the arguments */ - if (image_name == NULL) + if (image_name == NULL) return -1; - if (pal_data == NULL) + if (pal_data == NULL) return -1; @@ -1133,7 +1133,7 @@ herr_t H5IMis_image( hid_t loc_id, herr_t ret; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Assume initially fail condition */ @@ -1237,7 +1237,7 @@ herr_t H5IMis_palette( hid_t loc_id, herr_t ret; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Assume initially fail condition */ diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 1669a30..3106ea8 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -209,7 +209,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[]/*OUT*/, hid_t par_tid) valid = FALSE; end_of_fields = TRUE; break; - + case '\\': /* escape character */ ++fields_ptr; /* skip it */ if(*fields_ptr == '\0') @@ -241,7 +241,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[]/*OUT*/, hid_t par_tid) gotcomma = TRUE; break; - default: + default: *cur++ = *fields_ptr++; gotmember = TRUE; break; @@ -438,7 +438,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims /* Get dataset's dataspace */ if((sid = H5Dget_space(did)) < 0) goto done; - + /* Get the number of dimensions */ if((ndims = H5Sget_simple_extent_ndims(sid)) < 0) goto done; @@ -508,7 +508,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims /* Get the total size of the dataset's datatypes */ if(0 == (tot_tsize = H5LD_get_dset_type_size(did, NULL))) goto done; - + /* Allocate memory for reading in the elements in the dataset selection */ if(NULL == (sav_buf = tmp_buf = (char *)HDcalloc((size_t)num_elmts, tot_tsize))) goto done; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 3f6c538..d63776d 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -29,19 +29,19 @@ char *myinput; size_t indent = 0; -/* File Image operations - - A file image is a representation of an HDF5 file in a memory - buffer. In order to perform operations on an image in a similar way +/* File Image operations + + A file image is a representation of an HDF5 file in a memory + buffer. In order to perform operations on an image in a similar way to a file, the application buffer is copied to a FAPL buffer, which - in turn is copied to a VFD buffer. Buffer copying can decrease - performance, especially when using large file images. A solution to - this issue is to simulate the copying of the application buffer, - when actually the same buffer is used for the FAPL and the VFD. - This is implemented by using callbacks that simulate the standard - functions for memory management (additional callbacks are used for - the management of associated data structures). From the application - standpoint, a file handle can be obtained from a file image by using + in turn is copied to a VFD buffer. Buffer copying can decrease + performance, especially when using large file images. A solution to + this issue is to simulate the copying of the application buffer, + when actually the same buffer is used for the FAPL and the VFD. + This is implemented by using callbacks that simulate the standard + functions for memory management (additional callbacks are used for + the management of associated data structures). From the application + standpoint, a file handle can be obtained from a file image by using the API routine H5LTopen_file_image(). This function takes a flag argument that indicates the HDF5 library how to handle the given image; several flag values can be combined by using the bitwise OR operator. @@ -61,9 +61,9 @@ size_t indent = 0; well. The application is responsible to release the image buffer. */ -/* Data structure to pass application data to callbacks. */ +/* Data structure to pass application data to callbacks. */ typedef struct { - void *app_image_ptr; /* Pointer to application buffer */ + void *app_image_ptr; /* Pointer to application buffer */ size_t app_image_size; /* Size of application buffer */ void *fapl_image_ptr; /* Pointer to FAPL buffer */ size_t fapl_image_size; /* Size of FAPL buffer */ @@ -88,17 +88,17 @@ static herr_t udata_free(void *udata); /*------------------------------------------------------------------------- -* Function: image_malloc +* Function: image_malloc * * Purpose: Simulates malloc() function to avoid copying file images. * The application buffer is set to the buffer on only one FAPL. * Then the FAPL buffer can be copied to other FAPL buffers or -* to only one VFD buffer. +* to only one VFD buffer. * * Return: Address of "allocated" buffer, if successful. Otherwise, it returns * NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -109,23 +109,23 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) { H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; void * return_value = NULL; - + /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch ( file_image_op ) { /* the app buffer is "copied" to only one FAPL. Afterwards, FAPLs can be "copied" */ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: - if (udata->app_image_ptr == NULL) + if (udata->app_image_ptr == NULL) goto out; - if (udata->app_image_size != size) + if (udata->app_image_size != size) goto out; - if (udata->fapl_image_ptr != NULL) + if (udata->fapl_image_ptr != NULL) goto out; - if (udata->fapl_image_size != 0) + if (udata->fapl_image_size != 0) goto out; - if (udata->fapl_ref_count != 0) + if (udata->fapl_ref_count != 0) goto out; udata->fapl_image_ptr = udata->app_image_ptr; @@ -135,11 +135,11 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) break; case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: - if (udata->fapl_image_ptr == NULL) + if (udata->fapl_image_ptr == NULL) goto out; - if (udata->fapl_image_size != size) + if (udata->fapl_image_size != size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; return_value = udata->fapl_image_ptr; @@ -151,17 +151,17 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) case H5FD_FILE_IMAGE_OP_FILE_OPEN: /* FAPL buffer is "copied" to only one VFD buffer */ - if (udata->vfd_image_ptr != NULL) + if (udata->vfd_image_ptr != NULL) goto out; - if (udata->vfd_image_size != 0) + if (udata->vfd_image_size != 0) goto out; - if (udata->vfd_ref_count != 0) + if (udata->vfd_ref_count != 0) goto out; - if (udata->fapl_image_ptr == NULL) + if (udata->fapl_image_ptr == NULL) goto out; - if (udata->fapl_image_size != size) + if (udata->fapl_image_size != size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; udata->vfd_image_ptr = udata->fapl_image_ptr; @@ -189,15 +189,15 @@ out: /*------------------------------------------------------------------------- * Function: image_memcpy * -* Purpose: Simulates memcpy() function to avoid copying file images. +* Purpose: Simulates memcpy() function to avoid copying file images. * The image buffer can be set to only one FAPL buffer, and * "copied" to only one VFD buffer. The FAPL buffer can be -* "copied" to other FAPLs buffers. +* "copied" to other FAPLs buffers. * * Return: The address of the destination buffer, if successful. Otherwise, it * returns NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -210,31 +210,31 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch(file_image_op) { case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: - if (dest != udata->fapl_image_ptr) + if (dest != udata->fapl_image_ptr) goto out; - if (src != udata->app_image_ptr) + if (src != udata->app_image_ptr) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (size != udata->app_image_size) + if (size != udata->app_image_size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; break; case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: - if (dest != udata->fapl_image_ptr) + if (dest != udata->fapl_image_ptr) goto out; - if (src != udata->fapl_image_ptr) + if (src != udata->fapl_image_ptr) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (udata->fapl_ref_count < 2) + if (udata->fapl_ref_count < 2) goto out; break; @@ -242,17 +242,17 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file goto out; case H5FD_FILE_IMAGE_OP_FILE_OPEN: - if (dest != udata->vfd_image_ptr) + if (dest != udata->vfd_image_ptr) goto out; - if (src != udata->fapl_image_ptr) + if (src != udata->fapl_image_ptr) goto out; - if (size != udata->vfd_image_size) + if (size != udata->vfd_image_size) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; break; @@ -273,15 +273,15 @@ out: /*------------------------------------------------------------------------- -* Function: image_realloc +* Function: image_realloc * * Purpose: Reallocates the shared application image buffer and updates data -* structures that manage buffer "copying". -* +* structures that manage buffer "copying". +* * Return: Address of reallocated buffer, if successful. Otherwise, it returns -* NULL. +* NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -294,29 +294,29 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void * void * return_value = NULL; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - /* realloc() is not allowed when the HDF5 library won't release the image + /* realloc() is not allowed when the HDF5 library won't release the image buffer because reallocation may change the address of the buffer. The new address cannot be communicated to the application to release it. */ - if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE) - goto out; + if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE) + goto out; /* realloc() is not allowed if the image is open in read-only mode */ - if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW)) - goto out; + if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW)) + goto out; if (file_image_op == H5FD_FILE_IMAGE_OP_FILE_RESIZE) { - if (udata->vfd_image_ptr != ptr) - goto out; + if (udata->vfd_image_ptr != ptr) + goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size))) - goto out; - + goto out; + udata->vfd_image_size = size; return_value = udata->vfd_image_ptr; } /* end if */ @@ -337,9 +337,9 @@ out: * reference counters. Shared application buffer is actually * deallocated if there are no outstanding references. * -* Return: SUCCEED or FAIL +* Return: SUCCEED or FAIL * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -351,19 +351,19 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch(file_image_op) { case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: - if (udata->fapl_image_ptr != ptr) + if (udata->fapl_image_ptr != ptr) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; udata->fapl_ref_count--; - /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { HDfree(udata->fapl_image_ptr); @@ -374,14 +374,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) break; case H5FD_FILE_IMAGE_OP_FILE_CLOSE: - if (udata->vfd_image_ptr != ptr) + if (udata->vfd_image_ptr != ptr) goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; udata->vfd_ref_count--; - /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { HDfree(udata->vfd_image_ptr); @@ -410,7 +410,7 @@ out: /*------------------------------------------------------------------------- -* Function: udata_copy +* Function: udata_copy * * Purpose: Simulates the copying of the user data structure utilized in the * management of the "copying" of file images. @@ -418,7 +418,7 @@ out: * Return: Address of "newly allocated" structure, if successful. Otherwise, it * returns NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -430,9 +430,9 @@ udata_copy(void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - if (udata->ref_count == 0) + if (udata->ref_count == 0) goto out; udata->ref_count++; @@ -449,11 +449,11 @@ out: * * Purpose: Simulates deallocation of the user data structure utilized in the * management of the "copying" of file images. The data structure is -* actually deallocated when there are no outstanding references. +* actually deallocated when there are no outstanding references. * -* Return: SUCCEED or FAIL +* Return: SUCCEED or FAIL * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -465,9 +465,9 @@ udata_free(void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - if (udata->ref_count == 0) + if (udata->ref_count == 0) goto out; udata->ref_count--; @@ -479,7 +479,7 @@ udata_free(void *_udata) return(SUCCEED); -out: +out: return(FAIL); } /* end udata_free */ @@ -522,7 +522,7 @@ H5LT_make_dataset_numerical( hid_t loc_id, hid_t did = -1, sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Create the data space for the dataset. */ @@ -801,7 +801,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, size_t size; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* create a string data type */ @@ -852,11 +852,11 @@ out: /*------------------------------------------------------------------------- * Function: H5LTopen_file_image * -* Purpose: Open a user supplied file image using the core file driver. +* Purpose: Open a user supplied file image using the core file driver. * * Return: File identifier, Failure: -1 * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -871,22 +871,22 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) size_t min_incr = 65536; /* Minimum buffer increment */ double buf_prcnt = 0.1f; /* Percentage of buffer size to set as increment */ - static long file_name_counter; - H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, - &image_realloc, &image_free, - &udata_copy, &udata_free, + static long file_name_counter; + H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, + &image_realloc, &image_free, + &udata_copy, &udata_free, (void *)NULL}; /* check arguments */ - if (buf_ptr == NULL) + if (buf_ptr == NULL) goto out; - if (buf_size == 0) + if (buf_size == 0) goto out; if (flags & (unsigned)~(H5LT_FILE_IMAGE_ALL)) goto out; /* Create FAPL to transmit file image */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto out; /* set allocation increment to a percentage of the supplied buffer size, or @@ -898,7 +898,7 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) alloc_incr = min_incr; /* Configure FAPL to use the core file driver */ - if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) + if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) goto out; /* Set callbacks for file image ops ONLY if the file image is NOT copied */ @@ -932,10 +932,10 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) } /* end if */ /* Assign file image in user buffer to FAPL */ - if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0) + if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0) goto out; - /* set file open flags */ + /* set file open flags */ if (flags & H5LT_FILE_IMAGE_OPEN_RW) file_open_flags = H5F_ACC_RDWR; else @@ -943,17 +943,17 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) /* define a unique file name */ HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); - - /* Assign file image in FAPL to the core file driver */ - if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) + + /* Assign file image in FAPL to the core file driver */ + if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) goto out; /* Close FAPL */ - if (H5Pclose(fapl) < 0) + if (H5Pclose(fapl) < 0) goto out; - /* Return file identifier */ - return file_id; + /* Return file identifier */ + return file_id; out: H5E_BEGIN_TRY { @@ -983,7 +983,7 @@ H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void hid_t did; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1178,7 +1178,7 @@ herr_t H5LTread_dataset_string( hid_t loc_id, hid_t tid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1231,7 +1231,7 @@ herr_t H5LTget_dataset_ndims( hid_t loc_id, hid_t sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1291,7 +1291,7 @@ herr_t H5LTget_dataset_info( hid_t loc_id, hid_t sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* open the dataset. */ @@ -1368,9 +1368,9 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ int ret = 0; /* check the arguments */ - if (name == NULL) + if (name == NULL) return ret; - + /* Shut the compiler up */ loc_id = loc_id; linfo = linfo; @@ -1414,7 +1414,6 @@ H5LTfind_dataset( hid_t loc_id, const char *dset_name ) return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name); } - /*------------------------------------------------------------------------- * * Set attribute functions @@ -1455,11 +1454,11 @@ herr_t H5LTset_attribute_string( hid_t loc_id, size_t attr_size; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; - if (attr_data == NULL) + if (attr_data == NULL) return -1; /* Open the object */ @@ -1552,9 +1551,9 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id, int has_attr; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -1969,7 +1968,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, int ret = H5_ITER_CONT; /* check the arguments */ - if (name == NULL) + if (name == NULL) return H5_ITER_CONT; /* Shut compiler up */ @@ -2041,7 +2040,6 @@ H5LT_find_attribute( hid_t loc_id, const char* attr_name ) } - /*------------------------------------------------------------------------- * Function: H5LTget_attribute_ndims * @@ -2066,9 +2064,9 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -2139,9 +2137,9 @@ herr_t H5LTget_attribute_info( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -2220,7 +2218,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) hid_t type_id; /* check the arguments */ - if (text == NULL) + if (text == NULL) return -1; if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG) @@ -2263,7 +2261,7 @@ out: * *------------------------------------------------------------------------- */ -static char* +static char* realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str_to_add) { size_t size_str_to_add, size_str; @@ -2288,7 +2286,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str /* find the size of the current buffer */ size_str = HDstrlen(buf); - /* Check to make sure the appended string does not + /* Check to make sure the appended string does not * extend past the allocated buffer; if it does then truncate the string */ if(size_str < *len - 1) { @@ -2545,7 +2543,7 @@ char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *sl if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, NULL))) goto out; - + if(lang != H5LT_DDL) { HDsnprintf(dt_str, *slen, "only DDL is supported for now"); goto out; @@ -3112,9 +3110,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -3122,9 +3120,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id, return -1; /* Get the attribute */ - if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) + if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) { - H5Oclose(obj_id); + H5Oclose(obj_id); return -1; } @@ -3538,9 +3536,9 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, hid_t attr_id = -1; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -3780,7 +3778,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) ret_value = FALSE; goto done; } - + /* Determine if link resolves to an actual object */ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { ret_value = FAIL; diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 47be98a..6df7c4b 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -20,7 +20,7 @@ /* user supplied image buffer. The same image is open with the core driver. */ #define H5LT_FILE_IMAGE_DONT_RELEASE 0x0004 /* The HDF5 lib won't */ /* deallocate user supplied image buffer. The user application is reponsible */ -/* for doing so. */ +/* for doing so. */ #define H5LT_FILE_IMAGE_ALL 0x0007 typedef enum H5LT_lang_t { diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index a4bcbd4..c54c41f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -102,7 +102,7 @@ herr_t H5TBmake_table(const char *table_title, if (field_names == NULL) { goto out; } - + dims[0] = nrecords; dims_chunk[0] = chunk_size; @@ -300,7 +300,7 @@ herr_t H5TBappend_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the original number of records and fields */ @@ -374,7 +374,7 @@ herr_t H5TBwrite_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -477,9 +477,9 @@ herr_t H5TBwrite_fields_name(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_names == NULL) + if (field_names == NULL) goto out; /* create xfer properties to preserve initialized data */ @@ -640,7 +640,7 @@ herr_t H5TBwrite_fields_index(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* create xfer properties to preserve initialized data */ @@ -801,7 +801,7 @@ herr_t H5TBread_table(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -878,7 +878,7 @@ herr_t H5TBread_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the number of records and fields */ @@ -959,9 +959,9 @@ herr_t H5TBread_fields_name(hid_t loc_id, /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_names == NULL) + if (field_names == NULL) goto out; /* open the dataset */ @@ -1029,7 +1029,7 @@ herr_t H5TBread_fields_name(hid_t loc_id, /* check to make sure field was found, no reason to continue if it does not exist */ if(j == 0) goto out; - + /* get the dataspace handle */ if((sid = H5Dget_space(did)) < 0) goto out; @@ -1121,7 +1121,7 @@ herr_t H5TBread_fields_index(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -1281,9 +1281,9 @@ herr_t H5TBdelete_record(hid_t loc_id, unsigned char *tmp_buf = NULL; herr_t ret_val = -1; - + /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /*------------------------------------------------------------------------- @@ -1446,7 +1446,7 @@ herr_t H5TBinsert_record(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /*------------------------------------------------------------------------- @@ -1601,9 +1601,9 @@ herr_t H5TBadd_records_from(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name1 == NULL) + if (dset_name1 == NULL) goto out; - if (dset_name2 == NULL) + if (dset_name2 == NULL) goto out; /*------------------------------------------------------------------------- @@ -1754,11 +1754,11 @@ herr_t H5TBcombine_tables(hid_t loc_id1, herr_t ret_val = -1; /* check the arguments */ - if (dset_name1 == NULL) + if (dset_name1 == NULL) goto out; - if (dset_name2 == NULL) + if (dset_name2 == NULL) goto out; - if (dset_name3 == NULL) + if (dset_name3 == NULL) goto out; /*------------------------------------------------------------------------- @@ -2117,9 +2117,9 @@ herr_t H5TBinsert_field(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_name == NULL) + if (field_name == NULL) goto out; /* get the number of records and fields */ @@ -2532,9 +2532,9 @@ herr_t H5TBdelete_field(hid_t loc_id, /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_name == NULL) + if (field_name == NULL) goto out; /* get the number of records and fields */ @@ -2982,7 +2982,7 @@ htri_t H5TBAget_fill(hid_t loc_id, htri_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the number of records and fields */ @@ -3014,7 +3014,7 @@ htri_t H5TBAget_fill(hid_t loc_id, out: if(src_offset) HDfree(src_offset); - + return ret_val; } /* end H5TBAget_fill() */ @@ -3054,7 +3054,7 @@ herr_t H5TBget_table_info(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -3145,7 +3145,7 @@ herr_t H5TBget_field_info(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -3253,9 +3253,9 @@ hbool_t H5TB_find_field(const char *field, const char *field_list) const char *end; /* check the arguments */ - if (field == NULL) + if (field == NULL) return FALSE; - if (field_list == NULL) + if (field_list == NULL) return FALSE; while((end = HDstrstr(start, ",")) != 0) { diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c index d717a47..981aded 100644 --- a/hl/test/gen_test_ld.c +++ b/hl/test/gen_test_ld.c @@ -13,23 +13,23 @@ #include "H5LDprivate.h" /* - * WATCH.h5: file with various types of datasets for testing-- + * WATCH.h5: file with various types of datasets for testing-- * - * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: - * DSET_ONE: one-dimensional dataset - * DSET_TWO: two-dimensional dataset - * DSET_CMPD: one-dimensional dataset with compound type + * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: + * DSET_ONE: one-dimensional dataset + * DSET_TWO: two-dimensional dataset + * DSET_CMPD: one-dimensional dataset with compound type * DSET_CMPD_ESC: one-dimensional dataset with compound type and member names with - * escape/separator characters - * DSET_CMPD_TWO: two-dimensional dataset with compound type - * - * The following datasets are one-dimensional, chunked, max. dimension setting: - * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY - * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE - * - * The following datasets are one-dimensional: - * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE - * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR + * escape/separator characters + * DSET_CMPD_TWO: two-dimensional dataset with compound type + * + * The following datasets are one-dimensional, chunked, max. dimension setting: + * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY + * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE + * + * The following datasets are one-dimensional: + * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE + * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR */ #define ONE_DIMS0 10 #define MAX_ONE_DIMS0 100 diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am index 9ffde58..9de2135 100644 --- a/hl/tools/gif2h5/Makefile.am +++ b/hl/tools/gif2h5/Makefile.am @@ -29,9 +29,9 @@ bin_PROGRAMS=gif2h5 h52gif h52gif_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) gif2h5_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c +gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c -h52gif_SOURCES=hdf2gif.c hdfgifwr.c +h52gif_SOURCES=hdf2gif.c hdfgifwr.c # Programs all depend on the hdf5 library, the tools library, and the HL @@ -42,7 +42,7 @@ if BUILD_TESTS_CONDITIONAL TEST_SCRIPT=h52giftest.sh check_SCRIPTS=$(TEST_SCRIPT) noinst_PROGRAMS=h52gifgentst - h52gifgentst_SOURCES=h52gifgentst.c + h52gifgentst_SOURCES=h52gifgentst.c endif CHECK_CLEANFILES+=*.h5 diff --git a/hl/tools/gif2h5/h52giftest.sh.in b/hl/tools/gif2h5/h52giftest.sh.in index 5643e30..02c9e89 100644 --- a/hl/tools/gif2h5/h52giftest.sh.in +++ b/hl/tools/gif2h5/h52giftest.sh.in @@ -70,20 +70,20 @@ echo "" # Positive tests for h52gif echo "**validate the h52gif tool processes input correctly..." -TESTING "./h52gif h52giftst.h5 image1.gif -i image" +TESTING "./h52gif h52giftst.h5 image1.gif -i image" TOOLTEST ./h52gif $TESTFILE1 image1.gif -i image echo "" # Negative tests. echo "**verify that the h52gif tool handles error conditions correctly..." # nonexisting dataset name -TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image" -TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image" +TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image" +TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image" # this test should have failed but it did not. Comment it out for now. -#TESTING "./h52gif h52giftst.h5 image.gif -i palette" -#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette" -TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel" -TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel" +#TESTING "./h52gif h52giftst.h5 image.gif -i palette" +#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette" +TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel" +TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel" echo "" # all done. summarize results. diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 4dcf25e..6b59ea1 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -66,7 +66,7 @@ typedef struct set_t { * * Extending a two-dimensional dataset by action1 and action2. * --action1 and action2 can be a positive # or negative # or 0. - * + * *********************************************************************** */ static herr_t @@ -399,12 +399,12 @@ main(int argc, const char *argv[]) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_ONE) || - !HDstrcmp(dname, DSET_ALLOC_LATE) || + } else if(!HDstrcmp(dname, DSET_ONE) || + !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) { if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_TWO) || + } else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { if(extend_dset_two(fname, dname, action1, action2) < 0) goto error; diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 18e15fc..19c9876 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -15,23 +15,23 @@ #include "H5HLprivate2.h" /* - * WATCH.h5: file with various types of datasets for testing-- + * WATCH.h5: file with various types of datasets for testing-- * - * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: - * DSET_ONE: one-dimensional dataset - * DSET_TWO: two-dimensional dataset - * DSET_CMPD: one-dimensional dataset with compound type + * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: + * DSET_ONE: one-dimensional dataset + * DSET_TWO: two-dimensional dataset + * DSET_CMPD: one-dimensional dataset with compound type * DSET_CMPD_ESC: one-dimensional dataset with compound type and member names with - * escape/separator characters - * DSET_CMPD_TWO: two-dimensional dataset with compound type - * - * The following datasets are one-dimensional, chunked, max. dimension setting: - * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY - * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE - * - * The following datasets are one-dimensional: - * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE - * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR + * escape/separator characters + * DSET_CMPD_TWO: two-dimensional dataset with compound type + * + * The following datasets are one-dimensional, chunked, max. dimension setting: + * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY + * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE + * + * The following datasets are one-dimensional: + * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE + * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR */ #define ONE_DIMS0 10 #define MAX_ONE_DIMS0 100 diff --git a/hl/tools/h5watch/swmr_check_compat_vfd.c b/hl/tools/h5watch/swmr_check_compat_vfd.c index 26f76cb..608f4a8 100644 --- a/hl/tools/h5watch/swmr_check_compat_vfd.c +++ b/hl/tools/h5watch/swmr_check_compat_vfd.c @@ -13,7 +13,7 @@ /* Purpose: This is a small program that checks if the HDF5_DRIVER * environment variable is set to a value that supports SWMR. - * + * * It is intended for use in shell scripts. */ diff --git a/java/Makefile.am b/java/Makefile.am index 51398f2..4426e3e 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am index 8ca49f2..054407c 100644 --- a/java/examples/Makefile.am +++ b/java/examples/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am index b442603..c5b8a5d 100644 --- a/java/examples/datasets/Makefile.am +++ b/java/examples/datasets/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datasets.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_D_Alloc.java \ diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am index 5e0e971..f695528 100644 --- a/java/examples/datatypes/Makefile.am +++ b/java/examples/datatypes/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datatypes.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_T_Array.java \ diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am index 09df743..d5824e8 100644 --- a/java/examples/groups/Makefile.am +++ b/java/examples/groups/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)groups.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_G_Create.java \ diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am index 33f44c2..8c3716a 100644 --- a/java/examples/intro/Makefile.am +++ b/java/examples/intro/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)intro.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5_CreateAttribute.java \ diff --git a/java/src/Makefile.am b/java/src/Makefile.am index b7ad4bd..0df48bd 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 3f11933..46e6a7e 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)test.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ TestH5.java \ diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index 7e81a52..f0c6d68 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -11,12 +11,12 @@ ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! This file contains all the configure test programs +! This file contains all the configure test programs ! used by autotools and cmake. This avoids having to ! duplicate code for both cmake and autotool tests. ! For autotools, a program below is chosen via a ! sed command in aclocal_fc.m4. For cmake, a program -! below is chosen via the macro READ_SOURCE in +! below is chosen via the macro READ_SOURCE in ! HDF5UseFortran.cmake ! @@ -88,7 +88,7 @@ PROGRAM FC_AVAIL_KINDS INTEGER, DIMENSION(1:10) :: list_ikinds = -1 INTEGER, DIMENSION(1:10) :: list_rkinds = -1 LOGICAL :: new_kind - + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') ! Find integer KINDs @@ -157,6 +157,6 @@ END PROGRAM FC_AVAIL_KINDS PROGRAM FC_MPI_CHECK INCLUDE 'mpif.h' INTEGER :: comm, amode, info, fh, ierror - CHARACTER(LEN=1) :: filename + CHARACTER(LEN=1) :: filename CALL MPI_File_open( comm, filename, amode, info, fh, ierror) END PROGRAM FC_MPI_CHECK diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index ab45bbc..950d457 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -30,7 +30,7 @@ dnl fortran compilers for use with AC_PROG_FC that is more suitable for HPC dnl software packages AC_DEFUN([PAC_FC_SEARCH_LIST], [gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc]) -dnl +dnl dnl PAC_PROG_FC([COMPILERS]) dnl dnl COMPILERS is a space separated list of Fortran compilers to search for. @@ -54,10 +54,10 @@ dnl ifc - An older Intel compiler dnl fc - A compiler on some unknown system. This has been removed because dnl it may also be the name of a command for something other than dnl the Fortran compiler (e.g., fc=file system check!) -dnl gfortran - The GNU Fortran compiler (not the same as g95) +dnl gfortran - The GNU Fortran compiler (not the same as g95) dnl gfc - An alias for gfortran recommended in cygwin installations dnl NOTE: this macro suffers from a basically intractable "expanded before it -dnl was required" problem when libtool is also used +dnl was required" problem when libtool is also used dnl [1] MPICH.org dnl @@ -66,7 +66,7 @@ dnl See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" AC_DEFUN([PAC_PROG_FC_ISO_FORTRAN_ENV],[ HAVE_ISO_FORTRAN_ENV="no" AC_MSG_CHECKING([if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV]) - TEST_SRC="`sed -n '/PROGRAM PROG_FC_ISO_FORTRAN_ENV/,/END PROGRAM PROG_FC_ISO_FORTRAN_ENV/p' $srcdir/m4/aclocal_fc.f90`" + TEST_SRC="`sed -n '/PROGRAM PROG_FC_ISO_FORTRAN_ENV/,/END PROGRAM PROG_FC_ISO_FORTRAN_ENV/p' $srcdir/m4/aclocal_fc.f90`" AC_LINK_IFELSE([$TEST_SRC],[AC_MSG_RESULT([yes]) HAVE_ISO_FORTRAN_ENV="yes"], [AC_MSG_RESULT([no])]) @@ -122,11 +122,11 @@ dnl Check if C_LONG_DOUBLE is different from C_DOUBLE if test "X$FORTRAN_HAVE_C_LONG_DOUBLE" = "Xyes"; then AC_DEFUN([PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE],[ - C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) TEST_SRC="`sed -n '/MODULE type_mod/,/END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE/p' $srcdir/m4/aclocal_fc.f90`" - AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) - C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], [AC_MSG_RESULT([no])]) ]) fi @@ -138,8 +138,8 @@ AC_DEFUN([PAC_PROG_FC_HAVE_F2003_REQUIREMENTS],[ HAVE_F2003_REQUIREMENTS="no" AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF]) TEST_SRC="`sed -n '/PROG_FC_HAVE_F2003_REQUIREMENTS/,/END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS/p' $srcdir/m4/aclocal_fc.f90`" - AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) - HAVE_F2003_REQUIREMENTS="yes"], + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + HAVE_F2003_REQUIREMENTS="yes"], [AC_MSG_RESULT([no])]) ]) @@ -262,7 +262,7 @@ TEST_SRC="`sed -n '/PROGRAM FC_AVAIL_KINDS/,/END PROGRAM FC_AVAIL_KINDS/p' $srcd AC_RUN_IFELSE([$TEST_SRC], [ if test -s pac_fconftest.out ; then - + dnl The output from the above program will be: dnl -- LINE 1 -- valid integer kinds (comma seperated list) dnl -- LINE 2 -- valid real kinds (comma seperated list) @@ -453,7 +453,7 @@ rm -f pac_Cconftest.out #define C_FLT128_DIG 0 #endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define C_LDBL_DIG DECIMAL_DIG + #define C_LDBL_DIG DECIMAL_DIG #else #define C_LDBL_DIG LDBL_DIG #endif @@ -465,7 +465,7 @@ rm -f pac_Cconftest.out ]) AC_RUN_IFELSE([],[ if test -s pac_Cconftest.out ; then - LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else AC_MSG_ERROR([No output from C decimal precision program!]) @@ -138,8 +138,8 @@ H5_init_library(void) if (mpi_initialized && !mpi_finalized) { int key_val; - if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, - (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, + (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, &key_val, NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) @@ -209,7 +209,7 @@ H5_init_library(void) * The link interface needs to be initialized so that link property lists * have their properties registered. * The FS module needs to be initialized as a result of the fix for HDFFV-10160: - * It might not be initialized during normal file open. + * It might not be initialized during normal file open. * When the application does not close the file, routines in the module might * be called via H5_term_library() when shutting down the file. */ @@ -743,7 +743,7 @@ H5_debug_mask(const char *s) /*------------------------------------------------------------------------- * Function: H5_mpi_delete_cb * - * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 + * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. * * Return: MPI_SUCCESS @@ -989,7 +989,7 @@ H5close(void) * Return: * * Success: A pointer to the allocated buffer. - * + * * Failure: NULL * *------------------------------------------------------------------------- @@ -1030,7 +1030,7 @@ H5allocate_memory(size_t size, hbool_t clear) * Return: * * Success: A pointer to the resized buffer. - * + * * Failure: NULL (the input buffer will be unchanged) * *------------------------------------------------------------------------- @@ -1091,7 +1091,7 @@ H5is_library_threadsafe(hbool_t *is_ts) H5TRACE1("e", "*b", is_ts); HDassert(is_ts); - + /* At this time, it is impossible for this to fail. */ #ifdef H5_HAVE_THREADSAFE *is_ts = TRUE; @@ -439,7 +439,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { void *attr = NULL; /* attr object from VOL connector */ H5VL_object_t *vol_obj = NULL; /* object of loc_id */ - H5VL_loc_params_t loc_params; + H5VL_loc_params_t loc_params; hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) @@ -228,10 +228,10 @@ H5AC_term_package(void) * * Function: H5AC_cache_image_pending() * - * Purpose: Debugging function that tests to see if the load of a + * Purpose: Debugging function that tests to see if the load of a * metadata cache image load is pending (i.e. will be executed * on the next protect or insert) - * + * * Returns TRUE if a cache image load is pending, and FALSE * if not. Throws an assertion failure on error. * @@ -421,8 +421,8 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "auto resize configuration failed") /* Don't need to get the current H5C image config here since the - * cache has just been created, and thus f->shared->cache->image_ctl - * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). + * cache has just been created, and thus f->shared->cache->image_ctl + * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). * Note that this not true as soon as control returns to the application * program, as some test code modifies f->shared->cache->image_ctl. */ @@ -517,10 +517,10 @@ H5AC_dest(H5F_t *f) /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - /* If the file was opened R/W, attempt to flush all entries + /* If the file was opened R/W, attempt to flush all entries * from rank 0 & Bcast clean list to other ranks. * - * Must not flush in the R/O case, as this will trigger the + * Must not flush in the R/O case, as this will trigger the * free space manager settle routines. */ if(H5F_ACC_RDWR & H5F_INTENT(f)) @@ -1963,10 +1963,10 @@ done: * and flag an error and return FAIL otherwise. * * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an + * from the instance of H5AC_cache_image_config_t into an * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when - * H5AC_cache_image_config_t and H5C_cache_image_ctl_t + * H5C_validate_cache_image_config(). If and when + * H5AC_cache_image_config_t and H5C_cache_image_ctl_t * diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure @@ -1992,7 +1992,7 @@ H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown image config version") /* don't need to get the current H5C image config here since the - * default values of fields not in the H5AC config will always be + * default values of fields not in the H5AC config will always be * valid. */ internal_config.version = config_ptr->version; @@ -2132,11 +2132,11 @@ done: /*------------------------------------------------------------------------------ * Function: H5AC_ignore_tags() * - * Purpose: Override all assertion frameworks and force application of + * Purpose: Override all assertion frameworks and force application of * global tag everywhere. This should really only be used in the - * tests that need to access functions without going through + * tests that need to access functions without going through * API paths. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2159,7 +2159,7 @@ H5AC_ignore_tags(const H5F_t *f) /* Set up a new metadata tag */ if(H5C_ignore_tags(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_ignore_tags() */ @@ -2169,7 +2169,7 @@ done: * Function: H5AC_tag() * * Purpose: Sets the metadata tag property in the provided property list. - * + * * Return: void * * Programmer: Mike McGreevy @@ -2197,9 +2197,9 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) * Function: H5AC_retag_copied_metadata() * * Purpose: Searches through cache index for all entries with the - * H5AC__COPIED_TAG, indicating that it was created as a + * H5AC__COPIED_TAG, indicating that it was created as a * result of an object copy, and applies the provided tag. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2208,7 +2208,7 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) *------------------------------------------------------------------------------ */ herr_t -H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) +H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2217,7 +2217,7 @@ H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) /* Sanity checks */ HDassert(f); HDassert(f->shared); - + /* Call cache-level function to re-tag entries with the COPIED tag */ if(H5C_retag_entries(f->shared->cache, H5AC__COPIED_TAG, metadata_tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "Can't retag metadata") @@ -2231,8 +2231,8 @@ done: * Function: H5AC_flush_tagged_metadata() * * Purpose: Wrapper for cache level function which flushes all metadata - * that contains the specific tag. - * + * that contains the specific tag. + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2245,8 +2245,8 @@ H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2266,8 +2266,8 @@ done: * Function: H5AC_evict_tagged_metadata() * * Purpose: Wrapper for cache level function which flushes all metadata - * that contains the specific tag. - * + * that contains the specific tag. + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2280,8 +2280,8 @@ H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2302,7 +2302,7 @@ done: * * Purpose: Wrapper for cache level function which expunge entries with * a specific tag and type id. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Vailin Choi; May 2016 @@ -2314,8 +2314,8 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flag { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2335,7 +2335,7 @@ done: * Function: H5AC_get_tag() * * Purpose: Get the tag for a metadata cache entry. - * + * * Return: SUCCEED/FAIL * * Programmer: Dana Robinson @@ -2348,8 +2348,8 @@ H5AC_get_tag(const void *thing, haddr_t *tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 1235206..b40f8d0 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -253,8 +253,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, * type field contains the expected value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the * expected_type parameter * * If the target entry is not in cache, *in_cache_ptr is @@ -278,8 +278,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, */ #ifndef NDEBUG herr_t -H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, - const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, +H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, + const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, hbool_t *type_ok_ptr) { H5C_t * cache_ptr; @@ -304,7 +304,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_get_serialization_in_progress * - * Purpose: Return the current value of + * Purpose: Return the current value of * cache_ptr->serialization_in_progress. * * Return: Current value of cache_ptr->serialization_in_progress. diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index fadde28..f097e83 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -135,7 +135,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); /*------------------------------------------------------------------------- * Function: H5AC__set_sync_point_done_callback * - * Purpose: Set the value of the sync_point_done callback. This + * Purpose: Set the value of the sync_point_done callback. This * callback is used by the parallel test code to verify * that the expected writes and only the expected writes * take place during a sync point. @@ -204,7 +204,7 @@ H5AC__set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)) * Function: H5AC_add_candidate() * * Purpose: Add the supplied metadata entry address to the candidate - * list. Verify that each entry added does not appear in + * list. Verify that each entry added does not appear in * the list prior to its insertion. * * This function is intended for used in constructing list @@ -261,11 +261,11 @@ done: * * Purpose: Broadcast the contents of the process 0 candidate entry * slist. In passing, also remove all entries from said - * list. As the application of this will be handled by - * the same functions on all processes, construct and + * list. As the application of this will be handled by + * the same functions on all processes, construct and * return a copy of the list in the same format as that * received by the other processes. Note that if this - * copy is returned in *haddr_buf_ptr_ptr, the caller + * copy is returned in *haddr_buf_ptr_ptr, the caller * must free it. * * This function must only be called by the process with @@ -317,7 +317,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, unsigned chk_num_entries = 0; /* convert the candidate list into the format we - * are used to receiving from process 0, and also load it + * are used to receiving from process 0, and also load it * into a buffer for transmission. */ if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries, &haddr_buf_ptr) < 0) @@ -331,7 +331,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ - /* Pass the number of entries and the buffer pointer + /* Pass the number of entries and the buffer pointer * back to the caller. Do this so that we can use the same code * to apply the candidate list to all the processes. */ @@ -481,10 +481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5AC__construct_candidate_list() * - * Purpose: In the parallel case when the metadata_write_strategy is + * Purpose: In the parallel case when the metadata_write_strategy is * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, process 0 uses - * this function to construct the list of cache entries to - * be flushed. This list is then propagated to the other + * this function to construct the list of cache entries to + * be flushed. This list is then propagated to the other * caches, and then flushed in a distributed fashion. * * The sync_point_op parameter is used to determine the extent @@ -581,22 +581,22 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, * Function: H5AC__copy_candidate_list_to_buffer * * Purpose: Allocate buffer(s) and copy the contents of the candidate - * entry slist into it (them). In passing, remove all - * entries from the candidate slist. Note that the + * entry slist into it (them). In passing, remove all + * entries from the candidate slist. Note that the * candidate slist must not be empty. * * If MPI_Offset_buf_ptr_ptr is not NULL, allocate a buffer * of MPI_Offset, copy the contents of the candidate - * entry list into it with the appropriate conversions, - * and return the base address of the buffer in + * entry list into it with the appropriate conversions, + * and return the base address of the buffer in * *MPI_Offset_buf_ptr. Note that this is the buffer - * used by process 0 to transmit the list of entries to + * used by process 0 to transmit the list of entries to * be flushed to all other processes (in this file group). * * Similarly, allocate a buffer of haddr_t, load the contents - * of the candidate list into this buffer, and return its - * base address in *haddr_buf_ptr_ptr. Note that this - * latter buffer is constructed unconditionally. + * of the candidate list into this buffer, and return its + * base address in *haddr_buf_ptr_ptr. Note that this + * latter buffer is constructed unconditionally. * * In passing, also remove all entries from the candidate * entry slist. @@ -635,8 +635,8 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); - /* allocate a buffer(s) to store the list of candidate entry - * base addresses in + /* allocate a buffer(s) to store the list of candidate entry + * base addresses in */ buf_size = sizeof(haddr_t) * num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) @@ -651,7 +651,7 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for candidate entries") - /* Pass the number of entries and the buffer pointer + /* Pass the number of entries and the buffer pointer * back to the caller. */ *num_entries_ptr = num_entries; @@ -1131,32 +1131,32 @@ done: /*------------------------------------------------------------------------- * Function: H5AC__propagate_and_apply_candidate_list * - * Purpose: Prior to the addition of support for multiple metadata - * write strategies, in PHDF5, only the metadata cache with - * mpi rank 0 was allowed to write to file. All other - * metadata caches on processes with rank greater than 0 - * were required to retain dirty entries until they were + * Purpose: Prior to the addition of support for multiple metadata + * write strategies, in PHDF5, only the metadata cache with + * mpi rank 0 was allowed to write to file. All other + * metadata caches on processes with rank greater than 0 + * were required to retain dirty entries until they were * notified that the entry was clean. * - * This constraint is relaxed with the distributed + * This constraint is relaxed with the distributed * metadata write strategy, in which a list of candidate * metadata cache entries is constructed by the process 0 * cache and then distributed to the caches of all the other - * processes. Once the listed is distributed, many (if not - * all) processes writing writing a unique subset of the - * entries, and marking the remainder clean. The subsets - * are chosen so that each entry in the list of candidates - * is written by exactly one cache, and all entries are + * processes. Once the listed is distributed, many (if not + * all) processes writing writing a unique subset of the + * entries, and marking the remainder clean. The subsets + * are chosen so that each entry in the list of candidates + * is written by exactly one cache, and all entries are * marked as being clean in all caches. * - * While the list of candidate cache entries is prepared + * While the list of candidate cache entries is prepared * elsewhere, this function is the main routine for distributing - * and applying the list. It must be run simultaniously on + * and applying the list. It must be run simultaniously on * all processes that have the relevant file open. To ensure - * proper synchronization, there is a barrier at the beginning + * proper synchronization, there is a barrier at the beginning * of this function. * - * At present, this function is called under one of two + * At present, this function is called under one of two * circumstances: * * 1) Dirty byte creation exceeds some user specified value. @@ -1167,10 +1167,10 @@ done: * and therefore the same dirty data creation. * * This fact is used to synchronize the caches for purposes - * of propagating the list of candidate entries, by simply - * calling this function from all caches whenever some user - * specified threshold on dirty data is exceeded. (the - * process 0 cache creates the candidate list just before + * of propagating the list of candidate entries, by simply + * calling this function from all caches whenever some user + * specified threshold on dirty data is exceeded. (the + * process 0 cache creates the candidate list just before * calling this function). * * 2) Under direct user control -- this operation must be @@ -1185,20 +1185,20 @@ done: * * For the process with mpi rank 0: * - * 1) Load the contents of the candidate list + * 1) Load the contents of the candidate list * (candidate_slist_ptr) into a buffer, and broadcast that * buffer to all the other caches. Clear the candidate * list in passing. * - * If there is a positive number of candidates, proceed with + * If there is a positive number of candidates, proceed with * the following: * * 2) Apply the candidate entry list. * * 3) Particpate in a closing barrier. * - * 4) Remove from the dirty list (d_slist_ptr) and from the - * flushed and still clean entries list (c_slist_ptr), + * 4) Remove from the dirty list (d_slist_ptr) and from the + * flushed and still clean entries list (c_slist_ptr), * all addresses that appeared in the candidate list, as * these entries are now clean. * @@ -1207,7 +1207,7 @@ done: * * 1) Receive the candidate entry list broadcast * - * If there is a positive number of candidates, proceed with + * If there is a positive number of candidates, proceed with * the following: * * 2) Apply the candidate entry list. @@ -1264,8 +1264,8 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) if(num_candidates > 0) { herr_t result; - /* all processes apply the candidate list. - * H5C_apply_candidate_list() handles the details of + /* all processes apply the candidate list. + * H5C_apply_candidate_list() handles the details of * distributing the writes across the processes. */ @@ -1284,7 +1284,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") /* this code exists primarily for the test bed -- it allows us to - * enforce posix semantics on the server that pretends to be a + * enforce posix semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1323,16 +1323,16 @@ done: * Function: H5AC__propagate_flushed_and_still_clean_entries_list * * Purpose: In PHDF5, if the process 0 only metadata write strategy - * is selected, only the metadata cache with mpi rank 0 is - * allowed to write to file. All other metadata caches on - * processes with rank greater than 0 must retain dirty - * entries until they are notified that the entry is now + * is selected, only the metadata cache with mpi rank 0 is + * allowed to write to file. All other metadata caches on + * processes with rank greater than 0 must retain dirty + * entries until they are notified that the entry is now * clean. * - * This function is the main routine for handling this - * notification procedure. It must be called - * simultaniously on all processes that have the relevant - * file open. To this end, it is called only during a + * This function is the main routine for handling this + * notification procedure. It must be called + * simultaniously on all processes that have the relevant + * file open. To this end, it is called only during a * sync point, with a barrier prior to the call. * * Note that any metadata entry writes by process 0 will @@ -1428,7 +1428,7 @@ done: * * Purpose: Receive the list of entry addresses from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. - * Note that the caller must free this buffer if it is + * Note that the caller must free this buffer if it is * returned. * * This function must only be called by the process with @@ -1479,7 +1479,7 @@ H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ - /* finally, pass the number of entries and the buffer pointer + /* finally, pass the number of entries and the buffer pointer * back to the caller. */ *num_entries_ptr = num_entries; @@ -1562,7 +1562,7 @@ done: * * Purpose: Receive the list of candidate entries from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. - * Note that the caller must free this buffer if it is + * Note that the caller must free this buffer if it is * returned. * * This function must only be called by the process with @@ -1612,38 +1612,38 @@ done: * Purpose: Routine for handling the details of running a sync point * that is triggered by a flush -- which in turn must have been * triggered by either a flush API call or a file close -- - * when the distributed metadata write strategy is selected. - * - * Upon entry, each process generates it own candidate list, - * being a sorted list of all dirty metadata entries currently - * in the metadata cache. Note that this list must be idendical - * across all processes, as all processes see the same stream - * of dirty metadata coming in, and use the same lists of - * candidate entries at each sync point. (At first glance, this + * when the distributed metadata write strategy is selected. + * + * Upon entry, each process generates it own candidate list, + * being a sorted list of all dirty metadata entries currently + * in the metadata cache. Note that this list must be idendical + * across all processes, as all processes see the same stream + * of dirty metadata coming in, and use the same lists of + * candidate entries at each sync point. (At first glance, this * argument sounds circular, but think of it in the sense of * a recursive proof). * - * If this this list is empty, we are done, and the function + * If this this list is empty, we are done, and the function * returns * - * Otherwise, after the sorted list dirty metadata entries is - * constructed, each process uses the same algorithm to assign - * each entry on the candidate list to exactly one process for + * Otherwise, after the sorted list dirty metadata entries is + * constructed, each process uses the same algorithm to assign + * each entry on the candidate list to exactly one process for * flushing. * * At this point, all processes participate in a barrier to * avoid messages from the past/future bugs. * - * Each process then flushes the entries assigned to it, and + * Each process then flushes the entries assigned to it, and * marks all other entries on the candidate list as clean. * - * Finally, all processes participate in a second barrier to + * Finally, all processes participate in a second barrier to * avoid messages from the past/future bugs. * * At the end of this process, process 0 and only process 0 - * must tidy up its lists of dirtied and cleaned entries. + * must tidy up its lists of dirtied and cleaned entries. * These lists are not used in the distributed metadata write - * strategy, but they must be maintained should we shift + * strategy, but they must be maintained should we shift * to a strategy that uses them. * * Return: Success: non-negative @@ -1676,7 +1676,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - /* first construct the candidate list -- initially, this will be in the + /* first construct the candidate list -- initially, this will be in the * form of a skip list. We will convert it later. */ if(H5C_construct_candidate_list__clean_cache(cache_ptr) < 0) @@ -1692,7 +1692,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") /* Initial sync point barrier - * + * * When flushing from within the close operation from a file, * it's possible to skip this barrier (on the second flush of the cache). */ @@ -1715,7 +1715,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") /* this code exists primarily for the test bed -- it allows us to - * enforce posix semantics on the server that pretends to be a + * enforce posix semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1752,45 +1752,45 @@ done: * Function: H5AC__rsp__dist_md_write__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point - * triggered by the accumulation of dirty metadata (as + * triggered by the accumulation of dirty metadata (as * opposed to a flush call to the API) when the distributed * metadata write strategy is selected. * * After invocation and initial sanity checking this function - * first checks to see if evictions are enabled -- if they + * first checks to see if evictions are enabled -- if they * are not, the function does nothing and returns. * - * Otherwise, process zero constructs a list of entries to + * Otherwise, process zero constructs a list of entries to * be flushed in order to bring the process zero cache back - * within its min clean requirement. Note that this list + * within its min clean requirement. Note that this list * (the candidate list) may be empty. * * Then, all processes participate in a barrier. * - * After the barrier, process 0 broadcasts the number of - * entries in the candidate list prepared above, and all + * After the barrier, process 0 broadcasts the number of + * entries in the candidate list prepared above, and all * other processes receive this number. * * If this number is zero, we are done, and the function * returns without further action. * - * Otherwise, process 0 broadcasts the sorted list of + * Otherwise, process 0 broadcasts the sorted list of * candidate entries, and all other processes receive it. * - * Then, each process uses the same algorithm to assign - * each entry on the candidate list to exactly one process + * Then, each process uses the same algorithm to assign + * each entry on the candidate list to exactly one process * for flushing. * - * Each process then flushes the entries assigned to it, and + * Each process then flushes the entries assigned to it, and * marks all other entries on the candidate list as clean. * - * Finally, all processes participate in a second barrier to + * Finally, all processes participate in a second barrier to * avoid messages from the past/future bugs. * * At the end of this process, process 0 and only process 0 - * must tidy up its lists of dirtied and cleaned entries. + * must tidy up its lists of dirtied and cleaned entries. * These lists are not used in the distributed metadata write - * strategy, but they must be maintained should we shift + * strategy, but they must be maintained should we shift * to a strategy that uses them. * * Return: Success: non-negative @@ -1846,25 +1846,25 @@ done: * * Purpose: Routine for handling the details of running a sync point * that is triggered a flush -- which in turn must have been - * triggered by either a flush API call or a file close -- - * when the process 0 only metadata write strategy is selected. + * triggered by either a flush API call or a file close -- + * when the process 0 only metadata write strategy is selected. * * First, all processes participate in a barrier. * * Then process zero flushes all dirty entries, and broadcasts - * they number of clean entries (if any) to all the other + * they number of clean entries (if any) to all the other * caches. * * If this number is zero, we are done. * - * Otherwise, process 0 broadcasts the list of cleaned + * Otherwise, process 0 broadcasts the list of cleaned * entries, and all other processes which are part of this * file group receive it, and mark the listed entries as * clean in their caches. * - * Since all processes have the same set of dirty + * Since all processes have the same set of dirty * entries at the beginning of the sync point, and all - * entries that will be written are written before + * entries that will be written are written before * process zero broadcasts the number of cleaned entries, * there is no need for a closing barrier. * @@ -1896,8 +1896,8 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); - /* To prevent "messages from the future" we must - * synchronize all processes before we start the flush. + /* To prevent "messages from the future" we must + * synchronize all processes before we start the flush. * Hence the following barrier. * * However, when flushing from within the close operation from a file, @@ -1925,7 +1925,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") /* this code exists primarily for the test bed -- it allows us to - * enforce POSIX semantics on the server that pretends to be a + * enforce POSIX semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1945,32 +1945,32 @@ done: * Function: H5AC__rsp__p0_only__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point - * triggered by the accumulation of dirty metadata (as + * triggered by the accumulation of dirty metadata (as * opposed to a flush call to the API) when the process 0 * only metadata write strategy is selected. * * After invocation and initial sanity checking this function - * first checks to see if evictions are enabled -- if they + * first checks to see if evictions are enabled -- if they * are not, the function does nothing and returns. * * Otherwise, all processes participate in a barrier. * - * After the barrier, if this is process 0, the function - * causes the cache to flush sufficient entries to get the - * cache back within its minimum clean fraction, and broadcast - * the number of entries which have been flushed since + * After the barrier, if this is process 0, the function + * causes the cache to flush sufficient entries to get the + * cache back within its minimum clean fraction, and broadcast + * the number of entries which have been flushed since * the last sync point, and are still clean. * * If this number is zero, we are done. * - * Otherwise, process 0 broadcasts the list of cleaned + * Otherwise, process 0 broadcasts the list of cleaned * entries, and all other processes which are part of this * file group receive it, and mark the listed entries as * clean in their caches. * - * Since all processes have the same set of dirty + * Since all processes have the same set of dirty * entries at the beginning of the sync point, and all - * entries that will be written are written before + * entries that will be written are written before * process zero broadcasts the number of cleaned entries, * there is no need for a closing barrier. * @@ -2026,9 +2026,9 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) if(0 == aux_ptr->mpi_rank) { herr_t result; - /* here, process 0 flushes as many entries as necessary to + /* here, process 0 flushes as many entries as necessary to * comply with the currently specified min clean size. - * Note that it is quite possible that no entries will be + * Note that it is quite possible that no entries will be * flushed. */ @@ -2066,23 +2066,23 @@ done: * Function: H5AC__run_sync_point * * Purpose: Top level routine for managing a sync point between all - * meta data caches in the parallel case. Since all caches + * meta data caches in the parallel case. Since all caches * see the same sequence of dirty metadata, we simply count * bytes of dirty metadata, and run a sync point whenever the * number of dirty bytes of metadata seen since the last * sync point exceeds a threshold that is common across all - * processes. We also run sync points in response to + * processes. We also run sync points in response to * HDF5 API calls triggering either a flush or a file close. * - * In earlier versions of PHDF5, only the metadata cache with - * mpi rank 0 was allowed to write to file. All other + * In earlier versions of PHDF5, only the metadata cache with + * mpi rank 0 was allowed to write to file. All other * metadata caches on processes with rank greater than 0 were - * required to retain dirty entries until they were notified + * required to retain dirty entries until they were notified * that the entry is was clean. * - * This function was created to make it easier for us to - * experiment with other options, as it is a single point - * for the execution of sync points. + * This function was created to make it easier for us to + * experiment with other options, as it is a single point + * for the execution of sync points. * * Return: Success: non-negative * @@ -2197,13 +2197,13 @@ done: * * Purpose: In the distributed metadata write strategy, not all dirty * entries are written by process 0 -- thus we must tidy - * up the dirtied, and flushed and still clean lists + * up the dirtied, and flushed and still clean lists * maintained by process zero after each sync point. * * This procedure exists to tend to this issue. * * At this point, all entries that process 0 cleared should - * have been removed from both the dirty and flushed and + * have been removed from both the dirty and flushed and * still clean lists, and entries that process 0 has flushed * should have been removed from the dirtied list and added * to the flushed and still clean list. @@ -2214,7 +2214,7 @@ done: * them to be used should the metadata write strategy change * to one that uses these lists. * - * Thus for our purposes, all we need to do is remove from + * Thus for our purposes, all we need to do is remove from * the dirtied and flushed and still clean lists all * references to entries that appear in the candidate list. * @@ -2246,11 +2246,11 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, HDassert(num_candidates > 0); HDassert(candidates_list_ptr != NULL); - /* clean up dirtied and flushed and still clean lists by removing - * all entries on the candidate list. Cleared entries should - * have been removed from both the dirty and cleaned lists at - * this point, flushed entries should have been added to the - * cleaned list. However, for this metadata write strategy, + /* clean up dirtied and flushed and still clean lists by removing + * all entries on the candidate list. Cleared entries should + * have been removed from both the dirty and cleaned lists at + * this point, flushed entries should have been added to the + * cleaned list. However, for this metadata write strategy, * we just want to remove all references to the candidate entries. */ for(u = 0; u < num_candidates; u++) { @@ -2260,7 +2260,7 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, addr = candidates_list_ptr[u]; - /* addr may be either on the dirtied list, or on the flushed + /* addr may be either on the dirtied list, or on the flushed * and still clean list. Remove it. */ if(NULL != (d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)&addr))) diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 8997382..86ff385 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -153,23 +153,23 @@ H5FL_EXTERN(H5AC_aux_t); * * Update: When the above was written, I planned to allow the process * 0 metadata cache to write dirty metadata between sync points. - * However, testing indicated that this allowed occasional + * However, testing indicated that this allowed occasional * messages from the future to reach the caches on other processes. * * To resolve this, the code was altered to require that all metadata * writes take place during sync points -- which solved the problem. - * Initially all writes were performed by the process 0 cache. This + * Initially all writes were performed by the process 0 cache. This * approach was later replaced with a distributed write approach - * in which each process writes a subset of the metadata to be - * written. - * - * After thinking on the matter for a while, I arrived at the - * conclusion that the process 0 cache could be allowed to write - * dirty metadata between sync points if it restricted itself to - * entries that had been dirty at the time of the previous sync point. - * + * in which each process writes a subset of the metadata to be + * written. + * + * After thinking on the matter for a while, I arrived at the + * conclusion that the process 0 cache could be allowed to write + * dirty metadata between sync points if it restricted itself to + * entries that had been dirty at the time of the previous sync point. + * * To date, there has been no attempt to implement this optimization. - * However, should it be attempted, much of the supporting code + * However, should it be attempted, much of the supporting code * should still be around. * * JRM -- 1/6/15 @@ -206,14 +206,14 @@ H5FL_EXTERN(H5AC_aux_t); * broadcast. This field is reset to zero after each such * broadcast. * - * metadata_write_strategy: Integer code indicating how we will be - * writing the metadata. In the first incarnation of + * metadata_write_strategy: Integer code indicating how we will be + * writing the metadata. In the first incarnation of * this code, all writes were done from process 0. This - * field exists to facilitate experiments with other + * field exists to facilitate experiments with other * strategies. * * At present, this field must be set to either - * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * * dirty_bytes_propagations: This field only exists when the @@ -267,7 +267,7 @@ H5FL_EXTERN(H5AC_aux_t); * * Things have changed a bit since the following four fields were defined. * If metadata_write_strategy is H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, - * all comments hold as before -- with the caviate that pending further + * all comments hold as before -- with the caviate that pending further * coding, the process 0 metadata cache is forbidden to flush entries outside * of a sync point. * @@ -337,16 +337,16 @@ H5FL_EXTERN(H5AC_aux_t); * needed. * * Note: This field has been extended for use by all processes - * with the addition of support for the distributed - * metadata write strategy. + * with the addition of support for the distributed + * metadata write strategy. * JRM -- 5/9/10 * * sync_point_done: In the parallel test bed, it is necessary to verify * that the expected writes, and only the expected writes, * have taken place at the end of each sync point. * - * The sync_point_done callback allows t_cache to perform - * this verification. The field is set to NULL when the + * The sync_point_done callback allows t_cache to perform + * this verification. The field is set to NULL when the * callback is not needed. * * The following field supports the metadata cache image feature. @@ -402,7 +402,7 @@ typedef struct H5AC_aux_t void (* write_done)(void); - void (* sync_point_done)(unsigned num_writes, + void (* sync_point_done)(unsigned num_writes, haddr_t * written_entries_tbl); unsigned p0_image_len; diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 691f7c6..b932e16 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -88,18 +88,18 @@ typedef enum { * * Hence the following, somewhat odd set of #defines. * - * NOTE: test/cache plays games with the f->shared->cache, and thus - * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, - * irrelevant data when run with that test program. See + * NOTE: test/cache plays games with the f->shared->cache, and thus + * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, + * irrelevant data when run with that test program. See * comments on setup_cache() / takedown_cache() in test/cache_common.c. * for details. * * If you need to dump stats at file close in test/cache.c, - * use the dump_stats parameter to takedown_cache(), or call + * use the dump_stats parameter to takedown_cache(), or call * H5C_stats() directly. * JRM -- 4/12/15 * - * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much + * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats * displayed is much smaller, and directed purely at the cache image feature. * @@ -419,7 +419,7 @@ H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); /* Cache image routines */ -H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, +H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f); diff --git a/src/H5Adense.c b/src/H5Adense.c index 7491dd2..a73fcc6 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -310,17 +310,17 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) HDassert(took_ownership); /* - * If there is an attribute already stored in "user_attr", - * we need to free the dynamially allocated spaces for the - * attribute, otherwise we got infinite loop closing library due to + * If there is an attribute already stored in "user_attr", + * we need to free the dynamially allocated spaces for the + * attribute, otherwise we got infinite loop closing library due to * outstanding allocation. (HDFFV-10659) * * This callback is used by H5A__dense_remove() to close/free the * attribute stored in "user_attr" (via H5O__msg_free_real()) after * the attribute node is deleted from the name index v2 B-tree. - * The issue is: - * When deleting the attribute node from the B-tree, - * if the attribute is found in the intermediate B-tree nodes, + * The issue is: + * When deleting the attribute node from the B-tree, + * if the attribute is found in the intermediate B-tree nodes, * which may be merged/redistributed, we need to free the dynamically * allocated spaces for the intermediate decoded attribute. */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index e0a0f55..dd5eae3 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -192,7 +192,7 @@ H5Aopen_name(hid_t loc_id, const char *name) { void *attr = NULL; /* attr object from VOL connector */ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */ - H5VL_loc_params_t loc_params; + H5VL_loc_params_t loc_params; hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -507,7 +507,7 @@ H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) if((hdr->cls->compare)(udata, hdr->min_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp < 0) - HGOTO_DONE(FALSE) /* Less than the least record--not found */ + HGOTO_DONE(FALSE) /* Less than the least record--not found */ else if(cmp == 0) { /* Record is found */ if(op && (op)(hdr->min_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -518,7 +518,7 @@ H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) if((hdr->cls->compare)(udata, hdr->max_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp > 0) - HGOTO_DONE(FALSE) /* Less than the least record--not found */ + HGOTO_DONE(FALSE) /* Less than the least record--not found */ else if(cmp == 0) { /* Record is found */ if(op && (op)(hdr->max_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -1601,7 +1601,7 @@ done: * Function: H5B2_patch_file * * Purpose: Patch the top-level file pointer contained in bt2 - * to point to idx_info->f if they are different. + * to point to idx_info->f if they are different. * This is possible because the file pointer in bt2 can be * closed out if bt2 remains open. * diff --git a/src/H5B2int.c b/src/H5B2int.c index ea03ed6..53ac835 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -57,7 +57,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, +static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent); @@ -1757,7 +1757,7 @@ H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -1794,7 +1794,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - + /* Sanity checks */ HDassert(hdr); HDassert(depth > 0); @@ -1884,14 +1884,14 @@ done: */ static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, - const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, + const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - + /* Sanity checks */ HDassert(hdr); HDassert(depth > 1); @@ -1929,7 +1929,7 @@ H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 92c802e..1fee0af 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -388,7 +388,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in size_t split_nrec; /* Number of records to split node at */ /* Locate node pointer for child */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp == 0) @@ -444,7 +444,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Locate node pointer for child (after split/redistribute) */ /* Actually, this can be easily updated (for 2-node redistrib.) and shouldn't require re-searching */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp == 0) diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 7ed0468..b542061 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -1027,7 +1027,7 @@ done: *------------------------------------------------------------------------- */ H5_ATTR_PURE herr_t -H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, +H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf) { /* General sanity checking on node */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 27229f1..338db5a 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -433,7 +433,7 @@ H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, diff --git a/src/H5B2test.c b/src/H5B2test.c index 0f4a39c..7affd49 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -562,7 +562,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) } /* end if */ /* Locate node pointer for child */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") @@ -616,7 +616,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) } /* end if */ /* Locate record */ - if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, + if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") @@ -171,7 +171,7 @@ static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); #if H5C_DO_SLIST_SANITY_CHECKS -static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, +static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -722,10 +722,10 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * * Function: H5C_prep_for_file_close * - * Purpose: This function should be called just prior to the cache - * flushes at file close. There should be no protected + * Purpose: This function should be called just prior to the cache + * flushes at file close. There should be no protected * entries in the cache at this point. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -750,8 +750,8 @@ H5C_prep_for_file_close(H5F_t *f) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* For now at least, it is possible to receive the - * close warning more than once -- the following + /* For now at least, it is possible to receive the + * close warning more than once -- the following * if statement handles this. */ if(cache_ptr->close_warning_received) @@ -767,8 +767,8 @@ H5C_prep_for_file_close(H5F_t *f) #ifdef H5_HAVE_PARALLEL if ( ( H5F_INTENT(f) & H5F_ACC_RDWR ) && - ( ! image_generated ) && - ( cache_ptr->aux_ptr != NULL ) && + ( ! image_generated ) && + ( cache_ptr->aux_ptr != NULL ) && ( f->shared->fs_persist ) ) { /* If persistent free space managers are enabled, flushing the * metadata cache may result in the deletion, insertion, and/or @@ -1011,31 +1011,31 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Changes: Modified function to test for slist chamges in + * Changes: Modified function to test for slist chamges in * pre_serialize and serialize callbacks, and re-start * scans through the slist when such changes occur. * * This has been a potential problem for some time, - * and there has been code in this function to deal - * with elements of this issue. However the shift + * and there has been code in this function to deal + * with elements of this issue. However the shift * to the V3 cache in combination with the activities - * of some of the cache clients (in particular the + * of some of the cache clients (in particular the * free space manager and the fractal heap) have * made this re-work necessary. * * JRM -- 12/13/14 * - * Modified function to support rings. Basic idea is that + * Modified function to support rings. Basic idea is that * every entry in the cache is assigned to a ring. Entries - * in the outermost ring are flushed first, followed by - * those in the next outermost ring, and so on until the - * innermost ring is flushed. See header comment on - * H5C_ring_t in H5Cprivate.h for a more detailed + * in the outermost ring are flushed first, followed by + * those in the next outermost ring, and so on until the + * innermost ring is flushed. See header comment on + * H5C_ring_t in H5Cprivate.h for a more detailed * discussion. * * JRM -- 8/30/15 * - * Modified function to call the free space manager + * Modified function to call the free space manager * settling functions. * JRM -- 6/9/16 * @@ -1111,7 +1111,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { - /* flush each ring, starting from the outermost ring and + /* flush each ring, starting from the outermost ring and * working inward. */ ring = H5C_RING_USER; @@ -2245,7 +2245,7 @@ H5C_protect(H5F_t * f, if(entry_ptr->prefetched) { /* This call removes the prefetched entry from the cache, - * and replaces it with an entry deserialized from the + * and replaces it with an entry deserialized from the * image of the prefetched entry. */ if(H5C__deserialize_prefetched_entry(f, cache_ptr, &entry_ptr, type, addr, udata) < 0) @@ -2314,7 +2314,7 @@ H5C_protect(H5F_t * f, if(cache_ptr->ignore_tags != TRUE) { haddr_t tag; /* Tag value */ - /* The entry is already in the cache, but make sure that the tag value + /* The entry is already in the cache, but make sure that the tag value * is still legal. This will ensure that had the entry NOT been in the * cache, tagging was still set up correctly and it would have received * a legal tag value after getting loaded from disk. @@ -2322,7 +2322,7 @@ H5C_protect(H5F_t * f, /* Get the tag */ tag = H5CX_get_tag(); - + if(H5C_verify_tag(entry_ptr->type->id, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed") } /* end if */ @@ -2338,9 +2338,9 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, + if(NULL == (thing = H5C_load_entry(f, #ifdef H5_HAVE_PARALLEL - coll_access, + coll_access, #endif /* H5_HAVE_PARALLEL */ type, addr, udata))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't load entry") @@ -2449,12 +2449,12 @@ H5C_protect(H5F_t * f, * ******************************************* * * Set the flush_last field - * of the newly loaded entry before inserting it into the - * index. Must do this, as the index tracked the number of - * entries with the flush_last field set, but assumes that + * of the newly loaded entry before inserting it into the + * index. Must do this, as the index tracked the number of + * entries with the flush_last field set, but assumes that * the field will not change after insertion into the index. * - * Note that this means that the H5C__FLUSH_LAST_FLAG flag + * Note that this means that the H5C__FLUSH_LAST_FLAG flag * is ignored if the entry is already in cache. */ entry_ptr->flush_me_last = flush_last; @@ -2486,7 +2486,7 @@ H5C_protect(H5F_t * f, HDassert(entry_ptr->ro_ref_count > 0); (entry_ptr->ro_ref_count)++; } /* end if */ - else + else HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Target already protected & not read only?!?") } /* end if */ else { @@ -2890,7 +2890,7 @@ done: * 3/22/06 * * Changes: Added extreme sanity checks on entry and exit. - JRM -- 4/26/14 + JRM -- 4/26/14 * *------------------------------------------------------------------------- */ @@ -3112,7 +3112,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if(entry_ptr->flush_dep_nparents > 0) if(H5C__mark_flush_dep_dirty(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") - } /* end if */ + } /* end if */ /* Check for newly clean entry */ else if(!was_clean && !entry_ptr->is_dirty) { /* If the entry's type has a 'notify' callback send a 'entry cleaned' @@ -3969,8 +3969,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f ); /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this - * is a re-entrant call via a client callback called in the resize - * process. To avoid an infinite recursion, set reentrant_call to + * is a re-entrant call via a client callback called in the resize + * process. To avoid an infinite recursion, set reentrant_call to * TRUE, and goto done. */ if(cache_ptr->resize_in_progress) { @@ -5157,7 +5157,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) while(entry_ptr) { /* Check ring */ HDassert(entry_ptr->ring == H5C_RING_SB); - + /* Advance to next entry in pinned entry list */ entry_ptr = entry_ptr->next; } /* end while */ @@ -5199,7 +5199,7 @@ done: * until either the cache is empty, or the number of pinned * entries stops decreasing on each pass. * - * If flush dependencies appear in the target ring, the + * If flush dependencies appear in the target ring, the * function makes repeated passes through the cache flushing * entries in flush dependency order. * @@ -5252,8 +5252,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* The flush procedure here is a bit strange. * * In the outer while loop we make at least one pass through the - * cache, and then repeat until either all the pinned entries in - * the ring unpin themselves, or until the number of pinned entries + * cache, and then repeat until either all the pinned entries in + * the ring unpin themselves, or until the number of pinned entries * in the ring stops declining. In this later case, we scream and die. * * Since the fractal heap can dirty, resize, and/or move entries @@ -5309,9 +5309,9 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* There is also the possibility that entries will be * dirtied, resized, moved, and/or removed from the cache - * as the result of calls to the flush callbacks. We use - * the slist_len_increase and slist_size_increase increase - * fields in struct H5C_t to track these changes for purpose + * as the result of calls to the flush callbacks. We use + * the slist_len_increase and slist_size_increase increase + * fields in struct H5C_t to track these changes for purpose * of sanity checking. * * To this end, we must zero these fields before we start @@ -5326,8 +5326,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * This flag is set to TRUE by H5C__flush_single_entry if the slist * is modified by a pre_serialize, serialize, or notify callback. * - * H5C_flush_invalidate_ring() uses this flag to detect any - * modifications to the slist that might corrupt the scan of + * H5C_flush_invalidate_ring() uses this flag to detect any + * modifications to the slist that might corrupt the scan of * the slist -- and restart the scan in this event. */ cache_ptr->slist_changed = FALSE; @@ -5357,14 +5357,14 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) entry_ptr = next_entry_ptr; - /* It is possible that entries will be dirtied, resized, + /* It is possible that entries will be dirtied, resized, * flushed, or removed from the cache via the take ownership - * flag as the result of pre_serialize or serialized callbacks. - * + * flag as the result of pre_serialize or serialized callbacks. + * * This in turn can corrupt the scan through the slist. * - * We test for slist modifications in the pre_serialize - * and serialize callbacks, and restart the scan of the + * We test for slist modifications in the pre_serialize + * and serialize callbacks, and restart the scan of the * slist if we find them. However, best we do some extra * sanity checking just in case. */ @@ -5497,8 +5497,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) if((!entry_ptr->flush_me_last || (entry_ptr->flush_me_last && cache_ptr->num_last_entries >= cache_ptr->slist_len)) && entry_ptr->flush_dep_nchildren == 0 && entry_ptr->ring == ring) { if(entry_ptr->is_protected) { - /* we have major problems -- but lets flush and - * destroy everything we can before we flag an + /* we have major problems -- but lets flush and + * destroy everything we can before we flag an * error. */ protected_entries++; @@ -5506,9 +5506,9 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert(!(entry_ptr->is_dirty)); } /* end if */ else if(!(entry_ptr->is_pinned)) { - /* if *entry_ptr is dirty, it is possible - * that one or more other entries may be - * either removed from the cache, loaded + /* if *entry_ptr is dirty, it is possible + * that one or more other entries may be + * either removed from the cache, loaded * into the cache, or moved to a new location * in the file as a side effect of the flush. * @@ -5517,14 +5517,14 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * entry, allowing it to be removed also and * invalidating the next_entry_ptr. * - * If either of these happen, and one of the target - * or proxy entries happens to be the next entry in + * If either of these happen, and one of the target + * or proxy entries happens to be the next entry in * the hash bucket, we could either find ourselves * either scanning a non-existant entry, scanning * through a different bucket, or skipping an entry. * - * Neither of these are good, so restart the - * the scan at the head of the hash bucket + * Neither of these are good, so restart the + * the scan at the head of the hash bucket * after the flush if we detect that the next_entry_ptr * becomes invalid. * @@ -5538,11 +5538,11 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") /* Restart the index list scan if necessary. Must - * do this if the next entry is evicted, and also if + * do this if the next entry is evicted, and also if * one or more entries are inserted, loaded, or moved * as these operations can result in part of the scan * being skipped -- which can cause a spurious failure - * if this results in the size of the pinned entry + * if this results in the size of the pinned entry * failing to decline during the pass. */ if((NULL != next_entry_ptr && NULL == cache_ptr->entry_watched_for_removal) @@ -5585,7 +5585,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) entry_ptr = entry_ptr->next; } /* end while */ - /* Check if the number of pinned entries in the ring is positive, and + /* Check if the number of pinned entries in the ring is positive, and * it is not declining. Scream and die if so. */ if(cur_ring_pel_len > 0 && cur_ring_pel_len >= old_ring_pel_len) { @@ -5628,16 +5628,16 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_ring * - * Purpose: Flush the entries contained in the specified cache and + * Purpose: Flush the entries contained in the specified cache and * ring. All entries in rings outside the specified ring * must have been flushed on entry. * * If the cache contains protected entries in the specified - * ring, the function will fail, as protected entries cannot + * ring, the function will fail, as protected entries cannot * be flushed. However all unprotected entries in the target * ring should be flushed before the function returns failure. * - * If flush dependencies appear in the target ring, the + * If flush dependencies appear in the target ring, the * function makes repeated passes through the slist flushing * entries in flush dependency order. * @@ -5703,10 +5703,10 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) /* Set the cache_ptr->slist_changed to false. * - * This flag is set to TRUE by H5C__flush_single_entry if the + * This flag is set to TRUE by H5C__flush_single_entry if the * slist is modified by a pre_serialize, serialize, or notify callback. * H5C_flush_cache uses this flag to detect any modifications - * to the slist that might corrupt the scan of the slist -- and + * to the slist that might corrupt the scan of the slist -- and * restart the scan in this event. */ cache_ptr->slist_changed = FALSE; @@ -5726,8 +5726,8 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * * To make things more entertaining, with the advent of the * fractal heap, the entry serialize callback can cause entries - * to be dirtied, resized, and/or moved. Also, the - * pre_serialize callback can result in an entry being + * to be dirtied, resized, and/or moved. Also, the + * pre_serialize callback can result in an entry being * removed from the cache via the take ownership flag. * * To deal with this, we first make note of the initial @@ -5778,24 +5778,24 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); } /* end if */ - + entry_ptr = next_entry_ptr; /* With the advent of the fractal heap, the free space * manager, and the version 3 cache, it is possible - * that the pre-serialize or serialize callback will - * dirty, resize, or take ownership of other entries - * in the cache. + * that the pre-serialize or serialize callback will + * dirty, resize, or take ownership of other entries + * in the cache. * * To deal with this, I have inserted code to detect any * change in the skip list not directly under the control * of this function. If such modifications are detected, - * we must re-start the scan of the skip list to avoid + * we must re-start the scan of the skip list to avoid * the possibility that the target of the next_entry_ptr * may have been flushed or deleted from the cache. * * To verify that all such possibilities have been dealt - * with, we do a bit of extra sanity checking on + * with, we do a bit of extra sanity checking on * entry_ptr. */ HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); @@ -5825,20 +5825,20 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) else next_entry_ptr = NULL; - if((!flush_marked_entries || entry_ptr->flush_marker) + if((!flush_marked_entries || entry_ptr->flush_marker) && (!entry_ptr->flush_me_last || - (entry_ptr->flush_me_last + (entry_ptr->flush_me_last && (cache_ptr->num_last_entries >= cache_ptr->slist_len - || (flush_marked_entries && entry_ptr->flush_marker)))) + || (flush_marked_entries && entry_ptr->flush_marker)))) && (entry_ptr->flush_dep_nchildren == 0 - || entry_ptr->flush_dep_ndirty_children == 0) + || entry_ptr->flush_dep_ndirty_children == 0) && entry_ptr->ring == ring) { HDassert(entry_ptr->flush_dep_nunser_children == 0); if(entry_ptr->is_protected) { - /* we probably have major problems -- but lets - * flush everything we can before we decide + /* we probably have major problems -- but lets + * flush everything we can before we decide * whether to flag an error. */ tried_to_flush_protected_entry = TRUE; @@ -5850,9 +5850,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if(cache_ptr->slist_changed) { /* The slist has been modified by something - * other than the simple removal of the + * other than the simple removal of the * of the flushed entry after the flush. - * + * * This has the potential to corrupt the * scan through the slist, so restart it. */ @@ -5980,11 +5980,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) else write_entry = FALSE; - /* if we have received close warning, and we have been instructed to + /* if we have received close warning, and we have been instructed to * generate a metadata cache image, and we have actually constructed * the entry images, set suppress_image_entry_frees to TRUE. * - * Set suppress_image_entry_writes to TRUE if indicated by the + * Set suppress_image_entry_writes to TRUE if indicated by the * image_ctl flags. */ if(cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image @@ -6063,11 +6063,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ - /* Finally, write the image to disk. - * - * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the + /* Finally, write the image to disk. + * + * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the * in the entry's type, we silently skip the write. This - * flag should only be used in test code. + * flag should only be used in test code. */ if(write_entry) { HDassert(entry_ptr->is_dirty); @@ -6079,8 +6079,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Write the image to disk unless the write is suppressed. * - * This happens if both suppress_image_entry_writes and - * entry_ptr->include_in_image are TRUE, or if the + * This happens if both suppress_image_entry_writes and + * entry_ptr->include_in_image are TRUE, or if the * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ @@ -6113,7 +6113,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) #endif /* H5_HAVE_PARALLEL */ } /* end if */ - /* if the entry has a notify callback, notify it that we have + /* if the entry has a notify callback, notify it that we have * just flushed the entry. */ if(entry_ptr->type->notify && @@ -6125,7 +6125,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * made if it was appropriate to make them. Similarly, the entry * has been written to disk if desired. * - * Thus it is now safe to update the cache data structures for the + * Thus it is now safe to update the cache data structures for the * flush. */ @@ -6179,7 +6179,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * * 5) Remove it from the tag list for this object * - * Finally, if the destroy_entry flag is set, discard the + * Finally, if the destroy_entry flag is set, discard the * entry. */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL) @@ -6213,7 +6213,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* We are either doing a flush or a clear. * * A clear and a flush are the same from the point of - * view of the replacement policy and the slist. + * view of the replacement policy and the slist. * Hence no differentiation between them. * * JRM -- 7/7/07 @@ -6223,8 +6223,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) - /* mark the entry as clean and update the index for - * entry clean. Also, call the clear callback + /* mark the entry as clean and update the index for + * entry clean. Also, call the clear callback * if defined. */ entry_ptr->is_dirty = FALSE; @@ -6256,8 +6256,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) end before the entry_ptr gets freed */ entry_addr = entry_ptr->addr; - /* Internal cache data structures should now be up to date, and - * consistent with the status of the entry. + /* Internal cache data structures should now be up to date, and + * consistent with the status of the entry. * * Now discard the entry if appropriate. */ @@ -6266,18 +6266,18 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(0 == entry_ptr->flush_dep_nparents); /* if both suppress_image_entry_frees and entry_ptr->include_in_image - * are true, simply set entry_ptr->image_ptr to NULL, as we have + * are true, simply set entry_ptr->image_ptr to NULL, as we have * another pointer to the buffer in an instance of H5C_image_entry_t * in cache_ptr->image_entries. * * Otherwise, free the buffer if it exists. */ - if(suppress_image_entry_frees && entry_ptr->include_in_image) + if(suppress_image_entry_frees && entry_ptr->include_in_image) entry_ptr->image_ptr = NULL; else if(entry_ptr->image_ptr != NULL) entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - /* If the entry is not a prefetched entry, verify that the flush + /* If the entry is not a prefetched entry, verify that the flush * dependency parents addresses array has been transferred. * * If the entry is prefetched, the free_isr routine will dispose of @@ -6288,8 +6288,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(NULL == entry_ptr->fd_parent_addrs); } /* end if */ - /* Check whether we should free the space in the file that - * the entry occupies + /* Check whether we should free the space in the file that + * the entry occupies */ if(free_file_space) { hsize_t fsf_size; @@ -6326,14 +6326,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Reset the pointer to the cache the entry is within. -QAK */ entry_ptr->cache_ptr = NULL; - /* increment entries_removed_counter and set - * last_entry_removed_ptr. As we are likely abuut to - * free the entry, recall that last_entry_removed_ptr + /* increment entries_removed_counter and set + * last_entry_removed_ptr. As we are likely abuut to + * free the entry, recall that last_entry_removed_ptr * must NEVER be dereferenced. * * Recall that these fields are maintained to allow functions - * that perform scans of lists of entries to detect the - * unexpected removal of entries (via expunge, eviction, + * that perform scans of lists of entries to detect the + * unexpected removal of entries (via expunge, eviction, * or take ownership at present), so that they can re-start * their scans if necessary. * @@ -6377,15 +6377,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(take_ownership); /* client is taking ownership of the entry. - * set bad magic here too so the cache will choke + * set bad magic here too so the cache will choke * unless the entry is re-inserted properly */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; } /* end else */ } /* if (destroy) */ - /* Check if we have to update the page buffer with cleared entries - * so it doesn't go out of date + /* Check if we have to update the page buffer with cleared entries + * so it doesn't go out of date */ if(update_page_buffer) { /* Sanity check */ @@ -6402,9 +6402,9 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") done: - HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ! entry_ptr->flush_in_progress ) ); - HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( take_ownership ) || ( ! entry_ptr->is_dirty ) ); FUNC_LEAVE_NOAPI(ret_value) @@ -6421,7 +6421,7 @@ done: * If exceed, adjust 'len' accordingly. * * Verify that 'len' should not exceed eoa when 'actual' is - * true i.e. 'len' is the actual length from get_load_size + * true i.e. 'len' is the actual length from get_load_size * callback with non-null image pointer. * If exceed, return error. * @@ -6442,7 +6442,7 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, FUNC_ENTER_STATIC - /* if type == H5FD_MEM_GHEAP, H5F_block_read() forces + /* if type == H5FD_MEM_GHEAP, H5F_block_read() forces * type to H5FD_MEM_DRAW via its call to H5F__accum_read(). * Thus we do the same for purposes of computing the EOA * for sanity checks. @@ -6574,7 +6574,7 @@ H5C_load_entry(H5F_t * f, /* Get the # of read attempts */ max_tries = tries = H5F_GET_READ_ATTEMPTS(f); - /* + /* * This do/while loop performs the following till the metadata checksum * is correct or the file's number of allowed read attempts are reached. * --read the metadata @@ -6874,8 +6874,8 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); /* check to see if cache_ptr->msic_in_progress is TRUE. If it, this - * is a re-entrant call via a client callback called in the make - * space in cache process. To avoid an infinite recursion, set + * is a re-entrant call via a client callback called in the make + * space in cache process. To avoid an infinite recursion, set * reentrant_call to TRUE, and goto done. */ if(cache_ptr->msic_in_progress) { @@ -6947,9 +6947,9 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) } #endif /* H5C_COLLECT_CACHE_STATS */ - /* reset entries_removed_counter and - * last_entry_removed_ptr prior to the call to - * H5C__flush_single_entry() so that we can spot + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C__flush_single_entry() so that we can spot * unexpected removals of entries from the cache, * and set the restart_scan flag if proceeding * would be likely to cause us to scan an entry @@ -6966,7 +6966,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) restart_scan = TRUE; - } else if ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size + } else if ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size #ifdef H5_HAVE_PARALLEL && !(entry_ptr->coll_access) #endif /* H5_HAVE_PARALLEL */ @@ -7124,7 +7124,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) prev_ptr = entry_ptr->aux_prev; - if ( ( !(entry_ptr->prefetched_dirty) ) + if ( ( !(entry_ptr->prefetched_dirty) ) #ifdef H5_HAVE_PARALLEL && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ @@ -7174,7 +7174,7 @@ done: * * Changes: * - * Added code to verify that the LRU contains no pinned + * Added code to verify that the LRU contains no pinned * entries. JRM -- 4/25/14 * *------------------------------------------------------------------------- @@ -7254,7 +7254,7 @@ H5C_validate_lru_list(H5C_t * cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") } - if ( ( entry_ptr->is_pinned ) || + if ( ( entry_ptr->is_pinned ) || ( entry_ptr->pinned_from_client ) || ( entry_ptr->pinned_from_cache ) ) { @@ -7290,7 +7290,7 @@ done: * * Function: H5C_validate_pinned_entry_list * - * Purpose: Debugging function that scans the pinned entry list for + * Purpose: Debugging function that scans the pinned entry list for * errors. * * If an error is detected, the function generates a @@ -7422,7 +7422,7 @@ done: * * Function: H5C_validate_protected_entry_list * - * Purpose: Debugging function that scans the protected entry list for + * Purpose: Debugging function that scans the protected entry list for * errors. * * If an error is detected, the function generates a @@ -7547,11 +7547,11 @@ done: * * Function: H5C_entry_in_skip_list * - * Purpose: Debugging function that scans skip list to see if it - * is in present. We need this, as it is possible for + * Purpose: Debugging function that scans skip list to see if it + * is in present. We need this, as it is possible for * an entry to be in the skip list twice. * - * Return: FALSE if the entry is not in the skip list, and TRUE + * Return: FALSE if the entry is not in the skip list, and TRUE * if it is. * * Programmer: John Mainzer, 11/1/14 @@ -7617,7 +7617,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) */ herr_t H5C__flush_marked_entries(H5F_t * f) -{ +{ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -7639,7 +7639,7 @@ done: * Function: H5C_cork * * Purpose: To cork/uncork/get cork status of an object depending on "action": - * H5C__SET_CORK: + * H5C__SET_CORK: * To cork the object * Return error if the object is already corked * H5C__UNCORK: @@ -7648,7 +7648,7 @@ done: * H5C__GET_CORKED: * To retrieve the cork status of an object in * the parameter "corked" - * + * * Return: Success: Non-negative * Failure: Negative * @@ -7658,7 +7658,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) +H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) { H5C_tag_info_t *tag_info; /* Points to a tag info struct */ herr_t ret_value = SUCCEED; @@ -7840,8 +7840,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_serialized() * - * Purpose: Decrement the flush_dep_nunser_children fields of all the - * target entry's flush dependency parents in response to + * Purpose: Decrement the flush_dep_nunser_children fields of all the + * target entry's flush dependency parents in response to * the target entry becoming serialized. * * Return: Non-negative on success/Negative on failure @@ -7890,7 +7890,7 @@ done: * Function: H5C__mark_flush_dep_unserialized() * * Purpose: Increment the flush_dep_nunser_children fields of all the - * target entry's flush dependency parents in response to + * target entry's flush dependency parents in response to * the target entry becoming unserialized. * * Return: Non-negative on success/Negative on failure @@ -7916,7 +7916,7 @@ H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr) /* Sanity check */ HDassert(entry_ptr->flush_dep_parent); HDassert(entry_ptr->flush_dep_parent[u]->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < + HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < entry_ptr->flush_dep_parent[u]->flush_dep_nchildren); /* increment parents number of usserialized children */ @@ -7976,11 +7976,11 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, /*------------------------------------------------------------------------- * Function: H5C__serialize_cache * - * Purpose: Serialize (i.e. construct an on disk image) for all entries - * in the metadata cache including clean entries. + * Purpose: Serialize (i.e. construct an on disk image) for all entries + * in the metadata cache including clean entries. * * Note that flush dependencies and "flush me last" flags - * must be observed in the serialization process. + * must be observed in the serialization process. * * Note also that entries may be loaded, flushed, evicted, * expunged, relocated, resized, or removed from the cache @@ -7988,17 +7988,17 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, * a regular flush. * * However, we are given that the cache will contain no protected - * entries on entry to this routine (although entries may be - * briefly protected and then unprotected during the serialize - * process). + * entries on entry to this routine (although entries may be + * briefly protected and then unprotected during the serialize + * process). * - * The objective of this routine is serialize all entries and - * to force all entries into their actual locations on disk. + * The objective of this routine is serialize all entries and + * to force all entries into their actual locations on disk. * - * The initial need for this routine is to settle all entries - * in the cache prior to construction of the metadata cache + * The initial need for this routine is to settle all entries + * in the cache prior to construction of the metadata cache * image so that the size of the cache image can be calculated. - * However, I gather that other uses for the routine are + * However, I gather that other uses for the routine are * under consideration. * * Return: Non-negative on success/Negative on failure or if there was @@ -8069,10 +8069,10 @@ H5C__serialize_cache(H5F_t *f) #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #ifndef NDEBUG - /* if this is a debug build, set the serialization_count field of + /* if this is a debug build, set the serialization_count field of * each entry in the cache to zero before we start the serialization. * This allows us to detect the case in which any entry is serialized - * more than once (a performance issues), and more importantly, the + * more than once (a performance issues), and more importantly, the * case is which any flush depencency parent is serializes more than * once (a correctness issue). */ @@ -8088,10 +8088,10 @@ H5C__serialize_cache(H5F_t *f) } /* end block */ #endif /* NDEBUG */ - /* set cache_ptr->serialization_in_progress to TRUE, and back + /* set cache_ptr->serialization_in_progress to TRUE, and back * to FALSE at the end of the function. Must maintain this flag - * to support H5C_get_serialization_in_progress(), which is in - * turn required to support sanity checking in some cache + * to support H5C_get_serialization_in_progress(), which is in + * turn required to support sanity checking in some cache * clients. */ HDassert(!cache_ptr->serialization_in_progress); @@ -8169,16 +8169,16 @@ done: * * If the cache contains protected entries in the specified * ring, the function will fail, as protected entries cannot - * be serialized. However all unprotected entries in the - * target ring should be serialized before the function + * be serialized. However all unprotected entries in the + * target ring should be serialized before the function * returns failure. * * If flush dependencies appear in the target ring, the * function makes repeated passes through the index list * serializing entries in flush dependency order. * - * All entries outside the H5C_RING_SBE are marked for - * inclusion in the cache image. Entries in H5C_RING_SBE + * All entries outside the H5C_RING_SBE are marked for + * inclusion in the cache image. Entries in H5C_RING_SBE * and below are marked for exclusion from the image. * * Return: Non-negative on success/Negative on failure or if there was @@ -8213,76 +8213,76 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) /* The objective here is to serialize all entries in the cache ring * in flush dependency order. * - * The basic algorithm is to scan the cache index list looking for + * The basic algorithm is to scan the cache index list looking for * unserialized entries that are either not in a flush dependency * relationship, or which have no unserialized children. Any such - * entry is serialized and its flush dependency parents (if any) are + * entry is serialized and its flush dependency parents (if any) are * informed -- allowing them to decrement their userialized child counts. * * However, this algorithm is complicated by the ability - * of client serialization callbacks to perform operations on - * on the cache which can result in the insertion, deletion, + * of client serialization callbacks to perform operations on + * on the cache which can result in the insertion, deletion, * relocation, resize, dirty, flush, eviction, or removal (via the * take ownership flag) of entries. Changes in the flush dependency * structure are also possible. * - * On the other hand, the algorithm is simplified by the fact that - * we are serializing, not flushing. Thus, as long as all entries + * On the other hand, the algorithm is simplified by the fact that + * we are serializing, not flushing. Thus, as long as all entries * are serialized correctly, it doesn't matter if we have to go back * and serialize an entry a second time. * - * These possible actions result in the following modfications to + * These possible actions result in the following modfications to * tha basic algorithm: * - * 1) In the event of an entry expunge, eviction or removal, we must - * restart the scan as it is possible that the next entry in our + * 1) In the event of an entry expunge, eviction or removal, we must + * restart the scan as it is possible that the next entry in our * scan is no longer in the cache. Were we to examine this entry, * we would be accessing deallocated memory. * - * 2) A resize, dirty, or insertion of an entry may result in the - * the increment of a flush dependency parent's dirty and/or - * unserialized child count. In the context of serializing the - * the cache, this is a non-issue, as even if we have already - * serialized the parent, it will be marked dirty and its image - * marked out of date if appropriate when the child is serialized. - * + * 2) A resize, dirty, or insertion of an entry may result in the + * the increment of a flush dependency parent's dirty and/or + * unserialized child count. In the context of serializing the + * the cache, this is a non-issue, as even if we have already + * serialized the parent, it will be marked dirty and its image + * marked out of date if appropriate when the child is serialized. + * * However, this is a major issue for a flush, as were this to happen * in a flush, it would violate the invariant that the flush dependency - * feature is intended to enforce. As the metadata cache has no - * control over the behavior of cache clients, it has no way of + * feature is intended to enforce. As the metadata cache has no + * control over the behavior of cache clients, it has no way of * preventing this behaviour. However, it should detect it if at all - * possible. + * possible. * * Do this by maintaining a count of the number of times each entry is - * serialized during a cache serialization. If any flush dependency + * serialized during a cache serialization. If any flush dependency * parent is serialized more than once, throw an assertion failure. * - * 3) An entry relocation will typically change the location of the - * entry in the index list. This shouldn't cause problems as we - * will scan the index list until we make a complete pass without - * finding anything to serialize -- making relocations of either + * 3) An entry relocation will typically change the location of the + * entry in the index list. This shouldn't cause problems as we + * will scan the index list until we make a complete pass without + * finding anything to serialize -- making relocations of either * the current or next entries irrelevant. * - * Note that since a relocation may result in our skipping part of + * Note that since a relocation may result in our skipping part of * the index list, we must always do at least one more pass through * the index list after an entry relocation. * - * 4) Changes in the flush dependency structure are possible on + * 4) Changes in the flush dependency structure are possible on * entry insertion, load, expunge, evict, or remove. Destruction - * of a flush dependency has no effect, as it can only relax the + * of a flush dependency has no effect, as it can only relax the * flush dependencies. Creation of a flush dependency can create - * an unserialized child of a flush dependency parent where all + * an unserialized child of a flush dependency parent where all * flush dependency children were previously serialized. Should * this child dirty the flush dependency parent when it is serialized, * the parent will be re-serialized. * - * Per the discussion of 2) above, this is a non issue for cache + * Per the discussion of 2) above, this is a non issue for cache * serialization, and a major problem for cache flush. Using the - * same detection mechanism, throw an assertion failure if this - * condition appears. + * same detection mechanism, throw an assertion failure if this + * condition appears. * - * Observe that either eviction or removal of entries as a result of - * a serialization is not a problem as long as the flush depencency + * Observe that either eviction or removal of entries as a result of + * a serialization is not a problem as long as the flush depencency * tree does not change beyond the removal of a leaf. */ while(!done) { @@ -8300,7 +8300,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); /* Verify that either the entry is already serialized, or - * that it is assigned to either the target or an inner + * that it is assigned to either the target or an inner * ring. */ HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); @@ -8367,9 +8367,9 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) cache_ptr->entries_relocated_counter = 0; /* At this point, all entries not marked "flush me last" and in - * the current ring or outside it should be serialized and have up - * to date images. Scan the index list again to serialize the - * "flush me last" entries (if they are in the current ring) and to + * the current ring or outside it should be serialized and have up + * to date images. Scan the index list again to serialize the + * "flush me last" entries (if they are in the current ring) and to * verify that all other entries have up to date images. */ entry_ptr = cache_ptr->il_head; @@ -8422,7 +8422,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__serialize_single_entry * - * Purpose: Serialize the cache entry pointed to by the entry_ptr + * Purpose: Serialize the cache entry pointed to by the entry_ptr * parameter. * * Return: Non-negative on success/Negative on failure @@ -8487,12 +8487,12 @@ done: * Purpose: Serialize an entry and generate its image. * * Note: This may cause the entry to be re-sized and/or moved in - * the cache. + * the cache. * - * As we will not update the metadata cache's data structures - * until we we finish the write, we must touch up these - * data structures for size and location changes even if we - * are about to delete the entry from the cache (i.e. on a + * As we will not update the metadata cache's data structures + * until we we finish the write, we must touch up these + * data structures for size and location changes even if we + * are about to delete the entry from the cache (i.e. on a * flush destroy). * * Return: Non-negative on success/Negative on failure @@ -8528,7 +8528,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) old_addr = entry_ptr->addr; /* Call client's pre-serialize callback, if there's one */ - if(entry_ptr->type->pre_serialize && + if(entry_ptr->type->pre_serialize && (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") @@ -8596,7 +8596,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) */ H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); - /* As we haven't updated the cache data structures for + /* As we haven't updated the cache data structures for * for the flush or flush destroy yet, the entry should * be in the slist. Thus update it for the size change. */ @@ -8608,8 +8608,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) entry_ptr->size = new_len; } /* end if */ - /* If required, udate the entry and the cache data structures - * for a move + /* If required, udate the entry and the cache data structures + * for a move */ if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { /* Update stats and entries relocated counter */ @@ -8641,7 +8641,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ entry_ptr->image_up_to_date = TRUE; - /* Propagate the fact that the entry is serialized up the + /* Propagate the fact that the entry is serialized up the * flush dependency chain if appropriate. Since the image must * have been out of date for this function to have been called * (see assertion on entry), no need to check that -- only check @@ -8766,8 +8766,8 @@ H5C_remove_entry(void *_entry) if(entry == cache->entry_watched_for_removal) cache->entry_watched_for_removal = NULL; - /* Internal cache data structures should now be up to date, and - * consistent with the status of the entry. + /* Internal cache data structures should now be up to date, and + * consistent with the status of the entry. * * Now clean up internal cache fields if appropriate. */ @@ -706,7 +706,7 @@ H5CX__get_context(void) /* No associated value with current thread - create one */ #ifdef H5_HAVE_WIN_THREADS /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ - ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); + ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); #else /* Use HDmalloc here since this has to match the HDfree in the * destructor and we want to avoid the codestack there. @@ -1784,7 +1784,7 @@ H5CX_get_mpi_file_flushing(void) /*------------------------------------------------------------------------- - * Function: H5CX_get_mpio_rank0_bcast + * Function: H5CX_get_mpio_rank0_bcast * * Purpose: Retrieves if the dataset meets read-with-rank0-and-bcast requirements for the current API call context. * @@ -3120,7 +3120,7 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ @@ -3152,7 +3152,7 @@ H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ @@ -3256,7 +3256,7 @@ H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) @@ -3290,7 +3290,7 @@ H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) @@ -3324,7 +3324,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) @@ -3358,7 +3358,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) @@ -3392,7 +3392,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_c /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) @@ -3426,7 +3426,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_in /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) @@ -3460,7 +3460,7 @@ H5CX_test_set_mpio_coll_rank0_bcast(hbool_t mpio_coll_rank0_bcast) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index cb1d0e2..d5599f2 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -185,7 +185,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_dump_cache_LRU * - * Purpose: Print a summary of the contents of the metadata cache + * Purpose: Print a summary of the contents of the metadata cache * LRU for debugging purposes. * * Return: Non-negative on success/Negative on failure @@ -209,9 +209,9 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) HDassert(cache_name != NULL ); HDfprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name); - HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", + HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len, (int)(cache_ptr->LRU_list_size)); - HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", + HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", (int)(cache_ptr->index_size), (int)(cache_ptr->max_cache_size), (int)(cache_ptr->max_cache_size) - (int)(cache_ptr->index_size)); @@ -238,12 +238,12 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) if(NULL == entry_ptr->tag_info) HDfprintf(stdout, " %16s ", "N/A"); else - HDfprintf(stdout, " 0x%16llx ", + HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); HDfprintf(stdout, " %d ", (int)(entry_ptr->ring)); - HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), + HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); HDfprintf(stdout, "\n"); @@ -262,8 +262,8 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) /*------------------------------------------------------------------------- * Function: H5C_dump_cache_skip_list * - * Purpose: Debugging routine that prints a summary of the contents of - * the skip list used by the metadata cache metadata cache to + * Purpose: Debugging routine that prints a summary of the contents of + * the skip list used by the metadata cache metadata cache to * maintain an address sorted list of dirty entries. * * Return: Non-negative on success/Negative on failure @@ -343,9 +343,9 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) /*------------------------------------------------------------------------- * Function: H5C_dump_coll_write_list * - * Purpose: Debugging routine that prints a summary of the contents of - * the collective write skip list used by the metadata cache - * in the parallel case to maintain a list of entries to write + * Purpose: Debugging routine that prints a summary of the contents of + * the collective write skip list used by the metadata cache + * in the parallel case to maintain a list of entries to write * collectively at a sync point. * * Return: Non-negative on success/Negative on failure @@ -381,7 +381,7 @@ H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) list_len = (int)H5SL_count(cache_ptr->coll_write_list); - HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n", + HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n", aux_ptr->mpi_rank, calling_fcn); HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); @@ -773,7 +773,7 @@ H5C_stats(H5C_t * cache_ptr, (((double)(cache_ptr->total_dirty_pf_entries_skipped_in_msic)) / ((double)(cache_ptr->calls_to_msic))); - HDfprintf(stdout, + HDfprintf(stdout, "%s MSIC: Average/max dirty pf entries skipped = %lf / %ld\n", cache_ptr->prefix, average_dirty_pf_entries_skipped_per_call_to_msic, @@ -798,9 +798,9 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space)); - HDfprintf(stdout, + HDfprintf(stdout, "%s slist/LRU/index scan restarts = %lld / %lld / %lld.\n", - cache_ptr->prefix, + cache_ptr->prefix, (long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts), (long long)(cache_ptr->index_scan_restarts)); @@ -827,7 +827,7 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); if(cache_ptr->prefetches > 0) - prefetch_use_rate = + prefetch_use_rate = (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); else @@ -886,7 +886,7 @@ H5C_stats(H5C_t * cache_ptr, (int)(cache_ptr->max_read_protects[i])); HDfprintf(stdout, - "%s clears / flushes = %ld / %ld\n", + "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i])); @@ -1158,21 +1158,21 @@ H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, /*------------------------------------------------------------------------- * Function: H5C_flush_dependency_exists() * - * Purpose: Test to see if a flush dependency relationship exists - * between the supplied parent and child. Both parties + * Purpose: Test to see if a flush dependency relationship exists + * between the supplied parent and child. Both parties * are indicated by addresses so as to avoid the necessity - * of protect / unprotect calls prior to this call. + * of protect / unprotect calls prior to this call. * - * If either the parent or the child is not in the metadata + * If either the parent or the child is not in the metadata * cache, the function sets *fd_exists_ptr to FALSE. * - * If both are in the cache, the childs list of parents is + * If both are in the cache, the childs list of parents is * searched for the proposed parent. If the proposed parent * is found in the childs parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, + * *fd_exists_ptr to TRUE. In all other non-error cases, * the function sets *fd_exists_ptr FALSE. * - * Return: SUCCEED on success/FAIL on failure. Note that + * Return: SUCCEED on success/FAIL on failure. Note that * *fd_exists_ptr is undefined on failure. * * Programmer: John Mainzer @@ -1355,30 +1355,30 @@ done: * * Function: H5C_get_entry_ptr_from_addr() * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, returns a pointer - * to the entry in *entry_ptr_ptr. If the entry is not in the + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, returns a pointer + * to the entry in *entry_ptr_ptr. If the entry is not in the * cache, *entry_ptr_ptr is set to NULL. * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided when + * WARNING: This call should be used only in debugging + * routines, and it should be avoided when * possible. * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded * or heavily re-worked. * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. * * Note that this function is only defined if NDEBUG * is not defined. * - * As heavy use of this function is almost certainly a - * bad idea, the metadata cache tracks the number of - * successful calls to this function, and (if - * H5C_DO_SANITY_CHECKS is defined) displays any + * As heavy use of this function is almost certainly a + * bad idea, the metadata cache tracks the number of + * successful calls to this function, and (if + * H5C_DO_SANITY_CHECKS is defined) displays any * non-zero count on cache shutdown. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -1425,7 +1425,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_serialization_in_progress * - * Purpose: Return the current value of + * Purpose: Return the current value of * cache_ptr->serialization_in_progress. * * Return: Current value of cache_ptr->serialization_in_progress. @@ -1454,7 +1454,7 @@ H5C_get_serialization_in_progress(const H5C_t *cache_ptr) * * Function: H5C_cache_is_clean() * - * Purpose: Debugging function that verifies that all rings in the + * Purpose: Debugging function that verifies that all rings in the * metadata cache are clean from the outermost ring, inwards * to the inner ring specified. * @@ -1499,16 +1499,16 @@ done: * * Function: H5C_verify_entry_type() * - * Purpose: Debugging function that attempts to look up an entry in the + * Purpose: Debugging function that attempts to look up an entry in the * cache by its file address, and if found, test to see if its * type field contains the expted value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the expected_type + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the expected_type * parameter. * - * If the target entry is not in cache, *in_cache_ptr is + * If the target entry is not in cache, *in_cache_ptr is * set to FALSE, and *type_ok_ptr is undefined. * * Note that this function is only defined if NDEBUG diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index 8bcab9f..6451019 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -58,7 +58,7 @@ static herr_t H5C__epoch_marker_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr); static herr_t H5C__epoch_marker_get_final_load_size(const void *image_ptr, size_t image_len_ptr, void *udata_ptr, size_t *actual_len); -static htri_t H5C__epoch_marker_verify_chksum(const void *image_ptr, +static htri_t H5C__epoch_marker_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void * H5C__epoch_marker_deserialize(const void * image_ptr, size_t len, void * udata, hbool_t * dirty_ptr); @@ -71,7 +71,7 @@ static herr_t H5C__epoch_marker_serialize(const H5F_t *f, void * image_ptr, size_t len, void * thing); static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__epoch_marker_free_icr(void * thing); -static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, +static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED * fsf_size_ptr); @@ -143,8 +143,8 @@ H5C__epoch_marker_get_final_load_size(const void H5_ATTR_UNUSED *image_ptr, } /* end H5C__epoch_marker_final_get_load_size() */ -static htri_t -H5C__epoch_marker_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, +static htri_t +H5C__epoch_marker_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED *udata_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -228,7 +228,7 @@ H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing) } /* end H5C__epoch_marker_free_icr() */ -static herr_t +static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index db44c7a..ee286d9 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -102,11 +102,11 @@ static herr_t H5C__decode_cache_image_header(const H5F_t *f, static herr_t H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint8_t **buf, unsigned entry_num); #endif /* NDEBUG */ /* only used in assertions */ -static herr_t H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, +static herr_t H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_entry_ptr, H5C_cache_entry_t **fd_children); static herr_t H5C__encode_cache_image_header(const H5F_t *f, const H5C_t *cache_ptr, uint8_t **buf); -static herr_t H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, +static herr_t H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigned entry_num); static herr_t H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr); static void H5C__prep_for_file_close__compute_fd_heights_real( @@ -146,8 +146,8 @@ H5FL_DEFINE(H5C_cache_entry_t); * * Function: H5C_cache_image_pending() * - * Purpose: Tests to see if the load of a metadata cache image - * load is pending (i.e. will be executed on the next + * Purpose: Tests to see if the load of a metadata cache image + * load is pending (i.e. will be executed on the next * protect or insert) * * Returns TRUE if a cache image load is pending, and FALSE @@ -179,16 +179,16 @@ H5C_cache_image_pending(const H5C_t *cache_ptr) /*------------------------------------------------------------------------- * Function: H5C_cache_image_status() * - * Purpose: Examine the metadata cache associated with the supplied - * instance of H5F_t to determine whether the load of a - * cache image has either been queued or executed, and if + * Purpose: Examine the metadata cache associated with the supplied + * instance of H5F_t to determine whether the load of a + * cache image has either been queued or executed, and if * construction of a cache image has been requested. * * This done, it set *load_ci_ptr to TRUE if a cache image * has either been loaded or a load has been requested, and * to FALSE otherwise. * - * Similarly, set *write_ci_ptr to TRUE if construction of + * Similarly, set *write_ci_ptr to TRUE if construction of * a cache image has been requested, and to FALSE otherwise. * * Return: SUCCEED on success, and FAIL on failure. @@ -213,7 +213,7 @@ H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(load_ci_ptr); HDassert(write_ci_ptr); - + *load_ci_ptr = cache_ptr->load_image || cache_ptr->image_loaded; *write_ci_ptr = cache_ptr->image_ctl.generate_image; @@ -224,7 +224,7 @@ H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) /*------------------------------------------------------------------------- * Function: H5C__construct_cache_image_buffer() * - * Purpose: Allocate a buffer of size cache_ptr->image_len, and + * Purpose: Allocate a buffer of size cache_ptr->image_len, and * load it with an image of the metadata cache image block. * * Note that by the time this function is called, the cache @@ -330,7 +330,7 @@ H5C__construct_cache_image_buffer(H5F_t * f, H5C_t *cache_ptr) HDassert((cache_ptr->image_entries)[u].type_id == (fake_cache_ptr->image_entries)[u].type_id); HDassert((cache_ptr->image_entries)[u].lru_rank == (fake_cache_ptr->image_entries)[u].lru_rank); HDassert((cache_ptr->image_entries)[u].is_dirty == (fake_cache_ptr->image_entries)[u].is_dirty); - /* don't check image_fd_height as it is not stored in + /* don't check image_fd_height as it is not stored in * the metadata cache image block. */ HDassert((cache_ptr->image_entries)[u].fd_child_count == (fake_cache_ptr->image_entries)[u].fd_child_count); @@ -346,7 +346,7 @@ H5C__construct_cache_image_buffer(H5F_t * f, H5C_t *cache_ptr) (fake_cache_ptr->image_entries)[u].fd_parent_addrs = (haddr_t *)H5MM_xfree((fake_cache_ptr->image_entries)[u].fd_parent_addrs); (fake_cache_ptr->image_entries)[u].fd_parent_count = 0; } /* end if */ - else + else HDassert((fake_cache_ptr->image_entries)[u].fd_parent_count == 0); HDassert((cache_ptr->image_entries)[u].image_ptr); @@ -431,28 +431,28 @@ done: * Function: H5C__deserialize_prefetched_entry() * * Purpose: Deserialize the supplied prefetched entry entry, and return - * a pointer to the deserialized entry in *entry_ptr_ptr. + * a pointer to the deserialized entry in *entry_ptr_ptr. * If successful, remove the prefetched entry from the cache, * and free it. Insert the deserialized entry into the cache. * - * Note that the on disk image of the entry is not freed -- + * Note that the on disk image of the entry is not freed -- * a pointer to it is stored in the deserialized entries' * image_ptr field, and its image_up_to_date field is set to * TRUE unless the entry is dirtied by the deserialize call. * * If the prefetched entry is a flush dependency child, - * destroy that flush dependency prior to calling the + * destroy that flush dependency prior to calling the * deserialize callback. If appropriate, the flush dependency * relationship will be recreated by the cache client. * * If the prefetched entry is a flush dependency parent, - * destroy the flush dependency relationship with all its + * destroy the flush dependency relationship with all its * children. As all these children must be prefetched entries, - * recreate these flush dependency relationships with + * recreate these flush dependency relationships with * deserialized entry after it is inserted in the cache. * - * Since deserializing a prefetched entry is semantically - * equivalent to a load, issue an entry loaded nofification + * Since deserializing a prefetched entry is semantically + * equivalent to a load, issue an entry loaded nofification * if the notify callback is defined. * * Return: SUCCEED on success, and FAIL on failure. @@ -468,22 +468,22 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { - hbool_t dirty = FALSE; /* Flag indicating whether thing was - * dirtied during deserialize + hbool_t dirty = FALSE; /* Flag indicating whether thing was + * dirtied during deserialize */ size_t len; /* Size of image in file */ void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t * pf_entry_ptr; /* pointer to the prefetched entry */ /* supplied in *entry_ptr_ptr. */ - H5C_cache_entry_t * ds_entry_ptr; /* Alias for thing loaded, as cache - * entry + H5C_cache_entry_t * ds_entry_ptr; /* Alias for thing loaded, as cache + * entry */ H5C_cache_entry_t** fd_children = NULL; /* Pointer to a dynamically */ /* allocated array of pointers to */ /* the flush dependency children of */ /* the prefetched entry, or NULL if */ /* that array does not exist. */ - unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | + unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG); int i; herr_t ret_value = SUCCEED; /* Return value */ @@ -513,8 +513,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, /* verify absence of prohibited or unsupported type flag combinations */ HDassert(!(type->flags & H5C__CLASS_SKIP_READS)); - - /* Can't see how skip reads could be usefully combined with + + /* Can't see how skip reads could be usefully combined with * either the speculative read flag. Hence disallow. */ HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && @@ -535,7 +535,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, HDassert(pf_entry_ptr->flush_dep_parent[i]->flush_dep_nchildren > 0); HDassert(pf_entry_ptr->fd_parent_addrs); HDassert(pf_entry_ptr->flush_dep_parent[i]->addr == pf_entry_ptr->fd_parent_addrs[i]); - + if(H5C_destroy_flush_dependency(pf_entry_ptr->flush_dep_parent[i], pf_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry parent flush dependency") @@ -543,11 +543,11 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, } /* end for */ HDassert(pf_entry_ptr->flush_dep_nparents == 0); - /* If *pf_entry_ptr is a flush dependency parent, destroy its flush - * dependency relationships with all its children (which must be + /* If *pf_entry_ptr is a flush dependency parent, destroy its flush + * dependency relationships with all its children (which must be * prefetched entries as well). * - * These flush dependency relationships will have to be restored + * These flush dependency relationships will have to be restored * after the deserialized entry is inserted into the cache in order * to transfer these relationships to the new entry. Hence save the * pointers to the flush dependency children of *pf_enty_ptr for later @@ -561,16 +561,16 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry child flush dependency(s).") } /* end if */ - /* Since the size of the on disk image is known exactly, there is - * no need for either a call to the get_initial_load_size() callback, + /* Since the size of the on disk image is known exactly, there is + * no need for either a call to the get_initial_load_size() callback, * or retries if the H5C__CLASS_SPECULATIVE_LOAD_FLAG flag is set. * Similarly, there is no need to clamp possible reads beyond * EOF. */ len = pf_entry_ptr->size; - /* Deserialize the prefetched on-disk image of the entry into the - * native memory form + /* Deserialize the prefetched on-disk image of the entry into the + * native memory form */ if(NULL == (thing = type->deserialize(pf_entry_ptr->image_ptr, len, udata, &dirty))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "Can't deserialize image") @@ -587,14 +587,14 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * - * note that type ids 5 & 6 are associated with object headers in the + * note that type ids 5 & 6 are associated with object headers in the * metadata cache. * * When we get to using H5C for other purposes, we may wish to * tighten up the assert so that the loophole only applies to the * metadata cache. * - * Note that at present, dirty can't be set to true with prefetched + * Note that at present, dirty can't be set to true with prefetched * entries. However this may change, so include this functionality * against that posibility. * @@ -682,8 +682,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, /* We have successfully deserialized the prefetched entry. * * Before we return a pointer to the deserialized entry, we must remove - * the prefetched entry from the cache, discard it, and replace it with - * the deserialized entry. Note that we do not free the prefetched + * the prefetched entry from the cache, discard it, and replace it with + * the deserialized entry. Note that we do not free the prefetched * entries image, as that has been transferred to the deserialized * entry. * @@ -695,11 +695,11 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * 1) Set pf_entry_ptr->image_ptr to NULL. Since we have already * transferred the buffer containing the image to *ds_entry_ptr, * this is not a memory leak. - * + * * 2) Call H5C__flush_single_entry() with the H5C__FLUSH_INVALIDATE_FLAG * and H5C__FLUSH_CLEAR_ONLY_FLAG flags set. */ - pf_entry_ptr->image_ptr = NULL; + pf_entry_ptr->image_ptr = NULL; if(pf_entry_ptr->is_dirty) { HDassert(pf_entry_ptr->in_slist); flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; @@ -723,7 +723,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, ds_entry_ptr, FAIL) - /* Deserializing a prefetched entry is the conceptual equivalent of + /* Deserializing a prefetched entry is the conceptual equivalent of * loading it from file. If the deserialized entry has a notify callback, * send an "after load" notice now that the deserialized entry is fully * integrated into the cache. @@ -732,9 +732,9 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, (ds_entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_LOAD, ds_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry loaded into cache") - /* Restore flush dependencies with the flush dependency children of - * of the prefetched entry. Note that we must protect *ds_entry_ptr - * before the call to avoid triggering sanity check failures, and + /* Restore flush dependencies with the flush dependency children of + * of the prefetched entry. Note that we must protect *ds_entry_ptr + * before the call to avoid triggering sanity check failures, and * then unprotect it afterwards. */ i = 0; @@ -798,8 +798,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__free_image_entries_array * - * Purpose: If the image entries array exists, free the image - * associated with each entry, and then free the image + * Purpose: If the image entries array exists, free the image + * associated with each entry, and then free the image * entries array proper. * * Note that by the time this function is called, the cache @@ -834,7 +834,7 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /* Get pointer to image entry */ ie_ptr = &((cache_ptr->image_entries)[u]); - /* Sanity checks */ + /* Sanity checks */ HDassert(ie_ptr); HDassert(ie_ptr->magic == H5C_IMAGE_ENTRY_T_MAGIC); HDassert(ie_ptr->image_ptr); @@ -866,14 +866,14 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /*------------------------------------------------------------------------- * Function: H5C_force_cache_image_load() * - * Purpose: On rare occasions, it is necessary to run + * Purpose: On rare occasions, it is necessary to run * H5MF_tidy_self_referential_fsm_hack() prior to the first - * metadata cache access. This is a problem as if there is a - * cache image at the end of the file, that routine will + * metadata cache access. This is a problem as if there is a + * cache image at the end of the file, that routine will * discard it. * * We solve this issue by calling this function, which will - * load the cache image and then call + * load the cache image and then call * H5MF_tidy_self_referential_fsm_hack() to discard it. * * Return: SUCCEED on success, and FAIL on failure. @@ -1053,12 +1053,12 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) if ( ( NULL == aux_ptr ) || ( aux_ptr->mpi_rank == 0 ) ) { - HDassert((NULL == aux_ptr) || + HDassert((NULL == aux_ptr) || (aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC)); #endif /* H5_HAVE_PARALLEL */ /* Read the buffer (if serial access, or rank 0 of parallel access) */ - if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, + if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, cache_ptr->image_buffer) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") @@ -1068,9 +1068,9 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) if ( aux_ptr ) { /* Broadcast cache image */ - if ( MPI_SUCCESS != - (mpi_result = MPI_Bcast(cache_ptr->image_buffer, - (int)cache_ptr->image_len, MPI_BYTE, + if ( MPI_SUCCESS != + (mpi_result = MPI_Bcast(cache_ptr->image_buffer, + (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm)) ) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) @@ -1080,9 +1080,9 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) else if ( aux_ptr ) { /* Retrieve the contents of the metadata cache image from process 0 */ - if ( MPI_SUCCESS != - (mpi_result = MPI_Bcast(cache_ptr->image_buffer, - (int)cache_ptr->image_len, MPI_BYTE, + if ( MPI_SUCCESS != + (mpi_result = MPI_Bcast(cache_ptr->image_buffer, + (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm)) ) HMPI_GOTO_ERROR(FAIL, "can't receive cache image MPI_Bcast", \ @@ -1128,14 +1128,14 @@ H5C__load_cache_image(H5F_t *f) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* If the image address is defined, load the image, decode it, - * and insert its contents into the metadata cache. + /* If the image address is defined, load the image, decode it, + * and insert its contents into the metadata cache. * - * Note that under normal operating conditions, it is an error if the + * Note that under normal operating conditions, it is an error if the * image address is HADDR_UNDEF. However, to facilitate testing, * we allow this special value of the image address which means that - * no image exists, and that the load operation should be skipped - * silently. + * no image exists, and that the load operation should be skipped + * silently. */ if(H5F_addr_defined(cache_ptr->image_addr)) { /* Sanity checks */ @@ -1184,25 +1184,25 @@ done: /*------------------------------------------------------------------------- * Function: H5C_load_cache_image_on_next_protect() * - * Purpose: Note the fact that a metadata cache image superblock + * Purpose: Note the fact that a metadata cache image superblock * extension message exists, along with the base address * and length of the metadata cache image block. * - * Once this notification is received the metadata cache - * image block must be read, decoded, and loaded into the + * Once this notification is received the metadata cache + * image block must be read, decoded, and loaded into the * cache on the next call to H5C_protect(). * - * Further, if the file is opened R/W, the metadata cache - * image superblock extension message must be deleted from + * Further, if the file is opened R/W, the metadata cache + * image superblock extension message must be deleted from * the superblock extension and the image block freed * * Contrawise, if the file is openened R/O, the metadata * cache image superblock extension message and image block * must be left as is. Further, any dirty entries in the - * cache image block must be marked as clean to avoid + * cache image block must be marked as clean to avoid * attempts to write them on file close. * - * Return: SUCCEED + * Return: SUCCEED * * Programmer: John Mainzer * 7/6/15 @@ -1291,41 +1291,41 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) /*------------------------------------------------------------------------- * Function: H5C__prep_image_for_file_close * - * Purpose: The objective of the call is to allow the metadata cache - * to do any preparatory work prior to generation of a + * Purpose: The objective of the call is to allow the metadata cache + * to do any preparatory work prior to generation of a * cache image. * - * In particular, the cache must + * In particular, the cache must * * 1) serialize all its entries, * - * 2) compute the size of the metadata cache image, + * 2) compute the size of the metadata cache image, * * 3) allocate space for the metadata cache image, and * * 4) setup the metadata cache image superblock extension - * message with the address and size of the metadata + * message with the address and size of the metadata * cache image. * - * The parallel case is complicated by the fact that - * while all metadata caches must contain the same set of - * dirty entries, there is no such requirement for clean + * The parallel case is complicated by the fact that + * while all metadata caches must contain the same set of + * dirty entries, there is no such requirement for clean * entries or the order that entries appear in the LRU. * * Thus, there is no requirement that different processes * will construct cache images of the same size. * - * This is not a major issue as long as all processes include - * the same set of dirty entries in the cache -- as they - * currently do (note that this will change when we implement - * the ageout feature). Since only the process zero cache - * writes the cache image, all that is necessary is to - * broadcast the process zero cache size for use in the - * superblock extension messages and cache image block + * This is not a major issue as long as all processes include + * the same set of dirty entries in the cache -- as they + * currently do (note that this will change when we implement + * the ageout feature). Since only the process zero cache + * writes the cache image, all that is necessary is to + * broadcast the process zero cache size for use in the + * superblock extension messages and cache image block * allocations. * - * Note: At present, cache image is disabled in the - * parallel case as the new collective metadata write + * Note: At present, cache image is disabled in the + * parallel case as the new collective metadata write * code must be modified to support cache image. * * Return: Non-negative on success/Negative on failure @@ -1354,8 +1354,8 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(image_generated); - /* If the file is opened and closed without any access to - * any group or data set, it is possible that the cache image (if + /* If the file is opened and closed without any access to + * any group or data set, it is possible that the cache image (if * it exists) has not been read yet. Do this now if required. */ if(cache_ptr->load_image) { @@ -1365,15 +1365,15 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) } /* end if */ /* Before we start to generate the cache image (if requested), verify - * that the superblock supports superblock extension messages, and + * that the superblock supports superblock extension messages, and * silently cancel any request for a cache image if it does not. * * Ideally, we would do this when the cache image is requested, - * but the necessary information is not necessary available at that + * but the necessary information is not necessary available at that * time -- hence this last minute check. * - * Note that under some error conditions, the superblock will be - * undefined in this case as well -- if so, assume that the + * Note that under some error conditions, the superblock will be + * undefined in this case as well -- if so, assume that the * superblock does not support superblock extension messages. * Also verify that the file's high_bound is at least release * 1.10.x, otherwise cancel the request for a cache image @@ -1390,17 +1390,17 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) /* Generate the cache image, if requested */ if(cache_ptr->image_ctl.generate_image) { /* Create the cache image super block extension message. - * + * * Note that the base address and length of the metadata cache * image are undefined at this point, and thus will have to be * updated later. * - * Create the super block extension message now so that space + * Create the super block extension message now so that space * is allocated for it (if necessary) before we allocate space * for the cache image block. * - * To simplify testing, do this only if the - * H5C_CI__GEN_MDCI_SBE_MESG bit is set in + * To simplify testing, do this only if the + * H5C_CI__GEN_MDCI_SBE_MESG bit is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDCI_SBE_MESG) @@ -1411,20 +1411,20 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "serialization of the cache failed") - /* Scan the cache and record data needed to construct the + /* Scan the cache and record data needed to construct the * cache image. In particular, for each entry we must record: * * 1) rank in LRU (if entry is in LRU) * - * 2) Whether the entry is dirty prior to flush of + * 2) Whether the entry is dirty prior to flush of * cache just prior to close. * * 3) Addresses of flush dependency parents (if any). * - * 4) Number of flush dependency children (if any). + * 4) Number of flush dependency children (if any). * - * In passing, also compute the size of the metadata cache - * image. With the recent modifications of the free space + * In passing, also compute the size of the metadata cache + * image. With the recent modifications of the free space * manager code, this size should be correct. */ if(H5C__prep_for_file_close__scan_entries(f, cache_ptr) < 0) @@ -1432,7 +1432,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) HDassert(HADDR_UNDEF == cache_ptr->image_addr); #ifdef H5_HAVE_PARALLEL - /* In the parallel case, overwrite the image_len with the + /* In the parallel case, overwrite the image_len with the * value computed by process 0. */ if(cache_ptr->aux_ptr) { /* we have multiple processes */ @@ -1453,17 +1453,17 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) else { if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&p0_image_len, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - + aux_ptr->p0_image_len = p0_image_len; } /* end else */ - /* Allocate space for a cache image of size equal to that - * computed by the process 0. This may be different from + /* Allocate space for a cache image of size equal to that + * computed by the process 0. This may be different from * cache_ptr->image_data_len if mpi_rank != 0. However, since - * cache image write is suppressed on all processes other than + * cache image write is suppressed on all processes other than * process 0, this doesn't matter. * - * Note that we allocate the cache image directly from the file + * Note that we allocate the cache image directly from the file * driver so as to avoid unsettling the free space managers. */ if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, @@ -1472,8 +1472,8 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) } /* end if */ else #endif /* H5_HAVE_PARALLEL */ - /* Allocate the cache image block. Note that we allocate this - * this space directly from the file driver so as to avoid + /* Allocate the cache image block. Note that we allocate this + * this space directly from the file driver so as to avoid * unsettling the free space managers. */ if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, @@ -1497,25 +1497,25 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * image block to the next alignment boundary, and then setting * the image_data_len to the actual size of the cache_image. * - * On the off chance that there is some other way to get a + * On the off chance that there is some other way to get a * a fragment on a cache image allocation, leave the following * assertion in the code so we will find out. */ HDassert((eoa_frag_size == 0) || (f->shared->alignment != 1)); /* Eventually it will be possible for the length of the cache image - * block on file to be greater than the size of the data it - * contains. However, for now they must be the same. Set + * block on file to be greater than the size of the data it + * contains. However, for now they must be the same. Set * cache_ptr->image_len accordingly. */ cache_ptr->image_len = cache_ptr->image_data_len; - /* update the metadata cache image superblock extension - * message with the new cache image block base address and + /* update the metadata cache image superblock extension + * message with the new cache image block base address and * length. * - * to simplify testing, do this only if the - * H5C_CI__GEN_MDC_IMAGE_BLK bit is set in + * to simplify testing, do this only if the + * H5C_CI__GEN_MDC_IMAGE_BLK bit is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) @@ -1525,18 +1525,18 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) /* At this point: * * 1) space in the file for the metadata cache image - * is allocated, + * is allocated, * - * 2) the metadata cache image superblock extension - * message exists and (if so configured) contains + * 2) the metadata cache image superblock extension + * message exists and (if so configured) contains * the correct data, * - * 3) All entries in the cache that will appear in the + * 3) All entries in the cache that will appear in the * cache image are serialized with up to date images. * * Since we just updated the cache image message, * the super block extension message is dirty. However, - * since the superblock and the superblock extension + * since the superblock and the superblock extension * can't be included in the cache image, this is a non- * issue. * @@ -1544,16 +1544,16 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * the cache are marked as such, and we have a count * of same. * - * 5) Flush dependency heights are calculated for all + * 5) Flush dependency heights are calculated for all * entries that will be included in the cache image. * * If there are any entries to be included in the metadata cache - * image, allocate, populate, and sort the image_entries array. + * image, allocate, populate, and sort the image_entries array. * - * If the metadata cache image will be empty, delete the - * metadata cache image superblock extension message, set + * If the metadata cache image will be empty, delete the + * metadata cache image superblock extension message, set * cache_ptr->image_ctl.generate_image to FALSE. This will - * allow the file close to continue normally without the + * allow the file close to continue normally without the * unnecessary generation of the metadata cache image. */ if(cache_ptr->num_entries_in_image > 0) { @@ -1567,9 +1567,9 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) else { /* cancel creation of metadata cache image */ HDassert(cache_ptr->image_entries == NULL); - /* To avoid breaking the control flow tests, only delete - * the mdci superblock extension message if the - * H5C_CI__GEN_MDC_IMAGE_BLK flag is set in + /* To avoid breaking the control flow tests, only delete + * the mdci superblock extension message if the + * H5C_CI__GEN_MDC_IMAGE_BLK flag is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) @@ -1591,8 +1591,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_cache_image_config * - * Purpose: If *config_ptr contains valid data, copy it into the - * image_ctl field of *cache_ptr. Make adjustments for + * Purpose: If *config_ptr contains valid data, copy it into the + * image_ctl field of *cache_ptr. Make adjustments for * changes in configuration as required. * * If the file is open read only, silently @@ -1601,9 +1601,9 @@ done: * * Note that in addition to being inapplicable in the * read only case, cache image is also inapplicable if - * the superblock does not support superblock extension - * messages. Unfortunately, this information need not - * be available at this point. Thus we check for this + * the superblock does not support superblock extension + * messages. Unfortunately, this information need not + * be available at this point. Thus we check for this * later, in H5C_prep_for_file_close() and cancel the * cache image request if appropriate. * @@ -1638,7 +1638,7 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid cache image configuration") #ifdef H5_HAVE_PARALLEL - /* The collective metadata write code is not currently compatible + /* The collective metadata write code is not currently compatible * with cache image. Until this is fixed, suppress cache image silently * if there is more than one process. * JRM -- 11/8/16 @@ -1652,15 +1652,15 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, else { #endif /* H5_HAVE_PARALLEL */ /* A cache image can only be generated if the file is opened read / write - * and the superblock supports superblock extension messages. + * and the superblock supports superblock extension messages. * - * However, the superblock version is not available at this point -- + * However, the superblock version is not available at this point -- * hence we can only check the former requirement now. Do the latter - * check just before we construct the image.. + * check just before we construct the image.. * * If the file is opened read / write, apply the supplied configuration. * - * If it is not, set the image configuration to the default, which has + * If it is not, set the image configuration to the default, which has * the effect of silently disabling the cache image if it was requested. */ if(H5F_INTENT(f) & H5F_ACC_RDWR) @@ -1683,7 +1683,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_validate_cache_image_config() * - * Purpose: Run a sanity check on the provided instance of struct + * Purpose: Run a sanity check on the provided instance of struct * H5AC_cache_image_config_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -1715,8 +1715,8 @@ H5C_validate_cache_image_config(H5C_cache_image_ctl_t * ctl_ptr) if(ctl_ptr->save_resize_status != FALSE) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unexpected value in save_resize_status field") - /* At present, we do not support prefetched entry ageouts. Thus - * the entry_ageout field must be set to + /* At present, we do not support prefetched entry ageouts. Thus + * the entry_ageout field must be set to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. */ if(ctl_ptr->entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE) @@ -1740,7 +1740,7 @@ done: * Purpose: Compute the size of the header of the metadata cache * image block, and return the value. * - * Return: Size of the header section of the metadata cache image + * Return: Size of the header section of the metadata cache image * block in bytes. * * Programmer: John Mainzer @@ -1777,7 +1777,7 @@ H5C__cache_image_block_entry_header_size(const H5F_t * f) * Purpose: Compute the size of the header of the metadata cache * image block, and return the value. * - * Return: Size of the header section of the metadata cache image + * Return: Size of the header section of the metadata cache image * block in bytes. * * Programmer: John Mainzer @@ -1806,9 +1806,9 @@ H5C__cache_image_block_header_size(const H5F_t * f) /*------------------------------------------------------------------------- * Function: H5C__decode_cache_image_header() * - * Purpose: Decode the metadata cache image buffer header from the + * Purpose: Decode the metadata cache image buffer header from the * supplied buffer and load the data into the supplied instance - * of H5C_t. Advances the buffer pointer to the first byte + * of H5C_t. Advances the buffer pointer to the first byte * after the header image, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -1853,7 +1853,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, /* Decode flags */ flags = *p++; - if(flags & H5C__MDCI_HEADER_HAVE_RESIZE_STATUS) + if(flags & H5C__MDCI_HEADER_HAVE_RESIZE_STATUS) have_resize_status = TRUE; if(have_resize_status) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "MDC resize status not yet supported") @@ -1867,7 +1867,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, /* Read num entries */ UINT32DECODE(p, cache_ptr->num_entries_in_image); - if(cache_ptr->num_entries_in_image == 0) + if(cache_ptr->num_entries_in_image == 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache entry count") /* Verify expected length of header */ @@ -1888,13 +1888,13 @@ done: /*------------------------------------------------------------------------- * Function: H5C__decode_cache_image_entry() * - * Purpose: Decode the metadata cache image entry from the supplied + * Purpose: Decode the metadata cache image entry from the supplied * buffer into the supplied instance of H5C_image_entry_t. * This includes allocating a buffer for the entry image, - * loading it, and seting ie_ptr->image_ptr to point to + * loading it, and seting ie_ptr->image_ptr to point to * the buffer. * - * Advances the buffer pointer to the first byte + * Advances the buffer pointer to the first byte * after the entry, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -1998,8 +1998,8 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, /* Verify expected length of entry image */ if((size_t)(p - *buf) != H5C__cache_image_block_entry_header_size(f)) HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "Bad entry image len") - - /* If parent count greater than zero, allocate array for parent + + /* If parent count greater than zero, allocate array for parent * addresses, and decode addresses into the array. */ if(fd_parent_count > 0) { @@ -2053,9 +2053,9 @@ done: /*------------------------------------------------------------------------- * Function: H5C__destroy_pf_entry_child_flush_deps() * - * Purpose: Destroy all flush dependencies in this the supplied + * Purpose: Destroy all flush dependencies in this the supplied * prefetched entry is the parent. Note that the children - * in these flush dependencies must be prefetched entries as + * in these flush dependencies must be prefetched entries as * well. * * As this action is part of the process of transferring all @@ -2063,8 +2063,8 @@ done: * prefetched entry, ensure that the data necessary to complete * the transfer is retained. * - * Note: The current implementation of this function is - * quite inefficient -- mostly due to the current + * Note: The current implementation of this function is + * quite inefficient -- mostly due to the current * implementation of flush dependencies. This should * be fixed at some point. * @@ -2076,7 +2076,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, +H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_entry_ptr, H5C_cache_entry_t **fd_children) { H5C_cache_entry_t * entry_ptr; @@ -2103,8 +2103,8 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, while(entry_ptr != NULL) { HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - /* Here we look at entry_ptr->flush_dep_nparents and not - * entry_ptr->fd_parent_count as it is possible that some + /* Here we look at entry_ptr->flush_dep_nparents and not + * entry_ptr->fd_parent_count as it is possible that some * or all of the prefetched flush dependency child relationships * have already been destroyed. */ @@ -2145,9 +2145,9 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry child flush dependency") #ifndef NDEBUG - /* Sanity check -- verify that the address of the parent + /* Sanity check -- verify that the address of the parent * appears in entry_ptr->fd_parent_addrs. Must do a search, - * as with flush dependency creates and destroys, + * as with flush dependency creates and destroys, * entry_ptr->fd_parent_addrs and entry_ptr->flush_dep_parent * can list parents in different order. */ @@ -2181,8 +2181,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__encode_cache_image_header() * - * Purpose: Encode the metadata cache image buffer header in the - * supplied buffer. Updates buffer pointer to the first byte + * Purpose: Encode the metadata cache image buffer header in the + * supplied buffer. Updates buffer pointer to the first byte * after the header image in the buffer, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -2259,8 +2259,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__encode_cache_image_entry() * - * Purpose: Encode the metadata cache image buffer header in the - * supplied buffer. Updates buffer pointer to the first byte + * Purpose: Encode the metadata cache image buffer header in the + * supplied buffer. Updates buffer pointer to the first byte * after the entry in the buffer, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -2271,7 +2271,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, +H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigned entry_num) { H5C_image_entry_t * ie_ptr; /* Pointer to entry to encode */ @@ -2306,13 +2306,13 @@ H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, *p++ = (uint8_t)(ie_ptr->type_id); /* Compose and encode flags */ - if(ie_ptr->is_dirty) + if(ie_ptr->is_dirty) flags |= H5C__MDCI_ENTRY_DIRTY_FLAG; - if(ie_ptr->lru_rank > 0) + if(ie_ptr->lru_rank > 0) flags |= H5C__MDCI_ENTRY_IN_LRU_FLAG; if(ie_ptr->fd_child_count > 0) flags |= H5C__MDCI_ENTRY_IS_FD_PARENT_FLAG; - if(ie_ptr->fd_parent_count > 0) + if(ie_ptr->fd_parent_count > 0) flags |= H5C__MDCI_ENTRY_IS_FD_CHILD_FLAG; *p++ = flags; @@ -2377,51 +2377,51 @@ done: * flush dependency children. (Recall that the flush dependency * height of an entry in a flush dependency relationship is the * length of the longest path from the entry to a leaf entry -- - * that is an entry with flush dependency parents, but no - * flush dependency children. With the introduction of the + * that is an entry with flush dependency parents, but no + * flush dependency children. With the introduction of the * possibility of multiple flush dependency parents, we have - * a flush partial dependency latice, not a flush dependency - * tree. But since the partial latice is acyclic, the concept + * a flush partial dependency latice, not a flush dependency + * tree. But since the partial latice is acyclic, the concept * of flush dependency height still makes sense. * - * The purpose of this function is to compute the flush + * The purpose of this function is to compute the flush * dependency height of all entries that appear in the cache - * image. + * image. * - * At present, entries are included or excluded from the + * At present, entries are included or excluded from the * cache image depending upon the ring in which they reside. * Thus there is no chance that one side of a flush dependency * will be in the cache image, and the other side not. * * However, once we start placing a limit on the size of the * cache image, or start excluding prefetched entries from - * the cache image if they haven't been accessed in some - * number of file close / open cycles, this will no longer - * be the case. + * the cache image if they haven't been accessed in some + * number of file close / open cycles, this will no longer + * be the case. * * In particular, if a flush dependency child is dirty, and * one of its flush dependency parents is dirty and not in * the cache image, then the flush dependency child cannot * be in the cache image without violating flush ordering. * - * Observe that a clean flush dependency child can be either - * in or out of the cache image without effect on flush + * Observe that a clean flush dependency child can be either + * in or out of the cache image without effect on flush * dependencies. * - * Similarly, a flush dependency parent can always be part - * of a cache image, regardless of whether it is clean or + * Similarly, a flush dependency parent can always be part + * of a cache image, regardless of whether it is clean or * dirty -- but remember that a flush dependency parent can * also be a flush dependency child. - * + * * Finally, note that for purposes of the cache image, flush - * dependency height ends when a flush dependecy relation + * dependency height ends when a flush dependecy relation * passes off the cache image. * - * On exit, the flush dependency height of each entry in the + * On exit, the flush dependency height of each entry in the * cache image should be calculated and stored in the cache * entry. Entries will be removed from the cache image if * necessary to maintain flush ordering. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2447,10 +2447,10 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* Remove from the cache image all dirty entries that are + /* Remove from the cache image all dirty entries that are * flush dependency children of dirty entries that are not in the - * cache image. Must do this, as if we fail to do so, the parent - * will be written to file before the child. Since it is possible + * cache image. Must do this, as if we fail to do so, the parent + * will be written to file before the child. Since it is possible * that the child will have dirty children of its own, this may take * multiple passes through the index list. */ @@ -2484,17 +2484,17 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) entry_ptr = entry_ptr->il_next; } /* while ( entry_ptr != NULL ) */ - } /* while ( ! done ) */ + } /* while ( ! done ) */ /* at present, entries are included in the cache image if they reside - * in a specified set of rings. Thus it should be impossible for - * entries_removed_from_image to be positive. Assert that this is - * so. Note that this will change when we start aging entries out + * in a specified set of rings. Thus it should be impossible for + * entries_removed_from_image to be positive. Assert that this is + * so. Note that this will change when we start aging entries out * of the cache image. */ HDassert(entries_removed_from_image == 0); - /* Next, remove from entries in the cache image, references to + /* Next, remove from entries in the cache image, references to * flush dependency parents or children that are not in the cache image. */ entry_ptr = cache_ptr->il_head; @@ -2575,14 +2575,14 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) entry_ptr = entry_ptr->il_next; } /* while (entry_ptr != NULL) */ - /* At present, no extenal parent or child flush dependency links + /* At present, no extenal parent or child flush dependency links * should exist -- hence the following assertions. This will change * if we support ageout of entries in the cache image. */ HDassert(external_child_fd_refs_removed == 0); HDassert(external_parent_fd_refs_removed == 0); - /* At this point we should have removed all flush dependencies that + /* At this point we should have removed all flush dependencies that * cross cache image boundaries. Now compute the flush dependency * heights for all entries in the image. * @@ -2600,7 +2600,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) parent_ptr = entry_ptr->flush_dep_parent[u]; HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - if(parent_ptr->include_in_image && parent_ptr->image_fd_height <= 0) + if(parent_ptr->include_in_image && parent_ptr->image_fd_height <= 0) H5C__prep_for_file_close__compute_fd_heights_real(parent_ptr, 1); } /* end for */ } /* end if */ @@ -2623,37 +2623,37 @@ done: * * The basic observation behind this function is as follows: * - * Suppose you have an entry E with a flush dependency - * height of X. Then the parents of E must all have + * Suppose you have an entry E with a flush dependency + * height of X. Then the parents of E must all have * flush dependency X + 1 or greater. * * Use this observation to compute flush dependency height * of all entries in the cache image via the following * recursive algorithm: * - * 1) On entry, set the flush dependency height of the + * 1) On entry, set the flush dependency height of the * supplied cache entry to the supplied value. * - * 2) Examine all the flush dependency parents of the - * supplied entry. + * 2) Examine all the flush dependency parents of the + * supplied entry. * - * If the parent is in the cache image, and has flush + * If the parent is in the cache image, and has flush * dependency height less than or equal to the flush - * dependency height of the current entry, call the + * dependency height of the current entry, call the * recursive routine on the parent with flush dependency - * height equal to the flush dependency height of the + * height equal to the flush dependency height of the * child plus 1. * * Otherwise do nothing. * * Observe that if the flush dependency height of all entries - * in the image is initialized to zero, and if this recursive - * function is called with flush dependency height 0 on all - * entries in the cache image with FD parents in the image, - * but without FD children in the image, the correct flush - * dependency height should be set for all entries in the + * in the image is initialized to zero, and if this recursive + * function is called with flush dependency height 0 on all + * entries in the cache image with FD parents in the image, + * but without FD children in the image, the correct flush + * dependency height should be set for all entries in the * cache image. - * + * * Return: void * * Programmer: John Mainzer @@ -2698,9 +2698,9 @@ H5C__prep_for_file_close__compute_fd_heights_real(H5C_cache_entry_t *entry_ptr, * Function: H5C__prep_for_file_close__setup_image_entries_array * * Purpose: Allocate space for the image_entries array, and load - * each instance of H5C_image_entry_t in the array with + * each instance of H5C_image_entry_t in the array with * the data necessary to construct the metadata cache image. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2758,14 +2758,14 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) image_entries[u].ring = entry_ptr->ring; /* When a prefetched entry is included in the image, store - * its underlying type id in the image entry, not + * its underlying type id in the image entry, not * H5AC_PREFETCHED_ENTRY_ID. In passing, also increment * the age (up to H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX). */ if(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID) { image_entries[u].type_id = entry_ptr->prefetch_type_id; image_entries[u].age = entry_ptr->age + 1; - + if(image_entries[u].age > H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX) image_entries[u].age = H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX; } /* end if */ @@ -2780,13 +2780,13 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) image_entries[u].fd_parent_count = entry_ptr->fd_parent_count; image_entries[u].fd_parent_addrs = entry_ptr->fd_parent_addrs; image_entries[u].fd_child_count = entry_ptr->fd_child_count; - image_entries[u].fd_dirty_child_count = + image_entries[u].fd_dirty_child_count = entry_ptr->fd_dirty_child_count; image_entries[u].image_ptr = entry_ptr->image_ptr; - /* Null out entry_ptr->fd_parent_addrs and set + /* Null out entry_ptr->fd_parent_addrs and set * entry_ptr->fd_parent_count to zero so that ownership of the - * flush dependency parents address array is transferred to the + * flush dependency parents address array is transferred to the * image entry. */ entry_ptr->fd_parent_count = 0; @@ -2819,8 +2819,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__prep_for_file_close__scan_entries * - * Purpose: Scan all entries in the metadata cache, and store all - * entry specific data required for construction of the + * Purpose: Scan all entries in the metadata cache, and store all + * entry specific data required for construction of the * metadata cache image block and likely to be discarded * or modified during the cache flush on file close. * @@ -2838,7 +2838,7 @@ done: * * Finally, compute the size of the metadata cache image * block. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2891,7 +2891,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HDassert(entry_ptr->image_ptr); /* Initially, we mark all entries in the rings included - * in the cache image as being included in the in the + * in the cache image as being included in the in the * image. Depending on circumstances, we may exclude some * of these entries later. */ @@ -2907,7 +2907,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) entry_ptr->image_fd_height = 0; /* will compute this later */ /* Initially, include all flush dependency parents in the - * the list of flush dependencies to be stored in the + * the list of flush dependencies to be stored in the * image. We may remove some or all of these later. */ if(entry_ptr->flush_dep_nparents > 0) { @@ -2915,7 +2915,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) * as needed. */ if(entry_ptr->flush_dep_nparents == entry_ptr->fd_parent_count ) { - /* parent addresses array should already be allocated + /* parent addresses array should already be allocated * and of the correct size. */ HDassert(entry_ptr->fd_parent_addrs); @@ -2947,8 +2947,8 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HDassert(entry_ptr->fd_parent_addrs == NULL); /* Initially, all flush dependency children are included int - * the count of flush dependency child relationships to be - * represented in the cache image. Some or all of these + * the count of flush dependency child relationships to be + * represented in the cache image. Some or all of these * may be dropped from the image later. */ if(entry_ptr->flush_dep_nchildren > 0) { @@ -2970,23 +2970,23 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* Now compute the flush dependency heights of all flush dependency * relationships to be represented in the image. * - * If all entries in the target rings are included in the - * image, the flush dependency heights are simply the heights + * If all entries in the target rings are included in the + * image, the flush dependency heights are simply the heights * of all flush dependencies in the target rings. * - * However, if we restrict appearance in the cache image either - * by number of entries in the image, restrictions on the number - * of times a prefetched entry can appear in an image, or image + * However, if we restrict appearance in the cache image either + * by number of entries in the image, restrictions on the number + * of times a prefetched entry can appear in an image, or image * size, it is possible that flush dependency parents or children * of entries that are in the image may not be included in the - * the image. In this case, we must prune all flush dependency - * relationships that cross the image boundary, and all exclude - * from the image all dirty flush dependency children that have - * a dirty flush dependency parent that is not in the image. + * the image. In this case, we must prune all flush dependency + * relationships that cross the image boundary, and all exclude + * from the image all dirty flush dependency children that have + * a dirty flush dependency parent that is not in the image. * This is necessary to preserve the required flush ordering. - * - * These details are tended to by the following call to - * H5C__prep_for_file_close__compute_fd_heights(). Because the + * + * These details are tended to by the following call to + * H5C__prep_for_file_close__compute_fd_heights(). Because the * exact contents of the image cannot be known until after this * call, computation of the image size is delayed. */ @@ -2994,7 +2994,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "computation of flush dependency heights failed?!?") /* At this point, all entries that will appear in the cache - * image should be marked correctly. Compute the size of the + * image should be marked correctly. Compute the size of the * cache image. */ entries_visited = 0; @@ -3031,11 +3031,11 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* Now scan the LRU list to set the lru_rank fields of all entries * on the LRU. * - * Note that we start with rank 1, and increment by 1 with each - * entry on the LRU. + * Note that we start with rank 1, and increment by 1 with each + * entry on the LRU. * * Note that manually pinned entryies will have lru_rank -1, - * and no flush dependency. Putting these entries at the head of + * and no flush dependency. Putting these entries at the head of * the reconstructed LRU should be appropriate. */ entry_ptr = cache_ptr->LRU_head_ptr; @@ -3045,11 +3045,11 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* to avoid confusion, don't set lru_rank on epoch markers. * Note that we still increment the lru_rank, so that the holes - * in the sequence of entries on the LRU will indicate the - * locations of epoch markers (if any) when we reconstruct + * in the sequence of entries on the LRU will indicate the + * locations of epoch markers (if any) when we reconstruct * the LRU. * - * Do not set lru_rank or increment lru_rank for entries + * Do not set lru_rank or increment lru_rank for entries * that will not be included in the cache image. */ if(entry_ptr->type->id == H5AC_EPOCH_MARKER_ID) @@ -3076,9 +3076,9 @@ done: * Function: H5C__reconstruct_cache_contents() * * Purpose: Scan the image buffer, and create a prefetched - * cache entry for every entry in the buffer. Insert the - * prefetched entries in the index and the LRU, and - * reconstruct any flush dependencies. Order the entries + * cache entry for every entry in the buffer. Insert the + * prefetched entries in the index and the LRU, and + * reconstruct any flush dependencies. Order the entries * in the LRU as indicated by the stored lru_ranks. * * Return: SUCCEED on success, and FAIL on failure. @@ -3127,11 +3127,11 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) if(NULL == (pf_entry_ptr = H5C__reconstruct_cache_entry(f, cache_ptr, &p))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "reconstruction of cache entry failed") - /* Note that we make no checks on available cache space before + /* Note that we make no checks on available cache space before * inserting the reconstructed entry into the metadata cache. * * This is OK since the cache must be almost empty at the beginning - * of the process, and since we check cache size at the end of the + * of the process, and since we check cache size at the end of the * reconstruction process. */ @@ -3147,7 +3147,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, pf_entry_ptr->is_dirty) - /* If the prefetched entry is the child in one or more flush + /* If the prefetched entry is the child in one or more flush * dependency relationships, recreate those flush dependencies. */ for(v = 0; v < pf_entry_ptr->fd_parent_count; v++) { @@ -3171,7 +3171,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) */ H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, parent_ptr, FAIL) parent_ptr->is_protected = TRUE; - + /* Setup the flush dependency */ if(H5C_create_flush_dependency(parent_ptr, pf_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Can't restore flush dependency") @@ -3211,7 +3211,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) pf_entry_ptr = pf_entry_ptr->il_next; } /* end while */ - /* Scan the LRU, and verify the expected ordering of the + /* Scan the LRU, and verify the expected ordering of the * prefetched entries. */ { @@ -3233,7 +3233,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) HDassert((entry_ptr->lru_rank == -1) || (entry_ptr->lru_rank > i)); - if ( ( entry_ptr->lru_rank > 1 ) && + if ( ( entry_ptr->lru_rank > 1 ) && ( entry_ptr->lru_rank > i + 1 ) ) lru_rank_holes += entry_ptr->lru_rank - (i + 1); @@ -3245,9 +3245,9 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) entry_ptr = entry_ptr->next; } /* end while */ - /* Holes in the sequences of LRU ranks can appear due to epoch + /* Holes in the sequences of LRU ranks can appear due to epoch * markers. They are left in to allow re-insertion of the - * epoch markers on reconstruction of the cache -- thus + * epoch markers on reconstruction of the cache -- thus * the following sanity check will have to be revised when * we add code to store and restore adaptive resize status. */ @@ -3255,7 +3255,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) } /* end block */ #endif /* NDEBUG */ - /* Check to see if the cache is oversize, and evict entries as + /* Check to see if the cache is oversize, and evict entries as * necessary to remain within limits. */ if(cache_ptr->index_size >= cache_ptr->max_cache_size) { @@ -3289,7 +3289,7 @@ done: * Return a pointer to the newly allocated cache entry, * or NULL on failure. * - * Return: Pointer to the new instance of H5C_cache_entry on success, + * Return: Pointer to the new instance of H5C_cache_entry on success, * or NULL on failure. * * Programmer: John Mainzer @@ -3347,7 +3347,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, is_fd_child = TRUE; #endif /* NDEBUG */ /* only used in assertions */ - /* Force dirty entries to clean if the file read only -- must do + /* Force dirty entries to clean if the file read only -- must do * this as otherwise the cache will attempt to write them on file * close. Since the file is R/O, the metadata cache image superblock * extension message and the cache image block will not be removed. @@ -3355,7 +3355,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, * * However, if the dirty entry (marked clean for purposes of the R/O * file open) is evicted and then referred to, the cache will read - * either invalid or obsolete data from the file. Handle this by + * either invalid or obsolete data from the file. Handle this by * setting the prefetched_dirty field, and hiding such entries from * the eviction candidate selection algorithm. */ @@ -3375,7 +3375,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, /* Decode dirty dependency child count */ UINT16DECODE(p, pf_entry_ptr->fd_dirty_child_count); - if(!file_is_rw) + if(!file_is_rw) pf_entry_ptr->fd_dirty_child_count = 0; if(pf_entry_ptr->fd_dirty_child_count > pf_entry_ptr->fd_child_count) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "invalid dirty flush dependency child count") @@ -3401,8 +3401,8 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, /* Verify expected length of entry image */ if((size_t)(p - *buf) != H5C__cache_image_block_entry_header_size(f)) HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, NULL, "Bad entry image len") - - /* If parent count greater than zero, allocate array for parent + + /* If parent count greater than zero, allocate array for parent * addresses, and decode addresses into the array. */ if(pf_entry_ptr->fd_parent_count > 0) { @@ -3457,7 +3457,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__write_cache_image_superblock_msg * - * Purpose: Write the cache image superblock extension message, + * Purpose: Write the cache image superblock extension message, * creating if specified. * * In general, the size and location of the cache image block @@ -3560,7 +3560,7 @@ H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) } /* end if */ } /* end block */ #endif /* H5_HAVE_PARALLEL */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__write_cache_image() */ diff --git a/src/H5Clog.c b/src/H5Clog.c index cf9b7e8..794d6bb 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -313,7 +313,7 @@ H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, *------------------------------------------------------------------------- */ herr_t -H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value) +H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -348,7 +348,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_log_write_destroy_cache_msg(H5C_t *cache) +H5C_log_write_destroy_cache_msg(H5C_t *cache) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index 5ac354d..ab25a55 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -143,7 +143,7 @@ static H5C_log_class_t H5C_json_log_class_g = { /*------------------------------------------------------------------------- * Function: H5C__json_write_log_message * - * Purpose: Write a message to the log file and flush the file. + * Purpose: Write a message to the log file and flush the file. * The message string is neither modified nor freed. * * Return: SUCCEED/FAIL @@ -171,7 +171,7 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata) if((int)n_chars != HDfprintf(json_udata->outfile, json_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char))); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__json_write_log_message() */ @@ -222,7 +222,7 @@ H5C_log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi if(NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_json_udata_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") json_udata = (H5C_log_json_udata_t *)(log_info->udata); - + /* Allocate memory for the message buffer */ if(NULL == (json_udata->message = (char *)H5MM_calloc(H5C_MAX_JSON_LOG_MSG_SIZE * sizeof(char)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -341,7 +341,7 @@ H5C__json_write_start_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string (opens the JSON array) */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\n\ \"HDF5 metadata cache log messages\" : [\n\ @@ -386,7 +386,7 @@ H5C__json_write_stop_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string (closes the JSON array) */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -399,7 +399,7 @@ H5C__json_write_stop_log_msg(void *udata) /* Write the log message to the file */ if(H5C__json_write_log_message(json_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__json_write_stop_log_msg() */ @@ -418,7 +418,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) +H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) { H5C_log_json_udata_t *json_udata = (H5C_log_json_udata_t *)(udata); herr_t ret_value = SUCCEED; /* Return value */ @@ -430,7 +430,7 @@ H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -474,7 +474,7 @@ H5C__json_write_destroy_cache_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -517,7 +517,7 @@ H5C__json_write_evict_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -562,7 +562,7 @@ H5C__json_write_expunge_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -609,7 +609,7 @@ H5C__json_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -654,7 +654,7 @@ H5C__json_write_insert_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -705,7 +705,7 @@ H5C__json_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *e HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -752,7 +752,7 @@ H5C__json_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *e HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -799,7 +799,7 @@ H5C__json_write_mark_unserialized_entry_log_msg(void *udata, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -846,7 +846,7 @@ H5C__json_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -892,7 +892,7 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -903,7 +903,7 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)old_addr, + , (long long)HDtime(NULL), (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -942,7 +942,7 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -951,7 +951,7 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -992,7 +992,7 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1002,7 +1002,7 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1043,11 +1043,11 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr if(H5C__READ_ONLY_FLAG == flags) HDstrcpy(rw_s, "READ"); - else + else HDstrcpy(rw_s, "WRITE"); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1059,7 +1059,7 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, type_id, rw_s, (int)entry->size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1098,7 +1098,7 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1108,7 +1108,7 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1147,7 +1147,7 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1156,7 +1156,7 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1197,7 +1197,7 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1207,7 +1207,7 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1245,7 +1245,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1256,7 +1256,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)address, + , (long long)HDtime(NULL), (unsigned long)address, type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1295,7 +1295,7 @@ H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t HDassert(config); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1342,7 +1342,7 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1351,7 +1351,7 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index 713f333..63fe382 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -138,7 +138,7 @@ static H5C_log_class_t H5C_trace_log_class_g = { /*------------------------------------------------------------------------- * Function: H5C__trace_write_log_message * - * Purpose: Write a message to the log file and flush the file. + * Purpose: Write a message to the log file and flush the file. * The message string is neither modified nor freed. * * Return: SUCCEED/FAIL @@ -166,7 +166,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) if((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char))); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_log_message() */ @@ -217,7 +217,7 @@ H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mp if(NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_trace_udata_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") trace_udata = (H5C_log_trace_udata_t *)(log_info->udata); - + /* Allocate memory for the message buffer */ if(NULL == (trace_udata->message = (char *)H5MM_calloc(H5C_MAX_TRACE_LOG_MSG_SIZE * sizeof(char)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -340,7 +340,7 @@ H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", (unsigned long)address, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -377,7 +377,7 @@ H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", (int)fxn_ret_value); /* Write the log message to the file */ @@ -415,7 +415,7 @@ H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -454,7 +454,7 @@ H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t * HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -493,7 +493,7 @@ H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t * HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -532,7 +532,7 @@ H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -571,7 +571,7 @@ H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -609,7 +609,7 @@ H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_a HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -648,7 +648,7 @@ H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -689,7 +689,7 @@ H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -728,7 +728,7 @@ H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *ent HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", (unsigned long)(entry->addr), type_id, flags, (int)(entry->size), (int)fxn_ret_value); /* Write the log message to the file */ @@ -767,7 +767,7 @@ H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", (unsigned long)(entry->addr), (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -806,7 +806,7 @@ H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -847,7 +847,7 @@ H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -885,7 +885,7 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", (unsigned long)(address), type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ @@ -994,7 +994,7 @@ H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 2c176e4..0ac4c4f 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -60,7 +60,7 @@ /* Local Prototypes */ /********************/ static herr_t H5C__collective_write(H5F_t *f); -static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], +static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]); static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear); @@ -87,20 +87,20 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Purpose: Apply the supplied candidate list. * - * We used to do this by simply having each process write - * every mpi_size-th entry in the candidate list, starting - * at index mpi_rank, and mark all the others clean. + * We used to do this by simply having each process write + * every mpi_size-th entry in the candidate list, starting + * at index mpi_rank, and mark all the others clean. * - * However, this can cause unnecessary contention in a file - * system by increasing the number of processes writing to + * However, this can cause unnecessary contention in a file + * system by increasing the number of processes writing to * adjacent locations in the HDF5 file. * - * To attempt to minimize this, we now arange matters such - * that each process writes n adjacent entries in the + * To attempt to minimize this, we now arange matters such + * that each process writes n adjacent entries in the * candidate list, and marks all others clean. We must do - * this in such a fashion as to guarantee that each entry - * on the candidate list is written by exactly one process, - * and marked clean by all others. + * this in such a fashion as to guarantee that each entry + * on the candidate list is written by exactly one process, + * and marked clean by all others. * * To do this, first construct a table mapping mpi_rank * to the index of the first entry in the candidate list to @@ -110,7 +110,7 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Note that the table must be identical on all processes, as * all see the same candidate list, mpi_size, and mpi_rank -- - * the inputs used to construct the table. + * the inputs used to construct the table. * * We construct the table as follows. Let: * @@ -118,18 +118,18 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * m = num_candidates % mpi_size; * - * Now allocate an array of integers of length mpi_size + 1, - * and call this array candidate_assignment_table. + * Now allocate an array of integers of length mpi_size + 1, + * and call this array candidate_assignment_table. * * Conceptually, if the number of candidates is a multiple * of the mpi_size, we simply pass through the candidate list - * and assign n entries to each process to flush, with the - * index of the first entry to flush in the location in + * and assign n entries to each process to flush, with the + * index of the first entry to flush in the location in * the candidate_assignment_table indicated by the mpi_rank - * of the process. + * of the process. * - * In the more common case in which the candidate list isn't - * isn't a multiple of the mpi_size, we pretend it is, and + * In the more common case in which the candidate list isn't + * isn't a multiple of the mpi_size, we pretend it is, and * give num_candidates % mpi_size processes one extra entry * each to make things work out. * @@ -138,22 +138,22 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * first_entry_to_flush = candidate_assignment_table[mpi_rank] * - * last_entry_to_flush = + * last_entry_to_flush = * candidate_assignment_table[mpi_rank + 1] - 1; - * - * With these values determined, we simply scan through the - * candidate list, marking all entries in the range + * + * With these values determined, we simply scan through the + * candidate list, marking all entries in the range * [first_entry_to_flush, last_entry_to_flush] for flush, * and all others to be cleaned. * - * Finally, we scan the LRU from tail to head, flushing + * Finally, we scan the LRU from tail to head, flushing * or marking clean the candidate entries as indicated. * If necessary, we scan the pinned list as well. * - * Note that this function will fail if any protected or + * Note that this function will fail if any protected or * clean entries appear on the candidate list. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -246,7 +246,7 @@ H5C_apply_candidate_list(H5F_t * f, for(i = 1; i < mpi_size; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n; } /* end if */ - else { + else { for(i = 1; i <= m; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1; @@ -287,7 +287,7 @@ H5C_apply_candidate_list(H5F_t * f, HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); - HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", + HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush); HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank); @@ -316,7 +316,7 @@ H5C_apply_candidate_list(H5F_t * f, if(entry_ptr->is_protected) /* For now at least, we can't deal with protected entries. * If we encounter one, scream and die. If it becomes an - * issue, we should be able to work around this. + * issue, we should be able to work around this. */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?") @@ -328,9 +328,9 @@ H5C_apply_candidate_list(H5F_t * f, HDassert(!entry_ptr->clear_on_unprotect); /* Determine whether the entry is to be cleared or flushed, - * and mark it accordingly. We will scan the protected and + * and mark it accordingly. We will scan the protected and * pinned list shortly, and clear or flush according to these - * markings. + * markings. */ if(u >= first_entry_to_flush && u <= last_entry_to_flush) { total_entries_to_flush++; @@ -347,7 +347,7 @@ H5C_apply_candidate_list(H5F_t * f, * candidate list to clear from the cache have to be * removed from the coll list. This is OK since the * candidate list is collective and uniform across all - * ranks. + * ranks. */ if(entry_ptr->coll_access) { entry_ptr->coll_access = FALSE; @@ -368,14 +368,14 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", + HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", FUNC, mpi_rank, num_candidates, total_entries_to_clear, total_entries_to_flush); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - /* We have now marked all the entries on the candidate list for + /* We have now marked all the entries on the candidate list for * either flush or clear -- now scan the LRU and the pinned list - * for these entries and do the deed. Do this via a call to + * for these entries and do the deed. Do this via a call to * H5C__flush_candidate_entries(). * * Note that we are doing things in this round about manner so as @@ -412,10 +412,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_construct_candidate_list__clean_cache * - * Purpose: Construct the list of entries that should be flushed to + * Purpose: Construct the list of entries that should be flushed to * clean all entries in the cache. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -448,9 +448,9 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) * point, it is possible that some dirty entries may reside on the * pinned list at this point. */ - HDassert( cache_ptr->slist_size <= + HDassert( cache_ptr->slist_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size) ); - HDassert( cache_ptr->slist_len <= + HDassert( cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len) ); if(space_needed > 0) { /* we have work to do */ @@ -462,7 +462,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) HDassert( cache_ptr->slist_len > 0 ); /* Scan the dirty LRU list from tail forward and nominate sufficient - * entries to free up the necessary space. + * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; while((nominated_entries_size < space_needed) && @@ -484,7 +484,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) } /* end while */ HDassert( entry_ptr == NULL ); - /* it is possible that there are some dirty entries on the + /* it is possible that there are some dirty entries on the * protected entry list as well -- scan it too if necessary */ entry_ptr = cache_ptr->pel_head_ptr; @@ -521,10 +521,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_construct_candidate_list__min_clean * - * Purpose: Construct the list of entries that should be flushed to + * Purpose: Construct the list of entries that should be flushed to * get the cache back within its min clean constraints. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -547,7 +547,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - /* compute the number of bytes (if any) that must be flushed to get the + /* compute the number of bytes (if any) that must be flushed to get the * cache back within its min clean constraints. */ if(cache_ptr->max_cache_size > cache_ptr->index_size) { @@ -575,7 +575,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) HDassert( cache_ptr->slist_len > 0 ); /* Scan the dirty LRU list from tail forward and nominate sufficient - * entries to free up the necessary space. + * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; while((nominated_entries_size < space_needed) && @@ -751,23 +751,23 @@ H5C_mark_entries_as_clean(H5F_t * f, * any protected entries will not be on the LRU, and therefore * will not be flushed at this time. * - * Note that unlike H5C_apply_candidate_list(), - * H5C_mark_entries_as_clean() makes all its calls to - * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG - * set. As a result, the pre_serialize() and serialize calls are + * Note that unlike H5C_apply_candidate_list(), + * H5C_mark_entries_as_clean() makes all its calls to + * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG + * set. As a result, the pre_serialize() and serialize calls are * not made. * - * This then implies that (assuming such actions were - * permitted in the parallel case) no loads, dirties, - * resizes, or removals of other entries can occur as + * This then implies that (assuming such actions were + * permitted in the parallel case) no loads, dirties, + * resizes, or removals of other entries can occur as * a side effect of the flush. Hence, there is no need - * for the checks for entry removal / status change + * for the checks for entry removal / status change * that I ported to H5C_apply_candidate_list(). * * However, if (in addition to allowing such operations * in the parallel case), we allow such operations outside - * of the pre_serialize / serialize routines, this may - * cease to be the case -- requiring a review of this + * of the pre_serialize / serialize routines, this may + * cease to be the case -- requiring a review of this * point. * JRM -- 4/7/15 */ @@ -813,7 +813,7 @@ H5C_mark_entries_as_clean(H5F_t * f, pinned_entries_cleared++; progress = TRUE; - if(H5C__flush_single_entry(f, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -860,7 +860,7 @@ done: * * Function: H5C_clear_coll_entries * - * Purpose: Clear half or the entire list of collective entries and + * Purpose: Clear half or the entire list of collective entries and * mark them as independent. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -872,7 +872,7 @@ done: */ herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) -{ +{ uint32_t clear_cnt; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; @@ -1042,8 +1042,8 @@ H5C__collective_write(H5F_t *f) info = *info_p; - /* just to match up with the 1st MPI_File_set_view from - * H5FD_mpio_write() + /* just to match up with the 1st MPI_File_set_view from + * H5FD_mpio_write() */ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) @@ -1053,8 +1053,8 @@ H5C__collective_write(H5F_t *f) if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) - /* just to match up with the 2nd MPI_File_set_view (reset) in - * H5FD_mpio_write() + /* just to match up with the 2nd MPI_File_set_view (reset) in + * H5FD_mpio_write() */ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 6608bc2..8712af5 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -149,8 +149,8 @@ * * JRM - 9/8/05 * - * - Added macros supporting the index list -- a doubly liked list of - * all entries in the index. This list is necessary to reduce the + * - Added macros supporting the index list -- a doubly liked list of + * all entries in the index. This list is necessary to reduce the * cost of visiting all entries in the cache, which was previously * done via a scan of the hash table. * @@ -963,16 +963,16 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * * JRM -- 11/5/08 * - * - Updated existing index macros and sanity check macros to maintain + * - Updated existing index macros and sanity check macros to maintain * the index_ring_len, index_ring_size, clean_index_ring_size, and * dirty_index_ring_size fields of H5C_t. * * JRM -- 9/1/15 * - * - Updated existing index macros and sanity checks macros to + * - Updated existing index macros and sanity checks macros to * maintain an doubly linked list of all entries in the index. * This is necessary to reduce the computational cost of visiting - * all entries in the index, which used to be done by scanning + * all entries in the index, which used to be done by scanning * the hash table. * * JRM -- 10/15/15 @@ -1561,7 +1561,7 @@ if ( ( (cache_ptr)->index_size != \ * flush. * * JRM -- 12/13/14 - * Added code to set cache_ptr->slist_changed to TRUE + * Added code to set cache_ptr->slist_changed to TRUE * when an entry is inserted in the slist. * * JRM -- 9/1/15 @@ -1762,7 +1762,7 @@ if ( ( (cache_ptr)->index_size != \ * flush. * * JRM -- 12/13/14 - * Note that we do not set cache_ptr->slist_changed to TRUE + * Note that we do not set cache_ptr->slist_changed to TRUE * in this case, as the structure of the slist is not * modified. * @@ -2243,14 +2243,14 @@ if ( ( (cache_ptr)->index_size != \ * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND * * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * insertion of the specified cache entry. * - * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the - * new entry as the LEAST recently used entry, not the - * most recently used. + * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the + * new entry as the LEAST recently used entry, not the + * most recently used. * - * For now at least, this macro should only be used in - * the reconstruction of the metadata cache from a cache + * For now at least, this macro should only be used in + * the reconstruction of the metadata cache from a cache * image block. * * At present, we only support the modified LRU policy, so @@ -3491,7 +3491,7 @@ typedef struct H5C_tag_info_t { * * JRM - 9/26/05 * - * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. + * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. * This field is used to validate pointers to instances of * H5C_t. * @@ -3544,7 +3544,7 @@ typedef struct H5C_tag_info_t { * clean data so as to avoid case b) above. Again, this is * a soft limit. * - * close_warning_received: Boolean flag indicating that a file closing + * close_warning_received: Boolean flag indicating that a file closing * warning has been received. * * @@ -3576,7 +3576,7 @@ typedef struct H5C_tag_info_t { * this flag is set to FALSE, the metadata cache will not * attempt to evict entries to make space for newly protected * entries, and instead the will grow without limit. - * + * * Needless to say, this feature must be used with care. * * @@ -3586,12 +3586,12 @@ typedef struct H5C_tag_info_t { * Addendum: JRM -- 10/14/15 * * We sometimes need to visit all entries in the cache. In the past, this - * was done by scanning the hash table. However, this is expensive, and - * we have come to scan the hash table often enough that it has become a - * performance issue. To repair this, I have added code to maintain a - * list of all entries in the index -- call this list the index list. + * was done by scanning the hash table. However, this is expensive, and + * we have come to scan the hash table often enough that it has become a + * performance issue. To repair this, I have added code to maintain a + * list of all entries in the index -- call this list the index list. * - * The index list is maintained by the same macros that maintain the + * The index list is maintained by the same macros that maintain the * index, and must have the same length and size as the index proper. * * index_len: Number of entries currently in the hash table used to index @@ -3606,12 +3606,12 @@ typedef struct H5C_tag_info_t { * index_size by three should yield a conservative estimate * of the cache's memory footprint. * - * index_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the index by ring. Note - * that the sum of all the cells in this array must equal + * index_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the index by ring. Note + * that the sum of all the cells in this array must equal * the value stored in index_len above. * - * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to * maintain the sum of the sizes of all entries in the index * by ring. Note that the sum of all cells in this array must * equal the value stored in index_size above. @@ -3631,8 +3631,8 @@ typedef struct H5C_tag_info_t { * in the cache. * * clean_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all clean entries in the - * index by ring. Note that the sum of all cells in this array + * maintain the sum of the sizes of all clean entries in the + * index by ring. Note that the sum of all cells in this array * must equal the value stored in clean_index_size above. * * dirty_index_size: Number of bytes of dirty entries currently stored in @@ -3642,8 +3642,8 @@ typedef struct H5C_tag_info_t { * dirty_index_size == index_size. * * dirty_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all dirty entries in the - * index by ring. Note that the sum of all cells in this array + * maintain the sum of the sizes of all dirty entries in the + * index by ring. Note that the sum of all cells in this array * must equal the value stored in dirty_index_size above. * * index: Array of pointer to H5C_cache_entry_t of size @@ -3661,52 +3661,52 @@ typedef struct H5C_tag_info_t { * changing the H5C__HASH_FCN macro and the deletion of the * H5C__HASH_MASK #define. No other changes should be required. * - * il_len: Number of entries on the index list. + * il_len: Number of entries on the index list. * - * This must always be equal to index_len. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a length field, so + * This must always be equal to index_len. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a length field, so * this field exists primarily to avoid adding complexity to * these macros. * * il_size: Number of bytes of cache entries currently stored in the * index list. * - * This must always be equal to index_size. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a size field, so + * This must always be equal to index_size. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a size field, so * this field exists primarily to avoid adding complexity to * these macros. * * il_head: Pointer to the head of the doubly linked list of entries in - * the index list. Note that cache entries on this list are + * the index list. Note that cache entries on this list are * linked by their il_next and il_prev fields. * * This field is NULL if the index is empty. * * il_tail: Pointer to the tail of the doubly linked list of entries in - * the index list. Note that cache entries on this list are + * the index list. Note that cache entries on this list are * linked by their il_next and il_prev fields. * * This field is NULL if the index is empty. * * - * With the addition of the take ownership flag, it is possible that - * an entry may be removed from the cache as the result of the flush of - * a second entry. In general, this causes little trouble, but it is - * possible that the entry removed may be the next entry in the scan of - * a list. In this case, we must be able to detect the fact that the + * With the addition of the take ownership flag, it is possible that + * an entry may be removed from the cache as the result of the flush of + * a second entry. In general, this causes little trouble, but it is + * possible that the entry removed may be the next entry in the scan of + * a list. In this case, we must be able to detect the fact that the * entry has been removed, so that the scan doesn't attempt to proceed with * an entry that is no longer in the cache. * * The following fields are maintained to facilitate this. * * entries_removed_counter: Counter that is incremented each time an - * entry is removed from the cache by any means (eviction, + * entry is removed from the cache by any means (eviction, * expungement, or take ownership at this point in time). * Functions that perform scans on lists may set this field - * to zero prior to calling H5C__flush_single_entry(). - * Unexpected changes to the counter indicate that an entry + * to zero prior to calling H5C__flush_single_entry(). + * Unexpected changes to the counter indicate that an entry * was removed from the cache as a side effect of the flush. * * last_entry_removed_ptr: Pointer to the instance of H5C_cache_entry_t @@ -3715,11 +3715,11 @@ typedef struct H5C_tag_info_t { * performing a scan of a list has set this field to NULL prior * to calling H5C__flush_single_entry(). * - * WARNING!!! This field must NEVER be dereferenced. It is + * WARNING!!! This field must NEVER be dereferenced. It is * maintained to allow functions that perform scans of lists * to compare this pointer with their pointers to next, thus * allowing them to avoid unnecessary restarts of scans if the - * pointers don't match, and if entries_removed_counter is + * pointers don't match, and if entries_removed_counter is * one. * * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t @@ -3740,11 +3740,11 @@ typedef struct H5C_tag_info_t { * are flushed. (this has been changed -- dirty entries are now removed from * the skip list as they are flushed. JRM - 10/25/05) * - * slist_changed: Boolean flag used to indicate whether the contents of + * slist_changed: Boolean flag used to indicate whether the contents of * the slist has changed since the last time this flag was - * reset. This is used in the cache flush code to detect + * reset. This is used in the cache flush code to detect * conditions in which pre-serialize or serialize callbacks - * have modified the slist -- which obliges us to restart + * have modified the slist -- which obliges us to restart * the scan of the slist from the beginning. * * slist_len: Number of entries currently in the skip list @@ -3755,14 +3755,14 @@ typedef struct H5C_tag_info_t { * skip list used to maintain a sorted list of * dirty entries in the cache. * - * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the slist by ring. Note - * that the sum of all the cells in this array must equal + * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the slist by ring. Note + * that the sum of all the cells in this array must equal * the value stored in slist_len above. * * slist_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all entries in the - * slist by ring. Note that the sum of all cells in this + * maintain the sum of the sizes of all entries in the + * slist by ring. Note that the sum of all cells in this * array must equal the value stored in slist_size above. * * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted @@ -3826,7 +3826,7 @@ typedef struct H5C_tag_info_t { * num_objs_corked: Unsigned integer field containing the number of objects * that are "corked". The "corked" status of an object is * found by searching the "tag_list". This field is added - * for optimization so that the skip list search on "tag_list" + * for optimization so that the skip list search on "tag_list" * can be skipped if this field is zero, i.e. no "corked" * objects. * @@ -3867,7 +3867,7 @@ typedef struct H5C_tag_info_t { * * 2) A pinned entry can be accessed or modified at any time. * This places an additional burden on the associated pre-serialize - * and serialize callbacks, which must ensure the the entry is in + * and serialize callbacks, which must ensure the the entry is in * a consistent state before creating an image of it. * * 3) A pinned entry can be marked as dirty (and possibly @@ -3878,7 +3878,7 @@ typedef struct H5C_tag_info_t { * flush. * * Since pinned entries cannot be evicted, they must be kept on a pinned - * entry list (pel), instead of being entrusted to the replacement policy + * entry list (pel), instead of being entrusted to the replacement policy * code. * * Maintaining the pinned entry list requires the following fields: @@ -3907,7 +3907,7 @@ typedef struct H5C_tag_info_t { * * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have - * elected to support only a modified LRU (least recently used) policy + * elected to support only a modified LRU (least recently used) policy * for the first cut. * * To further simplify matters, I have simply included the fields needed @@ -3926,7 +3926,7 @@ typedef struct H5C_tag_info_t { * be collective and the other processes will not know to participate. * * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. In general, these + * clean and dirty LRU lists to the usual LRU list. In general, these * lists are only exist in parallel builds. * * The clean LRU list is simply the regular LRU list with all dirty cache @@ -3954,13 +3954,13 @@ typedef struct H5C_tag_info_t { * * LRU_list_len: Number of cache entries currently on the LRU list. * - * Observe that LRU_list_len + pl_len + pel_len must always + * Observe that LRU_list_len + pl_len + pel_len must always * equal index_len. * * LRU_list_size: Number of bytes of cache entries currently residing on the * LRU list. * - * Observe that LRU_list_size + pl_size + pel_size must always + * Observe that LRU_list_size + pl_size + pel_size must always * equal index_size. * * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache @@ -4071,25 +4071,25 @@ typedef struct H5C_tag_info_t { * size is decreased. The flag triggers a call to * H5C__make_space_in_cache() on the next call to H5C_protect(). * - * resize_in_progress: As the metadata cache has become re-entrant, it is - * possible that a protect may trigger a call to + * resize_in_progress: As the metadata cache has become re-entrant, it is + * possible that a protect may trigger a call to * H5C__auto_adjust_cache_size(), which may trigger a flush, - * which may trigger a protect, which will result in another - * call to H5C__auto_adjust_cache_size(). + * which may trigger a protect, which will result in another + * call to H5C__auto_adjust_cache_size(). * * The resize_in_progress boolean flag is used to detect this, * and to prevent the infinite recursion that would otherwise * occur. * - * Note that this issue is not hypothetical -- this field - * was added 12/29/15 to fix a bug exposed in the testing + * Note that this issue is not hypothetical -- this field + * was added 12/29/15 to fix a bug exposed in the testing * of changes to the file driver info superblock extension * management code needed to support rings. * * msic_in_progress: As the metadata cache has become re-entrant, and as - * the free space manager code has become more tightly - * integrated with the metadata cache, it is possible that - * a call to H5C_insert_entry() may trigger a call to + * the free space manager code has become more tightly + * integrated with the metadata cache, it is possible that + * a call to H5C_insert_entry() may trigger a call to * H5C_make_space_in_cache(), which, via H5C__flush_single_entry() * and client callbacks, may trigger an infinite regression * of calls to H5C_make_space_in_cache(). @@ -4098,9 +4098,9 @@ typedef struct H5C_tag_info_t { * and prevent the infinite regression that would otherwise * occur. * - * Note that this is issue is not hypothetical -- this field - * was added 2/16/17 to address this issue when it was - * exposed by modifications to test/fheap.c to cause it to + * Note that this is issue is not hypothetical -- this field + * was added 2/16/17 to address this issue when it was + * exposed by modifications to test/fheap.c to cause it to * use paged allocation. * * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration @@ -4184,45 +4184,45 @@ typedef struct H5C_tag_info_t { * data for generation of a cache image on file close. * * serialization_in_progress: Boolean field that is set to TRUE iff - * the cache is in the process of being serialized. This + * the cache is in the process of being serialized. This * field is needed to support the H5C_serialization_in_progress() * call, which is in turn required for sanity checks in some * cache clients. * - * load_image: Boolean flag indicating that the metadata cache image - * superblock extension message exists and should be + * load_image: Boolean flag indicating that the metadata cache image + * superblock extension message exists and should be * read, and the image block read and decoded on the next - * call to H5C_protect(). + * call to H5C_protect(). * - * image_loaded: Boolean flag indicating that the metadata cache has - * loaded the metadata cache image as directed by the + * image_loaded: Boolean flag indicating that the metadata cache has + * loaded the metadata cache image as directed by the * MDC cache image superblock extension message. * * delete_image: Boolean flag indicating whether the metadata cache image * superblock message should be deleted and the cache image * file space freed after they have been read and decoded. * - * This flag should be set to TRUE iff the file is opened + * This flag should be set to TRUE iff the file is opened * R/W and there is a cache image to be read. * - * image_addr: haddr_t containing the base address of the on disk - * metadata cache image, or HADDR_UNDEF if that value is - * undefined. Note that this field is used both in the - * construction and write, and the read and decode of + * image_addr: haddr_t containing the base address of the on disk + * metadata cache image, or HADDR_UNDEF if that value is + * undefined. Note that this field is used both in the + * construction and write, and the read and decode of * metadata cache image blocks. * - * image_len: hsize_t containing the size of the on disk metadata cache - * image, or zero if that value is undefined. Note that this - * field is used both in the construction and write, and the + * image_len: hsize_t containing the size of the on disk metadata cache + * image, or zero if that value is undefined. Note that this + * field is used both in the construction and write, and the * read and decode of metadata cache image blocks. * - * image_data_len: size_t containing the number of bytes of data in the - * on disk metadata cache image, or zero if that value is + * image_data_len: size_t containing the number of bytes of data in the + * on disk metadata cache image, or zero if that value is * undefined. * * In most cases, this value is the same as the image_len * above. It exists to allow for metadata cache image blocks - * that are larger than the actual image. Thus in all + * that are larger than the actual image. Thus in all * cases image_data_len <= image_len. * * To create the metadata cache image, we must first serialize all the @@ -4232,27 +4232,27 @@ typedef struct H5C_tag_info_t { * height in increasing order. * * This operation is complicated by the fact that entries other the the - * target may be inserted, loaded, relocated, or removed from the cache - * (either by eviction or the take ownership flag) as the result of a - * pre_serialize or serialize callback. While entry removals are not + * target may be inserted, loaded, relocated, or removed from the cache + * (either by eviction or the take ownership flag) as the result of a + * pre_serialize or serialize callback. While entry removals are not * a problem for the scan of the index, insertions, loads, and relocations - * are. Hence the entries loaded, inserted, and relocated counters - * listed below have been implemented to allow these conditions to be + * are. Hence the entries loaded, inserted, and relocated counters + * listed below have been implemented to allow these conditions to be * detected and dealt with by restarting the scan. * - * The serialization operation is further complicated by the fact that - * the flush dependency height of a given entry may increase (as the - * result of an entry load or insert) or decrease (as the result of an + * The serialization operation is further complicated by the fact that + * the flush dependency height of a given entry may increase (as the + * result of an entry load or insert) or decrease (as the result of an * entry removal -- via either eviction or the take ownership flag). The * entry_fd_height_change_counter field is maintained to allow detection * of this condition, and a restart of the scan when it occurs. * * Note that all these new fields would work just as well as booleans. * - * entries_loaded_counter: Number of entries loaded into the cache + * entries_loaded_counter: Number of entries loaded into the cache * since the last time this field was reset. * - * entries_inserted_counter: Number of entries inserted into the cache + * entries_inserted_counter: Number of entries inserted into the cache * since the last time this field was reset. * * entries relocated_counter: Number of entries whose base address has @@ -4261,32 +4261,32 @@ typedef struct H5C_tag_info_t { * entry_fd_height_change_counter: Number of entries whose flush dependency * height has changed since the last time this field was reset. * - * The following fields are used assemble the cache image prior to + * The following fields are used assemble the cache image prior to * writing it to disk. * * num_entries_in_image: Unsigned integer field containing the number of entries - * to be copied into the metadata cache image. Note that - * this value will be less than the number of entries in - * the cache, and the superblock and its related entries + * to be copied into the metadata cache image. Note that + * this value will be less than the number of entries in + * the cache, and the superblock and its related entries * are not written to the metadata cache image. * * image_entries: Pointer to a dynamically allocated array of instance of * H5C_image_entry_t of length num_entries_in_image, or NULL * if that array does not exist. This array is used to - * assemble entry data to be included in the image, and to + * assemble entry data to be included in the image, and to * sort them by flush dependency height and LRU rank. - * + * * image_buffer: Pointer to the dynamically allocated buffer of length - * image_len in which the metadata cache image is assembled, + * image_len in which the metadata cache image is assembled, * or NULL if that buffer does not exist. * * * Free Space Manager Related fields: * - * The free space managers must be informed when we are about to close + * The free space managers must be informed when we are about to close * or flush the file so that they order themselves accordingly. This used - * to be done much later in the close process, but with cache image and - * page buffering, this is no longer viable, as we must finalize the on + * to be done much later in the close process, but with cache image and + * page buffering, this is no longer viable, as we must finalize the on * disk image of all metadata much sooner. * * This is handled by the H5MF_settle_raw_data_fsm() and @@ -4300,11 +4300,11 @@ typedef struct H5C_tag_info_t { * flush is complete. * * rdfsm_settled: Boolean flag indicating whether the raw data free space - * manager is settled -- i.e. whether the correct space has + * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies to all free space + * Note that the name of this field is deceptive. In the + * multi file case, the flag applies to all free space * managers that are not involved in allocating space for * free space manager metadata. * @@ -4312,9 +4312,9 @@ typedef struct H5C_tag_info_t { * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies only to free space - * managers that are involved in allocating space for free + * Note that the name of this field is deceptive. In the + * multi file case, the flag applies only to free space + * managers that are involved in allocating space for free * space managers. * * @@ -4358,7 +4358,7 @@ typedef struct H5C_tag_info_t { * id equal to the array index has been inserted into the * cache in the current epoch. * - * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been inserted * pinned into the cache in the current epoch. @@ -4378,9 +4378,9 @@ typedef struct H5C_tag_info_t { * equal to the array index has been evicted from the cache in * the current epoch. * - * take_ownerships: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been removed from the + * take_ownerships: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been removed from the * cache via the H5C__TAKE_OWNERSHIP_FLAG in the current epoch. * * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells @@ -4388,12 +4388,12 @@ typedef struct H5C_tag_info_t { * id equal to the array index has been moved in the current * epoch. * - * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been moved * during its pre-serialize callback in the current epoch. * - * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been moved * during a cache flush in the current epoch. @@ -4436,7 +4436,7 @@ typedef struct H5C_tag_info_t { * entry_flush_size_changes: Array of int64 of length * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record * the number of times an entry with type id equal to the - * array index has changed size while in its pre-serialize + * array index has changed size while in its pre-serialize * callback. * * cache_flush_size_changes: Array of int64 of length @@ -4500,7 +4500,7 @@ typedef struct H5C_tag_info_t { * enforcing the min_clean_fraction in H5C__make_space_in_cache(). * * total_dirty_pf_entries_skipped_in_msic: Number of dirty prefetched entries - * skipped in H5C__make_space_in_cache(). Note that this can + * skipped in H5C__make_space_in_cache(). Note that this can * only occur when a file is opened R/O with a cache image * containing dirty entries. * @@ -4512,7 +4512,7 @@ typedef struct H5C_tag_info_t { * * max_dirty_pf_entries_skipped_in_msic: Maximum number of dirty prefetched * entries skipped in any one call to H5C__make_space_in_cache(). - * Note that this can only occur when the file is opened + * Note that this can only occur when the file is opened * R/O with a cache image containing dirty entries. * * max_entries_scanned_in_msic: Maximum number of entries scanned over @@ -4522,24 +4522,24 @@ typedef struct H5C_tag_info_t { * for entries to evict in order to make space in cache. * * - * The following fields track statistics on cache images. + * The following fields track statistics on cache images. * * images_created: Integer field containing the number of cache images - * created since the last time statistics were reset. + * created since the last time statistics were reset. * * At present, this field must always be either 0 or 1. - * Further, since cache images are only created at file + * Further, since cache images are only created at file * close, this field should only be set at that time. * - * images_read: Integer field containing the number of cache images + * images_read: Integer field containing the number of cache images * read from file. Note that reading an image is different * from loading it -- reading the image means just that, * while loading the image refers to decoding it and loading * it into the metadata cache. * - * In the serial case, image_read should always equal - * images_loaded. However, in the parallel case, the - * image should only be read by process 0. All other + * In the serial case, image_read should always equal + * images_loaded. However, in the parallel case, the + * image should only be read by process 0. All other * processes should receive the cache image via a broadcast * from process 0. * @@ -4547,25 +4547,25 @@ typedef struct H5C_tag_info_t { * loaded since the last time statistics were reset. * * At present, this field must always be either 0 or 1. - * Further, since cache images are only loaded at the + * Further, since cache images are only loaded at the * time of the first protect or on file close, this value * should only change on those events. * * last_image_size: Size of the most recently loaded metadata cache image * loaded into the cache, or zero if no image has been - * loaded. + * loaded. * - * At present, at most one cache image can be loaded into + * At present, at most one cache image can be loaded into * the metadata cache for any given file, and this image * will be loaded either on the first protect, or on file * close if no entry is protected before then. * * * Fields for tracking prefetched entries. Note that flushes and evictions - * of prefetched entries are tracked in the flushes and evictions arrays + * of prefetched entries are tracked in the flushes and evictions arrays * discused above. * - * prefetches: Number of prefetched entries that are loaded to the + * prefetches: Number of prefetched entries that are loaded to the * cache. * * dirty_prefetches: Number of dirty prefetched entries that are loaded @@ -4573,30 +4573,30 @@ typedef struct H5C_tag_info_t { * * prefetch_hits: Number of prefetched entries that are actually used. * - * - * As entries are now capable of moving, loading, dirtying, and deleting - * other entries in their pre_serialize and serialize callbacks, it has - * been necessary to insert code to restart scans of lists so as to avoid - * improper behavior if the next entry in the list is the target of one on + * + * As entries are now capable of moving, loading, dirtying, and deleting + * other entries in their pre_serialize and serialize callbacks, it has + * been necessary to insert code to restart scans of lists so as to avoid + * improper behavior if the next entry in the list is the target of one on * these operations. * - * The following fields are use to count such occurrences. They are used - * both in tests (to verify that the scan has been restarted), and to + * The following fields are use to count such occurrences. They are used + * both in tests (to verify that the scan has been restarted), and to * obtain estimates of how frequently these restarts occur. * * slist_scan_restarts: Number of times a scan of the slist (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next * entry in the scan. * * LRU_scan_restarts: Number of times a scan of the LRU list (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next * entry in the scan. * - * index_scan_restarts: Number of times a scan of the index has been + * index_scan_restarts: Number of times a scan of the index has been * restarted to avoid potential issues with load, insertion - * or change in flush dependency height of an entry other + * or change in flush dependency height of an entry other * than the target entry as the result of call(s) to the * pre_serialize or serialize callbacks. * @@ -4850,7 +4850,7 @@ struct H5C_t { int32_t max_dirty_pf_entries_skipped_in_msic; int32_t max_entries_scanned_in_msic; int64_t entries_scanned_to_make_space; - + /* Fields for tracking skip list scan restarts */ int64_t slist_scan_restarts; int64_t LRU_scan_restarts; diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 0befdf9..954dd60 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -66,7 +66,7 @@ static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, void *thing, unsigned *flags_ptr); static herr_t H5C__prefetched_entry_serialize(const H5F_t *f, void *image_ptr, size_t len, void *thing); -static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, +static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__prefetched_entry_free_icr(void *thing); static herr_t H5C__prefetched_entry_fsf_size(const void *thing, @@ -111,12 +111,12 @@ const H5AC_class_t H5AC_PREFETCHED_ENTRY[1] = {{ /*************************************************************************** - * With two exceptions, these functions should never be called, and thus + * With two exceptions, these functions should never be called, and thus * there is little point in documenting them separately as they all simply * throw an error. * * See header comments for the two exceptions (free_icr and notify). - * + * * JRM - 8/13/15 * ***************************************************************************/ @@ -157,8 +157,8 @@ H5C__prefetched_entry_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, static void * -H5C__prefetched_entry_deserialize(const void H5_ATTR_UNUSED * image_ptr, - size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED * udata, +H5C__prefetched_entry_deserialize(const void H5_ATTR_UNUSED * image_ptr, + size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED * udata, hbool_t H5_ATTR_UNUSED * dirty_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -182,9 +182,9 @@ H5C__prefetched_entry_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, +H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, - haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, + haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -196,7 +196,7 @@ H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED static herr_t -H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, +H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED *thing) { @@ -211,7 +211,7 @@ H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, /*------------------------------------------------------------------------- * Function: H5C__prefetched_entry_notify * - * Purpose: On H5AC_NOTIFY_ACTION_BEFORE_EVICT, check to see if the + * Purpose: On H5AC_NOTIFY_ACTION_BEFORE_EVICT, check to see if the * target entry is a child in a flush dependency relationship. * If it is, destroy that flush dependency relationship. * @@ -243,18 +243,18 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) case H5C_NOTIFY_ACTION_AFTER_INSERT: case H5C_NOTIFY_ACTION_AFTER_LOAD: case H5C_NOTIFY_ACTION_AFTER_FLUSH: - case H5C_NOTIFY_ACTION_ENTRY_DIRTIED: - case H5C_NOTIFY_ACTION_ENTRY_CLEANED: - case H5C_NOTIFY_ACTION_CHILD_DIRTIED: - case H5C_NOTIFY_ACTION_CHILD_CLEANED: - case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED: - case H5C_NOTIFY_ACTION_CHILD_SERIALIZED: + case H5C_NOTIFY_ACTION_ENTRY_DIRTIED: + case H5C_NOTIFY_ACTION_ENTRY_CLEANED: + case H5C_NOTIFY_ACTION_CHILD_DIRTIED: + case H5C_NOTIFY_ACTION_CHILD_CLEANED: + case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED: + case H5C_NOTIFY_ACTION_CHILD_SERIALIZED: /* do nothing */ break; case H5C_NOTIFY_ACTION_BEFORE_EVICT: for(u = 0; u < entry_ptr->flush_dep_nparents; u++) { - H5C_cache_entry_t * parent_ptr; + H5C_cache_entry_t * parent_ptr; /* Sanity checks */ HDassert(entry_ptr->flush_dep_parent); @@ -268,9 +268,9 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "unable to destroy prefetched entry flush dependency") if(parent_ptr->prefetched) { - /* In prefetched entries, the fd_child_count field is - * used in sanity checks elsewhere. Thus update this - * field to reflect the destruction of the flush + /* In prefetched entries, the fd_child_count field is + * used in sanity checks elsewhere. Thus update this + * field to reflect the destruction of the flush * dependency relationship. */ HDassert(parent_ptr->fd_child_count > 0); @@ -335,8 +335,8 @@ done: } /* end H5C__prefetched_entry_free_icr() */ -static herr_t -H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, +static herr_t +H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index bd200e0..0ba0234 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -150,7 +150,7 @@ * * These flags apply to H5C_protect() * H5C__READ_ONLY_FLAG - * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_LAST_FLAG ; super block only * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_unprotect(): @@ -213,8 +213,8 @@ #define H5C_DO_TAGGING_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 #else /* NDEBUG */ -/* With rare execptions, the following defines should be set - * to 0 if NDEBUG is defined +/* With rare execptions, the following defines should be set + * to 0 if NDEBUG is defined */ #define H5C_DO_SANITY_CHECKS 0 #define H5C_DO_SLIST_SANITY_CHECKS 0 @@ -292,50 +292,50 @@ typedef struct H5C_t H5C_t; * H5C__CLASS_NO_FLAGS_SET: No special processing. * * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in - * H5C_load_entry(). When it is set, entries are - * permitted to change their sizes on the first attempt - * to load. + * H5C_load_entry(). When it is set, entries are + * permitted to change their sizes on the first attempt + * to load. * * If the new size is larger than the old, the read buffer - * is reallocated to the new size, loaded from file, and the - * deserialize routine is called a second time on the - * new buffer. The entry returned by the first call to + * is reallocated to the new size, loaded from file, and the + * deserialize routine is called a second time on the + * new buffer. The entry returned by the first call to * the deserialize routine is discarded (via the free_icr * call) after the new size is retrieved (via the image_len - * call). Note that the new size is used as the size of the + * call). Note that the new size is used as the size of the * entry in the cache. * - * If the new size is smaller than the old, no new loads + * If the new size is smaller than the old, no new loads * or deserializes are performed, but the new size becomes * the size of the entry in the cache. * - * When this flag is set, an attempt to read past the - * end of file could occur. In this case, if the size - * returned get_load_size callback would result in a - * read past the end of file, the size is truncated to + * When this flag is set, an attempt to read past the + * end of file could occur. In this case, if the size + * returned get_load_size callback would result in a + * read past the end of file, the size is truncated to * avoid this, and processing proceeds as normal. * * The following flags may only appear in test code. * * H5C__CLASS_SKIP_READS: This flags is intended only for use in test * code. When it is set, reads on load will be skipped, - * and an uninitialize buffer will be passed to the + * and an uninitialize buffer will be passed to the * deserialize function. * * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test - * code. When it is set, writes of buffers prepared by the + * code. When it is set, writes of buffers prepared by the * serialize callback will be skipped. * * GET_INITIAL_LOAD_SIZE: Pointer to the 'get initial load size' function. * - * This function determines the size based on the information in the + * This function determines the size based on the information in the * parameter "udata" or an initial speculative guess. The size is * returned in the parameter "image_len_ptr". * * For an entry with H5C__CLASS_NO_FLAGS_SET: * This function returns in "image_len_ptr" the on disk size of the * entry. - * + * * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG: * This function returns in "image_len_ptr" an initial guess of the * entry's on disk size. This many bytes will be loaded from @@ -359,7 +359,7 @@ typedef struct H5C_t H5C_t; * This value is used by the cache to determine the size of * the disk image for the metadata, in order to read the disk * image from the file. - * + * * Processing in the get_load_size function should proceed as follows: * * If successful, the function will place the length in the *image_len_ptr @@ -420,17 +420,17 @@ typedef struct H5C_t H5C_t; * the same as the checksum stored in the metadata. * * It computes the checksum based on the metadata stored in the - * parameter "image_ptr" and the actual length of the metadata in the + * parameter "image_ptr" and the actual length of the metadata in the * parameter "len" which is obtained from the "get_load_size" callback. * * The typedef for the verify_chksum callback is as follows: * - * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, - * size_t len, + * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, + * size_t len, * void *udata_ptr); * * The parameters of the verify_chksum callback are as follows: - * + * * image_ptr: Pointer to a buffer containing the metadata read in. * * len: The actual length of the metadata. @@ -539,23 +539,23 @@ typedef struct H5C_t H5C_t; * responsible for serializing the data structure, not moving it on disk * or resizing it. * - * In addition, the client may use the pre-serialize callback to - * ensure that the entry is ready to be flushed -- in particular, - * if the entry contains references to other entries that are in + * In addition, the client may use the pre-serialize callback to + * ensure that the entry is ready to be flushed -- in particular, + * if the entry contains references to other entries that are in * temporary file space, the pre-serialize callback must move those - * entries into real file space so that the serialzed entry will + * entries into real file space so that the serialzed entry will * contain no invalid data. * * One would think that the base address and length of - * the length of the entry's image on disk would be well known. + * the length of the entry's image on disk would be well known. * However, that need not be the case as free space section info - * entries will change size (and possibly location) depending on the - * number of blocks of free space being manages, and fractal heap - * direct blocks can change compressed size (and possibly location) + * entries will change size (and possibly location) depending on the + * number of blocks of free space being manages, and fractal heap + * direct blocks can change compressed size (and possibly location) * on serialization if compression is enabled. Similarly, it may * be necessary to move entries from temporary to real file space. * - * The pre-serialize callback must report any such changes to the + * The pre-serialize callback must report any such changes to the * cache, which must then update its internal structures as needed. * * The typedef for the pre-serialize callback is as follows: @@ -575,7 +575,7 @@ typedef struct H5C_t H5C_t; * target entry. * * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. + * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the * addr and len given above. * @@ -587,8 +587,8 @@ typedef struct H5C_t H5C_t; * production mode. * * len: Length in bytes of the in file image of the entry to be - * serialized. Also the size the image passed to the - * serialize callback (discussed below) unless that + * serialized. Also the size the image passed to the + * serialize callback (discussed below) unless that * value is altered by this function. * * This parameter is supplied mainly for sanity checking. @@ -599,10 +599,10 @@ typedef struct H5C_t H5C_t; * new_addr_ptr: Pointer to haddr_t. If the entry is moved by * the serialize function, the new on disk base address must * be stored in *new_addr_ptr, and the appropriate flag set - * in *flags_ptr. + * in *flags_ptr. * - * If the entry is not moved by the serialize function, - * *new_addr_ptr is undefined on pre-serialize callback + * If the entry is not moved by the serialize function, + * *new_addr_ptr is undefined on pre-serialize callback * return. * * new_len_ptr: Pointer to size_t. If the entry is resized by the @@ -610,8 +610,8 @@ typedef struct H5C_t H5C_t; * must be stored in *new_len_ptr, and the appropriate flag set * in *flags_ptr. * - * If the entry is not resized by the pre-serialize function, - * *new_len_ptr is undefined on pre-serialize callback + * If the entry is not resized by the pre-serialize function, + * *new_len_ptr is undefined on pre-serialize callback * return. * * flags_ptr: Pointer to an unsigned integer used to return flags @@ -625,27 +625,27 @@ typedef struct H5C_t H5C_t; * must be stored in *new_len_ptr. * * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the - * new image base address must be stored in *new_addr_ptr. + * new image base address must be stored in *new_addr_ptr. * * Processing in the pre-serialize function should proceed as follows: * * The pre-serialize function must examine the in core representation * indicated by the thing parameter, if the pre-serialize function does * not need to change the size or location of the on-disk image, it must - * set *flags_ptr to zero. + * set *flags_ptr to zero. * * If the size of the on-disk image must be changed, the pre-serialize * function must load the length of the new image into *new_len_ptr, and - * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. + * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. * * If the base address of the on disk image must be changed, the * pre-serialize function must set *new_addr_ptr to the new base address, * and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr. * - * In addition, the pre-serialize callback may perform any other + * In addition, the pre-serialize callback may perform any other * processing required before the entry is written to disk * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API @@ -660,11 +660,11 @@ typedef struct H5C_t H5C_t; * * At this point, the base address and length of the entry's image on * disk must be well known and not change during the serialization - * process. + * process. * - * While any size and/or location changes must have been handled - * by a pre-serialize call, the client may elect to handle any other - * changes to the entry required to place it in correct form for + * While any size and/or location changes must have been handled + * by a pre-serialize call, the client may elect to handle any other + * changes to the entry required to place it in correct form for * writing to disk in this call. * * The typedef for the serialize callback is as follows: @@ -698,20 +698,20 @@ typedef struct H5C_t H5C_t; * production mode. * * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. + * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the * addr and len given above. * * Processing in the serialize function should proceed as follows: * - * If there are any remaining changes to the entry required before + * If there are any remaining changes to the entry required before * write to disk, they must be dealt with first. * - * The serialize function must then examine the in core - * representation indicated by the thing parameter, and write a - * serialized image of its contents into the provided buffer. + * The serialize function must then examine the in core + * representation indicated by the thing parameter, and write a + * serialized image of its contents into the provided buffer. * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API @@ -737,25 +737,25 @@ typedef struct H5C_t H5C_t; * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. This * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * of the addr and len of the entry. * * Processing in the notify function should proceed as follows: * * The notify function may perform any action it would like, including * metadata cache calls. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API - * routines. + * routines. * * * FREE_ICR: Pointer to the free ICR callback. * * The free ICR callback is invoked by the metadata cache when it * wishes to evict an entry, and needs the client to free the memory - * allocated for the in core representation. + * allocated for the in core representation. * * The typedef for the free ICR callback is as follows: * @@ -766,18 +766,18 @@ typedef struct H5C_t H5C_t; * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. This * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * of the addr and len of the entry. * * Processing in the free ICR function should proceed as follows: * * The free ICR function must free all memory allocated to the - * in core representation. + * in core representation. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API - * routines. + * routines. * * At least when compiled with debug, it would be useful if the * free ICR call would fail if the in core representation has been @@ -787,30 +787,30 @@ typedef struct H5C_t H5C_t; * * In principle, there is no need for the get file space free size * callback. However, as an optimization, it is sometimes convenient - * to allocate and free file space for a number of cache entries + * to allocate and free file space for a number of cache entries * simultaneously in a single contiguous block of file space. * * File space allocation is done by the client, so the metadata cache * need not be involved. However, since the metadata cache typically - * handles file space release when an entry is destroyed, some + * handles file space release when an entry is destroyed, some * adjustment on the part of the metadata cache is required for this * operation. * - * The get file space free size callback exists to support this + * The get file space free size callback exists to support this * operation. * - * If a group of cache entries that were allocated as a group are to + * If a group of cache entries that were allocated as a group are to * be discarded and their file space released, the type of the first - * (i.e. lowest address) entry in the group must implement the - * get free file space size callback. + * (i.e. lowest address) entry in the group must implement the + * get free file space size callback. * - * To free the file space of all entries in the group in a single - * operation, first expunge all entries other than the first without - * the free file space flag. + * To free the file space of all entries in the group in a single + * operation, first expunge all entries other than the first without + * the free file space flag. * * Then, to complete the operation, unprotect or expunge the first - * entry in the block with the free file space flag set. Since - * the get free file space callback is implemented, the metadata + * entry in the block with the free file space flag set. Since + * the get free file space callback is implemented, the metadata * cache will use this callback to get the size of the block to be * freed, instead of using the size of the entry as is done otherwise. * @@ -830,12 +830,12 @@ typedef struct H5C_t H5C_t; * call of the associated addr and len. * * fs_size_ptr: Pointer to hsize_t in which the callback will return - * the size of the piece of file space to be freed. Note - * that the space to be freed is presumed to have the same + * the size of the piece of file space to be freed. Note + * that the space to be freed is presumed to have the same * base address as the cache entry. * * The function simply returns the size of the block of file space - * to be freed in *fsf_size_ptr. + * to be freed in *fsf_size_ptr. * * If the function is successful, it must return SUCCEED. * @@ -847,16 +847,16 @@ typedef struct H5C_t H5C_t; /* Actions that can be reported to 'notify' client callback */ typedef enum H5C_notify_action_t { - H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache + H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache * via the insert call */ - H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the + H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the * from file via the protect call */ H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to * file. */ - H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted + H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted * from cache. */ H5C_NOTIFY_ACTION_ENTRY_DIRTIED, /* Entry has been marked dirty. */ @@ -911,45 +911,45 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * * H5C_ring_t & associated #defines * - * The metadata cache uses the concept of rings to order the flushes of - * classes of entries. In this arrangement, each entry in the cache is - * assigned to a ring, and on flush, the members of the outermost ring + * The metadata cache uses the concept of rings to order the flushes of + * classes of entries. In this arrangement, each entry in the cache is + * assigned to a ring, and on flush, the members of the outermost ring * are flushed first, followed by the next outermost, and so on with the - * members of the innermost ring being flushed last. + * members of the innermost ring being flushed last. * - * Note that flush dependencies are used to order flushes within rings. + * Note that flush dependencies are used to order flushes within rings. * * Note also that at the conceptual level, rings are argueably superfluous, - * as a similar effect could be obtained via the flush dependency mechanism. - * However, this would require all entries in the cache to participate in a - * flush dependency -- with the implied setup and takedown overhead and - * added complexity. Further, the flush ordering between rings need only - * be enforced on flush operations, and thus the use of flush dependencies - * instead would apply unnecessary constraints on flushes under normal + * as a similar effect could be obtained via the flush dependency mechanism. + * However, this would require all entries in the cache to participate in a + * flush dependency -- with the implied setup and takedown overhead and + * added complexity. Further, the flush ordering between rings need only + * be enforced on flush operations, and thus the use of flush dependencies + * instead would apply unnecessary constraints on flushes under normal * operating circumstances. * - * As of this writing, all metadata entries pretaining to data sets and - * groups must be flushed first, and are thus assigned to the outermost - * ring. + * As of this writing, all metadata entries pretaining to data sets and + * groups must be flushed first, and are thus assigned to the outermost + * ring. * * Free space managers managing file space must be flushed next, * and are assigned to the second and third outermost rings. Two rings * are used here as the raw data free space manager must be flushed before * the metadata free space manager. * - * The object header and associated chunks used to implement superblock - * extension messages must be flushed next, and are thus assigned to + * The object header and associated chunks used to implement superblock + * extension messages must be flushed next, and are thus assigned to * the fourth outermost ring. * - * The superblock proper must be flushed last, and is thus assigned to + * The superblock proper must be flushed last, and is thus assigned to * the innermost ring. * * The H5C_ring_t and the associated #defines below are used to define - * the rings. Each entry must be assigned to the appropriate ring on + * the rings. Each entry must be assigned to the appropriate ring on * insertion or protect. * - * Note that H5C_ring_t was originally an enumerated type. It was - * converted to an integer and a set of #defines for convenience in + * Note that H5C_ring_t was originally an enumerated type. It was + * converted to an integer and a set of #defines for convenience in * debugging. */ @@ -1015,8 +1015,8 @@ typedef int H5C_ring_t; * dynamically allocated block of size bytes in which the * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is * written to disk * * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr @@ -1038,14 +1038,14 @@ typedef int H5C_ring_t; * dirtied while protected. * * This field is set to FALSE in the protect call, and may - * be set to TRUE by the H5C_mark_entry_dirty() call at any + * be set to TRUE by the H5C_mark_entry_dirty() call at any * time prior to the unprotect call. * - * The H5C_mark_entry_dirty() call exists as a convenience - * function for the fractal heap code which may not know if - * an entry is protected or pinned, but knows that is either - * protected or pinned. The dirtied field was added as in - * the parallel case, it is necessary to know whether a + * The H5C_mark_entry_dirty() call exists as a convenience + * function for the fractal heap code which may not know if + * an entry is protected or pinned, but knows that is either + * protected or pinned. The dirtied field was added as in + * the parallel case, it is necessary to know whether a * protected entry is dirty prior to the protect call. * * is_protected: Boolean flag indicating whether this entry is protected @@ -1090,9 +1090,9 @@ typedef int H5C_ring_t; * policy code (LRU at present). * * 2) A pinned entry can be accessed or modified at any time. - * This places an extra burden on the pre-serialize and - * serialize callbacks, which must ensure that a pinned - * entry is consistent and ready to write to disk before + * This places an extra burden on the pre-serialize and + * serialize callbacks, which must ensure that a pinned + * entry is consistent and ready to write to disk before * generating an image. * * 3) A pinned entry can be marked as dirty (and possibly @@ -1121,9 +1121,9 @@ typedef int H5C_ring_t; * flushed from the cache until all other entries without * the flush_me_last flag set have been flushed. * - * Note: - * - * At this time, the flush_me_last + * Note: + * + * At this time, the flush_me_last * flag will only be applied to one entry, the superblock, * and the code utilizing these flags is protected with HDasserts * to enforce this. This restraint can certainly be relaxed in @@ -1149,11 +1149,11 @@ typedef int H5C_ring_t; * the unprotect, the entry's is_dirty flag is reset by flushing * it with the H5C__FLUSH_CLEAR_ONLY_FLAG. * - * flush_immediately: Boolean flag used only in Phdf5 -- and then only + * flush_immediately: Boolean flag used only in Phdf5 -- and then only * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * - * When a distributed metadata write is triggered at a - * sync point, this field is used to mark entries that + * When a distributed metadata write is triggered at a + * sync point, this field is used to mark entries that * must be flushed before leaving the sync point. At all * other times, this field should be set to FALSE. * @@ -1167,10 +1167,10 @@ typedef int H5C_ring_t; * * Fields supporting rings for flush ordering: * - * All entries in the metadata cache are assigned to a ring. On cache + * All entries in the metadata cache are assigned to a ring. On cache * flush, all entries in the outermost ring are flushed first, followed - * by all members of the next outermost ring, and so on until the - * innermost ring is flushed. Note that this ordering is ONLY applied + * by all members of the next outermost ring, and so on until the + * innermost ring is flushed. Note that this ordering is ONLY applied * in flush and serialize calls. Rings are ignored during normal operations * in which entries are flushed as directed by the replacement policy. * @@ -1211,7 +1211,7 @@ typedef int H5C_ring_t; * this field is nonzero, then this entry cannot be flushed. * * flush_dep_nunser_children: Number of flush dependency children - * that are either unserialized, or have a non-zero number of + * that are either unserialized, or have a non-zero number of * positive number of unserialized children. * * Note that since there is no requirement that a clean entry @@ -1219,7 +1219,7 @@ typedef int H5C_ring_t; * to be greater than flush_dep_ndirty_children. * * This field exist to facilitate correct ordering of entry - * serializations when it is necessary to serialize all the + * serializations when it is necessary to serialize all the * entries in the metadata cache. Thus in the cache * serialization, no entry can be serialized unless this * field contains 0. @@ -1232,7 +1232,7 @@ typedef int H5C_ring_t; * * Addendum: JRM -- 10/14/15 * - * We have come to scan all entries in the cache frequently enough that + * We have come to scan all entries in the cache frequently enough that * the cost of doing so by scanning the hash table has become unacceptable. * To reduce this cost, the index now also maintains a doubly linked list * of all entries in the index. This list is known as the index list. @@ -1251,12 +1251,12 @@ typedef int H5C_ring_t; * * il_next: Next pointer used by the index to maintain a doubly linked * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the next entry in the + * This field contains a pointer to the next entry in the * index list, or NULL if there is no next entry. * * il_prev: Prev pointer used by the index to maintain a doubly linked * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the previous entry in the + * This field contains a pointer to the previous entry in the * index list, or NULL if there is no previous entry. * * @@ -1294,71 +1294,71 @@ typedef int H5C_ring_t; * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU, the protected list, or - * the pinned list depending on the current values of - * is_protected and is_pinned. If there is no next entry + * next: Next pointer in either the LRU, the protected list, or + * the pinned list depending on the current values of + * is_protected and is_pinned. If there is no next entry * on the list, this field should be set to NULL. * * prev: Prev pointer in either the LRU, the protected list, - * or the pinned list depending on the current values of - * is_protected and is_pinned. If there is no previous + * or the pinned list depending on the current values of + * is_protected and is_pinned. If there is no previous * entry on the list, this field should be set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. + * This entry should be NULL when either is_protected or + * is_pinned is true. * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the next item on the dirty LRU - * list. + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the next item on the dirty LRU + * list. * - * When is_protected and is_pinned are false, and is_dirty is - * false, it should point to the next item on the clean LRU - * list. In either case, when there is no next item, it + * When is_protected and is_pinned are false, and is_dirty is + * false, it should point to the next item on the clean LRU + * list. In either case, when there is no next item, it * should be NULL. * * aux_prev: Previous pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. - * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the previous item on the dirty - * LRU list. - * - * When is_protected and is_pinned are false, and is_dirty - * is false, it should point to the previous item on the - * clean LRU list. - * - * In either case, when there is no previous item, it should + * This entry should be NULL when either is_protected or + * is_pinned is true. + * + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the previous item on the dirty + * LRU list. + * + * When is_protected and is_pinned are false, and is_dirty + * is false, it should point to the previous item on the + * clean LRU list. + * + * In either case, when there is no previous item, it should * be NULL. * * Fields supporting the cache image feature: * - * The following fields are used to store data about the entry which must - * be stored in the cache image block, but which will typically be either - * lost or heavily altered in the process of serializing the cache and + * The following fields are used to store data about the entry which must + * be stored in the cache image block, but which will typically be either + * lost or heavily altered in the process of serializing the cache and * preparing its contents to be copied into the cache image block. * * Some fields are also used in loading the contents of the metadata cache - * image back into the cache, and in managing such entries until they are - * either protected by the library (at which point they become regular - * entries) or are evicted. See discussion of the prefetched field for + * image back into the cache, and in managing such entries until they are + * either protected by the library (at which point they become regular + * entries) or are evicted. See discussion of the prefetched field for * further details. * * include_in_image: Boolean flag indicating whether this entry should * be included in the metadata cache image. This field should * always be false prior to the H5C_prep_for_file_close() call. * During that call, it should be set to TRUE for all entries - * that are to be included in the metadata cache image. At - * present, only the superblock, the superblock extension - * object header and its chunks (if any) are omitted from + * that are to be included in the metadata cache image. At + * present, only the superblock, the superblock extension + * object header and its chunks (if any) are omitted from * the image. * * lru_rank: Rank of the entry in the LRU just prior to file close. * * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during * the process of flushing the cache. * * image_dirty: Boolean flag indicating whether the entry should be marked @@ -1366,125 +1366,125 @@ typedef int H5C_ring_t; * TRUE iff the entry is dirty when H5C_prep_for_file_close() * is called. * - * fd_parent_count: If the entry is a child in one or more flush dependency - * relationships, this field contains the number of flush + * fd_parent_count: If the entry is a child in one or more flush dependency + * relationships, this field contains the number of flush * dependency parents. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any parents * that are not in the image are removed from this count and * from the fd_parent_addrs array below. * - * Finally observe that if the entry is dirty and in the + * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. * - * fd_parent_addrs: If the entry is a child in one or more flush dependency - * relationship when H5C_prep_for_file_close() is called, this - * field must contain a pointer to an array of size - * fd_parent_count containing the on disk addresses of the + * fd_parent_addrs: If the entry is a child in one or more flush dependency + * relationship when H5C_prep_for_file_close() is called, this + * field must contain a pointer to an array of size + * fd_parent_count containing the on disk addresses of the * parent. * * In all other cases, the field is set to NULL. * - * Note that while this list of addresses is initially taken - * from the flush dependency fields above, if the entry is in the + * Note that while this list of addresses is initially taken + * from the flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this list, and + * that are not in the image are removed from this list, and * and from the fd_parent_count above. * - * Finally observe that if the entry is dirty and in the + * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush * dependency children. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * - * fd_dirty_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of dirty flush + * fd_dirty_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of dirty flush * dependency children. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any dirty - * children that are not in the image are removed from this + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any dirty + * children that are not in the image are removed from this * count. * * image_fd_height: Flush dependency height of the entry in the cache image. * - * The flush dependency height of any entry involved in a - * flush dependency relationship is defined to be the + * The flush dependency height of any entry involved in a + * flush dependency relationship is defined to be the * longest flush dependency path from that entry to an entry - * with no flush dependency children. + * with no flush dependency children. * - * Since the image_fd_height is used to order entries in the - * cache image so that fd parents preceed fd children, for + * Since the image_fd_height is used to order entries in the + * cache image so that fd parents preceed fd children, for * purposes of this field, and entry is at flush dependency * level 0 if it either has no children, or if all of its - * children are not in the cache image. + * children are not in the cache image. * - * Note that if a child in a flush dependency relationship is + * Note that if a child in a flush dependency relationship is * dirty and in the cache image, and its parent is dirty and - * not in the cache image, then the child must be excluded + * not in the cache image, then the child must be excluded * from the cache image to maintain flush ordering. * * prefetched: Boolean flag indicating that the on disk image of the entry - * has been loaded into the cache prior any request for the + * has been loaded into the cache prior any request for the * entry by the rest of the library. * - * As of this writing (8/10/15), this can only happen through - * the load of a cache image block, although other scenarios - * are contemplated for the use of this feature. Note that - * unlike the usual prefetch situation, this means that a - * prefetched entry can be dirty, and/or can be a party to - * flush dependency relationship(s). This complicates matters + * As of this writing (8/10/15), this can only happen through + * the load of a cache image block, although other scenarios + * are contemplated for the use of this feature. Note that + * unlike the usual prefetch situation, this means that a + * prefetched entry can be dirty, and/or can be a party to + * flush dependency relationship(s). This complicates matters * somewhat. * - * The essential feature of a prefetched entry is that it - * consists only of a buffer containing the on disk image of - * the entry. Thus it must be deserialized before it can - * be passed back to the library on a protect call. This + * The essential feature of a prefetched entry is that it + * consists only of a buffer containing the on disk image of + * the entry. Thus it must be deserialized before it can + * be passed back to the library on a protect call. This * task is handled by H5C_deserialized_prefetched_entry(). - * In essence, this routine calls the deserialize callback - * provided in the protect call with the on disk image, + * In essence, this routine calls the deserialize callback + * provided in the protect call with the on disk image, * deletes the prefetched entry from the cache, and replaces * it with the deserialized entry returned by the deserialize * callback. * - * Further, if the prefetched entry is a flush dependency parent, - * all its flush dependency children (which must also be - * prefetched entries), must be transferred to the new cache + * Further, if the prefetched entry is a flush dependency parent, + * all its flush dependency children (which must also be + * prefetched entries), must be transferred to the new cache * entry returned by the deserialization callback. * - * Finally, if the prefetched entry is a flush dependency child, - * this flush dependency must be destroyed prior to the + * Finally, if the prefetched entry is a flush dependency child, + * this flush dependency must be destroyed prior to the * deserialize call. * - * In addition to the above special processing on the first + * In addition to the above special processing on the first * protect call on a prefetched entry (after which is no longer - * a prefetched entry), prefetched entries also require special + * a prefetched entry), prefetched entries also require special * tretment on flush and evict. * - * On flush, a dirty prefetched entry must simply be written - * to disk and marked clean without any call to any client + * On flush, a dirty prefetched entry must simply be written + * to disk and marked clean without any call to any client * callback. * - * On eviction, if a prefetched entry is a flush dependency + * On eviction, if a prefetched entry is a flush dependency * child, that flush dependency relationship must be destroyed * just prior to the eviction. If the flush dependency code * is working properly, it should be impossible for any entry @@ -1496,35 +1496,35 @@ typedef int H5C_ring_t; * * The value of this field is undefined in prefetched is FALSE. * - * age: Number of times a prefetched entry has appeared in - * subsequent cache images. The field exists to allow - * imposition of a limit on how many times a prefetched + * age: Number of times a prefetched entry has appeared in + * subsequent cache images. The field exists to allow + * imposition of a limit on how many times a prefetched * entry can appear in subsequent cache images without being * converted to a regular entry. * - * This field must be zero if prefetched is FALSE. + * This field must be zero if prefetched is FALSE. * * prefetched_dirty: Boolean field that must be set to FALSE unless the * following conditions hold: * * 1) The file has been opened R/O. * - * 2) The entry is either a prefetched entry, or was + * 2) The entry is either a prefetched entry, or was * re-constructed from a prefetched entry. * * 3) The base prefetched entry was marked dirty. * - * This field exists to solve the following problem with + * This field exists to solve the following problem with * files containing cache images that are opened R/O. * * If the cache image contains a dirty entry, that entry * must be marked clean when it is inserted into the cache - * in the read-only case, as otherwise the metadata cache - * will attempt to flush it on file close -- which is poor + * in the read-only case, as otherwise the metadata cache + * will attempt to flush it on file close -- which is poor * form in the read-only case. * - * However, since the entry is marked clean, it is possible - * that the metadata cache will evict it if the size of the + * However, since the entry is marked clean, it is possible + * that the metadata cache will evict it if the size of the * metadata in the file exceeds the size of the metadata cache, * and the application visits much of this data. * @@ -1534,24 +1534,24 @@ typedef int H5C_ring_t; * the entry has ever been written to it assigned location in * the file. * - * With this background, the purpose of this field should be - * obvious -- when set, it allows the eviction candidate - * selection code to skip over the entry, thus avoiding the + * With this background, the purpose of this field should be + * obvious -- when set, it allows the eviction candidate + * selection code to skip over the entry, thus avoiding the * issue. * - * Since the issue only arises in the R/O case, there is - * no possible interaction with SWMR. There are also + * Since the issue only arises in the R/O case, there is + * no possible interaction with SWMR. There are also * potential interactions with Evict On Close -- at present, * we deal with this by disabling EOC in the R/O case. * - * serialization_count: Integer field used to maintain a count of the - * number of times each entry is serialized during cache + * serialization_count: Integer field used to maintain a count of the + * number of times each entry is serialized during cache * serialization. While no entry should be serialized more than - * once in any serialization call, throw an assertion if any - * flush depencency parent is serialized more than once during + * once in any serialization call, throw an assertion if any + * flush depencency parent is serialized more than once during * a single cache serialization. * - * This is a debugging field, and thus is maintained only if + * This is a debugging field, and thus is maintained only if * NDEBUG is undefined. * * Fields supporting tagged entries: @@ -1688,7 +1688,7 @@ typedef struct H5C_cache_entry_t { * structure H5C_image_entry_t * * Instances of the H5C_image_entry_t structure are used to store data on - * metadata cache entries used in the construction of the metadata cache + * metadata cache entries used in the construction of the metadata cache * image block. In essence this structure is a greatly simplified version * of H5C_cache_entry_t. * @@ -1705,17 +1705,17 @@ typedef struct H5C_cache_entry_t { * * size: Length of the cache entry on disk in bytes. * - * ring: Instance of H5C_ring_t indicating the flush ordering ring + * ring: Instance of H5C_ring_t indicating the flush ordering ring * to which this entry is assigned. * - * age: Number of times this prefetech entry has appeared in - * the current sequence of cache images. This field is + * age: Number of times this prefetech entry has appeared in + * the current sequence of cache images. This field is * initialized to 0 if the instance of H5C_image_entry_t - * is constructed from a regular entry. + * is constructed from a regular entry. * - * If the instance is constructed from a prefetched entry + * If the instance is constructed from a prefetched entry * currently residing in the metadata cache, the field is - * set to 1 + the age of the prefetched entry, or to + * set to 1 + the age of the prefetched entry, or to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. * @@ -1724,8 +1724,8 @@ typedef struct H5C_cache_entry_t { * lru_rank: Rank of the entry in the LRU just prior to file close. * * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during * the process of flushing the cache. * * is_dirty: Boolean flag indicating whether the contents of the cache @@ -1757,9 +1757,9 @@ typedef struct H5C_cache_entry_t { * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the - * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are + * flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are * not in the image are removed from this count and * from the fd_parent_addrs array below. * @@ -1767,7 +1767,7 @@ typedef struct H5C_cache_entry_t { * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of + * This should have happened before the construction of * the instance of H5C_image_entry_t. * * fd_parent_addrs: If the entry is a child in one or more flush dependency @@ -1780,27 +1780,27 @@ typedef struct H5C_cache_entry_t { * * Note that while this list of addresses is initially taken * from the flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not - * in the image are removed from this list, and from the + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are not + * in the image are removed from this list, and from the * fd_parent_count above. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of + * This should have happened before the construction of * the instance of H5C_image_entry_t. * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush * dependency children. * * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image + * H5C_cache_entry_t, if the entry is in the cache image * (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * @@ -1812,16 +1812,16 @@ typedef struct H5C_cache_entry_t { * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any dirty children * that are not in the image are removed from this count. * * image_ptr: Pointer to void. When not NULL, this field points to a * dynamically allocated block of size bytes in which the * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is * written to disk * * @@ -2141,7 +2141,7 @@ typedef struct H5C_auto_size_ctl_t { * fields for generation of a metadata cache image on file close. * * At present control of construction of a cache image is via a FAPL - * property at file open / create. + * property at file open / create. * * The fields of the structure are discussed individually below: * @@ -2150,43 +2150,43 @@ typedef struct H5C_auto_size_ctl_t { * H5C_image_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * - * generate_image: Boolean flag indicating whether a cache image should + * generate_image: Boolean flag indicating whether a cache image should * be created on file close. * - * save_resize_status: Boolean flag indicating whether the cache image + * save_resize_status: Boolean flag indicating whether the cache image * should include the adaptive cache resize configuration and status. * Note that this field is ignored at present. * * entry_ageout: Integer field indicating the maximum number of * times a prefetched entry can appear in subsequent cache images. - * This field exists to allow the user to avoid the buildup of + * This field exists to allow the user to avoid the buildup of * infrequently used entries in long sequences of cache images. * * The value of this field must lie in the range - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit * is imposed on number of times a prefeteched entry can appear * in subsequent cache images. * - * A value of 0 prevents prefetched entries from being included + * A value of 0 prevents prefetched entries from being included * in cache images. * * Positive integers restrict prefetched entries to the specified * number of appearances. - * + * * Note that the number of subsequent cache images that a prefetched * entry has appeared in is tracked in an 8 bit field. Thus, while - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its - * current value, any value in excess of 255 will be the functional + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its + * current value, any value in excess of 255 will be the functional * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. * * flags: Unsigned integer containing flags controlling which aspects of the - * cache image functinality is actually executed. The primary impetus - * behind this field is to allow development of tests for partial - * implementations that will require little if any modification to run - * with the full implementation. In normal operation, all flags should + * cache image functinality is actually executed. The primary impetus + * behind this field is to allow development of tests for partial + * implementations that will require little if any modification to run + * with the full implementation. In normal operation, all flags should * be set. * ****************************************************************************/ @@ -2196,7 +2196,7 @@ typedef struct H5C_auto_size_ctl_t { #define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) #define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) -/* This #define must set all defined H5C_CI flags. It is +/* This #define must set all defined H5C_CI flags. It is * used in the default value for instances of H5C_cache_image_ctl_t. * This value will only be modified in test code. */ @@ -2242,7 +2242,7 @@ H5_DLL herr_t H5C_evict(H5F_t *f); H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); -H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); @@ -2270,7 +2270,7 @@ H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header); H5_DLL herr_t H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, +H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_mark_entry_clean(void *thing); @@ -2309,7 +2309,7 @@ H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) H5_DLL herr_t H5C_unsettle_entry_ring(void *thing); H5_DLL herr_t H5C_unsettle_ring(H5F_t * f, H5C_ring_t ring); H5_DLL herr_t H5C_remove_entry(void *thing); -H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, +H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr); H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); diff --git a/src/H5Cquery.c b/src/H5Cquery.c index a1267c5..9f1ec31 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -426,7 +426,7 @@ done: * Function: H5C_get_mdc_image_info * * Purpose: To retrieve the address and size of the cache image in the file. - * + * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: Vailin Choi; March 2017 @@ -447,7 +447,7 @@ H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_le *image_addr = cache_ptr->image_addr; if(image_len) *image_len = cache_ptr->image_len; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_get_mdc_image_info() */ diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 807e68d..e92d0e4 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -56,16 +56,16 @@ /* Typedef for tagged entry iterator callback context - evict tagged entries */ typedef struct { H5F_t *f; /* File pointer for evicting entry */ - hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry - * was evicted when iterating over - * cache + hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry + * was evicted when iterating over + * cache */ - hbool_t pinned_entries_need_evicted;/* Flag to indicate that a pinned - * entry was attempted to be evicted + hbool_t pinned_entries_need_evicted;/* Flag to indicate that a pinned + * entry was attempted to be evicted */ - hbool_t skipped_pf_dirty_entries; /* Flag indicating that one or more + hbool_t skipped_pf_dirty_entries; /* Flag indicating that one or more * entries marked prefetched_dirty - * were encountered and not + * were encountered and not * evicted. */ } H5C_tag_iter_evict_ctx_t; @@ -113,10 +113,10 @@ H5FL_EXTERN(H5C_tag_info_t); * Function: H5C_ignore_tags * * Purpose: Override all assertion frameworks associated with making - * sure proper tags are applied to cache entries. + * sure proper tags are applied to cache entries. * - * NOTE: This should really only be used in tests that need - * to access internal functions without going through + * NOTE: This should really only be used in tests that need + * to access internal functions without going through * standard API paths. Since tags are set inside dxpl_id's * before coming into the cache, any external functions that * use the internal library functions (i.e., tests) should @@ -204,8 +204,8 @@ H5C_get_num_objs_corked(const H5C_t *cache_ptr) * Function: H5C__tag_entry * * Purpose: Tags an entry with the provided tag (contained in the API context). - * If sanity checking is enabled, this function will perform - * validation that a proper tag is contained within the provided + * If sanity checking is enabled, this function will perform + * validation that a proper tag is contained within the provided * data access property list id before application. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -234,10 +234,10 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) if(cache->ignore_tags) { /* if we're ignoring tags, it's because we're running - tests on internal functions and may not have inserted a tag + tests on internal functions and may not have inserted a tag value into a given API context before creating some metadata. Thus, in this case only, if a tag value has not been set, we can - arbitrarily set it to something for the sake of passing the tests. + arbitrarily set it to something for the sake of passing the tests. If the tag value is set, then we'll just let it get assigned without additional checking for correctness. */ if(!H5F_addr_defined(tag)) @@ -399,7 +399,7 @@ H5C__iter_tagged_entries_real(H5C_t *cache, haddr_t tag, H5C_tag_iter_cb_t cb, /* Make callback for entry */ if((cb)(entry, cb_ctx) != H5_ITER_CONT) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "tagged entry iteration callback failed") - + /* Advance to next entry */ entry = next_entry; } /* end while */ @@ -441,11 +441,11 @@ H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") /* Check for iterating over global metadata */ - if(match_global) { + if(match_global) { /* Iterate over the entries for SOHM entries */ if(H5C__iter_tagged_entries_real(cache, H5AC__SOHM_TAG, cb, cb_ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") - + /* Iterate over the entries for global heap entries */ if(H5C__iter_tagged_entries_real(cache, H5AC__GLOBALHEAP_TAG, cb, cb_ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") @@ -553,29 +553,29 @@ H5C_evict_tagged_entries(H5F_t * f, haddr_t tag, hbool_t match_global) /* Keep doing this until we have stopped evicted entries */ } while(TRUE == ctx.evicted_entries_last_pass); - /* In most cases, fail if we have finished evicting entries and pinned - * entries still need evicted + /* In most cases, fail if we have finished evicting entries and pinned + * entries still need evicted * - * However, things can get strange if the file was opened R/O and - * the file contains a cache image and the cache image contains dirty - * entries. + * However, things can get strange if the file was opened R/O and + * the file contains a cache image and the cache image contains dirty + * entries. * - * Since the file was opened read only, dirty entries in the cache + * Since the file was opened read only, dirty entries in the cache * image were marked as clean when they were inserted into the metadata * cache. This is necessary, as if they are marked dirty, the metadata - * cache will attempt to write them on file close, which is frowned + * cache will attempt to write them on file close, which is frowned * upon when the file is opened R/O. * - * On the other hand, such entries (marked prefetched_dirty) must not + * On the other hand, such entries (marked prefetched_dirty) must not * be evicted, as should the cache be asked to re-load them, the cache * will attempt to read them from the file, and at best load an outdated * version. - * - * To avoid this, H5C__evict_tagged_entries_cb has been modified to - * skip such entries. However, by doing so, it may prevent pinned + * + * To avoid this, H5C__evict_tagged_entries_cb has been modified to + * skip such entries. However, by doing so, it may prevent pinned * entries from becoming unpinned. * - * Thus we must ignore ctx.pinned_entries_need_evicted if + * Thus we must ignore ctx.pinned_entries_need_evicted if * ctx.skipped_pf_dirty_entries is TRUE. */ if((!ctx.skipped_pf_dirty_entries) && (ctx.pinned_entries_need_evicted)) @@ -631,7 +631,7 @@ H5C__mark_tagged_entries_cb(H5C_cache_entry_t *entry, void H5_ATTR_UNUSED *_ctx) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5C__mark_tagged_entries(H5C_t *cache, haddr_t tag) { herr_t ret_value = SUCCEED; /* Return value */ @@ -698,16 +698,16 @@ H5C_verify_tag(int id, haddr_t tag) if(tag == H5AC__SUPERBLOCK_TAG) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "H5AC__SUPERBLOCK_TAG applied to non-superblock entry") } /* end else */ - + /* Free Space Manager */ if(tag == H5AC__FREESPACE_TAG && ((id != H5AC_FSPACE_HDR_ID) && (id != H5AC_FSPACE_SINFO_ID))) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "H5AC__FREESPACE_TAG applied to non-freespace entry") - + /* SOHM */ if((id == H5AC_SOHM_TABLE_ID) || (id == H5AC_SOHM_LIST_ID)) if(tag != H5AC__SOHM_TAG) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "sohm entry not tagged with H5AC__SOHM_TAG") - + /* Global Heap */ if(id == H5AC_GHEAP_ID) { if(tag != H5AC__GLOBALHEAP_TAG) @@ -783,7 +783,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_retag_entries(H5C_t *cache, haddr_t src_tag, haddr_t dest_tag) +H5C_retag_entries(H5C_t *cache, haddr_t src_tag, haddr_t dest_tag) { H5C_tag_info_t *tag_info; /* Points to a tag info struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -860,7 +860,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { H5C_t *cache; /* Pointer to cache structure */ @@ -904,7 +904,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5C_get_tag(const void *thing, haddr_t *tag /*OUT*/) { const H5C_cache_entry_t *entry = (const H5C_cache_entry_t *)thing; /* Pointer to cache entry */ @@ -332,7 +332,7 @@ H5Dclose(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset ID") /* Decrement the counter on the dataset. It will be freed if the count - * reaches zero. + * reaches zero. */ if(H5I_dec_app_ref_always_close(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") @@ -814,7 +814,7 @@ H5Dflush(hid_t dset_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); - + /* Check args */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dset_id parameter is not a valid dataset identifier") @@ -873,7 +873,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dformat_convert (Internal) * - * Purpose: For chunked: + * Purpose: For chunked: * Convert the chunk indexing type to version 1 B-tree if not * For compact/contiguous: * Downgrade layout version to 3 if greater than 3 @@ -892,7 +892,7 @@ H5Dformat_convert(hid_t dset_id) { H5VL_object_t *vol_obj; /* Dataset for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 56554f8..ae98654 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * * Purpose: v2 B-tree indexing for chunked datasets with > 1 unlimited dimensions. * Each dataset chunk in the b-tree is identified by its dimensional offset. @@ -106,7 +106,7 @@ static int H5D__bt2_idx_iterate_cb(const void *_record, void *_udata); /* Callback for H5B2_find() which is called in H5D__bt2_idx_get_addr() */ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); -/* +/* * Callback for H5B2_remove() and H5B2_delete() which is called * in H5D__bt2_idx_remove() and H5D__bt2_idx_delete(). */ @@ -252,7 +252,7 @@ H5D__bt2_crt_context(void *_udata) H5MM_memcpy(my_dim, udata->dim, H5O_LAYOUT_NDIMS * sizeof(uint32_t)); ctx->dim = my_dim; - /* + /* * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ @@ -292,7 +292,7 @@ H5D__bt2_dst_context(void *_ctx) /* Free array for chunk dimension sizes */ if(ctx->dim) - (void)H5FL_ARR_FREE(uint32_t, ctx->dim); + (void)H5FL_ARR_FREE(uint32_t, ctx->dim); /* Release callback context */ ctx = H5FL_FREE(H5D_bt2_ctx_t, ctx); @@ -569,7 +569,7 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ const H5D_bt2_ctx_t *ctx = (const H5D_bt2_ctx_t *)_ctx; /* Callback context */ unsigned u; /* Local index variable */ - + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ @@ -735,9 +735,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__bt2_idx_create + * Function: H5D__bt2_idx_create * - * Purpose: Create the v2 B-tree for tracking dataset chunks + * Purpose: Create the v2 B-tree for tracking dataset chunks * * Return: SUCCEED/FAIL * @@ -769,7 +769,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) if(idx_info->pline->nused > 0) { unsigned chunk_size_len; /* Size of encoded chunk size */ - /* + /* * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ @@ -837,7 +837,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Function: H5D__bt2_mod_cb * * Purpose: Modify record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_modify() which is called in + * This is the callback for H5B2_modify() which is called in * H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -879,7 +879,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) * Function: H5D__bt2_idx_insert * * Purpose: Insert chunk address into the indexing structure. - * A non-filtered chunk: + * A non-filtered chunk: * Should not exist * Allocate the chunk and pass chunk address back up * A filtered chunk: @@ -954,7 +954,7 @@ done: * Function: H5D__bt2_found_cb * * Purpose: Retrieve record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_find() which is called in + * This is the callback for H5B2_find() which is called in * H5D__bt2_idx_get_addr() and H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -1073,7 +1073,7 @@ done: * Purpose: Translate the B-tree specific chunk record into a generic * form and make the callback to the generic chunk callback * routine. - * This is the callback for H5B2_iterate() which is called in + * This is the callback for H5B2_iterate() which is called in * H5D__bt2_idx_iterate(). * * Return: Success: Non-negative @@ -1163,7 +1163,7 @@ done: * * Purpose: Free space for 'dataset chunk' object as v2 B-tree * is being deleted or v2 B-tree node is removed. - * This is the callback for H5B2_remove() and H5B2_delete() which + * This is the callback for H5B2_remove() and H5B2_delete() which * which are called in H5D__bt2_idx_remove() and H5D__bt2_idx_delete(). * * Return: Success: non-negative diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index eab08ac..58dfbc5 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -11,31 +11,31 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol <koziol@hdfgroup.org> - * Thursday, April 24, 2008 - * - * Purpose: Abstract indexed (chunked) I/O functions. The logical - * multi-dimensional dataspace is regularly partitioned into - * same-sized "chunks", the first of which is aligned with the - * logical origin. The chunks are indexed by different methods, - * that map a chunk index to disk address. Each chunk can be +/* Programmer: Quincey Koziol <koziol@hdfgroup.org> + * Thursday, April 24, 2008 + * + * Purpose: Abstract indexed (chunked) I/O functions. The logical + * multi-dimensional dataspace is regularly partitioned into + * same-sized "chunks", the first of which is aligned with the + * logical origin. The chunks are indexed by different methods, + * that map a chunk index to disk address. Each chunk can be * compressed independently and the chunks may move around in the * file as their storage requirements change. * - * Cache: Disk I/O is performed in units of chunks and H5MF_alloc() - * contains code to optionally align chunks on disk block - * boundaries for performance. - * - * The chunk cache is an extendible hash indexed by a function - * of storage B-tree address and chunk N-dimensional offset - * within the dataset. Collisions are not resolved -- one of - * the two chunks competing for the hash slot must be preempted - * from the cache. All entries in the hash also participate in - * a doubly-linked list and entries are penalized by moving them - * toward the front of the list. When a new chunk is about to - * be added to the cache the heap is pruned by preempting - * entries near the front of the list to make room for the new - * entry which is added to the end of the list. + * Cache: Disk I/O is performed in units of chunks and H5MF_alloc() + * contains code to optionally align chunks on disk block + * boundaries for performance. + * + * The chunk cache is an extendible hash indexed by a function + * of storage B-tree address and chunk N-dimensional offset + * within the dataset. Collisions are not resolved -- one of + * the two chunks competing for the hash slot must be preempted + * from the cache. All entries in the hash also participate in + * a doubly-linked list and entries are penalized by moving them + * toward the front of the list. When a new chunk is about to + * be added to the cache the heap is pruned by preempting + * entries near the front of the list to make room for the new + * entry which is added to the end of the list. */ /****************/ @@ -48,19 +48,19 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #ifdef H5_HAVE_PARALLEL -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #endif /* H5_HAVE_PARALLEL */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File functions */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File functions */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -83,26 +83,26 @@ /* * Feature: If this constant is defined then every cache preemption and load - * causes a character to be printed on the standard error stream: + * causes a character to be printed on the standard error stream: * * `.': Entry was preempted because it has been completely read or - * completely written but not partially read and not partially - * written. This is often a good reason for preemption because such - * a chunk will be unlikely to be referenced in the near future. + * completely written but not partially read and not partially + * written. This is often a good reason for preemption because such + * a chunk will be unlikely to be referenced in the near future. * * `:': Entry was preempted because it hasn't been used recently. * * `#': Entry was preempted because another chunk collided with it. This - * is usually a relatively bad thing. If there are too many of - * these then the number of entries in the cache can be increased. + * is usually a relatively bad thing. If there are too many of + * these then the number of entries in the cache can be increased. * * c: Entry was preempted because the file is closing. * - * w: A chunk read operation was eliminated because the library is - * about to write new values to the entire chunk. This is a good - * thing, especially on files where the chunk size is the same as - * the disk block size, chunks are aligned on disk block boundaries, - * and the operating system can also eliminate a read operation. + * w: A chunk read operation was eliminated because the library is + * about to write new values to the entire chunk. This is a good + * thing, especially on files where the chunk size is the same as + * the disk block size, chunks are aligned on disk block boundaries, + * and the operating system can also eliminate a read operation. */ /*#define H5D_CHUNK_DEBUG */ @@ -119,19 +119,19 @@ /* Raw data chunks are cached. Each entry in the cache is: */ typedef struct H5D_rdcc_ent_t { - hbool_t locked; /*entry is locked in cache */ - hbool_t dirty; /*needs to be written to disk? */ - hbool_t deleted; /*chunk about to be deleted */ + hbool_t locked; /*entry is locked in cache */ + hbool_t dirty; /*needs to be written to disk? */ + hbool_t deleted; /*chunk about to be deleted */ unsigned edge_chunk_state; /*states related to edge chunks (see above) */ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */ - uint32_t rd_count; /*bytes remaining to be read */ - uint32_t wr_count; /*bytes remaining to be written */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */ + uint32_t rd_count; /*bytes remaining to be read */ + uint32_t wr_count; /*bytes remaining to be written */ H5F_block_t chunk_block; /*offset/length of chunk in file */ - hsize_t chunk_idx; /*index of chunk in dataset */ - uint8_t *chunk; /*the unfiltered chunk data */ - unsigned idx; /*index in hash table */ - struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */ - struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */ + hsize_t chunk_idx; /*index of chunk in dataset */ + uint8_t *chunk; /*the unfiltered chunk data */ + unsigned idx; /*index in hash table */ + struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */ + struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */ struct H5D_rdcc_ent_t *tmp_next;/*next item in temporary doubly-linked list */ struct H5D_rdcc_ent_t *tmp_prev;/*previous item in temporary doubly-linked list */ } H5D_rdcc_ent_t; @@ -142,7 +142,7 @@ typedef struct H5D_chunk_it_ud1_t { H5D_chunk_common_ud_t common; /* Common info for B-tree user data (must be first) */ const H5D_chk_idx_info_t *idx_info; /* Chunked index info */ const H5D_io_info_t *io_info; /* I/O info for dataset operation */ - const hsize_t *space_dim; /* New dataset dimensions */ + const hsize_t *space_dim; /* New dataset dimensions */ const hbool_t *shrunk_dim; /* Dimensions which have been shrunk */ H5S_t *chunk_space; /* Dataspace for a chunk */ uint32_t elmts_per_chunk;/* Elements in chunk */ @@ -192,12 +192,12 @@ typedef struct H5D_chunk_it_ud3_t { /* needed for getting raw data from chunk cache */ hbool_t chunk_in_cache; - uint8_t *chunk; /* the unfiltered chunk data */ + uint8_t *chunk; /* the unfiltered chunk data */ } H5D_chunk_it_ud3_t; /* Callback info for iteration to dump index */ typedef struct H5D_chunk_it_ud4_t { - FILE *stream; /* Output stream */ + FILE *stream; /* Output stream */ hbool_t header_displayed; /* Node's header is displayed? */ unsigned ndims; /* Number of dimensions for chunk/dataset */ uint32_t *chunk_dim; /* Chunk dimensions */ @@ -207,7 +207,7 @@ typedef struct H5D_chunk_it_ud4_t { typedef struct H5D_chunk_it_ud5_t { H5D_chk_idx_info_t *new_idx_info; /* Dest. chunk index info object */ unsigned dset_ndims; /* Number of dimensions in dataset */ - hsize_t *dset_dims; /* Dataset dimensions */ + hsize_t *dset_dims; /* Dataset dimensions */ } H5D_chunk_it_ud5_t; /* Callback info for nonexistent readvv operation */ @@ -254,7 +254,7 @@ static herr_t H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, +static herr_t H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, @@ -321,7 +321,7 @@ static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size); static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); #ifdef H5_HAVE_PARALLEL -static herr_t H5D__chunk_collective_fill(const H5D_t *dset, +static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); static int H5D__chunk_cmp_addr(const void *addr1, const void *addr2); #endif /* H5_HAVE_PARALLEL */ @@ -393,15 +393,15 @@ H5FL_BLK_DEFINE_STATIC(chunk); /* Declare extern free list to manage the H5S_sel_iter_t struct */ H5FL_EXTERN(H5S_sel_iter_t); - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_direct_write + * Function: H5D__chunk_direct_write * - * Purpose: Internal routine to write a chunk directly into the file. + * Purpose: Internal routine to write a chunk directly into the file. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 July 2012 * *------------------------------------------------------------------------- @@ -444,7 +444,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Set the file block information for the old chunk */ @@ -486,7 +486,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, /* Evict the (old) entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != udata.idx_hint) { - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") @@ -509,7 +509,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_direct_write() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_direct_read * @@ -606,7 +606,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_direct_read() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_chunk_storage_size * @@ -704,15 +704,15 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5D__get_chunk_storage_size */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_set_info_real + * Function: H5D__chunk_set_info_real * - * Purpose: Internal routine to set the information about chunks for a dataset + * Purpose: Internal routine to set the information about chunks for a dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * *------------------------------------------------------------------------- @@ -742,7 +742,7 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, /* Sanity check */ if(layout->dim[u] == 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "dimension size must be > 0, dim = %u ", u) - + layout->max_chunks[u] = ((max_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; } @@ -761,15 +761,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_set_info_real() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_set_info + * Function: H5D__chunk_set_info * - * Purpose: Sets the information about chunks for a dataset + * Purpose: Sets the information about chunks for a dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * *------------------------------------------------------------------------- @@ -786,7 +786,7 @@ H5D__chunk_set_info(const H5D_t *dset) /* Set the base layout information */ if(H5D__chunk_set_info_real(&dset->shared->layout.u.chunk, dset->shared->ndims, dset->shared->curr_dims, dset->shared->max_dims) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") /* Call the index's "resize" callback */ if(dset->shared->layout.storage.u.chunk.ops->resize && (dset->shared->layout.storage.u.chunk.ops->resize)(&dset->shared->layout.u.chunk) < 0) @@ -796,15 +796,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_set_info() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_set_sizes + * Function: H5D__chunk_set_sizes * * Purpose: Sets chunk and type sizes. * * Return: SUCCEED/FAIL * - * Programmer: Dana Robinson + * Programmer: Dana Robinson * December 2015 * *------------------------------------------------------------------------- @@ -859,15 +859,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_set_sizes */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_construct + * Function: H5D__chunk_construct * - * Purpose: Constructs new chunked layout information for dataset + * Purpose: Constructs new chunked layout information for dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 22, 2008 * *------------------------------------------------------------------------- @@ -922,16 +922,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_construct() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_init + * Function: H5D__chunk_init * - * Purpose: Initialize the raw data chunk cache for a dataset. This is - * called when the dataset is initialized. + * Purpose: Initialize the raw data chunk cache for a dataset. This is + * called when the dataset is initialized. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, May 18, 1998 * *------------------------------------------------------------------------- @@ -940,7 +940,7 @@ static herr_t H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ H5P_genplist_t *dapl; /* Data access property list object pointer */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -1027,15 +1027,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_init() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_is_space_alloc + * Function: H5D__chunk_is_space_alloc * - * Purpose: Query if space is allocated for layout + * Purpose: Query if space is allocated for layout * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 15, 2009 * *------------------------------------------------------------------------- @@ -1058,7 +1058,7 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_is_space_alloc() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_is_data_cached * @@ -1082,15 +1082,15 @@ H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset) FUNC_LEAVE_NOAPI(shared_dset->cache.chunk.nused > 0) } /* end H5D__chunk_is_data_cached() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_io_init + * Function: H5D__chunk_io_init * - * Purpose: Performs initialization before any sort of I/O on the raw data + * Purpose: Performs initialization before any sort of I/O on the raw data * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 20, 2008 * *------------------------------------------------------------------------- @@ -1106,7 +1106,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf unsigned f_ndims; /* The number of dimensions of the file's dataspace */ int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1172,15 +1172,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_io_init() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_io_init_selections + * Function: H5D__chunk_io_init_selections * - * Purpose: Initialize the chunk mappings + * Purpose: Initialize the chunk mappings * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 20, 2008 * *------------------------------------------------------------------------- @@ -1194,7 +1194,7 @@ H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_ H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ char bogus; /* "bogus" buffer to pass to selection iterator */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1347,7 +1347,7 @@ H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_ HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid") if(H5S_select_iter_init(&(fm->mem_iter), fm->mem_space, elmt_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") - iter_init = TRUE; /* Selection iteration info has been initialized */ + iter_init = TRUE; /* Selection iteration info has been initialized */ iter_op.op_type = H5S_SEL_ITER_OP_LIB; iter_op.u.lib_op = H5D__chunk_mem_cb; @@ -1376,17 +1376,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_io_init_selections() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_mem_alloc + * Function: H5D__chunk_mem_alloc * - * Purpose: Allocate space for a chunk in memory. This routine allocates + * Purpose: Allocate space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list * and uses malloc()/free() for filtered chunks. * - * Return: Pointer to memory for chunk on success/NULL on failure + * Return: Pointer to memory for chunk on success/NULL on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2004 * *------------------------------------------------------------------------- @@ -1394,7 +1394,7 @@ done: static void * H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline) { - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1408,17 +1408,17 @@ H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline) FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_mem_alloc() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_mem_xfree + * Function: H5D__chunk_mem_xfree * - * Purpose: Free space for a chunk in memory. This routine releases + * Purpose: Free space for a chunk in memory. This routine releases * memory space for non-filtered chunks from a block free list * and uses malloc()/free() for filtered chunks. * - * Return: NULL (never fails) + * Return: NULL (never fails) * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2004 * *------------------------------------------------------------------------- @@ -1440,7 +1440,7 @@ H5D__chunk_mem_xfree(void *chk, const void *_pline) FUNC_LEAVE_NOAPI(NULL) } /* H5D__chunk_mem_xfree() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_mem_realloc * @@ -1473,7 +1473,7 @@ H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline) FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_mem_realloc() */ - + /*-------------------------------------------------------------------------- NAME H5D__free_chunk_info @@ -1516,16 +1516,16 @@ H5D__free_chunk_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * FUNC_LEAVE_NOAPI(0) } /* H5D__free_chunk_info() */ - + /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_map_single + * Function: H5D__create_chunk_map_single * - * Purpose: Create chunk selections when appending a single record + * Purpose: Create chunk selections when appending a single record * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, November 20, 2007 + * Programmer: Quincey Koziol + * Tuesday, November 20, 2007 * *------------------------------------------------------------------------- */ @@ -1541,7 +1541,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1601,16 +1601,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_chunk_map_single() */ - + /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_file_map_all + * Function: H5D__create_chunk_file_map_all * - * Purpose: Create all chunk selections in file, for an "all" selection. + * Purpose: Create all chunk selections in file, for an "all" selection. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Monday, January 21, 2019 + * Programmer: Quincey Koziol + * Monday, January 21, 2019 * *------------------------------------------------------------------------- */ @@ -1627,14 +1627,14 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t zeros[H5S_MAX_RANK]; /* All zero vector (for start parameter to setting hyperslab on partial chunks) */ hsize_t coords[H5S_MAX_RANK]; /* Current coordinates of chunk */ hsize_t end[H5S_MAX_RANK]; /* Final coordinates of chunk */ - hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ hsize_t chunk_index; /* "Index" of chunk */ - hsize_t curr_partial_clip[H5S_MAX_RANK]; /* Current partial dimension sizes to clip against */ - hsize_t partial_dim_size[H5S_MAX_RANK]; /* Size of a partial dimension */ + hsize_t curr_partial_clip[H5S_MAX_RANK]; /* Current partial dimension sizes to clip against */ + hsize_t partial_dim_size[H5S_MAX_RANK]; /* Size of a partial dimension */ hbool_t is_partial_dim[H5S_MAX_RANK]; /* Whether a dimension is currently a partial chunk */ unsigned num_partial_dims; /* Current number of partial dimensions */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1758,7 +1758,7 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t end[curr_dim] = fm->chunk_dim[curr_dim] - 1; /* Check for previous partial chunk in this dimension */ - if(is_partial_dim[curr_dim] && end[curr_dim] < file_dims[curr_dim]) { + if(is_partial_dim[curr_dim] && end[curr_dim] < file_dims[curr_dim]) { /* Sanity check */ HDassert(num_partial_dims > 0); @@ -1805,16 +1805,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_chunk_file_map_all() */ - + /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_file_map_hyper + * Function: H5D__create_chunk_file_map_hyper * - * Purpose: Create all chunk selections in file, for a hyperslab selection. + * Purpose: Create all chunk selections in file, for a hyperslab selection. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, May 29, 2003 + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 * *------------------------------------------------------------------------- */ @@ -1834,10 +1834,10 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t end[H5O_LAYOUT_NDIMS]; /* Final coordinates of chunk */ hsize_t chunk_index; /* Index of chunk */ hsize_t start_scaled[H5S_MAX_RANK]; /* Starting scaled coordinates of selection */ - hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ int curr_dim; /* Current dimension to increment */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1913,7 +1913,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t new_chunk_info->mspace_shared = FALSE; /* Copy the chunk's scaled coordinates */ - H5MM_memcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); + H5MM_memcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); new_chunk_info->scaled[fm->f_ndims] = 0; /* Insert the new chunk into the skip list */ @@ -1979,18 +1979,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_chunk_file_map_hyper() */ - + /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_mem_map_hyper + * Function: H5D__create_chunk_mem_map_hyper * - * Purpose: Create all chunk selections in memory by copying the file + * Purpose: Create all chunk selections in memory by copying the file * chunk selections and adjusting their offsets to be correct * for the memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, May 29, 2003 + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 * * Assumptions: That the file and memory selections are the same shape. * @@ -2007,7 +2007,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) hsize_t mem_sel_end[H5S_MAX_RANK]; /* Offset of high bound of file selection */ hssize_t adjust[H5S_MAX_RANK]; /* Adjustment to make to all file chunks */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2111,17 +2111,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_chunk_mem_map_hyper() */ - + /*------------------------------------------------------------------------- - * Function: H5D__create_mem_map_1d + * Function: H5D__create_mem_map_1d * - * Purpose: Create all chunk selections for 1-dimensional regular memory space + * Purpose: Create all chunk selections for 1-dimensional regular memory space * that has only one single block in the selection * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Sept 18, 2019 + * Programmer: Vailin Choi + * Sept 18, 2019 * *------------------------------------------------------------------------- */ @@ -2192,17 +2192,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_chunk_mem_map_1d() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_file_cb + * Function: H5D__chunk_file_cb * - * Purpose: Callback routine for file selection iterator. Used when + * Purpose: Callback routine for file selection iterator. Used when * creating selections in file for each point selected. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, July 23, 2003 + * Programmer: Quincey Koziol + * Wednesday, July 23, 2003 * *------------------------------------------------------------------------- */ @@ -2214,9 +2214,9 @@ H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ hsize_t chunk_index; /* Chunk index */ - hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2309,17 +2309,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_file_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_mem_cb + * Function: H5D__chunk_mem_cb * - * Purpose: Callback routine for file selection iterator. Used when + * Purpose: Callback routine for file selection iterator. Used when * creating selections in memory for each chunk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -2330,7 +2330,7 @@ H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ hsize_t coords_in_mem[H5S_MAX_RANK]; /* Coordinates of element in memory */ hsize_t chunk_index; /* Chunk index */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2385,17 +2385,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_mem_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_cacheable + * Function: H5D__chunk_cacheable * - * Purpose: A small internal function to if it's possible to load the + * Purpose: A small internal function to if it's possible to load the * chunk into cache. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Raymond Lu - * 17 July 2007 + * Programmer: Raymond Lu + * 17 July 2007 * *------------------------------------------------------------------------- */ @@ -2477,16 +2477,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_cacheable() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_read + * Function: H5D__chunk_read * - * Purpose: Read from a chunked dataset. + * Purpose: Read from a chunked dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -2504,7 +2504,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t src_accessed_bytes = 0; /* Total accessed size in a chunk */ hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -2556,7 +2556,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); while(chunk_node) { H5D_chunk_info_t *chunk_info; /* Chunk information */ - H5D_chunk_ud_t udata; /* Chunk index pass-through */ + H5D_chunk_ud_t udata; /* Chunk index pass-through */ /* Get the actual chunk information from the skip list node */ chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); @@ -2566,7 +2566,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Check for non-existant chunk & skip it if appropriate */ @@ -2629,16 +2629,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_read() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_write + * Function: H5D__chunk_write * - * Purpose: Writes to a chunked dataset. + * Purpose: Writes to a chunked dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -2654,7 +2654,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2684,10 +2684,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); while(chunk_node) { H5D_chunk_info_t *chunk_info; /* Chunk information */ - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ void *chunk; /* Pointer to locked chunk buffer */ - H5D_chunk_ud_t udata; /* Index pass-through */ + H5D_chunk_ud_t udata; /* Index pass-through */ htri_t cacheable; /* Whether the chunk is cacheable */ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ @@ -2699,11 +2699,11 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); - /* Set chunk's [scaled] coordinates */ - io_info->store->chunk.scaled = chunk_info->scaled; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, TRUE)) < 0) @@ -2720,7 +2720,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Determine if we will access all the data in the chunk */ if(dst_accessed_bytes != ctg_store.contig.dset_size || (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size || - fm->fsel_type == H5S_SEL_POINTS) + fm->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; /* Lock the chunk into the cache */ @@ -2746,8 +2746,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, udata.chunk_block.length = io_info->dset->shared->layout.u.chunk.size; /* Allocate the chunk */ - if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, chunk_info->scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") + if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, chunk_info->scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) @@ -2772,16 +2772,16 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") - /* Release the cache lock on the chunk, or insert chunk into index. */ - if(chunk) { - if(H5D__chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ - else { + /* Release the cache lock on the chunk, or insert chunk into index. */ + if(chunk) { + if(H5D__chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + } /* end if */ + else { if(need_insert && io_info->dset->shared->layout.storage.u.chunk.ops->insert) if((io_info->dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") - } /* end else */ + } /* end else */ /* Advance to next chunk in list */ chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); @@ -2791,16 +2791,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_write() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_flush + * Function: H5D__chunk_flush * - * Purpose: Writes all dirty chunks to disk and optionally preempts them - * from the cache. + * Purpose: Writes all dirty chunks to disk and optionally preempts them + * from the cache. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -2809,8 +2809,8 @@ static herr_t H5D__chunk_flush(H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - H5D_rdcc_ent_t *ent, *next; - unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ + H5D_rdcc_ent_t *ent, *next; + unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2820,34 +2820,34 @@ H5D__chunk_flush(H5D_t *dset) /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; + next = ent->next; if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_flush() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_io_term + * Function: H5D__chunk_io_term * - * Purpose: Destroy I/O operation information. + * Purpose: Destroy I/O operation information. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Saturday, May 17, 2003 + * Programmer: Quincey Koziol + * Saturday, May 17, 2003 * *------------------------------------------------------------------------- */ static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -2882,16 +2882,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_io_term() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_dest + * Function: H5D__chunk_dest * - * Purpose: Destroy the entire chunk cache by flushing dirty entries, - * preempting all entries, and freeing the cache itself. + * Purpose: Destroy the entire chunk cache by flushing dirty entries, + * preempting all entries, and freeing the cache itself. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -2900,9 +2900,9 @@ static herr_t H5D__chunk_dest(H5D_t *dset) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ - H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ - int nerrors = 0; /* Accumulated count of errors */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ + H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ + int nerrors = 0; /* Accumulated count of errors */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -2918,7 +2918,7 @@ H5D__chunk_dest(H5D_t *dset) if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0) nerrors++; } /* end for */ - + /* Continue even if there are failures. */ if(nerrors) HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") @@ -2942,15 +2942,15 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_dest() */ - + /*------------------------------------------------------------------------- - * Function: H5D_chunk_idx_reset + * Function: H5D_chunk_idx_reset * - * Purpose: Reset index information + * Purpose: Reset index information * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 15, 2009 * *------------------------------------------------------------------------- @@ -2969,21 +2969,21 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index structures */ if((storage->ops->reset)(storage, reset_addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_idx_reset() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_reset + * Function: H5D__chunk_cinfo_cache_reset * - * Purpose: Reset the cached chunk info + * Purpose: Reset the cached chunk info * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -3002,15 +3002,15 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5D__chunk_cinfo_cache_reset() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_update + * Function: H5D__chunk_cinfo_cache_update * - * Purpose: Update the cached chunk info + * Purpose: Update the cached chunk info * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -3039,15 +3039,15 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud FUNC_LEAVE_NOAPI(SUCCEED) } /* H5D__chunk_cinfo_cache_update() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_found + * Function: H5D__chunk_cinfo_cache_found * - * Purpose: Look for chunk info in cache + * Purpose: Look for chunk info in cache * - * Return: TRUE/FALSE/FAIL + * Return: TRUE/FALSE/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -3088,19 +3088,19 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_cinfo_cache_found() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_create + * Function: H5D__chunk_create * - * Purpose: Creates a new chunked storage index and initializes the - * layout information with information about the storage. The - * layout info should be immediately written to the object header. + * Purpose: Creates a new chunked storage index and initializes the + * layout information with information about the storage. The + * layout info should be immediately written to the object header. * - * Return: Non-negative on success (with the layout information initialized - * and ready to write to an object header). Negative on failure. + * Return: Non-negative on success (with the layout information initialized + * and ready to write to an object header). Negative on failure. * - * Programmer: Quincey Koziol - * Thursday, May 22, 2008 + * Programmer: Quincey Koziol + * Thursday, May 22, 2008 * *------------------------------------------------------------------------- */ @@ -3124,7 +3124,7 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/) unsigned u; /* Local index variable */ for(u = 0; u < dset->shared->layout.u.chunk.ndims; u++) - HDassert(dset->shared->layout.u.chunk.dim[u] > 0); + HDassert(dset->shared->layout.u.chunk.dim[u] > 0); } #endif @@ -3142,16 +3142,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_create() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_hash_val + * Function: H5D__chunk_hash_val * - * Purpose: To calculate an index based on the dataset's scaled - * coordinates and sizes of the faster dimensions. + * Purpose: To calculate an index based on the dataset's scaled + * coordinates and sizes of the faster dimensions. * - * Return: Hash value index + * Return: Hash value index * - * Programmer: Vailin Choi; Nov 2014 + * Programmer: Vailin Choi; Nov 2014 * *------------------------------------------------------------------------- */ @@ -3184,16 +3184,16 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) FUNC_LEAVE_NOAPI(ret) } /* H5D__chunk_hash_val() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_lookup + * Function: H5D__chunk_lookup * - * Purpose: Loops up a chunk in cache and on disk, and retrieves + * Purpose: Loops up a chunk in cache and on disk, and retrieves * information about that chunk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * June 27, 1998 * *------------------------------------------------------------------------- @@ -3206,7 +3206,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); unsigned idx; /* Index of chunk in cache, if present */ hbool_t found = FALSE; /* In cache? */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3326,18 +3326,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_lookup() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_flush_entry + * Function: H5D__chunk_flush_entry * - * Purpose: Writes a chunk to disk. If RESET is non-zero then the - * entry is cleared -- it's slightly faster to flush a chunk if - * the RESET flag is turned on because it results in one fewer - * memory copy. + * Purpose: Writes a chunk to disk. If RESET is non-zero then the + * entry is cleared -- it's slightly faster to flush a chunk if + * the RESET flag is turned on because it results in one fewer + * memory copy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -3345,10 +3345,10 @@ done: static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) { - void *buf = NULL; /* Temporary buffer */ - hbool_t point_of_no_return = FALSE; + void *buf = NULL; /* Temporary buffer */ + hbool_t point_of_no_return = FALSE; H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC_TAG(dset->oloc.addr) @@ -3361,7 +3361,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) buf = ent->chunk; if(ent->dirty) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_chunk_ud_t udata; /* pass through B-tree */ + H5D_chunk_ud_t udata; /* pass through B-tree */ hbool_t must_alloc = FALSE; /* Whether the chunk must be allocated */ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ @@ -3379,7 +3379,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) && !(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)) { H5Z_EDC_t err_detect; /* Error detection info */ H5Z_cb_t filter_cb; /* I/O filter callback function */ - size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */ + size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */ size_t nbytes; /* Chunk size (in bytes) */ /* Retrieve filter settings from API context */ @@ -3517,7 +3517,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_flush_entry() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_cache_evict * @@ -3596,17 +3596,17 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_cache_evict() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_cache_prune + * Function: H5D__chunk_cache_prune * - * Purpose: Prune the cache by preempting some things until the cache has - * room for something which is SIZE bytes. Only unlocked - * entries are considered for preemption. + * Purpose: Prune the cache by preempting some things until the cache has + * room for something which is SIZE bytes. Only unlocked + * entries are considered for preemption. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -3614,13 +3614,13 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size) { - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - size_t total = rdcc->nbytes_max; - const int nmeth = 2; /*number of methods */ - int w[1]; /*weighting as an interval */ - H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ - H5D_rdcc_ent_t *n[2]; /*list next pointers */ - int nerrors = 0; /* Accumulated error count during preemptions */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + size_t total = rdcc->nbytes_max; + const int nmeth = 2; /*number of methods */ + int w[1]; /*weighting as an interval */ + H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ + H5D_rdcc_ent_t *n[2]; /*list next pointers */ + int nerrors = 0; /* Accumulated error count during preemptions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -3642,91 +3642,91 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) { int i; /* Local index variable */ - /* Introduce new pointers */ - for(i = 0; i < nmeth - 1; i++) + /* Introduce new pointers */ + for(i = 0; i < nmeth - 1; i++) if(0 == w[i]) p[i + 1] = rdcc->head; - /* Compute next value for each pointer */ - for(i = 0; i < nmeth; i++) + /* Compute next value for each pointer */ + for(i = 0; i < nmeth; i++) n[i] = p[i] ? p[i]->next : NULL; - /* Give each method a chance */ - for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { - if(0 == i && p[0] && !p[0]->locked && + /* Give each method a chance */ + for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { + if(0 == i && p[0] && !p[0]->locked && ((0 == p[0]->rd_count && 0 == p[0]->wr_count) || (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { - /* - * Method 0: Preempt entries that have been completely written - * and/or completely read but not entries that are partially - * written or partially read. - */ - cur = p[0]; - } else if(1 == i && p[1] && !p[1]->locked) { - /* - * Method 1: Preempt the entry without regard to - * considerations other than being locked. This is the last - * resort preemption. - */ - cur = p[1]; - } else { - /* Nothing to preempt at this point */ - cur = NULL; - } - - if(cur) { + /* + * Method 0: Preempt entries that have been completely written + * and/or completely read but not entries that are partially + * written or partially read. + */ + cur = p[0]; + } else if(1 == i && p[1] && !p[1]->locked) { + /* + * Method 1: Preempt the entry without regard to + * considerations other than being locked. This is the last + * resort preemption. + */ + cur = p[1]; + } else { + /* Nothing to preempt at this point */ + cur = NULL; + } + + if(cur) { int j; /* Local index variable */ - for(j = 0; j < nmeth; j++) { - if(p[j] == cur) + for(j = 0; j < nmeth; j++) { + if(p[j] == cur) p[j] = NULL; - if(n[j] == cur) + if(n[j] == cur) n[j] = cur->next; - } /* end for */ - if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) + } /* end for */ + if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) nerrors++; - } /* end if */ - } /* end for */ + } /* end if */ + } /* end for */ - /* Advance pointers */ - for(i = 0; i < nmeth; i++) + /* Advance pointers */ + for(i = 0; i < nmeth; i++) p[i] = n[i]; - for(i = 0; i < nmeth - 1; i++) + for(i = 0; i < nmeth - 1; i++) w[i] -= 1; } /* end while */ if(nerrors) - HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") + HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_cache_prune() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_lock + * Function: H5D__chunk_lock * - * Purpose: Return a pointer to a dataset chunk. The pointer points - * directly into the chunk cache and should not be freed - * by the caller but will be valid until it is unlocked. The - * input value IDX_HINT is used to speed up cache lookups and - * it's output value should be given to H5D__chunk_unlock(). - * IDX_HINT is ignored if it is out of range, and if it points - * to the wrong entry then we fall back to the normal search - * method. + * Purpose: Return a pointer to a dataset chunk. The pointer points + * directly into the chunk cache and should not be freed + * by the caller but will be valid until it is unlocked. The + * input value IDX_HINT is used to speed up cache lookups and + * it's output value should be given to H5D__chunk_unlock(). + * IDX_HINT is ignored if it is out of range, and if it points + * to the wrong entry then we fall back to the normal search + * method. * - * If RELAX is non-zero and the chunk isn't in the cache then - * don't try to read it from the file, but just allocate an - * uninitialized buffer to hold the result. This is intended - * for output functions that are about to overwrite the entire - * chunk. + * If RELAX is non-zero and the chunk isn't in the cache then + * don't try to read it from the file, but just allocate an + * uninitialized buffer to hold the result. This is intended + * for output functions that are about to overwrite the entire + * chunk. * - * Return: Success: Ptr to a file chunk. + * Return: Success: Ptr to a file chunk. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -3742,12 +3742,12 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/ - H5D_rdcc_ent_t *ent; /*cache entry */ - size_t chunk_size; /*size of a chunk */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/ + H5D_rdcc_ent_t *ent; /*cache entry */ + size_t chunk_size; /*size of a chunk */ hbool_t disable_filters = FALSE; /* Whether to disable filters (when adding to cache) */ - void *chunk = NULL; /*the file chunk */ - void *ret_value = NULL; /* Return value */ + void *chunk = NULL; /*the file chunk */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -3774,7 +3774,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, #ifndef NDEBUG { - unsigned u; /*counters */ + unsigned u; /*counters */ /* Make sure this is the right chunk */ for(u = 0; u < layout->u.chunk.ndims - 1; u++) @@ -3932,8 +3932,8 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Check if the chunk exists on disk */ if(H5F_addr_defined(chunk_addr)) { - size_t my_chunk_alloc = chunk_alloc; /* Allocated buffer size */ - size_t buf_alloc = chunk_alloc; /* [Re-]allocated buffer size */ + size_t my_chunk_alloc = chunk_alloc; /* Allocated buffer size */ + size_t buf_alloc = chunk_alloc; /* [Re-]allocated buffer size */ /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ @@ -3973,7 +3973,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, rdcc->stats.nmisses++; } /* end if */ else { - H5D_fill_value_t fill_status; + H5D_fill_value_t fill_status; /* Sanity check */ HDassert(fill->alloc_time != H5D_ALLOC_TIME_EARLY); @@ -4107,25 +4107,25 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_lock() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_unlock + * Function: H5D__chunk_unlock * - * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and - * OFFSET arguments should be the same as for H5D__chunk_lock(). - * The DIRTY argument should be set to non-zero if the chunk has - * been modified since it was locked. The IDX_HINT argument is - * the returned index hint from the lock operation and BUF is - * the return value from the lock. + * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and + * OFFSET arguments should be the same as for H5D__chunk_lock(). + * The DIRTY argument should be set to non-zero if the chunk has + * been modified since it was locked. The IDX_HINT argument is + * the returned index hint from the lock operation and BUF is + * the return value from the lock. * - * The NACCESSED argument should be the number of bytes accessed - * for reading or writing (depending on the value of DIRTY). - * It's only purpose is to provide additional information to the - * preemption policy. + * The NACCESSED argument should be the number of bytes accessed + * for reading or writing (depending on the value of DIRTY). + * It's only purpose is to provide additional information to the + * preemption policy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -4135,7 +4135,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */ - const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); + const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -4173,9 +4173,9 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, fake_ent.edge_chunk_state = H5D_RDCC_DISABLE_FILTERS; if(udata->new_unfilt_chunk) fake_ent.edge_chunk_state |= H5D_RDCC_NEWLY_DISABLED_FILTERS; - H5MM_memcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); + H5MM_memcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); HDassert(layout->u.chunk.size > 0); - fake_ent.chunk_idx = udata->chunk_idx; + fake_ent.chunk_idx = udata->chunk_idx; fake_ent.chunk_block.offset = udata->chunk_block.offset; fake_ent.chunk_block.length = udata->chunk_block.length; fake_ent.chunk = (uint8_t *)chunk; @@ -4186,16 +4186,16 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, else { if(chunk) chunk = H5D__chunk_mem_xfree(chunk, (is_unfiltered_edge_chunk ? NULL - : &(io_info->dset->shared->dcpl_cache.pline))); + : &(io_info->dset->shared->dcpl_cache.pline))); } /* end else */ } /* end if */ else { - H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ + H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ /* Sanity check */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); - HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); + HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); /* * It's in the cache so unlock it. @@ -4215,16 +4215,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_unlock() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocated_cb + * Function: H5D__chunk_allocated_cb * - * Purpose: Simply counts the number of chunks for a dataset. + * Purpose: Simply counts the number of chunks for a dataset. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- @@ -4241,17 +4241,17 @@ H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* H5D__chunk_allocated_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocated + * Function: H5D__chunk_allocated * - * Purpose: Return the number of bytes allocated in the file for storage - * of raw data in the chunked dataset + * Purpose: Return the number of bytes allocated in the file for storage + * of raw data in the chunked dataset * - * Return: Success: Number of bytes stored in all chunks. - * Failure: 0 + * Return: Success: Number of bytes stored in all chunks. + * Failure: 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 20, 2008 * *------------------------------------------------------------------------- @@ -4260,7 +4260,7 @@ herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ H5D_rdcc_ent_t *ent; /* Cache entry */ hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); @@ -4295,18 +4295,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_allocated() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocate + * Function: H5D__chunk_allocate * - * Purpose: Allocate file space for all chunks that are not allocated yet. - * Return SUCCEED if all needed allocation succeed, otherwise - * FAIL. + * Purpose: Allocate file space for all chunks that are not allocated yet. + * Return SUCCEED if all needed allocation succeed, otherwise + * FAIL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Albert Cheng - * June 26, 1998 + * Programmer: Albert Cheng + * June 26, 1998 * *------------------------------------------------------------------------- */ @@ -4318,8 +4318,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ const H5D_chunk_ops_t *ops = dset->shared->layout.storage.u.chunk.ops; /* Chunk operations */ hsize_t min_unalloc[H5O_LAYOUT_NDIMS]; /* First chunk in each dimension that is unallocated (in scaled coordinates) */ hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated (in scaled coordinates) */ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */ - size_t orig_chunk_size; /* Original size of chunk in bytes */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */ + size_t orig_chunk_size; /* Original size of chunk in bytes */ size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */ unsigned filter_mask = 0; /* Filter mask for chunks that have them */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ @@ -4335,7 +4335,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ H5D_chunk_coll_info_t chunk_info; /* chunk address information for doing I/O */ #endif /* H5_HAVE_PARALLEL */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Dataset's dataspace dimensions */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ @@ -4347,7 +4347,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each dimension */ unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) @@ -4637,8 +4637,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ udata.filter_mask = filter_mask; /* Allocate the chunk (with all processes) */ - if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") + if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") HDassert(H5F_addr_defined(udata.chunk_block.offset)); /* Check if fill values should be written to chunks */ @@ -4677,7 +4677,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ /* Insert the chunk record into the index */ - if(need_insert && ops->insert) + if(need_insert && ops->insert) if((ops->insert)(&idx_info, &udata, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") @@ -4756,7 +4756,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_allocate() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_update_old_edge_chunks * @@ -4837,12 +4837,12 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Calculate offset of first previously incomplete chunk in this * dimension */ - old_edge_chunk_sc[op_dim] = (old_dim[op_dim] / chunk_dim[op_dim]); + old_edge_chunk_sc[op_dim] = (old_dim[op_dim] / chunk_dim[op_dim]); /* Calculate the largest offset of chunks that might need to be * modified in this dimension */ - max_edge_chunk_sc[op_dim] = MIN((old_dim[op_dim] - 1) / chunk_dim[op_dim], - MAX((space_dim[op_dim] / chunk_dim[op_dim]), 1) - 1); + max_edge_chunk_sc[op_dim] = MIN((old_dim[op_dim] - 1) / chunk_dim[op_dim], + MAX((space_dim[op_dim] / chunk_dim[op_dim]), 1) - 1); /* Check for old_dim aligned with chunk boundary in this dimension, if * so we do not need to modify chunks along the edge in this dimension @@ -4852,7 +4852,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Check if the dataspace expanded enough to cause the old edge chunks * in this dimension to become full */ - if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1)) + if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1)) new_full_dim[op_dim] = TRUE; } /* end for */ @@ -4900,7 +4900,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) carry = TRUE; for(i = ((int)space_ndims - 1); i >= 0; --i) { if((unsigned)i != op_dim) { - ++chunk_sc[i]; + ++chunk_sc[i]; if(chunk_sc[i] > (hsize_t) max_edge_chunk_sc[i]) chunk_sc[i] = 0; else { @@ -4928,18 +4928,18 @@ done: } /* end H5D__chunk_update_old_edge_chunks() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_collective_fill + * Function: H5D__chunk_collective_fill * * Purpose: Use MPIO collective write to fill the chunks (if number of - * chunks to fill is greater than the number of MPI procs; + * chunks to fill is greater than the number of MPI procs; * otherwise use independent I/O). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi - * July 30, 2014 + * Programmer: Mohamad Chaarawi + * July 30, 2014 * *------------------------------------------------------------------------- */ @@ -4947,7 +4947,7 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf) { - MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ + MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ int mpi_size = (-1); /* MPI Comm size */ int mpi_code; /* MPI return code */ @@ -5116,17 +5116,17 @@ H5D__chunk_cmp_addr(const void *addr1, const void *addr2) } /* end H5D__chunk_cmp_addr() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_prune_fill + * Function: H5D__chunk_prune_fill * - * Purpose: Write the fill value to the parts of the chunk that are no + * Purpose: Write the fill value to the parts of the chunk that are no * longer part of the dataspace * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * March 26, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * March 26, 2002 * *------------------------------------------------------------------------- */ @@ -5143,7 +5143,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) hsize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ size_t chunk_size; /*size of a chunk */ - void *chunk; /* The file chunk */ + void *chunk; /* The file chunk */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ uint32_t bytes_accessed; /* Bytes accessed in chunk */ unsigned u; /* Local index variable */ @@ -5242,18 +5242,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_prune_fill */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_prune_by_extent + * Function: H5D__chunk_prune_by_extent * - * Purpose: This function searches for chunks that are no longer necessary + * Purpose: This function searches for chunks that are no longer necessary * both in the raw data cache and in the chunk index. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Algorithm: Robb Matzke - * March 27, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Algorithm: Robb Matzke + * March 27, 2002 * * The algorithm is: * @@ -5355,7 +5355,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_storage_t chk_store; /* Chunk storage information */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Current dataspace dimensions */ unsigned op_dim; /* Current operating dimension */ @@ -5370,7 +5370,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) uint32_t elmts_per_chunk; /* Elements in chunk */ hbool_t disable_edge_filters = FALSE; /* Whether to disable filters on partial edge chunks */ hbool_t new_unfilt_chunk = FALSE; /* Whether the chunk is newly unfiltered */ - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -5404,13 +5404,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) elmts_per_chunk = 1; for(u = 0; u < space_ndims; u++) { elmts_per_chunk *= layout->u.chunk.dim[u]; - chunk_dim[u] = layout->u.chunk.dim[u]; - shrunk_dim[u] = (space_dim[u] < old_dim[u]); + chunk_dim[u] = layout->u.chunk.dim[u]; + shrunk_dim[u] = (space_dim[u] < old_dim[u]); } /* end for */ /* Create a dataspace for a chunk & set the extent */ if(NULL == (chunk_space = H5S_create_simple(space_ndims, chunk_dim, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Reset hyperslab start array */ /* (hyperslabs will always start from origin) */ @@ -5537,7 +5537,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) carry = FALSE; while(!carry) { - int i; /* Local index variable */ + int i; /* Local index variable */ udata.common.scaled = scaled; @@ -5598,7 +5598,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Remove the chunk from disk, if present */ if(H5F_addr_defined(chk_udata.chunk_block.offset)) { /* Update the offset in idx_udata */ - idx_udata.scaled = udata.common.scaled; + idx_udata.scaled = udata.common.scaled; /* Remove the chunk from disk */ if((sc->ops->remove)(&idx_info, &idx_udata) < 0) @@ -5666,16 +5666,16 @@ done: } /* end H5D__chunk_prune_by_extent() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_addrmap_cb + * Function: H5D__chunk_addrmap_cb * * Purpose: Callback when obtaining the chunk addresses for all existing chunks * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Kent Yang + * Programmer: Kent Yang * Tuesday, November 15, 2005 * *------------------------------------------------------------------------- @@ -5683,7 +5683,7 @@ done: static int H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ + H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */ hsize_t chunk_index; @@ -5698,14 +5698,14 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* H5D__chunk_addrmap_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_addrmap + * Function: H5D__chunk_addrmap * * Purpose: Obtain the chunk addresses for all existing chunks * - * Return: Success: Non-negative on succeed. - * Failure: negative value + * Return: Success: Non-negative on succeed. + * Failure: negative value * * Programmer: Kent Yang * November 15, 2005 @@ -5717,7 +5717,7 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ - H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ + H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -5749,16 +5749,16 @@ done: } /* end H5D__chunk_addrmap() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_delete + * Function: H5D__chunk_delete * - * Purpose: Delete raw data storage for entire dataset (i.e. all chunks) + * Purpose: Delete raw data storage for entire dataset (i.e. all chunks) * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 20, 2003 * *------------------------------------------------------------------------- @@ -5771,7 +5771,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */ H5O_pline_t pline; /* I/O pipeline message */ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ - htri_t exists; /* Flag if header message of interest exists */ + htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5826,17 +5826,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_delete() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_update_cache + * Function: H5D__chunk_update_cache * - * Purpose: Update any cached chunks index values after the dataspace + * Purpose: Update any cached chunks index values after the dataspace * size has changed * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, May 29, 2004 * *------------------------------------------------------------------------- @@ -5844,8 +5844,8 @@ done: herr_t H5D__chunk_update_cache(H5D_t *dset) { - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - H5D_rdcc_ent_t *ent, *next; /*cache entry */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + H5D_rdcc_ent_t *ent, *next; /*cache entry */ H5D_rdcc_ent_t tmp_head; /* Sentinel entry for temporary entry list */ H5D_rdcc_ent_t *tmp_tail; /* Tail pointer for temporary entry list */ herr_t ret_value = SUCCEED; /* Return value */ @@ -5866,7 +5866,7 @@ H5D__chunk_update_cache(H5D_t *dset) /* Recompute the index for each cached chunk that is in a dataset */ for(ent = rdcc->head; ent; ent = next) { - unsigned old_idx; /* Previous index number */ + unsigned old_idx; /* Previous index number */ /* Get the pointer to the next cache entry */ next = ent->next; @@ -5876,7 +5876,7 @@ H5D__chunk_update_cache(H5D_t *dset) ent->idx = H5D__chunk_hash_val(dset->shared, ent->scaled); if(old_idx != ent->idx) { - H5D_rdcc_ent_t *old_ent; /* Old cache entry */ + H5D_rdcc_ent_t *old_ent; /* Old cache entry */ /* Check if there is already a chunk at this chunk's new location */ old_ent = rdcc->slot[ent->idx]; @@ -5939,7 +5939,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_update_cache() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_copy_cb * @@ -6144,8 +6144,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata->chunk_in_cache = FALSE; - udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1, - udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled); + udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1, + udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled); /* Allocate chunk in the file */ if(H5D__chunk_file_alloc(udata->idx_info_dst, NULL, &udata_dst.chunk_block, &need_insert, udata_dst.common.scaled) < 0) @@ -6171,17 +6171,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_copy_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_copy + * Function: H5D__chunk_copy * - * Purpose: Copy chunked storage from SRC file to DST file. + * Purpose: Copy chunked storage from SRC file to DST file. * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * * Programmer: Peter Cao - * August 20, 2005 + * August 20, 2005 * *------------------------------------------------------------------------- */ @@ -6455,7 +6455,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_copy() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_bh_info * @@ -6534,18 +6534,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_bh_info() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_dump_index_cb + * Function: H5D__chunk_dump_index_cb * - * Purpose: If the UDATA.STREAM member is non-null then debugging + * Purpose: If the UDATA.STREAM member is non-null then debugging * information is written to that stream. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- @@ -6553,7 +6553,7 @@ done: static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ + H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ FUNC_ENTER_STATIC_NOERR @@ -6579,17 +6579,17 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* H5D__chunk_dump_index_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_dump_index + * Function: H5D__chunk_dump_index * - * Purpose: Prints information about the storage index to the specified - * stream. + * Purpose: Prints information about the storage index to the specified + * stream. * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 28, 1999 * *------------------------------------------------------------------------- @@ -6637,17 +6637,17 @@ done: } /* end H5D__chunk_dump_index() */ #ifdef H5D_CHUNK_DEBUG - + /*------------------------------------------------------------------------- - * Function: H5D__chunk_stats + * Function: H5D__chunk_stats * - * Purpose: Print raw data cache statistics to the debug stream. If - * HEADERS is non-zero then print table column headers, - * otherwise assume that the H5AC layer has already printed them. + * Purpose: Print raw data cache statistics to the debug stream. If + * HEADERS is non-zero then print table column headers, + * otherwise assume that the H5AC layer has already printed them. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -6655,9 +6655,9 @@ done: herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers) { - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - double miss_rate; - char ascii[32]; + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + double miss_rate; + char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -6701,22 +6701,22 @@ done: } /* end H5D__chunk_stats() */ #endif /* H5D_CHUNK_DEBUG */ - + /*------------------------------------------------------------------------- - * Function: H5D__nonexistent_readvv_cb + * Function: H5D__nonexistent_readvv_cb * - * Purpose: Callback operation for performing fill value I/O operation + * Purpose: Callback operation for performing fill value I/O operation * on memory buffer. * - * Note: This algorithm is pretty inefficient about initializing and + * Note: This algorithm is pretty inefficient about initializing and * terminating the fill buffer info structure and it would be * faster to refactor this into a "real" initialization routine, * and a "vectorized fill" routine. -QAK * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * 30 Sep 2010 + * Programmer: Quincey Koziol + * 30 Sep 2010 * *------------------------------------------------------------------------- */ @@ -6750,24 +6750,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__nonexistent_readvv_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5D__nonexistent_readvv + * Function: H5D__nonexistent_readvv * - * Purpose: When the chunk doesn't exist on disk and the chunk is bigger + * Purpose: When the chunk doesn't exist on disk and the chunk is bigger * than the cache size, performs fill value I/O operation on * memory buffer, advancing through two I/O vectors, until one * runs out. * - * Note: This algorithm is pretty inefficient about initializing and + * Note: This algorithm is pretty inefficient about initializing and * terminating the fill buffer info structure and it would be * faster to refactor this into a "real" initialization routine, * and a "vectorized fill" routine. -QAK * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * 6 Feb 2009 + * Programmer: Raymond Lu + * 6 Feb 2009 * *------------------------------------------------------------------------- */ @@ -6804,7 +6804,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__nonexistent_readvv() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_is_partial_edge_chunk * @@ -6843,14 +6843,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_is_partial_edge_chunk() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_file_alloc() * - * Purpose: Chunk allocation: - * Create the chunk if it doesn't exist, or reallocate the + * Purpose: Chunk allocation: + * Create the chunk if it doesn't exist, or reallocate the * chunk if its size changed. - * The coding is moved and modified from each index structure. + * The coding is moved and modified from each index structure. * * Return: Non-negative on success/Negative on failure * @@ -6862,8 +6862,8 @@ herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled) { - hbool_t alloc_chunk = FALSE; /* Whether to allocate chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t alloc_chunk = FALSE; /* Whether to allocate chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -6881,7 +6881,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Check for filters on chunks */ if(idx_info->pline->nused > 0) { /* Sanity/error checking block */ - HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); + HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); { unsigned allow_chunk_size_len; /* Allowed size of encoded chunk size */ unsigned new_chunk_size_len; /* Size of encoded chunk size */ @@ -6931,9 +6931,9 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old } /* end else */ } /* end if */ else { - HDassert(!H5F_addr_defined(new_chunk->offset)); - HDassert(new_chunk->length == idx_info->layout->size); - alloc_chunk = TRUE; + HDassert(!H5F_addr_defined(new_chunk->offset)); + HDassert(new_chunk->length == idx_info->layout->size); + alloc_chunk = TRUE; } /* end else */ /* Actually allocate space for the chunk in the file */ @@ -6973,11 +6973,11 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old HDassert(H5F_addr_defined(new_chunk->offset)); -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_file_alloc() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_format_convert_cb * @@ -6995,13 +6995,13 @@ done: static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_chunk_it_ud5_t *udata = (H5D_chunk_it_ud5_t *)_udata; /* User data */ - H5D_chk_idx_info_t *new_idx_info; /* The new chunk index information */ - H5D_chunk_ud_t insert_udata; /* Chunk information to be inserted */ - haddr_t chunk_addr; /* Chunk address */ - size_t nbytes; /* Chunk size */ - void *buf = NULL; /* Pointer to buffer of chunk data */ - int ret_value = H5_ITER_CONT; /* Return value */ + H5D_chunk_it_ud5_t *udata = (H5D_chunk_it_ud5_t *)_udata; /* User data */ + H5D_chk_idx_info_t *new_idx_info; /* The new chunk index information */ + H5D_chunk_ud_t insert_udata; /* Chunk information to be inserted */ + haddr_t chunk_addr; /* Chunk address */ + size_t nbytes; /* Chunk size */ + void *buf = NULL; /* Pointer to buffer of chunk data */ + int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -7019,7 +7019,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) unsigned filter_mask = chunk_rec->filter_mask; H5Z_cb_t filter_cb; /* Filter failure callback struct */ - size_t read_size = nbytes; /* Bytes to read */ + size_t read_size = nbytes; /* Bytes to read */ HDassert(read_size == new_idx_info->layout->size); @@ -7074,12 +7074,12 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_format_convert_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__chunk_format_convert * * Purpose: Iterate over the chunks for the current chunk index and insert the - * the chunk addresses into v1 B-tree chunk index via callback. + * the chunk addresses into v1 B-tree chunk index via callback. * * Return: Non-negative on success/Negative on failure * @@ -7091,7 +7091,7 @@ done: herr_t H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx_info_t *new_idx_info) { - H5D_chunk_it_ud5_t udata; /* User data */ + H5D_chunk_it_ud5_t udata; /* User data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7106,13 +7106,13 @@ H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx /* Iterate over the chunks in the current index and insert the chunk addresses into version 1 B-tree index */ if((idx_info->storage->ops->iterate)(idx_info, H5D__chunk_format_convert_cb, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to chunk info") + HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to chunk info") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_format_convert() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_num_chunks_cb * @@ -7144,7 +7144,7 @@ H5D__get_num_chunks_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *_u FUNC_LEAVE_NOAPI(ret_value) } /* H5D__get_num_chunks_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_num_chunks * @@ -7206,7 +7206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_num_chunks() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_chunk_info_cb * @@ -7255,7 +7255,7 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* H5D__get_chunk_info_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_chunk_info * @@ -7344,7 +7344,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_chunk_info() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_chunk_info_by_coord_cb * @@ -7392,7 +7392,7 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* H5D__get_chunk_info_by_coord_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_chunk_info_by_coord * diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index e48c3b3..655f660 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -843,7 +843,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, * the end of the data element, and don't read more than * the buffer size. */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Read the new sieve buffer */ @@ -1038,7 +1038,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, max_data = store_contig->dset_size - dst_off; /* Compute the size of the sieve buffer */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Check if there is any point in reading the data from the file */ @@ -1154,7 +1154,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, * the end of the data element, and don't read more than * the buffer size. */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Check if there is any point in reading the data from the file */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index b23ac46..eaa8c46 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -615,7 +615,7 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, * Failure: NULL * * Programmer: Vailin Choi; July 2010 - * + * *------------------------------------------------------------------------- */ static void * @@ -933,7 +933,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* General parameters */ if(idx_info->pline->nused > 0) { unsigned chunk_size_len; /* Size of encoded chunk size */ - + /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ @@ -1349,7 +1349,7 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, } /* end if */ udata.cb = chunk_cb; udata.udata = chunk_udata; - + /* Iterate over the extensible array elements */ if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 2d85e3b..cbaa52d 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -14,8 +14,8 @@ /* Programmer: Vailin Choi <vchoi@hdfgroup.org> * Thursday, April 30, 2009 * - * Purpose: Fixed array indexed (chunked) I/O functions. - * The chunk coordinate is mapped as an index into an array of + * Purpose: Fixed array indexed (chunked) I/O functions. + * The chunk coordinate is mapped as an index into an array of * disk addresses for the chunks. * */ @@ -910,7 +910,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Set up the user data */ udata.f = idx_info->f; udata.chunk_size = idx_info->layout->size; - + /* Create the fixed array for the chunk index */ if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") @@ -961,7 +961,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi; 5 May 2014 - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1224,7 +1224,7 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, } /* end if */ udata.cb = chunk_cb; udata.udata = chunk_udata; - + /* Iterate over the fixed array elements */ if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); diff --git a/src/H5Dfill.c b/src/H5Dfill.c index f5a5238..94c7b1c 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -565,7 +565,7 @@ done: */ herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) -{ +{ herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 4750ad6..9f7e004 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1418,6 +1418,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, NULL, "unable to reset external file list info") if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") + if(new_dset->shared->type) { if(new_dset->shared->type_id > 0) { if(H5I_dec_ref(new_dset->shared->type_id) < 0) @@ -1428,6 +1429,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") } /* end else */ } /* end if */ + if(H5F_addr_defined(new_dset->oloc.addr)) { if(H5O_dec_rc_by_loc(&(new_dset->oloc)) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") diff --git a/src/H5Dio.c b/src/H5Dio.c index 3d49df7..84b7e7a 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -321,7 +321,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dwrite_chunk * - * Purpose: Writes an entire chunk to the file directly. + * Purpose: Writes an entire chunk to the file directly. * * Return: Non-negative on success/Negative on failure * @@ -331,13 +331,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, +H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf) { H5VL_object_t *vol_obj = NULL; uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiIu*hz*x", dset_id, dxpl_id, filters, offset, data_size, buf); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 91557c3..492902b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -364,13 +364,13 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* Check to see if the process is reading the entire dataset */ if(H5S_GET_SELECT_TYPE(file_space) != H5S_SEL_ALL) - local_cause[1] |= H5D_MPIO_RANK0_NOT_H5S_ALL; + local_cause[1] |= H5D_MPIO_RANK0_NOT_H5S_ALL; /* Only perform this optimization for contigous datasets, currently */ else if(H5D_CONTIGUOUS != io_info->dset->shared->layout.type) - /* Flag to do a MPI_Bcast of the data from one proc instead of + /* Flag to do a MPI_Bcast of the data from one proc instead of * having all the processes involved in the collective I/O. */ - local_cause[1] |= H5D_MPIO_RANK0_NOT_CONTIGUOUS; + local_cause[1] |= H5D_MPIO_RANK0_NOT_CONTIGUOUS; else if((is_vl_storage = H5T_is_vl_storage(type_info->dset_type)) < 0) local_cause[0] |= H5D_MPIO_ERROR_WHILE_CHECKING_COLLECTIVE_POSSIBLE; else if(is_vl_storage) @@ -394,7 +394,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, dset_size = ((hsize_t)snelmts) * type_size; /* If the size of the dataset is less than 2GB then do an MPI_Bcast - * of the data from one process instead of having all the processes + * of the data from one process instead of having all the processes * involved in the collective I/O. */ if(dset_size > ((hsize_t)(2.0F * H5_GB) - 1)) @@ -402,7 +402,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, } /* end else */ } /* end else */ } /* end else */ - + /* Check for independent I/O */ if(local_cause[0] & H5D_MPIO_SET_INDEPENDENT) global_cause[0] = local_cause[0]; @@ -812,7 +812,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ /* direct request to multi-chunk-io */ else if(H5FD_MPIO_CHUNK_MULTI_IO == chunk_opt_mode) - io_option = H5D_MULTI_CHUNK_IO; + io_option = H5D_MULTI_CHUNK_IO; /* via default path. branch by num threshold */ else { unsigned one_link_chunk_io_threshold; /* Threshold to use single collective I/O for all chunks */ @@ -1123,9 +1123,9 @@ if(H5DEBUG(D)) /* Obtain MPI derived datatype from all individual chunks */ for(u = 0; u < num_chunk; u++) { - hsize_t *permute_map = NULL; /* array that holds the mapping from the old, - out-of-order displacements to the in-order - displacements of the MPI datatypes of the + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the point selection of the file space */ hbool_t is_permuted = FALSE; @@ -1135,8 +1135,8 @@ if(H5DEBUG(D)) * where it will be freed. */ if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.fspace, - type_info->src_type_size, - &chunk_ftype[u], /* OUT: datatype created */ + type_info->src_type_size, + &chunk_ftype[u], /* OUT: datatype created */ &chunk_mpi_file_counts[u], /* OUT */ &(chunk_mft_is_derived_array[u]), /* OUT */ TRUE, /* this is a file space, @@ -1154,9 +1154,9 @@ if(H5DEBUG(D)) if(is_permuted) HDassert(permute_map); if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.mspace, - type_info->dst_type_size, &chunk_mtype[u], - &chunk_mpi_mem_counts[u], - &(chunk_mbt_is_derived_array[u]), + type_info->dst_type_size, &chunk_mtype[u], + &chunk_mpi_mem_counts[u], + &(chunk_mbt_is_derived_array[u]), FALSE, /* this is a memory space, so if the file space is not @@ -2016,9 +2016,9 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ - hsize_t *permute_map = NULL; /* array that holds the mapping from the old, - out-of-order displacements to the in-order - displacements of the MPI datatypes of the + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the point selection of the file space */ hbool_t is_permuted = FALSE; @@ -2027,8 +2027,8 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * and will be fed into the next call to H5S_mpio_space_type * where it will be freed. */ - if(H5S_mpio_space_type(file_space, type_info->src_type_size, - &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ + if(H5S_mpio_space_type(file_space, type_info->src_type_size, + &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ TRUE, /* this is a file space, so permute the datatype if the point selection is out of @@ -2037,13 +2037,13 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf the permutation of points selected in case they are out of - order */ + order */ &is_permuted /* OUT */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") /* Sanity check */ if(is_permuted) HDassert(permute_map); - if(H5S_mpio_space_type(mem_space, type_info->src_type_size, + if(H5S_mpio_space_type(mem_space, type_info->src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */ FALSE, /* this is a memory space, so if the file space is not @@ -2055,7 +2055,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf generated by the file_space selection and applied to the - memory selection */, + memory selection */, &is_permuted /* IN */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type") /* Sanity check */ @@ -2627,7 +2627,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ local_info_array[i].num_writers = 0; local_info_array[i].owners.original_owner = local_info_array[i].owners.new_owner = mpi_rank; local_info_array[i].buf = NULL; - + local_info_array[i].async_info.num_receive_requests = 0; local_info_array[i].async_info.receive_buffer_array = NULL; local_info_array[i].async_info.receive_requests_array = NULL; diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 2093512..5ba3f5b 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -14,7 +14,7 @@ /* Programmer: Vailin Choi <vchoi@hdfgroup.org> * September 2010 * - * Purpose: Implicit (Non Index) chunked I/O functions. + * Purpose: Implicit (Non Index) chunked I/O functions. * This is used when the dataset is: * extendible but with fixed max. dims * with early allocation @@ -114,8 +114,8 @@ const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{ * Function: H5D__none_idx_create * * Purpose: Allocate memory for the maximum # of chunks in the dataset. - * - * Return: Non-negative on success + * + * Return: Non-negative on success * Negative on failure. * * Programmer: Vailin Choi; September 2010 @@ -472,7 +472,7 @@ H5D__none_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /*------------------------------------------------------------------------- * Function: H5D__none_idx_dump * - * Purpose: Dump + * Purpose: Dump * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 281da81..b6ec06d 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -150,7 +150,7 @@ H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); -H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, +H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf); H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, void *buf); @@ -193,7 +193,7 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag" #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset" #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters" - + /* Typedefs */ diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 8efa771..33274bb 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -14,7 +14,7 @@ /* Programmer: Vailin Choi <vchoi@hdfgroup.org> * May 2011; updated 10/2015 * - * Purpose: Single Chunk I/O functions. + * Purpose: Single Chunk I/O functions. * This is used when the dataset has only 1 chunk (with or without filter): * cur_dims[] is equal to max_dims[] is equal to the chunk dims[] * non-filter chunk record: [address of the chunk] @@ -150,8 +150,8 @@ H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, * Function: H5D__single_idx_create * * Purpose: Set up Single Chunk Index: filtered or non-filtered - * - * Return: Non-negative on success + * + * Return: Non-negative on success * Negative on failure. * * Programmer: Vailin Choi; July 2011 @@ -364,7 +364,7 @@ H5E__get_stack(void) /* No associated value with current thread - create one */ #ifdef H5_HAVE_WIN_THREADS /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ - estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); + estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); #else /* Use HDmalloc here since this has to match the HDfree in the * destructor and we want to avoid the codestack there. @@ -1045,7 +1045,7 @@ done: * * Programmer: Raymond Lu * Friday, July 15, 2003 - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 1d182a4..affa127 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -117,7 +117,7 @@ static herr_t H5EA__cache_dblk_page_get_initial_load_size(void *udata, size_t *i static htri_t H5EA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); -static herr_t H5EA__cache_dblk_page_image_len(const void *thing, +static herr_t H5EA__cache_dblk_page_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -1467,12 +1467,12 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)) HDmemset(&dblock, 0, sizeof(dblock)); /* need to set: - * + * * dblock.hdr * dblock.npages * dblock.nelmts * - * before we invoke either H5EA_DBLOCK_PREFIX_SIZE() or + * before we invoke either H5EA_DBLOCK_PREFIX_SIZE() or * H5EA_DBLOCK_SIZE(). */ dblock.hdr = udata->hdr; @@ -1564,7 +1564,7 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED if(NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block") - HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || + HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || (len == H5EA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the extensible array data block's information */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 0adcde2..bb3f39c 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -219,10 +219,10 @@ typedef struct H5EA_hdr_t { * of the extensible array header. * * The field is used to avoid duplicate - * setups of the flush dependency - * relationship, and to allow the + * setups of the flush dependency + * relationship, and to allow the * extensible array header to destroy - * the flush dependency on receipt of + * the flush dependency on receipt of * an eviction notification from the * metadata cache. */ @@ -448,7 +448,7 @@ H5_DLL herr_t H5EA__dblock_dest(H5EA_dblock_t *dblock); H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent); H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr); -H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, +H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags); H5_DLL herr_t H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags); diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 58e255a..8926d6a 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -346,10 +346,10 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ * Function: H5EA__test_crt_dbg_context * * Purpose: Create context for debugging callback - * + * * Return: Success: non-NULL * Failure: NULL - * + * * Programmer: Vailin Choi; August 2010 * *------------------------------------------------------------------------- @@ -357,10 +357,10 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) - + /* Local variables */ H5EA__ctx_cb_t *ctx; /* Context for callbacks */ - + /* Allocate new context structure */ if(NULL == (ctx = H5FL_MALLOC(H5EA__ctx_cb_t))) H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context") diff --git a/src/H5Eint.c b/src/H5Eint.c index 735f0f2..ca7031b 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -994,7 +994,7 @@ H5E_dump_api_stack(hbool_t is_api) #ifdef H5_NO_DEPRECATED_SYMBOLS if(estack->auto_op.func2) (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ if(estack->auto_op.vers == 1) { if(estack->auto_op.func1) (void)((estack->auto_op.func1)(estack->auto_data)); diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 86b5b73..83f3816 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -79,7 +79,7 @@ typedef struct { typedef struct { H5E_auto2_t func2; /* Only the new style callback function is available. */ } H5E_auto_op_t; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ typedef struct { diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 922153c..8f5e696 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -669,7 +669,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") - HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) + HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the fixed array data block's information */ @@ -954,21 +954,21 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */ * to free when a dblock entry is destroyed with the free * file space block set. * - * This function is needed when the data block is paged, as + * This function is needed when the data block is paged, as * the datablock header and all its pages are allocted as a - * single contiguous chunk of file space, and must be + * single contiguous chunk of file space, and must be * deallocated the same way. * * The size of the chunk of memory in which the dblock * header and all its pages is stored in the size field, * so we simply pass that value back to the cache. * - * If the datablock is not paged, then the size field of + * If the datablock is not paged, then the size field of * the cache_info contains the correct size. However this * value will be the same as the size field, so we return * the contents of the size field to the cache in this case * as well. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -1158,7 +1158,7 @@ H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)) HDassert(image_len); /* Set the image length size */ - *image_len = dblk_page->size; + *image_len = dblk_page->size; END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 8f76fc9..2baee88 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -157,10 +157,10 @@ typedef struct H5FA_hdr_t { * of the fixed array header. * * The field is used to avoid duplicate - * setups of the flush dependency - * relationship, and to allow the + * setups of the flush dependency + * relationship, and to allow the * fixed array header to destroy - * the flush dependency on receipt of + * the flush dependency on receipt of * an eviction notification from the * metadata cache. */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 6db8af6..d551f2f 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -82,7 +82,7 @@ typedef struct H5FD_core_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /* changes not saved? */ @@ -404,7 +404,7 @@ done: * * Purpose: Initializes any interface-specific data or routines. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -756,9 +756,9 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { if(HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") - + /* If backing store is requested, create and stat the file - * Note: We are forcing the O_CREAT flag here, even though this is + * Note: We are forcing the O_CREAT flag here, even though this is * technically an open. */ if(fa->backing_store) { @@ -870,7 +870,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_in = H5_POSIX_MAX_IO_BYTES; else bytes_in = (h5_posix_io_t)size; - + do { #ifdef H5_HAVE_PREADWRITE bytes_read = HDpread(file->fd, mem, bytes_in, offset); @@ -879,7 +879,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_read = HDread(file->fd, mem, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -888,10 +888,10 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + mem += bytes_read; size -= (size_t)bytes_read; } /* end while */ @@ -1465,24 +1465,24 @@ done: * than the end-of-address. * * Addendum -- 12/2/11 - * For file images opened with the core file driver, it is + * For file images opened with the core file driver, it is * necessary that we avoid reallocating the core file driver's * buffer uneccessarily. * * To this end, I have made the following functional changes - * to this function. + * to this function. * - * If we are closing, and there is no backing store, this + * If we are closing, and there is no backing store, this * function becomes a no-op. * * If we are closing, and there is backing store, we set the - * eof to equal the eoa, and truncate the backing store to + * eof to equal the eoa, and truncate the backing store to * the new eof * - * If we are not closing, we realloc the buffer to size equal - * to the smallest multiple of the allocation increment that - * equals or exceeds the eoa and set the eof accordingly. - * Note that we no longer truncate the backing store to the + * If we are not closing, we realloc the buffer to size equal + * to the smallest multiple of the allocation increment that + * equals or exceeds the eoa and set the eof accordingly. + * Note that we no longer truncate the backing store to the * new eof if applicable. * -- JRM * diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 3d4128d..37252f0 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -43,7 +43,7 @@ extern "C" { * * `version` (int32_t) * - * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed + * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed * to the above calls must have a recognized version number, or an error * will be flagged. * diff --git a/src/H5FDint.c b/src/H5FDint.c index ea8c4d8..8a2148a 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -241,7 +241,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") if((addr + file->base_addr + size) > eoa) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%llu, eoa=%llu", + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%llu, eoa=%llu", (unsigned long long)(addr+ file->base_addr), (unsigned long long)size, (unsigned long long)eoa) /* Dispatch to driver */ @@ -389,7 +389,7 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) /* Check for the driver to query and then query it */ if(driver->query) ret_value = (driver->query)(NULL, flags); - else + else *flags = 0; FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index ac5667f..b1da5f0 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -108,7 +108,7 @@ typedef struct H5FD_log_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -1294,7 +1294,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 11f0411..8c7e91a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1283,7 +1283,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, #endif HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code) } /* end if */ - + /* If the rank0-bcast feature was used, broadcast the # of bytes read to * other ranks, which didn't perform any I/O. */ @@ -1582,14 +1582,14 @@ done: * * Purpose: Make certain the file's size matches it's allocated size * - * This is a little sticky in the mpio case, as it is not + * This is a little sticky in the mpio case, as it is not * easy for us to track the current EOF by extracting it from - * write calls. + * write calls. * * Instead, we first check to see if the eoa has changed since - * the last call to this function. If it has, we call - * MPI_File_get_size() to determine the current EOF, and - * only call MPI_File_set_size() if this value disagrees + * the last call to this function. If it has, we call + * MPI_File_get_size() to determine the current EOF, and + * only call MPI_File_set_size() if this value disagrees * with the current eoa. * * Return: SUCCEED/FAIL @@ -1621,13 +1621,13 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR MPI_Offset size; MPI_Offset needed_eof; - /* In principle, it is possible for the size returned by the - * call to MPI_File_get_size() to depend on whether writes from + /* In principle, it is possible for the size returned by the + * call to MPI_File_get_size() to depend on whether writes from * all proceeses have completed at the time process 0 makes the - * call. + * call. * * In practice, most (all?) truncate calls will come after a barrier - * and with no interviening writes to the file (with the possible + * and with no interviening writes to the file (with the possible * exception of sueprblock / superblock extension message updates). * * Check the "MPI file closing" flag in the API context to determine @@ -1658,13 +1658,13 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, needed_eof))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - /* In general, we must wait until all processes have finished - * the truncate before any process can continue, since it is - * possible that a process would write at the end of the + /* In general, we must wait until all processes have finished + * the truncate before any process can continue, since it is + * possible that a process would write at the end of the * file, and this write would be discarded by the truncate. * - * While this is an issue for a user initiated flush, it may - * not be an issue at file close. If so, we may be able to + * While this is an issue for a user initiated flush, it may + * not be an issue at file close. If so, we may be able to * optimize out the following barrier in that case. */ if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index d7fc88d..72f4da5 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -87,7 +87,7 @@ typedef struct H5FD_multi_t { haddr_t memb_next[H5FD_MEM_NTYPES]; /*addr of next member */ H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */ haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files, - *end of allocated addresses. v1.6 library + *end of allocated addresses. v1.6 library *have the EOA for the entire file. But it's *meaningless for MULTI file. We replaced it *with the EOAs for individual files */ @@ -831,9 +831,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) if (file->memb[mt]) if(H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1) - - /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ - file->memb_eoa[mt] = memb_eoa[mt]; + + /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ + file->memb_eoa[mt] = memb_eoa[mt]; } END_MEMBERS; return 0; @@ -1001,7 +1001,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* * Initialize the file from the file access properties, using default * values if necessary. Make sure to use CALLOC here because the code - * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa + * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa * in H5FD_multi_t. */ if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 514d1bf..54ca8f7 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -207,7 +207,7 @@ typedef enum H5F_mem_t H5FD_mem_t; * the handle for the VFD (returned with the 'get_handle' callback) is * of type 'int' and is compatible with POSIX I/O calls. */ -#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 +#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 /* * Defining H5FD_FEAT_HAS_MPI for a VFL driver means that * the driver makes use of MPI communication and code may retrieve @@ -220,7 +220,7 @@ typedef enum H5F_mem_t H5FD_mem_t; * instead of the default H5D_ALLOC_TIME_LATE */ #define H5FD_FEAT_ALLOCATE_EARLY 0x00000200 - /* + /* * Defining H5FD_FEAT_ALLOW_FILE_IMAGE for a VFL driver means that * the driver is able to use a file image in the fapl as the initial * contents of a file. @@ -332,7 +332,7 @@ struct H5FD_t { /* Define enum for the source of file image callbacks */ typedef enum { H5FD_FILE_IMAGE_OP_NO_OP, - H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, @@ -343,13 +343,13 @@ typedef enum { /* Define structure to hold file image callbacks */ typedef struct { - void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, + void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, void *udata); void *(*image_memcpy)(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op, void *udata); - void *(*image_realloc)(void *ptr, size_t size, + void *(*image_realloc)(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata); - herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, + herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, void *udata); void *(*udata_copy)(void *udata); herr_t (*udata_free)(void *udata); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 0054a86..6504ef9 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -85,7 +85,7 @@ typedef struct H5FD_sec2_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -599,7 +599,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) * either the filesystem end-of-file or the HDF5 end-of-address * markers. * - * Return: End of file address, the first address past the end of the + * Return: End of file address, the first address past the end of the * "file", either the filesystem file or the HDF5 file. * * Programmer: Robb Matzke @@ -715,7 +715,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS bytes_read = HDread(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -724,16 +724,16 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + if(0 == bytes_read) { /* end of file but not end of format address space */ HDmemset(buf, 0, size); break; } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -819,7 +819,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU bytes_wrote = HDwrite(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); - + if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -828,7 +828,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_wrote > 0); HDassert((size_t)bytes_wrote <= size); diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 861c6a6..d29a1b4 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -110,7 +110,7 @@ typedef struct H5FD_stdio_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ } H5FD_stdio_t; @@ -824,13 +824,13 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1) } /* end if */ - + if(0 == bytes_read && feof(file->fp)) { /* end of file but not end of format address space */ memset((unsigned char *)buf, 0, size); break; } /* end if */ - + size -= bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -914,7 +914,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } /* end if */ - + assert(bytes_wrote > 0); assert((size_t)bytes_wrote <= size); @@ -1040,7 +1040,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, if(dwError != NO_ERROR ) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1) } - + bError = SetEndOfFile(file->hFile); if(0 == bError) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) diff --git a/src/H5FDtest.c b/src/H5FDtest.c index dec0818..2eb176d 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -110,6 +110,6 @@ H5FD__supports_swmr_test(const char *vfd_name) ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2"); FUNC_LEAVE_NOAPI(ret_value) - + } /* end H5FD__supports_swmr_test() */ @@ -1171,7 +1171,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__sinfo_dest() */ -herr_t +herr_t H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FScache.c b/src/H5FScache.c index d5f2817..c3e3998 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -85,7 +85,7 @@ static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); -static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, +static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *thing); static herr_t H5FS__cache_hdr_free_icr(void *thing); @@ -241,7 +241,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, +H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -303,8 +303,8 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len /* Expand percent */ UINT16DECODE(image, fspace->expand_percent); - /* Size of address space free space sections are within - * (log2 of actual value) + /* Size of address space free space sections are within + * (log2 of actual value) */ UINT16DECODE(image, fspace->max_sect_addr); @@ -378,20 +378,20 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_hdr_pre_serialize * - * Purpose: The free space manager header contains the address, size, and + * Purpose: The free space manager header contains the address, size, and * allocation size of the free space manager section info. However, * since it is possible for the section info to either not be allocated * at all, or be allocated in temporary (AKA imaginary) files space, * it is possible for the above mentioned fields to contain giberish * when the free space manager header is serialized. * - * This function exists to prevent this problem. It does so by + * This function exists to prevent this problem. It does so by * forcing allocation of real file space for the section information. * * Note that in the Version 2 cache, this problem was dealt with by * simply flushing the section info before flushing the header. This - * was possible, since the clients handled file I/O directly. As - * this responsibility has moved to the cache in Version 3, this + * was possible, since the clients handled file I/O directly. As + * this responsibility has moved to the cache in Version 3, this * solution is no longer directly applicable. * * Return: Success: SUCCEED @@ -402,9 +402,9 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, - haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr, + haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ @@ -433,23 +433,23 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Set the ring type for the section info in the API context */ H5AC_set_ring(ring, &orig_ring); - /* This implies that the header "owns" the section info. + /* This implies that the header "owns" the section info. * - * Unfortunately, the comments in the code are not clear as to + * Unfortunately, the comments in the code are not clear as to * what this means, but from reviewing the code (most particularly - * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I - * gather that it means that the header is maintaining a pointer to - * an instance of H5FS_sinfo_t in which free space data is + * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I + * gather that it means that the header is maintaining a pointer to + * an instance of H5FS_sinfo_t in which free space data is * maintained, and either: * * 1) The instance of H5FS_sinfo_t is not in the metadata cache. * - * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) + * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) * is FALSE, and fspace->sinfo is not NULL. This is sometimes * referred to as "floating" section info in the comments. * - * If the section info structure contains free space data - * that must be placed on disk eventually, then + * If the section info structure contains free space data + * that must be placed on disk eventually, then * * fspace->serial_sect_count > 0 * @@ -458,57 +458,57 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, * H5F_addr_defined(fspace->addr) * * will both be TRUE. If this contition does not hold, then - * either the free space info is not persistent - * (!H5F_addr_defined(fspace->addr)???) or the section info - * contains no free space data that must be written to file + * either the free space info is not persistent + * (!H5F_addr_defined(fspace->addr)???) or the section info + * contains no free space data that must be written to file * ( fspace->serial_sect_count == 0 ). * * 2) The instance of H5FS_sinfo_t is in the metadata cache with * address in temporary file space (AKA imaginary file space). - * The entry may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * The entry may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * * 3) The instance of H5FS_sinfo_t is in the metadata cache with * address in real file space. As in case 2) above, the entry - * may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * - * Observe that fspace->serial_sect_count > 0 must be TRUE in - * cases 2) and 3), as the section info should not be stored on + * Observe that fspace->serial_sect_count > 0 must be TRUE in + * cases 2) and 3), as the section info should not be stored on * disk if it doesn't exist. Similarly, since the section info - * will not be stored to disk unless the header is, + * will not be stored to disk unless the header is, * H5F_addr_defined(fspace->addr) must hold as well. * * As the objective is to touch up the free space manager header - * so that it contains sensical data on the size and location of + * so that it contains sensical data on the size and location of * the section information, we have to handle each of the above * cases differently. * - * Case 1) If either fspace->serial_sect_count == 0 or - * ! H5F_addr_defined(fspace->addr) do nothing as either - * the free space manager data is not persistent, or the + * Case 1) If either fspace->serial_sect_count == 0 or + * ! H5F_addr_defined(fspace->addr) do nothing as either + * the free space manager data is not persistent, or the * section info is empty. * * Otherwise, allocate space for the section info in real - * file space, insert the section info at this location, and - * set fspace->sect_addr, fspace->sect_size, and + * file space, insert the section info at this location, and + * set fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location * of the section info. Note that it is not necessary to * force a write of the section info. * * Case 2) Allocate space for the section info in real file space, - * and tell the metadata cache to relocate the entry. - * Update fspace->sect_addr, fspace->sect_size, and + * and tell the metadata cache to relocate the entry. + * Update fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location. * * Case 3) Nothing to be done in this case, although it is useful * to perform sanity checks. * - * Note that while we may alter the contents of the free space - * header in cases 1) and 2), there is no need to mark the header - * as dirty, as the metadata cache would not be attempting to + * Note that while we may alter the contents of the free space + * header in cases 1) and 2), there is no need to mark the header + * as dirty, as the metadata cache would not be attempting to * serialize the header if it thought it was clean. */ if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) { @@ -558,7 +558,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); - /* the metadata cache is now managing the section info, + /* the metadata cache is now managing the section info, * so set fspace->sinfo to NULL. */ fspace->sinfo = NULL; @@ -607,11 +607,11 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, } /* end else */ } /* end if */ else if(H5F_addr_defined(fspace->sect_addr)) { - /* Here the metadata cache is managing the section info. + /* Here the metadata cache is managing the section info. * - * Do some sanity checks, and then test to see if the section - * info is in real file space. If it isn't relocate it into - * real file space lest the header be written to file with + * Do some sanity checks, and then test to see if the section + * info is in real file space. If it isn't relocate it into + * real file space lest the header be written to file with * a nonsense section info address. */ if(!H5F_POINT_OF_NO_RETURN(f)) { @@ -623,12 +623,12 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, unsigned sect_status = 0; haddr_t new_sect_addr; - /* we have work to do -- must relocate section info into + /* we have work to do -- must relocate section info into * real file space. * * Since the section info address is in temporary space (AKA - * imaginary space), it follows that the entry must be in - * cache. Further, since fspace->sinfo is NULL, it must be + * imaginary space), it follows that the entry must be in + * cache. Further, since fspace->sinfo is NULL, it must be * unprotected and un-pinned. Start by verifying this. */ if(H5AC_get_entry_status(f, fspace->sect_addr, §_status) < 0) @@ -654,7 +654,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Update the internal address for the section info */ fspace->sect_addr = new_sect_addr; - /* No need to mark the header dirty, as we are about to + /* No need to mark the header dirty, as we are about to * serialize it. */ } /* end if */ @@ -682,7 +682,7 @@ done: * * Purpose: Given an instance of H5FS_t and a suitably sized buffer, * serialize the contents of the instance of H5FS_t and write - * its contents to the buffer. This buffer will be used to + * its contents to the buffer. This buffer will be used to * write the image of the instance to file. * * Return: Success: SUCCEED @@ -712,19 +712,19 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); HDassert(fspace->hdr_size == len); - /* The section information does not always exits, and if it does, - * it is not always in the cache. To make matters more interesting, + /* The section information does not always exits, and if it does, + * it is not always in the cache. To make matters more interesting, * even if it is in the cache, it may not be in real file space. * - * The pre-serialize function should have moved the section info + * The pre-serialize function should have moved the section info * into real file space if necessary before this function was called. * The following asserts are a cursory check on this. */ HDassert((! H5F_addr_defined(fspace->sect_addr)) || (! H5F_IS_TMP_ADDR(f, fspace->sect_addr))); if(!H5F_POINT_OF_NO_RETURN(f)) - HDassert((! H5F_addr_defined(fspace->sect_addr)) || - ((fspace->sect_size > 0) && + HDassert((! H5F_addr_defined(fspace->sect_addr)) || + ((fspace->sect_size > 0) && (fspace->alloc_sect_size == (size_t)fspace->sect_size))); /* Magic number */ @@ -758,8 +758,8 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN /* Expand percent */ UINT16ENCODE(image, fspace->expand_percent); - /* Size of address space free space sections are within (log2 of - * actual value) + /* Size of address space free space sections are within (log2 of + * actual value) */ UINT16ENCODE(image, fspace->max_sect_addr); @@ -808,7 +808,7 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(fspace); @@ -893,7 +893,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_get_initial_load_size() * - * Purpose: Compute the size of the on disk image of the free space + * Purpose: Compute the size of the on disk image of the free space * manager section info, and place this value in *image_len. * * Return: Success: SUCCEED @@ -904,7 +904,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_get_initial_load_size(void *_udata, size_t *image_len) { const H5FS_t *fspace; /* free space manager */ @@ -1108,7 +1108,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l UINT32DECODE(chksum_image, stored_chksum); /* Sanity check */ - HDassert((image == chksum_image) || + HDassert((image == chksum_image) || ((size_t)((image - (const uint8_t *)_image) + (chksum_image - image)) == old_sect_size)); /* Set return value */ @@ -1163,9 +1163,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_pre_serialize * - * Purpose: The objective of this function is to test to see if file space - * for the section info is located in temporary (AKA imaginary) file - * space. If it is, relocate file space for the section info to + * Purpose: The objective of this function is to test to see if file space + * for the section info is located in temporary (AKA imaginary) file + * space. If it is, relocate file space for the section info to * regular file space. * * Return: Success: SUCCEED @@ -1176,9 +1176,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, - size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, + size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ @@ -1249,8 +1249,8 @@ done: * Function: H5FS__cache_sinfo_serialize * * Purpose: Given an instance of H5FS_sinfo_t and a suitably sized buffer, - * serialize the contents of the instance of H5FS_sinfo_t and write - * its contents to the buffer. This buffer will be used to write + * serialize the contents of the instance of H5FS_sinfo_t and write + * its contents to the buffer. This buffer will be used to write * the image of the instance to file. * * Return: Success: SUCCEED @@ -1261,7 +1261,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thing) { @@ -1348,7 +1348,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - + /* Sanity check */ HDassert(sinfo); @@ -1396,7 +1396,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_free_icr * - * Purpose: Free the memory used for the in core representation of the + * Purpose: Free the memory used for the in core representation of the * free space manager section info. * * Note: The metadata cache sets the object's cache_info.magic to @@ -1411,7 +1411,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_free_icr(void *_thing) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ diff --git a/src/H5FSint.c b/src/H5FSint.c index 264950d..6ba5748 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -121,7 +121,7 @@ H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -153,7 +153,7 @@ H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -161,7 +161,7 @@ H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) /* Destroy a flush dependency between parent and child entry */ if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__destroy_flush_depend() */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index df67bd9..047657e 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -307,9 +307,9 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" * Purpose: Release the section info, either giving ownership back to * the cache or letting the free space header keep it. * - * Add the fix in this routine to resolve the potential infinite loop - * problem when allocating file space for the meta data of the - * self-referential free-space managers at file closing. + * Add the fix in this routine to resolve the potential infinite loop + * problem when allocating file space for the meta data of the + * self-referential free-space managers at file closing. * * On file close or flushing, when the section info is modified * and protected/unprotected, does not allow the section info size @@ -317,8 +317,8 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" * --if the current allocated section info size in fspace->sect_size is * larger than the previous section info size in fpsace->alloc_sect_size, * release the section info - * --Otherwise, set the fspace->sect_size to be the same as - * fpsace->alloc_sect_size. This means fspace->sect_size may be larger + * --Otherwise, set the fspace->sect_size to be the same as + * fpsace->alloc_sect_size. This means fspace->sect_size may be larger * than what is actually needed. * * Return: SUCCEED/FAIL @@ -439,7 +439,7 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC); /* Check if we need to release section info in the file */ if(H5F_addr_defined(fspace->sect_addr)) { /* Set flag to release section info space in file */ - /* On file close or flushing, only need to release section info with size + /* On file close or flushing, only need to release section info with size bigger than previous section */ if(f->shared->closing || flush_in_progress) { if(fspace->sect_size > fspace->alloc_sect_size) @@ -1248,7 +1248,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Retarget section pointer to 'less than' node that was merged into */ *sect = tmp_sect; - if(*sect == NULL) + if(*sect == NULL) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ @@ -1293,7 +1293,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't merge two sections") /* It's possible that the merge caused the section to be deleted (particularly in the paged allocation case) */ - if(*sect == NULL) + if(*sect == NULL) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ @@ -2457,22 +2457,22 @@ done: * The previous hack in this routine to avoid the potential infinite * loops by allocating file space directly from the end of the file * is removed. The allocation can now be done via the usual - * file space allocation call H5MF_alloc(). + * file space allocation call H5MF_alloc(). * - * The design flaw is addressed by not allowing the size - * of section info to shrink. This means, when trying to allocate - * section info size X via H5MF_alloc() and the section info size + * The design flaw is addressed by not allowing the size + * of section info to shrink. This means, when trying to allocate + * section info size X via H5MF_alloc() and the section info size * after H5MF_alloc() changes to Y: - * --if Y is larger than X, free the just allocated file space X + * --if Y is larger than X, free the just allocated file space X * via H5MF_xfree() and set fspace->sect_size to Y. - * This routine will be called again later from - * H5MF_settle_meta_data_fsm() to allocate section info with the + * This routine will be called again later from + * H5MF_settle_meta_data_fsm() to allocate section info with the * larger fpsace->sect_size Y. - * --if Y is smaller than X, no further allocation is needed and + * --if Y is smaller than X, no further allocation is needed and * fspace->sect_size and fspace->alloc_sect_size are set to X. * This means fspace->sect_size may be larger than what is * actually needed. - * + * * This routine also re-inserts the header and section info in the * metadata cache with this allocation. * @@ -2510,7 +2510,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, HDassert(f->shared->fs_persist); /* At present, all free space strategies enable the free space managers. - * This will probably change -- at which point this assertion should + * This will probably change -- at which point this assertion should * be revisited. */ /* Updated: Only the following two strategies enable the free-space managers */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 264a623..77d29f5 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -895,7 +895,7 @@ H5F__efc_try_close(H5F_t *f) HGOTO_DONE(SUCCEED) /* If the file EFC were locked, that should always mean that there exists - * a reference to this file that is not in an EFC (it may have just been + * a reference to this file that is not in an EFC (it may have just been * removed from an EFC), and should have been caught by the above check */ /* If we get here then we must be beginning a new run. Make sure that the * temporary variables in f->shared->efc are at the default value */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index b85305e..46185ff 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -80,17 +80,17 @@ + 1) /* superblock version */ /* The H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE is the minimal amount of super block - * variable length data guarnateed to load the sizeof offsets and the sizeof + * variable length data guarnateed to load the sizeof offsets and the sizeof * lengths fields in all versions of the superblock. * - * This is necessary in the V3 cache, as on the initial load, we need to + * This is necessary in the V3 cache, as on the initial load, we need to * get enough of the superblock to determine its version and size so that - * the metadata cache can load the correct amount of data from file to + * the metadata cache can load the correct amount of data from file to * allow the second deserialization attempt to succeed. * - * The value selected will have to be revisited for each new version + * The value selected will have to be revisited for each new version * of the super block. Note that the current value is one byte larger - * than it needs to be. + * than it needs to be. */ #define H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE 7 @@ -166,8 +166,8 @@ typedef struct H5F_superblock_cache_ud_t { unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ haddr_t stored_eof; /* End-of-file in file */ hbool_t drvrinfo_removed; /* Indicate if the driver info was removed */ - unsigned super_vers; /* Superblock version obtained in get_load_size callback. - * It will be used later in verify_chksum callback + unsigned super_vers; /* Superblock version obtained in get_load_size callback. + * It will be used later in verify_chksum callback */ } H5F_superblock_cache_ud_t; @@ -242,16 +242,16 @@ typedef struct H5F_super_t { struct H5F_shared_t { H5FD_t *lf; /* Lower level file handle for I/O */ H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ - H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info + H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info * cache entry. This field is only defined * for older versions of the super block, * and then only when a driver information * block is present. At all other times * it should be NULL. */ - hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track - * whether the driver info superblock - * extension message has been created + hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track + * whether the driver info superblock + * extension message has been created * yet. This field should be TRUE iff the * superblock extension exists and contains * a driver info message. Under all other @@ -278,7 +278,7 @@ struct H5F_shared_t { /* metadata cache. This structure is */ /* fixed at creation time and should */ /* not change thereafter. */ - H5AC_cache_image_config_t + H5AC_cache_image_config_t mdc_initCacheImageCfg; /* initial configuration for the */ /* generate metadata cache image on */ /* close option. This structure is */ @@ -318,7 +318,7 @@ struct H5F_shared_t { hsize_t fs_threshold; /* Free space section threshold */ hbool_t fs_persist; /* Free-space persist or not */ unsigned fs_version; /* Free-space version: */ - /* It is used to update fsinfo message in the superblock + /* It is used to update fsinfo message in the superblock extension when closing down the free-space managers */ hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ haddr_t tmp_addr; /* Next address to use for temp. space in the file */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index f8a40b2..119548c 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -268,7 +268,7 @@ H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvrinfo, char *drv_name, UINT32DECODE(image, drvrinfo->len); /* Driver name and/or version */ - if(drv_name) { + if(drv_name) { H5MM_memcpy(drv_name, (const char *)image, (size_t)8); drv_name[8] = '\0'; image += 8; /* advance past name/version */ @@ -369,7 +369,7 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDE udata->super_vers = sblock.super_vers; /* Set the final size for the cache image */ - *actual_len = H5F_SUPERBLOCK_FIXED_SIZE + + *actual_len = H5F_SUPERBLOCK_FIXED_SIZE + (size_t)H5F_SUPERBLOCK_VARLEN_SIZE(sblock.super_vers, sblock.sizeof_addr, sblock.sizeof_size); done: @@ -380,7 +380,7 @@ done: /*------------------------------------------------------------------------- * Function: H5F__cache_superblock_verify_chksum * - * Purpose: Verify the computed checksum of the data structure is the + * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * * Return: Success: TRUE/FALSE @@ -584,14 +584,14 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS H5F_addr_decode(udata->f, (const uint8_t **)&image, &udata->stored_eof/*out*/); H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->root_addr/*out*/); - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Decode checksum */ UINT32DECODE(image, read_chksum); /* The Driver Information Block may not appear with the version - * 2 super block. Thus we set the driver_addr field of the in - * core representation of the super block HADDR_UNDEF to prevent + * 2 super block. Thus we set the driver_addr field of the in + * core representation of the super block HADDR_UNDEF to prevent * any attempt to load the Driver Information Block. */ sblock->driver_addr = HADDR_UNDEF; @@ -675,11 +675,11 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU HDassert(image); HDassert(sblock); - /* Assert that the superblock is marked as being flushed last (and + /* Assert that the superblock is marked as being flushed last (and collectively in parallel) */ /* (We'll rely on the cache to make sure it actually *is* flushed last (and collectively in parallel), but this check doesn't hurt) */ - HDassert(sblock->cache_info.flush_me_last); + HDassert(sblock->cache_info.flush_me_last); /* Encode the common portion of the file superblock for all versions */ H5MM_memcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); @@ -782,7 +782,7 @@ H5Gflush(hid_t group_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); - + /* Check args */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group ID") diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 0ffdc53..13a33a3 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -114,7 +114,7 @@ H5FL_SEQ_EXTERN(H5G_entry_t); /*------------------------------------------------------------------------- * Function: H5G__cache_node_get_initial_load_size() * - * Purpose: Determine the size of the on-disk image of the node, and + * Purpose: Determine the size of the on-disk image of the node, and * return this value in *image_len. * * Return: Success: SUCCEED @@ -150,10 +150,10 @@ H5G__cache_node_get_initial_load_size(void *_udata, size_t *image_len) * node, allocate an instance of H5G_node_t, load the contence of the * image into it, and return a pointer to the instance. * - * Note that deserializing the image requires access to the file - * pointer, which is not included in the parameter list for this - * callback. Finesse this issue by passing in the file pointer - * twice to the H5AC_protect() call -- once as the file pointer + * Note that deserializing the image requires access to the file + * pointer, which is not included in the parameter list for this + * callback. Finesse this issue by passing in the file pointer + * twice to the H5AC_protect() call -- once as the file pointer * proper, and again as the user data * * Return: Success: Pointer to in core representation diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 7e2b324..1a76012 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -60,7 +60,7 @@ typedef struct { /* PRIVATE PROTOTYPES */ static herr_t H5G__compact_build_table_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, +static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata); diff --git a/src/H5Gint.c b/src/H5Gint.c index a3849a6..0f9f9cb 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -496,9 +496,9 @@ H5G_close(H5G_t *grp) /* Evict group metadata if evicting on close */ if(!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { - if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) + if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) + if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 35b90f3..9faa0b5 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -538,7 +538,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, rt = sn->nsyms; while(lt < rt && cmp) { idx = (lt + rt) / 2; - + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") cmp = HDstrcmp(udata->common.name, s); @@ -1449,7 +1449,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 6dc025c..8ad03d0 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -372,7 +372,7 @@ H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t hsize_t n, char* name, size_t size); H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, +H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk); @@ -434,7 +434,7 @@ H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hsize_t idx, char *name, size_t size); H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, +H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 19b120c..501c883 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -216,7 +216,7 @@ H5_DLL herr_t H5G_iterate(H5G_loc_t *loc, const char *group_name, H5_DLL herr_t H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data); -/* +/* * Functions that understand links in groups */ H5_DLL herr_t H5G_link_to_info(const struct H5O_loc_t *link_loc, const struct H5O_link_t *lnk, H5L_info2_t *linfo); diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 0f27880..5a4380d 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -843,9 +843,9 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver /* Set up invalid tag. This is a precautionary step only. Setting an invalid * tag here will ensure that no metadata accessed while doing the traversal - * is given an improper tag, unless another one is specifically set up - * first. This will ensure we're not accidentally tagging something we - * shouldn't be during the traversal. Note that for best tagging assertion + * is given an improper tag, unless another one is specifically set up + * first. This will ensure we're not accidentally tagging something we + * shouldn't be during the traversal. Note that for best tagging assertion * coverage, setting H5C_DO_TAGGING_SANITY_CHECKS is advised. */ H5_BEGIN_TAG(H5AC__INVALID_TAG); diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 5807c56..479c2bd 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -360,7 +360,7 @@ H5HF__huge_bt2_indir_compare(const void *_rec1, const void *_rec2, int *result) { FUNC_ENTER_STATIC_NOERR - *result = (int)(((const H5HF_huge_bt2_indir_rec_t *)_rec1)->id - + *result = (int)(((const H5HF_huge_bt2_indir_rec_t *)_rec1)->id - ((const H5HF_huge_bt2_indir_rec_t *)_rec2)->id); FUNC_LEAVE_NOAPI(SUCCEED) @@ -563,7 +563,7 @@ H5HF__huge_bt2_filt_indir_compare(const void *_rec1, const void *_rec2, int *res { FUNC_ENTER_STATIC_NOERR - *result = (int)(((const H5HF_huge_bt2_filt_indir_rec_t *)_rec1)->id - + *result = (int)(((const H5HF_huge_bt2_filt_indir_rec_t *)_rec1)->id - ((const H5HF_huge_bt2_filt_indir_rec_t *)_rec2)->id); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 4a2ff91..8dbdf25 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -77,35 +77,35 @@ static herr_t H5HF__cache_hdr_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); static htri_t H5HF__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, - size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HF__cache_hdr_free_icr(void *thing); static herr_t H5HF__cache_iblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_iblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); -static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); + size_t len, void *thing); +static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_iblock_free_icr(void *thing); static herr_t H5HF__cache_dblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_dblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, - size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_dblock_free_icr(void *thing); static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size); @@ -114,14 +114,14 @@ static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) #ifndef NDEBUG static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, +static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, +static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks); -static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, +static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -212,7 +212,7 @@ H5FL_BLK_DEFINE(direct_block); * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref) { const uint8_t *image = *image_ref; /* Pointer into into supplied image */ @@ -351,8 +351,8 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * Purpose: Determine the size of the fractal heap header on disk, * and set *image_len to this value. * - * Note also that the value returned by this function presumes that - * there is no I/O filtering data in the header. If there is, the + * Note also that the value returned by this function presumes that + * there is no I/O filtering data in the header. If there is, the * size reported will be too small, and H5C_load_entry() * will have to make two tries to load the fractal heap header. * @@ -364,7 +364,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) { H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* Pointer to user data */ @@ -402,7 +402,7 @@ H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { @@ -609,11 +609,11 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_image_len * - * Purpose: Return the actual size of the fractal heap header on - * disk image. + * Purpose: Return the actual size of the fractal heap header on + * disk image. * - * If the header contains filter information, this size will be - * larger than the value returned by H5HF__cache_hdr_get_initial_load_size(). + * If the header contains filter information, this size will be + * larger than the value returned by H5HF__cache_hdr_get_initial_load_size(). * * Return: Success: SUCCEED * Failure: FAIL @@ -623,7 +623,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) { const H5HF_hdr_t *hdr = (const H5HF_hdr_t *)_thing; /* Fractal heap info */ @@ -645,13 +645,13 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_pre_serialize * - * Purpose: As best I can tell, fractal heap header blocks are always + * Purpose: As best I can tell, fractal heap header blocks are always * allocated in real file space. Thus this routine simply verifies * this, verifies that the len parameter contains the expected * value, and returns an error if either of these checks fail. * * When compiled in debug mode, the function also verifies that all - * indirect and direct blocks that are children of the header are + * indirect and direct blocks that are children of the header are * either clean, or not in the metadata cache. * * Return: Success: SUCCEED @@ -662,7 +662,7 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len, unsigned *flags) @@ -706,8 +706,8 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, * is made during a cache serialization instead of an entry or cache * flush. * - * Note also that with the recent change in the definition of flush - * dependency, not all descendants need be clean -- only direct flush + * Note also that with the recent change in the definition of flush + * dependency, not all descendants need be clean -- only direct flush * dependency children. * * Finally, observe that the H5HF__cache_verify_hdr_descendants_clean() @@ -736,7 +736,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_serialize * - * Purpose: Construct the on disk image of the header, and place it in + * Purpose: Construct the on disk image of the header, and place it in * the buffer pointed to by image. Return SUCCEED on success, * and FAIL on failure. * @@ -748,7 +748,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { @@ -846,7 +846,7 @@ done: * * Purpose: Free the in core representation of the fractal heap header. * - * This routine frees just the header itself, not the + * This routine frees just the header itself, not the * associated version 2 B-Tree, the associated Free Space Manager, * nor the indirect/direct block tree that is rooted in the header. * @@ -865,7 +865,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_free_icr(void *_thing) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ @@ -890,7 +890,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_get_initial_load_size() * - * Purpose: Compute the size of the on disk image of the indirect + * Purpose: Compute the size of the on disk image of the indirect * block, and place this value in *image_len. * * Return: Success: SUCCEED @@ -901,7 +901,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) { H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ @@ -913,7 +913,7 @@ H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) HDassert(udata->par_info); HDassert(udata->par_info->hdr); HDassert(image_len); - + /* Set the image length size */ *image_len = (size_t)H5HF_MAN_INDIRECT_SIZE(udata->par_info->hdr, *udata->nrows); @@ -961,9 +961,9 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_deserialize * - * Purpose: Given a buffer containing the on disk image of the indirect - * block, allocate an instance of H5HF_indirect_t, load the data - * in the buffer into this new instance, and return a pointer to + * Purpose: Given a buffer containing the on disk image of the indirect + * block, allocate an instance of H5HF_indirect_t, load the data + * in the buffer into this new instance, and return a pointer to * it. * * As best I can tell, the size of the indirect block image is fully @@ -979,7 +979,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN *------------------------------------------------------------------------- */ static void * -H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ @@ -1164,7 +1164,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) { const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1188,11 +1188,11 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * * Purpose: The primary objective of this function is to determine if the * indirect block is currently allocated in temporary file space, - * and if so, to move it to real file space before the entry is + * and if so, to move it to real file space before the entry is * serialized. * - * In debug compiles, this function also verifies that all - * immediate flush dependency children of this indirect block + * In debug compiles, this function also verifies that all + * immediate flush dependency children of this indirect block * are either clean or are not in cache. * * Return: Success: SUCCEED @@ -1203,7 +1203,7 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len, unsigned *flags) @@ -1237,7 +1237,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, unsigned iblock_status = 0; /* verify that flush dependencies are working correctly. Do this - * by verifying that all immediate flush dependency children of this + * by verifying that all immediate flush dependency children of this * iblock are clean. */ if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) @@ -1254,7 +1254,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, } #endif /* NDEBUG */ - /* Check to see if we must re-allocate the iblock from temporary to + /* Check to see if we must re-allocate the iblock from temporary to * normal (AKA real) file space. */ if(H5F_IS_TMP_ADDR(f, addr)) { @@ -1302,7 +1302,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, *new_addr = iblock_addr; *flags = H5AC__SERIALIZE_MOVED_FLAG; } /* end if */ - else + else *flags = 0; done: @@ -1313,8 +1313,8 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_serialize * - * Purpose: Given a pointer to an iblock, and a pointer to a buffer of - * the appropriate size, write the contents of the iblock to the + * Purpose: Given a pointer to an iblock, and a pointer to a buffer of + * the appropriate size, write the contents of the iblock to the * buffer in format appropriate for writing to disk. * * Return: Success: SUCCEED @@ -1325,7 +1325,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { @@ -1390,7 +1390,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /* (either both the address & size are defined or both are * not defined) */ - HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) + HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); /* Size of filtered direct block */ @@ -1431,11 +1431,11 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_notify * - * Purpose: This function is used to create and destroy flush dependency + * Purpose: This function is used to create and destroy flush dependency * relationships between iblocks and their parents as indirect blocks * are loaded / inserted and evicted from the metadata cache. * - * In general, the parent will be another iblock, but it may be the + * In general, the parent will be another iblock, but it may be the * header if the iblock in question is the root iblock. * * Return: Success: SUCCEED @@ -1446,7 +1446,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) { H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1528,7 +1528,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_free_icr * - * Purpose: Unlink the supplied instance of H5HF_indirect_t from the + * Purpose: Unlink the supplied instance of H5HF_indirect_t from the * fractal heap and free its memory. * * Note: The metadata cache sets the object's cache_info.magic to @@ -1543,7 +1543,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_free_icr(void *thing) { H5HF_indirect_t *iblock = (H5HF_indirect_t *)thing; /* Fractal heap indirect block to free */ @@ -1570,7 +1570,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_dblock_get_initial_load_size() * - * Purpose: Determine the size of the direct block on disk image, and + * Purpose: Determine the size of the direct block on disk image, and * return it in *image_len. * * Return: Success: SUCCEED @@ -1581,7 +1581,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) { const H5HF_dblock_cache_ud_t *udata = (const H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ @@ -1612,7 +1612,7 @@ H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) } /* end if */ else *image_len = udata->dblock_size; - + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HF__cache_dblock_get_initial_load_size() */ @@ -1668,7 +1668,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may re-size the buffer + * it. Must do this as H5Z_pipeline() may re-size the buffer * provided to it. */ if(NULL == (read_buf = H5MM_malloc(len))) @@ -1801,7 +1801,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { /* Direct block is already decompressed in verify_chksum callback */ - if(udata->decompressed) { + if(udata->decompressed) { /* Sanity check */ HDassert(udata->dblk); @@ -1822,7 +1822,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer + * it. Must do this as H5Z_pipeline() may resize the buffer * provided to it. */ if (NULL == (read_buf = H5MM_malloc(len))) @@ -1926,7 +1926,7 @@ done: * Function: H5HF__cache_dblock_image_len * * Purpose: Report the actual size of the direct block image on disk. - * Note that this value will probably be incorrect if compression + * Note that this value will probably be incorrect if compression * is enabled and the entry is dirty. * * Return: Success: SUCCEED @@ -1937,7 +1937,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) { const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Direct block info */ @@ -1958,32 +1958,32 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - /* + /* * If the data is available, set to the compressed - * size of the direct block -- otherwise set it equal to the - * uncompressed size. + * size of the direct block -- otherwise set it equal to the + * uncompressed size. * * We have three possible scenarios here. * * First, the block may never have been flushed. In this - * case, both dblock->file_size and the size stored in the - * parent (either the header or the parent iblock) will all - * be zero. In this case, return the uncompressed size + * case, both dblock->file_size and the size stored in the + * parent (either the header or the parent iblock) will all + * be zero. In this case, return the uncompressed size * stored in dblock->size as the size. * * Second, the block may have just been serialized, in which - * case, dblock->file_size should be zero, and the correct + * case, dblock->file_size should be zero, and the correct * on disk size should be stored in the parent (again, either * the header or the parent iblock as case may be). - * - * Third, we may be in the process of discarding this + * + * Third, we may be in the process of discarding this * dblock without writing it. In this case, dblock->file_size - * should be non-zero and have the correct size. Note that + * should be non-zero and have the correct size. Note that * in this case, the direct block will have been detached, * and thus looking up the parent will likely return incorrect * data. */ - if(dblock->file_size != 0) + if(dblock->file_size != 0) size = dblock->file_size; else { const H5HF_indirect_t *par_iblock = dblock->parent; /* Parent iblock */ @@ -2012,54 +2012,54 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) * Function: H5HF__cache_dblock_pre_serialize * * Purpose: In principle, the purpose of this function is to determine - * the size and location of the disk image of the target direct + * the size and location of the disk image of the target direct * block. In this case, the uncompressed size of the block is - * fixed, but since the direct block could be compressed, + * fixed, but since the direct block could be compressed, * we may need to compute and report the compressed size. * - * This is a bit sticky in the case of a direct block when I/O + * This is a bit sticky in the case of a direct block when I/O * filters are enabled, as the size of the compressed version - * of the on disk image is not known until the direct block has - * been run through the filters. Further, the location of the - * on disk image may change if the compressed size of the image + * of the on disk image is not known until the direct block has + * been run through the filters. Further, the location of the + * on disk image may change if the compressed size of the image * changes as well. * - * To complicate matters further, the direct block may have been - * initially allocated in temporary (AKA imaginary) file space. - * In this case, we must relocate the direct block's on-disk - * image to "real" file space regardless of whether it has changed + * To complicate matters further, the direct block may have been + * initially allocated in temporary (AKA imaginary) file space. + * In this case, we must relocate the direct block's on-disk + * image to "real" file space regardless of whether it has changed * size. * - * One simplifying factor is the direct block's "blk" field, + * One simplifying factor is the direct block's "blk" field, * which contains a pointer to a buffer which (with the exception - * of a small header) contains the on disk image in uncompressed + * of a small header) contains the on disk image in uncompressed * form. * - * To square this particular circle, this function does - * everything the serialize function usually does, with the - * exception of copying the image into the image buffer provided - * to the serialize function by the metadata cache. The data to + * To square this particular circle, this function does + * everything the serialize function usually does, with the + * exception of copying the image into the image buffer provided + * to the serialize function by the metadata cache. The data to * copy is provided to the serialize function in a buffer pointed * to by the write_buf field. * - * If I/O filters are enabled, on exit, - * H5HF__cache_dblock_pre_serialize() sets the write_buf field to + * If I/O filters are enabled, on exit, + * H5HF__cache_dblock_pre_serialize() sets the write_buf field to * point to a buffer containing the filtered image of the direct * block. The serialize function should free this block, and set - * the write_buf field to NULL after copying it into the image + * the write_buf field to NULL after copying it into the image * buffer provided by the metadata cache. * - * If I/O filters are not enabled, this function prepares - * the buffer pointed to by the blk field for copying to the - * image buffer provided by the metadata cache, and sets the - * write_buf field equal to the blk field. In this case, the - * serialize function should simply set the write_buf field to - * NULL after copying the direct block image into the image + * If I/O filters are not enabled, this function prepares + * the buffer pointed to by the blk field for copying to the + * image buffer provided by the metadata cache, and sets the + * write_buf field equal to the blk field. In this case, the + * serialize function should simply set the write_buf field to + * NULL after copying the direct block image into the image * buffer. * - * In both of the above cases, the length of the buffer pointed - * to by write_buf is provided in the write_len field. This - * field must contain 0 on entry to this function, and should + * In both of the above cases, the length of the buffer pointed + * to by write_buf is provided in the write_len field. This + * field must contain 0 on entry to this function, and should * be set back to 0 at the end of the serialize function. * * Return: Success: SUCCEED @@ -2070,7 +2070,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { @@ -2114,10 +2114,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); if(dblock->parent) { - /* this is the common case, in which the direct block is the child + /* this is the common case, in which the direct block is the child * of an indirect block. Set up the convenience variables we will - * need if the address and/or compressed size of the on disk image - * of the direct block changes, and do some sanity checking in + * need if the address and/or compressed size of the on disk image + * of the direct block changes, and do some sanity checking in * passing. */ par_iblock = dblock->parent; @@ -2137,8 +2137,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, at_tmp_addr = H5F_IS_TMP_ADDR(f, addr); /* Begin by preping the direct block to be written to disk. Do - * this by writing the correct magic number, the dblock version, - * the address of the header, the offset of the block in the heap, + * this by writing the correct magic number, the dblock version, + * the address of the header, the offset of the block in the heap, * and the checksum at the beginning of the block. */ @@ -2172,7 +2172,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, UINT32ENCODE(image, metadata_chksum); } /* end if */ - /* at this point, dblock->blk should point to an uncompressed image of + /* at this point, dblock->blk should point to an uncompressed image of * the direct block. If I/O filters are not enabled, this image should * be ready to hand off to the metadata cache. */ @@ -2211,10 +2211,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Use the compressed number of bytes as the size to write */ write_size = nbytes; - /* If the size and/or location of the on disk image of the + /* If the size and/or location of the on disk image of the * direct block changes, we must touch up its parent to reflect * these changes. Do this differently depending on whether the - * direct block's parent is an indirect block or (rarely) the + * direct block's parent is an indirect block or (rarely) the * fractal heap header. In this case, the direct block is known * as a root direct block. */ @@ -2233,7 +2233,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, hdr_changed = TRUE; } /* end if */ - /* verify that the cache's last record of the compressed + /* verify that the cache's last record of the compressed * size matches the heap's last record. This value will * likely change shortly. */ @@ -2241,10 +2241,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if we need to re-size the block on disk */ if(hdr->pline_root_direct_size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated - * in temp. file space + /* Check if the direct block is NOT currently allocated + * in temp. file space * - * (temp. file space does not need to be freed) + * (temp. file space does not need to be freed) */ if(!at_tmp_addr) /* Release direct block's current disk space */ @@ -2255,8 +2255,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - /* Update information about compressed direct block's - * location & size + /* Update information about compressed direct block's + * location & size */ HDassert(hdr->man_dtable.table_addr == addr); HDassert(hdr->pline_root_direct_size == len); @@ -2285,7 +2285,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, par_changed = TRUE; } /* end if */ - /* verify that the cache's last record of the compressed + /* verify that the cache's last record of the compressed * size matches the heap's last record. This value will * likely change shortly. */ @@ -2293,10 +2293,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if we need to re-size the block on disk */ if(par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated - * in temp. file space + /* Check if the direct block is NOT currently allocated + * in temp. file space * - * (temp. file space does not need to be freed) + * (temp. file space does not need to be freed) */ if(!at_tmp_addr) /* Release direct block's current disk space */ @@ -2307,8 +2307,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - /* Update information about compressed direct block's - * location & size + /* Update information about compressed direct block's + * location & size */ HDassert(par_iblock->ents[par_entry].addr == addr); HDassert(par_iblock->filt_ents[par_entry].size == len); @@ -2326,21 +2326,21 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, } /* end else */ } /* end if */ else { - /* I/O filters are not enabled -- thus all we need to do is check to - * see if the direct block is in temporary (AKA imaginary) file + /* I/O filters are not enabled -- thus all we need to do is check to + * see if the direct block is in temporary (AKA imaginary) file * space, and move it to real file space if it is. * - * As in the I/O filters case above, we will have to touch up the + * As in the I/O filters case above, we will have to touch up the * direct blocks parent if the direct block is relocated. * - * Recall that temporary file space need not be freed, which + * Recall that temporary file space need not be freed, which * simplifies matters slightly. */ write_buf = dblock->blk; write_size = dblock->size; - /* Check to see if we must re-allocate direct block from 'temp.' - * to 'normal' file space + /* Check to see if we must re-allocate direct block from 'temp.' + * to 'normal' file space */ if(at_tmp_addr) { /* Allocate 'normal' space for the direct block */ @@ -2377,9 +2377,9 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, } /* end if */ } /* end else */ - /* At this point, write_buf points to a buffer containing the image + /* At this point, write_buf points to a buffer containing the image * of the direct block that is ready to copy into the image buffer, - * and write_size contains the length of this buffer. + * and write_size contains the length of this buffer. * * Also, if image size or address has changed, the direct block's * parent has been modified to reflect the change. @@ -2419,14 +2419,14 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_dblock_serialize * - * Purpose: In principle, this function is supposed to construct the on - * disk image of the direct block, and place that image in the + * Purpose: In principle, this function is supposed to construct the on + * disk image of the direct block, and place that image in the * image buffer provided by the metadata cache. * - * However, since there are cases in which the pre_serialize - * function has to construct the on disk image to determine its size + * However, since there are cases in which the pre_serialize + * function has to construct the on disk image to determine its size * and address, this function simply copies the image prepared by - * the pre-serialize function into the supplied image buffer, and + * the pre-serialize function into the supplied image buffer, and * discards a buffer if necessary. * * Return: Success: SUCCEED @@ -2437,8 +2437,8 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, +static herr_t +H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ @@ -2462,8 +2462,8 @@ H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, /* Copy the image from *(dblock->write_buf) to *image */ H5MM_memcpy(image, dblock->write_buf, dblock->write_size); - /* Free *(dblock->write_buf) if it was allocated by the - * pre-serialize function + /* Free *(dblock->write_buf) if it was allocated by the + * pre-serialize function */ if(dblock->write_buf != dblock->blk) H5MM_xfree(dblock->write_buf); @@ -2490,7 +2490,7 @@ H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2560,7 +2560,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_free_icr(void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2597,7 +2597,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) { const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2621,9 +2621,9 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_hdr_descendants_clean * - * Purpose: Sanity checking routine that verifies that all indirect - * and direct blocks that are descendants of the supplied - * instance of H5HF_hdr_t are clean. Set *clean to + * Purpose: Sanity checking routine that verifies that all indirect + * and direct blocks that are descendants of the supplied + * instance of H5HF_hdr_t are clean. Set *clean to * TRUE if this is the case, and to FALSE otherwise. * * Update -- 8/24/15 @@ -2636,41 +2636,41 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) * remain dirty. * * To address this, updated the sanity checks in this function - * to treat entries whose images are up to date as clean if + * to treat entries whose images are up to date as clean if * a cache serialization is in progress. * * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * @@ -2709,16 +2709,16 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* We have three basic scenarios we have to deal with: * - * The first, and most common case, is that there is a root iblock. - * In this case we need to verify that the root iblock and all its + * The first, and most common case, is that there is a root iblock. + * In this case we need to verify that the root iblock and all its * children are clean. * - * The second, and much less common case, is that in which the - * the fractal heap contains only one direct block, which is - * pointed to by hdr->man_dtable.table_addr. In this case, all we + * The second, and much less common case, is that in which the + * the fractal heap contains only one direct block, which is + * pointed to by hdr->man_dtable.table_addr. In this case, all we * need to do is verify that the root direct block is clean. * - * Finally, it is possible that the fractal heap is empty, and + * Finally, it is possible that the fractal heap is empty, and * has neither a root indirect block nor a root direct block. * In this case, we have nothing to do. */ @@ -2726,15 +2726,15 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* There are two ways in which we can arrive at the first scenario. * * By far the most common is when hdr->root_iblock contains a pointer - * to the root iblock -- in this case the root iblock is almost certainly + * to the root iblock -- in this case the root iblock is almost certainly * pinned, although we can't count on that. * - * However, it is also possible that there is a root iblock that - * is no longer pointed to by the header. In this case, the on + * However, it is also possible that there is a root iblock that + * is no longer pointed to by the header. In this case, the on * disk address of the iblock will be in hdr->man_dtable.table_addr * and hdr->man_dtable.curr_root_rows will contain a positive value. * - * Since the former case is far and away the most common, we don't + * Since the former case is far and away the most common, we don't * worry too much about efficiency in the second case. */ if(hdr->root_iblock || @@ -2748,7 +2748,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* make note of the on disk address of the root iblock */ if(root_iblock == NULL) /* hdr->man_dtable.table_addr must contain address of root - * iblock. Check to see if it is in cache. If it is, + * iblock. Check to see if it is in cache. If it is, * protect it and put its address in root_iblock. */ root_iblock_addr = hdr->man_dtable.table_addr; @@ -2786,18 +2786,18 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* At this point, the root iblock may be pinned, protected, * both, or neither, and we may or may not have a pointer - * to root iblock in memory. + * to root iblock in memory. * * Before we call H5HF__cache_verify_iblock_descendants_clean(), - * we must ensure that the root iblock is either pinned or - * protected or both, and that we have a pointer to it. + * we must ensure that the root iblock is either pinned or + * protected or both, and that we have a pointer to it. * Do this as follows: */ if(root_iblock == NULL) { /* we don't have ptr to root iblock */ if(0 == (root_iblock_status & H5AC_ES__IS_PROTECTED)) { /* just protect the root iblock -- this will give us - * the pointer we need to proceed, and ensure that - * it is locked into the metadata cache for the + * the pointer we need to proceed, and ensure that + * it is locked into the metadata cache for the * duration. * * Note that the udata is only used in the load callback. @@ -2808,9 +2808,9 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * The tag specified in the API context we received * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the API context via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. + * these macros must be reported with HGOTO_ERROR_TAG. */ H5_BEGIN_TAG(hdr->heap_addr) @@ -2825,7 +2825,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* the root iblock is protected, and we have no * legitimate way of getting a pointer to it. * - * We square this circle by using the + * We square this circle by using the * H5AC_get_entry_ptr_from_addr() to get the needed * pointer. * @@ -2846,14 +2846,14 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * be unpinned is if none of its children are in cache. * This unfortunately means that if it is protected and * not pinned, the fractal heap is in the process of loading - * or inserting one of its children. The obvious - * implication is that there is a significant chance that + * or inserting one of its children. The obvious + * implication is that there is a significant chance that * the root iblock is in an unstable state. * - * All this suggests that using - * H5AC_get_entry_ptr_from_addr() to obtain the pointer - * to the protected root iblock is questionable here. - * However, since this is test/debugging code, I expect + * All this suggests that using + * H5AC_get_entry_ptr_from_addr() to obtain the pointer + * to the protected root iblock is questionable here. + * However, since this is test/debugging code, I expect * that we will use this approach until it causes problems, * or we think of a better way. */ @@ -2863,8 +2863,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, } /* end else */ } /* end if */ else { /* root_iblock != NULL */ - /* we have the pointer to the root iblock. Protect it - * if it is neither pinned nor protected -- otherwise we + /* we have the pointer to the root iblock. Protect it + * if it is neither pinned nor protected -- otherwise we * are ready to go. */ H5HF_indirect_t * iblock = NULL; @@ -2882,9 +2882,9 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * The tag associated specified in the API context we received * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the API context via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. + * these macros must be reported with HGOTO_ERROR_TAG. */ H5_BEGIN_TAG(hdr->heap_addr) @@ -2953,8 +2953,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and is a flush dep parent.") *clean = !((root_dblock_status & H5AC_ES__IS_DIRTY) && - (((root_dblock_status & - H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (((root_dblock_status & + H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))); *fd_clean = *clean; @@ -2965,8 +2965,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, } /* end else */ } /* end else-if */ else { - /* this is scenario 3 -- the fractal heap is empty, and we - * have nothing to do. + /* this is scenario 3 -- the fractal heap is empty, and we + * have nothing to do. */ *fd_clean = TRUE; *clean = TRUE; @@ -2981,62 +2981,62 @@ done: /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_iblock_descendants_clean * - * Purpose: Sanity checking routine that verifies that all indirect - * and direct blocks that are descendants of the supplied - * instance of H5HF_indirect_t are clean. Set *clean + * Purpose: Sanity checking routine that verifies that all indirect + * and direct blocks that are descendants of the supplied + * instance of H5HF_indirect_t are clean. Set *clean * to TRUE if this is the case, and to FALSE otherwise. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: At its top level call, this function is - * intended to be called from H5HF_cache_iblock_flush(), - * and thus presumes that the supplied indirect block - * is in cache. Any other use of this function and - * its descendants must insure that this assumption is + * WARNING: At its top level call, this function is + * intended to be called from H5HF_cache_iblock_flush(), + * and thus presumes that the supplied indirect block + * is in cache. Any other use of this function and + * its descendants must insure that this assumption is * met. * - * Note that this function and - * H5HF__cache_verify_descendant_iblocks_clean() are + * Note that this function and + * H5HF__cache_verify_descendant_iblocks_clean() are * recursive co-routines. * * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * Return: Non-negative on success/Negative on failure @@ -3096,17 +3096,17 @@ done: * direct blocks pointed to by the supplied indirect block * are either clean, or not in the cache. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: This function presumes that the supplied - * iblock is in the cache, and will not be removed - * during the call. Caller must ensure that this is + * WARNING: This function presumes that the supplied + * iblock is in the cache, and will not be removed + * during the call. Caller must ensure that this is * the case before the call. * * Update -- 8/24/15 @@ -3125,35 +3125,35 @@ done: * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * Return: Non-negative on success/Negative on failure @@ -3165,8 +3165,8 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, - H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, +H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, + H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks) { unsigned num_direct_rows; @@ -3224,16 +3224,16 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, (((dblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))) { *clean = FALSE; - + if(H5AC_flush_dependency_exists(f, fd_parent_addr, dblock_addr, &fd_exists) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - if(fd_exists) + if(fd_exists) *fd_clean = FALSE; } /* end if */ - /* If a child dblock is in cache, it must have a flush - * dependency relationship with this iblock. Test this + /* If a child dblock is in cache, it must have a flush + * dependency relationship with this iblock. Test this * here. */ if(H5AC_flush_dependency_exists(f, iblock_addr, dblock_addr, &fd_exists) < 0) @@ -3246,7 +3246,7 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, i++; } /* end while */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5HF__cache_verify_iblocks_dblocks_clean() */ @@ -3260,17 +3260,17 @@ done: * direct blocks pointed to by the supplied indirect block * are either clean, or not in the cache. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: This function presumes that the supplied - * iblock is in the cache, and will not be removed - * during the call. Caller must ensure that this is + * WARNING: This function presumes that the supplied + * iblock is in the cache, and will not be removed + * during the call. Caller must ensure that this is * the case before the call. * * Update -- 8/24/15 @@ -3289,35 +3289,35 @@ done: * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have + * Further, metadata cache entries are now allowed to have * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * @@ -3388,54 +3388,54 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, *fd_clean = FALSE; } /* end if */ - /* if the child iblock is in cache and *fd_clean is TRUE, + /* if the child iblock is in cache and *fd_clean is TRUE, * we must continue to explore down the fractal heap tree - * structure to verify that all descendant blocks that are - * flush dependency children of the entry at parent_addr are - * either clean, or not in the metadata cache. We do this - * with a recursive call to + * structure to verify that all descendant blocks that are + * flush dependency children of the entry at parent_addr are + * either clean, or not in the metadata cache. We do this + * with a recursive call to * H5HF__cache_verify_iblock_descendants_clean(). * However, we can't make this call unless the child iblock - * is somehow locked into the cache -- typically via either + * is somehow locked into the cache -- typically via either * pinning or protecting. * * If the child iblock is pinned, we can look up its pointer - * on the current iblock's pinned child iblock list, and + * on the current iblock's pinned child iblock list, and * and use that pointer in the recursive call. * * If the entry is unprotected and unpinned, we simply * protect it. * - * If, however, the the child iblock is already protected, - * but not pinned, we have a bit of a problem, as we have + * If, however, the the child iblock is already protected, + * but not pinned, we have a bit of a problem, as we have * no legitimate way of looking up its pointer in memory. * * To solve this problem, I have added a new metadata cache - * call to obtain the pointer. + * call to obtain the pointer. * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided there when - * possible. + * WARNING: This call should be used only in debugging + * routines, and it should be avoided there when + * possible. * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded * or heavily re-worked. * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. * - * Assuming that the flush dependency code is working - * as it should, the only reason for the child entry to + * Assuming that the flush dependency code is working + * as it should, the only reason for the child entry to * be unpinned is if none of its children are in cache. - * This unfortunately means that if it is protected and + * This unfortunately means that if it is protected and * not pinned, the fractal heap is in the process of loading * or inserting one of its children. The obvious implication - * is that there is a significant chance that the child + * is that there is a significant chance that the child * iblock is in an unstable state. * - * All this suggests that using the new call to obtain the - * pointer to the protected child iblock is questionable + * All this suggests that using the new call to obtain the + * pointer to the protected child iblock is questionable * here. However, since this is test/debugging code, I * expect that we will use this approach until it causes * problems, or we think of a better way. @@ -3491,8 +3491,8 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, child_iblock = iblock->child_iblocks[i - first_iblock_index]; } /* end else */ - /* At this point, one way or another we should have - * a pointer to the child iblock. Verify that we + /* At this point, one way or another we should have + * a pointer to the child iblock. Verify that we * that we have the correct one. */ HDassert(child_iblock); @@ -3504,8 +3504,8 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, if(H5HF__cache_verify_iblock_descendants_clean(f, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") - /* if iblock_addr != fd_parent_addr, verify that a flush - * dependency relationship exists between iblock and + /* if iblock_addr != fd_parent_addr, verify that a flush + * dependency relationship exists between iblock and * the child iblock. */ if(fd_parent_addr != iblock_addr) { diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 20a62b7..07eb9cd 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -1805,7 +1805,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, /* Sanity check - first lookup must be an indirect block */ HDassert(row >= hdr->man_dtable.max_direct_rows); - /* Traverse down, until a direct block at the offset is found, then + /* Traverse down, until a direct block at the offset is found, then * use previous (i.e. parent's) offset, row, and column. */ prev_par_block_off = par_block_off = 0; diff --git a/src/H5HFman.c b/src/H5HFman.c index e5b5cb8..ea00546 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -238,7 +238,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) HDassert(hdr); HDassert(id); HDassert(obj_len_p); - + /* Skip over the flag byte */ id++; @@ -276,7 +276,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off HDassert(hdr); HDassert(id); HDassert(obj_off_p); - + /* Skip over the flag byte */ id++; @@ -307,8 +307,8 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, { H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */ unsigned dblock_access_flags; /* Access method for direct block */ - /* must equal either - * H5AC__NO_FLAGS_SET or + /* must equal either + * H5AC__NO_FLAGS_SET or * H5AC__READ_ONLY_FLAG */ haddr_t dblock_addr; /* Direct block address */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index b38a897..83e46fc 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -646,9 +646,9 @@ H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node); @@ -779,13 +779,13 @@ H5_DLL herr_t H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, H5_DLL htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node); H5_DLL herr_t H5HF__space_revert_root(const H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock); H5_DLL herr_t H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size); H5_DLL herr_t H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node); H5_DLL herr_t H5HF__space_close(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index c11bc34..a0f984b 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -156,7 +156,7 @@ static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); -static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 0c27180..113124c 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -264,11 +264,11 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(hdr); HDassert(id); HDassert(op); - + /* Get the object's encoded length */ /* H5HF_tiny_obj_len can't fail */ ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); - + /* Advance past flag byte(s) */ if(!hdr->tiny_len_extended) id++; @@ -785,14 +785,14 @@ H5HG_remove (H5F_t *f, H5HG_t *hobj) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); - + /* When the application selects the same location to rewrite the VL element by using H5Sselect_elements, * it can happen that the entry has been removed by first rewrite. Here we simply skip the removal of * the entry and let the second rewrite happen (see HDFFV-10635). In the future, it'd be nice to handle * this situation in H5T_conv_vlen in H5Tconv.c instead of this level (HDFFV-10648). */ if(heap->obj[hobj->idx].nrefs == 0 && heap->obj[hobj->idx].size == 0 && !heap->obj[hobj->idx].begin) HGOTO_DONE(ret_value) - + obj_start = heap->obj[hobj->idx].begin; /* Include object header size */ need = H5HG_ALIGN(heap->obj[hobj->idx].size) + H5HG_SIZEOF_OBJHDR(f); diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 18625cc..7485aad 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -64,10 +64,10 @@ static herr_t H5HG__cache_heap_get_initial_load_size(void *udata, size_t *image_ static herr_t H5HG__cache_heap_get_final_load_size(const void *_image, size_t image_len, void *udata, size_t *actual_len); static void *H5HG__cache_heap_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len); static herr_t H5HG__cache_heap_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HG__cache_heap_free_icr(void *thing); /* Prefix deserialization */ @@ -158,10 +158,10 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_get_initial_load_size() * - * Purpose: Return the initial speculative read size to the metadata - * cache. This size will be used in the initial attempt to read - * the global heap. If this read is too small, the cache will - * try again with the correct value obtained from + * Purpose: Return the initial speculative read size to the metadata + * cache. This size will be used in the initial attempt to read + * the global heap. If this read is too small, the cache will + * try again with the correct value obtained from * H5HG__cache_get_final_load_size(). * * Return: Success: SUCCEED @@ -232,7 +232,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_deserialize * - * Purpose: Given a buffer containing the on disk image of the global + * Purpose: Given a buffer containing the on disk image of the global * heap, deserialize it, load its contents into a newly allocated * instance of H5HG_heap_t, and return a pointer to the new instance. * @@ -334,11 +334,11 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, heap->obj[idx].begin = begin; /* - * The total storage size includes the size of the object - * header and is zero padded so the next object header is - * properly aligned. The entire obj array was calloc'ed, - * so no need to zero the space here. The last bit of space - * is the free space object whose size is never padded and + * The total storage size includes the size of the object + * header and is zero padded so the next object header is + * properly aligned. The entire obj array was calloc'ed, + * so no need to zero the space here. The last bit of space + * is the free space object whose size is never padded and * already includes the object header. */ if(idx > 0) { @@ -384,7 +384,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_image_len * - * Purpose: Return the on disk image size of the global heap to the + * Purpose: Return the on disk image size of the global heap to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -418,7 +418,7 @@ H5HG__cache_heap_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_serialize * - * Purpose: Given an appropriately sized buffer and an instance of + * Purpose: Given an appropriately sized buffer and an instance of * H5HG_heap_t, serialize the global heap for writing to file, * and copy the serialized version into the buffer. * diff --git a/src/H5HLcache.c b/src/H5HLcache.c index b0ac05f..cff3942 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -77,16 +77,16 @@ static void *H5HL__cache_prefix_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HL__cache_prefix_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_prefix_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HL__cache_prefix_free_icr(void *thing); /* Local heap data block */ static herr_t H5HL__cache_datablock_get_initial_load_size(void *udata, size_t *image_len); static void *H5HL__cache_datablock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HL__cache_datablock_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_datablock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing); static herr_t H5HL__cache_datablock_free_icr(void *thing); @@ -176,12 +176,12 @@ H5HL__hdr_deserialize( H5HL_t *heap, const uint8_t *image, HDassert(udata); /* Check magic number */ - if(HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature") image += H5_SIZEOF_MAGIC; /* Version */ - if(H5HL_VERSION != *image++) + if(H5HL_VERSION != *image++) HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "wrong version number in local heap") /* Reserved */ @@ -323,7 +323,7 @@ H5HL__fl_serialize(const H5HL_t *heap) /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_get_initial_load_size() * - * Purpose: Return the initial size of the buffer the metadata cache should + * Purpose: Return the initial size of the buffer the metadata cache should * load from file and pass to the deserialize routine. * * Return: Success: SUCCEED @@ -352,7 +352,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_get_final_load_size() * - * Purpose: Return the final size of the buffer the metadata cache should + * Purpose: Return the final size of the buffer the metadata cache should * load from file and pass to the deserialize routine. * * Return: Success: SUCCEED @@ -402,7 +402,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_deserialize * - * Purpose: Given a buffer containing the on disk image of the local + * Purpose: Given a buffer containing the on disk image of the local * heap prefix, deserialize it, load its contents into a newly allocated * instance of H5HL_prfx_t, and return a pointer to the new instance. * @@ -415,7 +415,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HL_t *heap = NULL; /* Local heap */ @@ -472,8 +472,8 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ else - /* Note that the heap should _NOT_ be a single - * object in the cache + /* Note that the heap should _NOT_ be a single + * object in the cache */ heap->single_cache_obj = FALSE; } /* end if */ @@ -501,7 +501,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_image_len * - * Purpose: Return the on disk image size of a local heap prefix to the + * Purpose: Return the on disk image size of a local heap prefix to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -528,8 +528,8 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) /* Set the prefix's size */ *image_len = prfx->heap->prfx_size; - /* If the heap is stored as a single object, add in the - * data block size also + /* If the heap is stored as a single object, add in the + * data block size also */ if(prfx->heap->single_cache_obj) *image_len += prfx->heap->dblk_size; @@ -541,9 +541,9 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_serialize * - * Purpose: Given a pointer to an instance of H5HL_prfx_t and an - * appropriately sized buffer, serialize the contents of the - * instance for writing to disk, and copy the serialized data + * Purpose: Given a pointer to an instance of H5HL_prfx_t and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data * into the buffer. * * Return: Success: SUCCEED @@ -603,9 +603,9 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, if((size_t)(image - (uint8_t *)_image) < heap->prfx_size) { size_t gap; /* Size of gap between prefix and data block */ - /* Set image to the start of the data block. This is necessary - * because there may be a gap between the used portion of - * the prefix and the data block due to alignment constraints. + /* Set image to the start of the data block. This is necessary + * because there may be a gap between the used portion of + * the prefix and the data block due to alignment constraints. */ gap = heap->prfx_size - (size_t)(image - (uint8_t *)_image); HDmemset(image, 0, gap); @@ -636,11 +636,11 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_free_icr * - * Purpose: Free the supplied in core representation of a local heap + * Purpose: Free the supplied in core representation of a local heap * prefix. * - * Note that this function handles the partially initialize prefix - * from a failed speculative load attempt. See comments below for + * Note that this function handles the partially initialize prefix + * from a failed speculative load attempt. See comments below for * details. * * Note: The metadata cache sets the object's cache_info.magic to @@ -681,7 +681,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_datablock_get_initial_load_size() * - * Purpose: Tell the metadata cache how large a buffer to read from + * Purpose: Tell the metadata cache how large a buffer to read from * file when loading a datablock. In this case, we simply lookup * the correct value in the user data, and return it in *image_len. * @@ -715,7 +715,7 @@ H5HL__cache_datablock_get_initial_load_size(void *_udata, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HL__cache_datablock_deserialize * - * Purpose: Given a buffer containing the on disk image of a local + * Purpose: Given a buffer containing the on disk image of a local * heap data block, deserialize it, load its contents into a newly allocated * instance of H5HL_dblk_t, and return a pointer to the new instance. * @@ -826,7 +826,7 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, +H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HL_t *heap; /* Pointer to the local heap */ @@ -872,7 +872,7 @@ H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *imag * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 762a213..c3fcffe 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -242,7 +242,7 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size)) /* Insert data block into cache (pinned) */ if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap data block"); - + dblk = NULL; /* Reset 'single cache object' flag */ diff --git a/src/H5HLint.c b/src/H5HLint.c index e625f3d..cc3e3ea 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -213,7 +213,7 @@ CATCH if(NULL != (fl = H5FL_FREE(H5HL_free_t, fl))) H5E_THROW(H5E_CANTFREE, "unable to free local heap free list"); } /* end while */ - + if(NULL != (heap = H5FL_FREE(H5HL_t, heap))) H5E_THROW(H5E_CANTFREE, "unable to free local heap"); @@ -819,7 +819,7 @@ done: * * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. * This routine will check to ensure the supplied ID is not already - * in use, and ensure that it is a valid ID for the given type, + * in use, and ensure that it is a valid ID for the given type, * but will NOT check to ensure the OBJECT is not already * registered (thus, it is possible to register one object under * multiple IDs). @@ -1360,10 +1360,10 @@ H5I_dec_ref(hid_t id) * reference count without calling the free method. * * Beware: the free method may call other H5I functions. - * - * If an object is closing, we can remove the ID even though the free + * + * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the + * write when a dataset is closed and the chunk cache is flushed to the * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ if(1 == id_ptr->count) { @@ -1467,9 +1467,9 @@ H5I_dec_app_ref_always_close(hid_t id) /* Check for failure */ if (ret_value < 0) { /* - * If an object is closing, we can remove the ID even though the free + * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the + * write when a dataset is closed and the chunk cache is flushed to the * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ H5I_remove(id); @@ -1948,7 +1948,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) udata.app_key = key; udata.ret_obj = NULL; - /* Note that H5I_iterate returns an error code. We ignore it + /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ (void)H5I_iterate(type, H5I__search_cb, &udata, TRUE); @@ -2099,22 +2099,22 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /*------------------------------------------------------------------------- * Function: H5I_iterate * - * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). - * Stop if FUNC returns a non zero value (i.e. anything - * other than H5_ITER_CONT). + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). * - * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * If FUNC returns a positive value (i.e. H5_ITER_STOP), * return SUCCEED. * - * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), * return FAIL. - * - * The FUNC should take a pointer to the object and the - * udata as arguments and return non-zero to terminate + * + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate * siteration, and zero to continue. * - * Limitation: Currently there is no way to start the iteration from + * Limitation: Currently there is no way to start the iteration from * where a previous iteration left off. * * Return: SUCCEED/FAIL @@ -304,7 +304,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") @@ -394,7 +394,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") @@ -1325,7 +1325,7 @@ H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.obj_type = H5I_get_type(group_id); /* Iterate over the links */ - if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, + if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") @@ -475,7 +475,7 @@ H5Mclose(hid_t map_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a map ID") /* Decrement the counter on the map. It will be freed if the count - * reaches zero. + * reaches zero. */ if(H5I_dec_app_ref_always_close(map_id) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTDEC, FAIL, "can't decrement count on map ID") @@ -848,7 +848,7 @@ done: * restart iteration at the same location on a subsequent * call to H5Miterate, IDX should be the same value as * returned by the previous call. - * + * * H5M_iterate_t is defined as: * herr_t (*H5M_iterate_t)(hid_t map_id, const void *key, * void *ctx) @@ -1307,7 +1307,7 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r end = addr + size; /* For paged aggregation: - * To extend a small block: can only extend if not crossing page boundary + * To extend a small block: can only extend if not crossing page boundary * To extend a large block at EOA: calculate in advance mis-aligned fragment so EOA will still end at page boundary */ if(H5F_PAGED_AGGR(f)) { @@ -1658,8 +1658,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* check args */ HDassert(f); - /* If there have been no file space allocations / deallocation so - * far, must call H5MF_tidy_self_referential_fsm_hack() to float + /* If there have been no file space allocations / deallocation so + * far, must call H5MF_tidy_self_referential_fsm_hack() to float * all self referential FSMs and release file space allocated to * them. Otherwise, the function will be called after the format * conversion, and will become very confused. @@ -1797,9 +1797,9 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); - /* file space for all non-empty free space managers should be + /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should - * be written to file and thus their headers and section info + * be written to file and thus their headers and section info * entries in the metadata cache should be clean. */ @@ -1870,8 +1870,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); if(HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) ) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") - /* f->shared->eoa_post_fsm_fsalloc is undefined if there has - * been no file space allocation or deallocation since file + /* f->shared->eoa_post_fsm_fsalloc is undefined if there has + * been no file space allocation or deallocation since file * open. */ HDassert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); @@ -2031,13 +2031,13 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * been no file space allocation or deallocation since file * open. * - * If there is a cache image in the file at file open, - * f->shared->first_alloc_dealloc will always be FALSE unless + * If there is a cache image in the file at file open, + * f->shared->first_alloc_dealloc will always be FALSE unless * the file is opened R/O, as otherwise, the image will have been * read and discarded by this point. * - * If a cache image was created on file close, the actual EOA - * should be in f->shared->eoa_post_mdci_fsalloc. Note that in + * If a cache image was created on file close, the actual EOA + * should be in f->shared->eoa_post_mdci_fsalloc. Note that in * this case, it is conceivable that f->shared->first_alloc_dealloc * will still be TRUE, as the cache image is allocated directly from * the file driver layer. However, as this possibility seems remote, @@ -2049,8 +2049,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); (final_eoa == f->shared->eoa_post_mdci_fsalloc))); } /* end if */ else { - /* Iterate over all the free space types that have managers - * and get each free list's space + /* Iterate over all the free space types that have managers + * and get each free list's space */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; ptype++) if(H5MF__close_delete_fstype(f, ptype) < 0) @@ -2365,16 +2365,16 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t HDassert(f->shared); HDassert(f->shared->lf); - /* H5MF_tidy_self_referential_fsm_hack() will fail if any self + /* H5MF_tidy_self_referential_fsm_hack() will fail if any self * referential FSM is opened prior to the call to it. Thus call * it here if necessary and if it hasn't been called already. * * The situation is further complicated if a cache image exists * and had not yet been loaded into the metadata cache. In this - * case, call H5AC_force_cache_image_load() instead of + * case, call H5AC_force_cache_image_load() instead of * H5MF_tidy_self_referential_fsm_hack(). H5AC_force_cache_image_load() - * will load the cache image, and then call - * H5MF_tidy_self_referential_fsm_hack() to discard the cache image + * will load the cache image, and then call + * H5MF_tidy_self_referential_fsm_hack() to discard the cache image * block. */ @@ -2529,50 +2529,50 @@ done: /*------------------------------------------------------------------------- * Function: H5MF_settle_raw_data_fsm() * - * Purpose: Handle any tasks required before the metadata cache + * Purpose: Handle any tasks required before the metadata cache * can serialize or flush the raw data free space manager - * and any metadata free space managers that reside in the + * and any metadata free space managers that reside in the * raw data free space manager ring. * - * Specifically, this means any metadata managers that DON'T - * handle space allocation for free space manager header or - * section info will reside in the raw data free space manager + * Specifically, this means any metadata managers that DON'T + * handle space allocation for free space manager header or + * section info will reside in the raw data free space manager * ring. * - * In the absence of page allocation, there is at most one + * In the absence of page allocation, there is at most one * free space manager per memory type defined in H5F_mem_t. - * Of these, the one that allocates H5FD_MEM_DRAW will + * Of these, the one that allocates H5FD_MEM_DRAW will * always reside in the raw data free space manager ring. - * If there is more than one metadata free space manager, - * all that don't handle H5FD_MEM_FSPACE_HDR or - * H5FD_MEM_FSPACE_SINFO (which map to H5FD_MEM_OHDR and - * H5FD_MEM_LHEAP respectively) will reside in the raw + * If there is more than one metadata free space manager, + * all that don't handle H5FD_MEM_FSPACE_HDR or + * H5FD_MEM_FSPACE_SINFO (which map to H5FD_MEM_OHDR and + * H5FD_MEM_LHEAP respectively) will reside in the raw * data free space manager ring as well * - * With page allocation, the situation is conceptually + * With page allocation, the situation is conceptually * identical, but more complex in practice. * - * In the worst case (multi file driver) page allocation - * can result in two free space managers for each memory + * In the worst case (multi file driver) page allocation + * can result in two free space managers for each memory * type -- one for small (less than on equal to one page) * allocations, and one for large (greater than one page) * allocations. * * In the more common one file case, page allocation will - * result in a total of three free space managers -- one for - * small (<= one page) raw data allocations, one for small - * metadata allocations (i.e, all memory types other than - * H5FD_MEM_DRAW), and one for all large (> one page) + * result in a total of three free space managers -- one for + * small (<= one page) raw data allocations, one for small + * metadata allocations (i.e, all memory types other than + * H5FD_MEM_DRAW), and one for all large (> one page) * allocations. * * Despite these complications, the solution is the same in - * the page allocation case -- free space managers (be they - * small data or large) are assigned to the raw data free + * the page allocation case -- free space managers (be they + * small data or large) are assigned to the raw data free * space manager ring if they don't allocate file space for - * free space managers. Note that in the one file case, the + * free space managers. Note that in the one file case, the * large free space manager must be assigned to the metadata - * free space manager ring, as it both allocates pages for - * the metadata free space manager, and allocates space for + * free space manager ring, as it both allocates pages for + * the metadata free space manager, and allocates space for * large (> 1 page) metadata cache entries. * * At present, the task list for this routine is: @@ -2582,14 +2582,14 @@ done: * a) Free both aggregators. Space not at EOA will be * added to the appropriate free space manager. * - * The raw data aggregator should not be restarted + * The raw data aggregator should not be restarted * after this point. It is possible that the metadata * aggregator will be. * * b) Free all file space currently allocated to free * space managers. * - * c) Delete the free space manager superblock + * c) Delete the free space manager superblock * extension message if allocated. * * This done, reduce the EOA by moving it to just before @@ -2597,23 +2597,23 @@ done: * * 2) Ensure that space is allocated for the free space * manager superblock extension message. Must do this - * now, before reallocating file space for free space + * now, before reallocating file space for free space * managers, as it is possible that this allocation may * grab the last section in a FSM -- making it unnecessary * to re-allocate file space for it. * * 3) Scan all free space managers not involved in allocating * space for free space managers. For each such free space - * manager, test to see if it contains free space. If + * manager, test to see if it contains free space. If * it does, allocate file space for its header and section - * data. If it contains no free space, leave it without - * allocated file space as there is no need to save it to + * data. If it contains no free space, leave it without + * allocated file space as there is no need to save it to * file. * * Note that all free space managers in this class should - * see no further space allocations / deallocations as - * at this point, all raw data allocations should be - * finalized, as should all metadata allocations not + * see no further space allocations / deallocations as + * at this point, all raw data allocations should be + * finalized, as should all metadata allocations not * involving free space managers. * * We will allocate space for free space managers involved @@ -2648,7 +2648,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); - /* + /* * Only need to settle things if we are persisting free space and * the private property in f->shared->null_fsm_addr is not enabled. */ @@ -2683,7 +2683,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * Note that while the raw data aggregator should not be restarted during * the close process, this need not be the case for the metadata aggregator. * - * Note also that the aggregators will not exist if page aggregation + * Note also that the aggregators will not exist if page aggregation * is enabled -- skip this if so. */ /* Vailin -- is this correct? */ @@ -2719,10 +2719,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * referential nature of the problem. These FSMs are dealt with in * H5MF_settle_meta_data_fsm(). * - * Since paged allocation may be enabled, there may be up to two + * Since paged allocation may be enabled, there may be up to two * free space managers per memory type -- one for small and one for * large allocation. Hence we must loop over the memory types twice - * setting the allocation size accordingly if paged allocation is + * setting the allocation size accordingly if paged allocation is * enabled. */ for(pass_count = 0; pass_count <= 1; pass_count++) { @@ -2783,7 +2783,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* Check if the free space manager has space in the file */ if(H5F_addr_defined(fs_stat.addr) || H5F_addr_defined(fs_stat.sect_addr)) { - /* Delete the free space manager in the file. Will + /* Delete the free space manager in the file. Will * reallocate later if the free space manager contains * any free space. */ @@ -2808,7 +2808,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * extension messages will choke if the target message is * unexpectedly either absent or present. * - * Update: This is probably unnecessary, as I gather that the + * Update: This is probably unnecessary, as I gather that the * file space manager info message is guaranteed to exist. * Leave it in for now, but consider removing it. */ @@ -2911,9 +2911,9 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) fsm_visited[fsm_type] = TRUE; if(f->shared->fs_man[fsm_type]) { - /* Only allocate file space if the target free space manager - * doesn't allocate file space for free space managers. Note - * that this is also the deciding factor as to whether a FSM + /* Only allocate file space if the target free space manager + * doesn't allocate file space for free space managers. Note + * that this is also the deciding factor as to whether a FSM * in in the raw data FSM ring. */ if(!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) { @@ -2995,15 +2995,15 @@ done: /*------------------------------------------------------------------------- * Function: H5MF_settle_meta_data_fsm() * - * Purpose: If the free space manager is persistent, handle any tasks - * required before the metadata cache can serialize or flush - * the metadata free space manager(s) that handle file space + * Purpose: If the free space manager is persistent, handle any tasks + * required before the metadata cache can serialize or flush + * the metadata free space manager(s) that handle file space * allocation for free space managers. * - * In most cases, there will be only one manager assigned + * In most cases, there will be only one manager assigned * to this role. However, since for reasons unknown, - * free space manager headers and section info blocks are - * different classes of memory, it is possible that two free + * free space manager headers and section info blocks are + * different classes of memory, it is possible that two free * space managers will be involved. * * On entry to this function, the raw data settle routine @@ -3020,23 +3020,23 @@ done: * 5) Re-created the free space manager superblock extension * message. * - * 6) Reallocated file space for all non-empty free space - * managers NOT involved in allocation of space for free + * 6) Reallocated file space for all non-empty free space + * managers NOT involved in allocation of space for free * space managers. * * Note that these free space managers (if not empty) should * have been written to file by this point, and that no - * further space allocations involving them should take + * further space allocations involving them should take * place during file close. * * On entry to this routine, the free space manager(s) involved * in allocation of file space for free space managers should - * still be floating. (i.e. should not have any file space + * still be floating. (i.e. should not have any file space * allocated to them.) * - * Similarly, the raw data aggregator should not have been - * restarted. Note that it is probable that reallocation of - * space in 5) and 6) above will have re-started the metadata + * Similarly, the raw data aggregator should not have been + * restarted. Note that it is probable that reallocation of + * space in 5) and 6) above will have re-started the metadata * aggregator. * * @@ -3048,35 +3048,35 @@ done: * 2) Free the aggregators. * * 3) Reduce the EOA to the extent possible, and make note - * of the resulting value. This value will be stored + * of the resulting value. This value will be stored * in the fsinfo superblock extension message and be used * in the subsequent file open. * * 4) Re-allocate space for any free space manager(s) that: * - * a) are involved in allocation of space for free space - * managers, and + * a) are involved in allocation of space for free space + * managers, and * * b) contain free space. * - * It is possible that we could allocate space for one - * of these free space manager(s) only to have the allocation - * result in the free space manager being empty and thus + * It is possible that we could allocate space for one + * of these free space manager(s) only to have the allocation + * result in the free space manager being empty and thus * obliging us to free the space again. Thus there is the * potential for an infinite loop if we want to avoid saving * empty free space managers. * - * Similarly, it is possible that we could allocate space - * for a section info block, only to discover that this - * allocation has changed the size of the section info -- + * Similarly, it is possible that we could allocate space + * for a section info block, only to discover that this + * allocation has changed the size of the section info -- * forcing us to deallocate and start the loop over again. * - * The solution is to modify the FSM code to + * The solution is to modify the FSM code to * save empty FSMs to file, and to allow section info blocks * to be oversized. That is, only allow section info to increase * in size, not shrink. The solution is now implemented. * - * 5) Make note of the EOA -- used for sanity checking on + * 5) Make note of the EOA -- used for sanity checking on * FSM shutdown. This is saved as eoa_pre_fsm_fsalloc in * the free-space info message for backward compatibility * with the 1.10 library that has the hack. @@ -3112,7 +3112,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); - /* + /* * Only need to settle things if we are persisting free space and * the private property in f->shared->null_fsm_addr is not enabled. */ @@ -3197,8 +3197,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ - /* Verify that lg_sinfo_fspace is floating if it - * exists and is distinct + /* Verify that lg_sinfo_fspace is floating if it + * exists and is distinct */ if((lg_sinfo_fspace) && (lg_hdr_fspace != lg_sinfo_fspace)) { /* Query free space manager info for this type */ @@ -3217,7 +3217,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) * H5MF_free_aggrs() call. Note that the raw data aggregator must * have already been freed. Sanity checks for this? * - * Note that the aggregators will not exist if paged aggregation + * Note that the aggregators will not exist if paged aggregation * is enabled -- don't attempt to free if this is the case. */ /* (for space not at EOF, it may be put into free space managers) */ @@ -3228,30 +3228,30 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") - /* WARNING: This approach settling the self referential free space - * managers and allocating space for them in the file will - * not work as currently implemented with the split and - * multi file drivers, as the self referential free space - * manager header and section info can be stored in up to - * two different files -- requiring that up to two EOA's - * be stored in the the free space managers super block - * extension message. + /* WARNING: This approach settling the self referential free space + * managers and allocating space for them in the file will + * not work as currently implemented with the split and + * multi file drivers, as the self referential free space + * manager header and section info can be stored in up to + * two different files -- requiring that up to two EOA's + * be stored in the the free space managers super block + * extension message. * - * As of this writing, we are solving this problem by - * simply not supporting persistent FSMs with the split + * As of this writing, we are solving this problem by + * simply not supporting persistent FSMs with the split * and multi file drivers. * - * Current plans are to do away with the multi file + * Current plans are to do away with the multi file * driver, so this should be a non-issue in this case. * - * We should be able to support the split file driver - * without a file format change. However, the code to + * We should be able to support the split file driver + * without a file format change. However, the code to * do so does not exist at present. * NOTE: not sure whether to remove or keep the above comments */ - /* - * Continue allocating file space for the header and section info until + /* + * Continue allocating file space for the header and section info until * they are all settled, */ do { @@ -3288,8 +3288,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* All free space managers should have file space allocated for them * now, and should see no further allocations / deallocations. - * For backward compatibility, store the eoa in f->shared->eoa_fsm_fsalloc - * which will be set to fsinfo.eoa_pre_fsm_fsalloc when we actually write + * For backward compatibility, store the eoa in f->shared->eoa_fsm_fsalloc + * which will be set to fsinfo.eoa_pre_fsm_fsalloc when we actually write * the free-space info message to the superblock extension. * This will allow the 1.10 library with the hack to open the file with * the new solution. @@ -3330,7 +3330,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, +H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index d716ae2..0124555 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -189,11 +189,11 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); * The line in #ifdef REPLACE triggers the following problem: * test/objcopy.c: test_copy_group_deep() test fails with the family driver * - * When closing the destination file after H5Ocopy, the library flushes the fractal + * When closing the destination file after H5Ocopy, the library flushes the fractal * heap direct block via H5HF__cache_dblock_pre_serialize(). While doing so, * the cache eventually adjusts/evicts ageout entries and ends up flushing out the * same entry that is being serialized (flush_in_progress). - */ + */ if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && (!f->shared->closing || !f->shared->fs_persist)) { #ifdef REPLACE if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && !f->shared->closing) { @@ -405,7 +405,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, +H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ @@ -419,7 +419,7 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, /* Check if this aggregator is active */ if(f->shared->feature_flags & aggr->feature_flag) { - /* + /* * If the block being tested adjoins the beginning of the aggregator * block, check if the aggregator can accommodate the extension. */ @@ -443,7 +443,7 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, /* * If extra_requested is above percentage threshold: * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested - * 2) extend the block into the aggregator + * 2) extend the block into the aggregator */ else { hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested; diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 7bb77e8..43e2305 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -115,8 +115,8 @@ H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* Print generic section information */ HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, "Section type:", - (sect->sect_info.type == H5MF_FSPACE_SECT_SIMPLE ? "simple" : - (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL ? "small" : + (sect->sect_info.type == H5MF_FSPACE_SECT_SIMPLE ? "simple" : + (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL ? "small" : (sect->sect_info.type == H5MF_FSPACE_SECT_LARGE ? "large" : "unknown")))); HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth, "Section address:", diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index de1bdfb..acd773b 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -75,9 +75,9 @@ H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled); -/* This function has to be declared in H5MFprivate.h as it is needed - * in our test code to allow us to manually start a self referential - * free space manager prior to the first file space allocations / +/* This function has to be declared in H5MFprivate.h as it is needed + * in our test code to allow us to manually start a self referential + * free space manager prior to the first file space allocations / * deallocation without causing assertion failures on the first * file space allocation / deallocation. */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index f661ef9..715ece4 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -186,7 +186,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ /* Declare a free list to manage the H5MF_free_section_t struct */ H5FL_DEFINE(H5MF_free_section_t); -/* +/* * "simple/small/large" section callbacks */ @@ -371,7 +371,7 @@ done: FUNC_LEAVE_NOAPI((H5FS_section_info_t *)ret_value) } /* end H5MF__sect_split() */ -/* +/* * "simple" section callbacks */ @@ -615,7 +615,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__sect_simple_shrink() */ -/* +/* * "small" section callbacks */ @@ -625,7 +625,7 @@ done: * * Purpose: Perform actions on a small "meta" action before adding it to the free space manager: * 1) Drop the section if it is at page end and its size <= page end threshold - * 2) Adjust section size to include page end threshold if + * 2) Adjust section size to include page end threshold if * (section size + threshold) is at page end * * Return: Success: non-negative @@ -792,7 +792,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__sect_small_merge() */ -/* +/* * "Large" section callbacks */ @@ -254,7 +254,7 @@ H5MM_final_sanity_check(void) * difficult to check as a return value. This is still * considered an error condition since allocations of zero * bytes usually indicate problems. - * + * * Return: Success: Pointer to new memory * Failure: NULL * diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 573bb7a..aeaebea 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -36,7 +36,7 @@ static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_ty void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index a4a746e..d498be5 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -830,7 +830,7 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Because the attribute structure is shared now. The only situation that requires - * copying the data is when the metadata cache evicts and reloads this attribute. + * copying the data is when the metadata cache evicts and reloads this attribute. * The shared attribute structure will be different in that situation. SLU-2010/7/29 */ if(((H5A_t *)mesg->native)->shared != udata->attr->shared) { /* Sanity check */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8bad181..45c55fd 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -66,17 +66,17 @@ static herr_t H5O__cache_get_final_load_size(const void *image_ptr, size_t image void *udata, size_t *actual_len); static htri_t H5O__cache_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5O__cache_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5O__cache_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_serialize(const H5F_t *f, void *image, size_t len, - void *thing); + void *thing); static herr_t H5O__cache_notify(H5AC_notify_action_t action, void *_thing); static herr_t H5O__cache_free_icr(void *thing); static herr_t H5O__cache_chk_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5O__cache_chk_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5O__cache_chk_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -161,7 +161,7 @@ H5FL_SEQ_DEFINE(H5O_cont_t); /*------------------------------------------------------------------------- * Function: H5O__cache_get_initial_load_size() * - * Purpose: Tell the metadata cache how much data to read from file in + * Purpose: Tell the metadata cache how much data to read from file in * the first speculative read for the object header. * * Return: Success: SUCCEED @@ -288,12 +288,12 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) /*------------------------------------------------------------------------- * Function: H5O__cache_deserialize * - * Purpose: Attempt to deserialize the object header contained in the - * supplied buffer, load the data into an instance of H5O_t, and + * Purpose: Attempt to deserialize the object header contained in the + * supplied buffer, load the data into an instance of H5O_t, and * return a pointer to the new instance. * - * Note that the object header is read with with a speculative read. - * If the initial read is too small, make note of this fact and return + * Note that the object header is read with with a speculative read. + * If the initial read is too small, make note of this fact and return * without error. H5C_load_entry() will note the size discrepency * and retry the deserialize operation with the correct size read. * @@ -317,7 +317,7 @@ H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void /* Check arguments */ HDassert(image); - HDassert(len > 0); + HDassert(len > 0); HDassert(udata); HDassert(udata->common.f); HDassert(udata->common.cont_msg_info); @@ -441,15 +441,15 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) H5O__assert(oh); #endif /* H5O_DEBUG */ - /* Point to raw data 'image' for first chunk, which - * has room for the prefix + /* Point to raw data 'image' for first chunk, which + * has room for the prefix */ chunk_image = oh->chunk[0].image; /* Later versions of object header prefix have different format and * also require that chunk 0 always be updated, since the checksum * on the entire block of memory needs to be updated if anything is - * modified + * modified */ if(oh->version > H5O_VERSION_1) { uint64_t chunk0_size; /* Size of chunk 0's data */ @@ -536,11 +536,11 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) HDassert((size_t)(chunk_image - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); /* Serialize messages for this chunk */ - if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) + if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") - /* copy the chunk into the image -- this is potentially expensive. - * Can we rework things so that the object header and the cache + /* copy the chunk into the image -- this is potentially expensive. + * Can we rework things so that the object header and the cache * share a buffer? */ H5MM_memcpy(image, oh->chunk[0].image, len); @@ -651,7 +651,7 @@ done: */ static herr_t H5O__cache_free_icr(void *_thing) -{ +{ H5O_t *oh = (H5O_t *)_thing; /* Object header to destroy */ herr_t ret_value = SUCCEED; /* Return value */ @@ -674,8 +674,8 @@ done: /*------------------------------------------------------------------------- * Function: H5O__cache_chk_get_initial_load_size() * - * Purpose: Tell the metadata cache how large the on disk image of the - * chunk proxy is, so it can load the image into a buffer for the + * Purpose: Tell the metadata cache how large the on disk image of the + * chunk proxy is, so it can load the image into a buffer for the * deserialize call. * * Return: Success: SUCCEED @@ -751,7 +751,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) * Function: H5O__cache_chk_deserialize * * Purpose: Attempt to deserialize the object header continuation chunk - * contained in the supplied buffer, load the data into an instance + * contained in the supplied buffer, load the data into an instance * of H5O_chunk_proxy_t, and return a pointer to the new instance. * * Return: Success: Pointer to in core representation @@ -780,7 +780,7 @@ H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, HDassert(dirty); /* Allocate space for the object header data structure */ - if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) + if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Check if we are still decoding the object header */ @@ -804,7 +804,7 @@ H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, /* Set the chunk number for the chunk proxy */ chk_proxy->chunkno = udata->chunkno; - /* Sanity check that the chunk representation we have in memory is + /* Sanity check that the chunk representation we have in memory is * the same as the one being brought in from disk. */ HDassert(0 == HDmemcmp(image, udata->oh->chunk[chk_proxy->chunkno].image, udata->oh->chunk[chk_proxy->chunkno].size)); @@ -830,7 +830,7 @@ done: /*------------------------------------------------------------------------- * Function: H5O__cache_chk_image_len * - * Purpose: Return the on disk image size of a object header chunk to the + * Purpose: Return the on disk image size of a object header chunk to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -864,9 +864,9 @@ H5O__cache_chk_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5O__cache_chk_serialize * - * Purpose: Given a pointer to an instance of an object header chunk and an - * appropriately sized buffer, serialize the contents of the - * instance for writing to disk, and copy the serialized data + * Purpose: Given a pointer to an instance of an object header chunk and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data * into the buffer. * * Return: Success: SUCCEED @@ -1263,19 +1263,19 @@ H5O__prefix_deserialize(const uint8_t *_image, H5O_cache_ud_t *udata) /* Verify object header prefix length */ HDassert((size_t)(image - _image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - /* If udata->oh is to be freed (see H5O__cache_verify_chksum), + /* If udata->oh is to be freed (see H5O__cache_verify_chksum), save the pointer to udata->oh and free it later after setting udata->oh with the new object header */ if(udata->free_oh) { H5O_t *saved_oh = udata->oh; - HDassert(udata->oh); + HDassert(udata->oh); /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; if(H5O__free(saved_oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header") udata->free_oh = FALSE; - } else + } else /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; @@ -1491,7 +1491,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image mesg->type = H5O_msg_class_g[H5O_UNKNOWN_ID]; /* Check for "fail if unknown" message flags */ - if(((udata->file_intent & H5F_ACC_RDWR) && + if(((udata->file_intent & H5F_ACC_RDWR) && (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE)) || (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "unknown message with 'fail if unknown' flag found") diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 70d9ef5..6ac04c8 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -40,10 +40,10 @@ /* Callbacks for message class */ static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, +static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mdci_copy(const void *_mesg, void *_dest); -static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, +static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mdci_free(void *mesg); static herr_t H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); @@ -143,7 +143,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_mdci_t *mesg = (const H5O_mdci_t *)_mesg; @@ -220,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ @@ -228,7 +228,7 @@ H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_ENTER_STATIC_NOERR /* Set return value */ - ret_value = (size_t)( 1 + /* Version number */ + ret_value = (size_t)( 1 + /* Version number */ H5F_SIZEOF_ADDR(f) + /* addr of metadata cache */ /* image block */ H5F_SIZEOF_SIZE(f) ); /* length of metadata cache */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c27ece0..6eaaae9 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -43,7 +43,7 @@ static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_t void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index b441840..898184b 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -270,11 +270,11 @@ done: * Purpose: Refreshes all buffers associated with an object. * * Note: This is based on the original H5O_refresh_metadata() but - * is split into 2 routines. + * is split into 2 routines. * This is done so that H5Fstart_swmr_write() can use these - * 2 routines to refresh opened objects. This may be + * 2 routines to refresh opened objects. This may be * restored back to the original code when H5Fstart_swmr_write() - * uses a different approach to handle issues with opened objects. + * uses a different approach to handle issues with opened objects. * H5Fstart_swmr_write() no longer calls the 1st routine. (12/24/15) * * Return: Non-negative on success, negative on failure @@ -383,7 +383,7 @@ H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - + /* Make deep local copy of object's location information */ if(obj_loc) { H5G_loc_t tmp_loc; diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 2a2a07b..8e6e204 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -373,7 +373,7 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Check version */ if(mesg->version < H5O_LAYOUT_VERSION_4) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "invalid layout version with virtual layout") - + /* Heap information */ H5F_addr_decode(f, &p, &(mesg->storage.u.virt.serial_list_hobjid.addr)); UINT32DECODE(p, mesg->storage.u.virt.serial_list_hobjid.idx); diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 0ecc0d7..fbf7613 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -11,20 +11,20 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke <matzke@llnl.gov> - * Friday, July 24, 1998 +/* Programmer: Robb Matzke <matzke@llnl.gov> + * Friday, July 24, 1998 * - * Purpose: The object modification time message. + * Purpose: The object modification time message. */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, @@ -43,62 +43,62 @@ static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ - H5O_MTIME_ID, /*message id number */ - "mtime", /*message name for debugging */ - sizeof(time_t), /*native message size */ - 0, /* messages are sharable? */ - H5O__mtime_decode, /*decode message */ - H5O_mtime_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_size, /*raw message size */ - NULL, /* reset method */ - H5O__mtime_free, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /*set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O__mtime_debug /*debug the message */ + H5O_MTIME_ID, /*message id number */ + "mtime", /*message name for debugging */ + sizeof(time_t), /*native message size */ + 0, /* messages are sharable? */ + H5O__mtime_decode, /*decode message */ + H5O_mtime_encode, /*encode message */ + H5O_mtime_copy, /*copy the native value */ + H5O_mtime_size, /*raw message size */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__mtime_debug /*debug the message */ }}; /* This message derives from H5O message class */ /* (Only encode, decode & size routines are different from old mtime routines) */ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ - H5O_MTIME_NEW_ID, /*message id number */ - "mtime_new", /*message name for debugging */ - sizeof(time_t), /*native message size */ - 0, /* messages are sharable? */ - H5O__mtime_new_decode, /*decode message */ - H5O_mtime_new_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_new_size, /*raw message size */ - NULL, /* reset method */ - H5O__mtime_free, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /*set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O__mtime_debug /*debug the message */ + H5O_MTIME_NEW_ID, /*message id number */ + "mtime_new", /*message name for debugging */ + sizeof(time_t), /*native message size */ + 0, /* messages are sharable? */ + H5O__mtime_new_decode, /*decode message */ + H5O_mtime_new_encode, /*encode message */ + H5O_mtime_copy, /*copy the native value */ + H5O_mtime_new_size, /*raw message size */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__mtime_debug /*debug the message */ }}; /* Current version of new mtime information */ -#define H5O_MTIME_VERSION 1 +#define H5O_MTIME_VERSION 1 /* Declare a free list to manage the time_t struct */ H5FL_DEFINE(time_t); - + /*------------------------------------------------------------------------- - * Function: H5O__mtime_new_decode + * Function: H5O__mtime_new_decode * * Purpose: Decode a new modification time message and return a pointer to * a new time_t value. @@ -106,13 +106,13 @@ H5FL_DEFINE(time_t); * The new modification time message format was added due to the * performance overhead of the old format. * - * Return: Success: Ptr to new message in native struct. + * Return: Success: Ptr to new message in native struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 3 2002 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 3 2002 * *------------------------------------------------------------------------- */ @@ -121,7 +121,7 @@ H5O__mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { - time_t *mesg; + time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ void *ret_value = NULL; /* Return value */ @@ -153,9 +153,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__mtime_new_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5O__mtime_decode + * Function: H5O__mtime_decode * * Purpose: Decode a modification time message and return a pointer to a * new time_t value. @@ -163,13 +163,13 @@ done: * The new modification time message format was added due to the * performance overhead of the old format. * - * Return: Success: Ptr to new message in native struct. + * Return: Success: Ptr to new message in native struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 24 1998 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 24 1998 * *------------------------------------------------------------------------- */ @@ -178,9 +178,9 @@ H5O__mtime_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { - time_t *mesg, the_time; - struct tm tm; - int i; /* Local index variable */ + time_t *mesg, the_time; + struct tm tm; + int i; /* Local index variable */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -218,24 +218,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__mtime_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_encode + * Function: H5O_mtime_new_encode * - * Purpose: Encodes a new modification time message. + * Purpose: Encodes a new modification time message. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 3 2002 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 3 2002 * *------------------------------------------------------------------------- */ static herr_t H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { - const time_t *mesg = (const time_t *) _mesg; + const time_t *mesg = (const time_t *) _mesg; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -258,17 +258,17 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_mtime_new_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5O_mtime_encode + * Function: H5O_mtime_encode * - * Purpose: Encodes a modification time message. + * Purpose: Encodes a modification time message. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 24 1998 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 24 1998 * * Modifications: * @@ -277,8 +277,8 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha static herr_t H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { - const time_t *mesg = (const time_t *) _mesg; - struct tm *tm; + const time_t *mesg = (const time_t *) _mesg; + struct tm *tm; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -296,20 +296,20 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_LEAVE_NOAPI(SUCCEED) } - + /*------------------------------------------------------------------------- - * Function: H5O_mtime_copy + * Function: H5O_mtime_copy * - * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if - * necessary. + * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if + * necessary. * - * Return: Success: Ptr to _DEST + * Return: Success: Ptr to _DEST * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 24 1998 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 24 1998 * * Modifications: * @@ -318,8 +318,8 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, static void * H5O_mtime_copy(const void *_mesg, void *_dest) { - const time_t *mesg = (const time_t *) _mesg; - time_t *dest = (time_t *) _dest; + const time_t *mesg = (const time_t *) _mesg; + time_t *dest = (time_t *) _dest; void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -339,22 +339,22 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_size + * Function: H5O_mtime_new_size * - * Purpose: Returns the size of the raw message in bytes not - * counting the message type or size fields, but only the data - * fields. This function doesn't take into account - * alignment. + * Purpose: Returns the size of the raw message in bytes not + * counting the message type or size fields, but only the data + * fields. This function doesn't take into account + * alignment. * - * Return: Success: Message data size in bytes w/o alignment. + * Return: Success: Message data size in bytes w/o alignment. * - * Failure: 0 + * Failure: 0 * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 3 2002 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 3 2002 * * Modifications: * @@ -372,22 +372,22 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disabl FUNC_LEAVE_NOAPI(8) } /* end H5O_mtime_new_size() */ - + /*------------------------------------------------------------------------- - * Function: H5O_mtime_size + * Function: H5O_mtime_size * - * Purpose: Returns the size of the raw message in bytes not - * counting the message type or size fields, but only the data - * fields. This function doesn't take into account - * alignment. + * Purpose: Returns the size of the raw message in bytes not + * counting the message type or size fields, but only the data + * fields. This function doesn't take into account + * alignment. * - * Return: Success: Message data size in bytes w/o alignment. + * Return: Success: Message data size in bytes w/o alignment. * - * Failure: 0 + * Failure: 0 * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 14 1998 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 14 1998 * * Modifications: * @@ -405,15 +405,15 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_sh FUNC_LEAVE_NOAPI(16) } - + /*------------------------------------------------------------------------- - * Function: H5O__mtime_free + * Function: H5O__mtime_free * - * Purpose: Frees the message + * Purpose: Frees the message * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 30, 2000 * *------------------------------------------------------------------------- @@ -430,17 +430,17 @@ H5O__mtime_free(void *mesg) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__mtime_free() */ - + /*------------------------------------------------------------------------- - * Function: H5O__mtime_debug + * Function: H5O__mtime_debug * - * Purpose: Prints debugging info for the message. + * Purpose: Prints debugging info for the message. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 24 1998 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 24 1998 * *------------------------------------------------------------------------- */ @@ -448,9 +448,9 @@ static herr_t H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { - const time_t *mesg = (const time_t *)_mesg; - struct tm *tm; - char buf[128]; + const time_t *mesg = (const time_t *)_mesg; + struct tm *tm; + char buf[128]; FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Oname.c b/src/H5Oname.c index dbfa710..1f20f10 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -25,10 +25,10 @@ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ @@ -43,29 +43,29 @@ static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream, /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ - H5O_NAME_ID, /*message id number */ - "name", /*message name for debugging */ - sizeof(H5O_name_t), /*native message size */ - 0, /* messages are sharable? */ - H5O__name_decode, /*decode message */ - H5O_name_encode, /*encode message */ - H5O_name_copy, /*copy the native value */ - H5O_name_size, /*raw message size */ - H5O__name_reset, /*free internal memory */ - NULL, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /*set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O__name_debug /*debug the message */ + H5O_NAME_ID, /*message id number */ + "name", /*message name for debugging */ + sizeof(H5O_name_t), /*native message size */ + 0, /* messages are sharable? */ + H5O__name_decode, /*decode message */ + H5O_name_encode, /*encode message */ + H5O_name_copy, /*copy the native value */ + H5O_name_size, /*raw message size */ + H5O__name_reset, /*free internal memory */ + NULL, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__name_debug /*debug the message */ }}; - + /*------------------------------------------------------------------------- * Function: H5O__name_decode * @@ -98,9 +98,9 @@ H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, /* decode */ if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set return value */ ret_value = mesg; @@ -113,7 +113,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__name_decode() */ - + /*------------------------------------------------------------------------- * Function: H5O_name_encode * @@ -147,7 +147,7 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_LEAVE_NOAPI(SUCCEED) } - + /*------------------------------------------------------------------------- * Function: H5O_name_copy * @@ -179,7 +179,7 @@ H5O_name_copy(const void *_mesg, void *_dest) HDassert(mesg); if(!dest && NULL == (dest = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *mesg; @@ -197,7 +197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_name_copy() */ - + /*------------------------------------------------------------------------- * Function: H5O_name_size * @@ -235,7 +235,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5O__name_reset * @@ -266,7 +266,7 @@ H5O__name_reset(void *_mesg) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__name_reset() */ - + /*------------------------------------------------------------------------- * Function: H5O__name_debug * @@ -286,7 +286,7 @@ static herr_t H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { - const H5O_name_t *mesg = (const H5O_name_t *)_mesg; + const H5O_name_t *mesg = (const H5O_name_t *)_mesg; FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Opkg.h b/src/H5Opkg.h index fb08f7d..16ea8e5 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -391,15 +391,15 @@ typedef struct H5O_chunk_proxy_t { H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Chunk number for this chunk */ - /* Flush depencency parent information (not stored) + /* Flush depencency parent information (not stored) * - * The following field is used to store a pointer + * The following field is used to store a pointer * to the in-core representation of a new chunk proxy's flush dependency * parent -- if it exists. If it does not exist, this field will * contain NULL. * - * If the file is opened in SWMR write mode, the flush dependency - * parent of the chunk proxy will be either its object header + * If the file is opened in SWMR write mode, the flush dependency + * parent of the chunk proxy will be either its object header * or the chunk with the continuation message that references this chunk. */ void *fd_parent; /* Pointer to flush dependency parent */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 40df939..57fa8dc 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -13,7 +13,7 @@ /* * Programmer: Robb Matzke <matzke@llnl.gov> - * Wednesday, April 15, 1998 + * Wednesday, April 15, 1998 * * Purpose: Data filter pipeline message. */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index ceaa96d..0be6d89 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -223,7 +223,7 @@ typedef struct H5O_copy_t { #define H5O_MDCI_MSG_ID 0x0018 /* Metadata Cache Image Message */ #define H5O_UNKNOWN_ID 0x0019 /* Placeholder message ID for unknown message. */ /* (this should never exist in a file) */ -/* +/* * Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g * in H5O.c when creating a new message type. Also bump the value of * H5O_BOGUS_INVALID_ID, below, to be one greater than the value of @@ -482,7 +482,7 @@ typedef struct H5O_storage_chunk_t { const struct H5D_chunk_ops_t *ops; /* Pointer to chunked storage operations */ union { H5O_storage_chunk_btree_t btree; /* Information for v1 B-tree index */ - H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */ + H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */ H5O_storage_chunk_earray_t earray; /* Information for extensible array index */ H5O_storage_chunk_farray_t farray; /* Information for fixed array index */ H5O_storage_chunk_single_filt_t single; /* Information for single chunk w/ filters index */ @@ -583,8 +583,8 @@ typedef struct H5O_storage_t { typedef struct H5O_layout_chunk_farray_t { /* Creation parameters for fixed array data structure */ struct { - uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - - i.e. # of bits needed to store max. # of elements + uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - + i.e. # of bits needed to store max. # of elements in a data block page */ } cparam; } H5O_layout_chunk_farray_t; diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 32f6313..d0f8ab3 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -38,7 +38,7 @@ #define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /* Copy only immediate members */ #define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /* Expand soft links into new objects */ #define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /* Expand external links into new objects */ -#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */ +#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */ #define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /* Copy object without copying attributes */ #define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /* Copy NULL messages (empty space) */ #define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /* Merge committed datatypes in dest file */ @@ -100,29 +100,29 @@ /* Types of objects in file */ typedef enum H5O_type_t { - H5O_TYPE_UNKNOWN = -1, /* Unknown object type */ - H5O_TYPE_GROUP, /* Object is a group */ - H5O_TYPE_DATASET, /* Object is a dataset */ - H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */ + H5O_TYPE_UNKNOWN = -1, /* Unknown object type */ + H5O_TYPE_GROUP, /* Object is a group */ + H5O_TYPE_DATASET, /* Object is a dataset */ + H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */ H5O_TYPE_MAP, /* Object is a map */ H5O_TYPE_NTYPES /* Number of different object types (must be last!) */ } H5O_type_t; /* Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */ typedef struct H5O_hdr_info_t { - unsigned version; /* Version number of header format in file */ - unsigned nmesgs; /* Number of object header messages */ - unsigned nchunks; /* Number of object header chunks */ + unsigned version; /* Version number of header format in file */ + unsigned nmesgs; /* Number of object header messages */ + unsigned nchunks; /* Number of object header chunks */ unsigned flags; /* Object header status flags */ struct { - hsize_t total; /* Total space for storing object header in file */ - hsize_t meta; /* Space within header for object header metadata information */ - hsize_t mesg; /* Space within header for actual message information */ - hsize_t free; /* Free space within object header */ + hsize_t total; /* Total space for storing object header in file */ + hsize_t meta; /* Space within header for object header metadata information */ + hsize_t mesg; /* Space within header for actual message information */ + hsize_t free; /* Free space within object header */ } space; struct { - uint64_t present; /* Flags to indicate presence of message type in header */ - uint64_t shared; /* Flags to indicate message type is shared in header */ + uint64_t present; /* Flags to indicate presence of message type in header */ + uint64_t shared; /* Flags to indicate message type is shared in header */ } mesg; } H5O_hdr_info_t; @@ -159,14 +159,15 @@ typedef herr_t (*H5O_iterate2_t)(hid_t obj, const char *name, const H5O_info2_t void *op_data); typedef enum H5O_mcdt_search_ret_t { - H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */ - H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */ - H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */ + H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */ + H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */ + H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */ } H5O_mcdt_search_ret_t; /* Callback to invoke when completing the search for a matching committed datatype from the committed dtype list */ typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data); + /********************/ /* Public Variables */ /********************/ @@ -820,7 +820,7 @@ done: H5Pencode2 PURPOSE Routine to convert the property values in a property list into a binary buffer. - The encoding of property values will be done according to the file format + The encoding of property values will be done according to the file format setting in fapl_id. USAGE herr_t H5Pencode(plist_id, buf, nalloc, fapl_id) @@ -878,7 +878,7 @@ done: Failure: H5I_INVALID_HID (negative) DESCRIPTION Decodes a property list from a binary buffer. The contents of the buffer - contain the values for the correponding properties of the plist. The decode + contain the values for the correponding properties of the plist. The decode callback of a certain property decodes its value from the buffer and sets it in the property list. GLOBAL VARIABLES @@ -166,7 +166,7 @@ H5FL_DEFINE_STATIC(H5PB_entry_t); * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_reset_stats(H5PB_t *page_buf) { FUNC_ENTER_NOAPI_NOERR @@ -208,7 +208,7 @@ H5PB_reset_stats(H5PB_t *page_buf) * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]) { @@ -517,9 +517,9 @@ done: /*------------------------------------------------------------------------- * Function: H5PB_add_new_page * - * Purpose: Add a new page to the new page skip list. This is called - * from the MF layer when a new page is allocated to - * indicate to the page buffer layer that a read of the page + * Purpose: Add a new page to the new page skip list. This is called + * from the MF layer when a new page is allocated to + * indicate to the page buffer layer that a read of the page * from the file is not necessary since it's an empty page. * * Return: Non-negative on success/Negative on failure @@ -577,9 +577,9 @@ done: /*------------------------------------------------------------------------- * Function: H5PB_update_entry * - * Purpose: In PHDF5, entries that are written by other processes and just - * marked clean by this process have to have their corresponding - * pages updated if they exist in the page buffer. + * Purpose: In PHDF5, entries that are written by other processes and just + * marked clean by this process have to have their corresponding + * pages updated if they exist in the page buffer. * This routine checks and update the pages. * * Return: Non-negative on success/Negative on failure @@ -588,7 +588,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf) { H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ @@ -743,7 +743,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * page_buf->bypasses[0] ++; } /* end if */ - /* If page buffering is disabled, or if this is a large metadata access, + /* If page buffering is disabled, or if this is a large metadata access, * or if this is parallel raw data access, we are done here */ if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) || @@ -769,7 +769,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * last_page_addr = ((addr + size - 1) / page_buf->page_size) * page_buf->page_size; /* How many pages does this write span */ - num_touched_pages = (last_page_addr / page_buf->page_size + 1) - + num_touched_pages = (last_page_addr / page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if(first_page_addr == last_page_addr) { HDassert(1 == num_touched_pages); @@ -822,7 +822,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * offset = addr - first_page_addr; HDassert(page_buf->page_size > offset); - H5MM_memcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset, + H5MM_memcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset, page_buf->page_size - (size_t)offset); /* move to top of LRU list */ @@ -830,7 +830,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * } /* end if */ /* special handling for the last page if it is not a full page access */ else if(num_touched_pages > 1 && i == num_touched_pages-1 && search_addr < addr+size) { - offset = (num_touched_pages-2)*page_buf->page_size + + offset = (num_touched_pages-2)*page_buf->page_size + (page_buf->page_size - (addr - first_page_addr)); H5MM_memcpy((uint8_t *)buf + offset, page_entry->page_buf_ptr, @@ -843,7 +843,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * else { offset = i*page_buf->page_size; - H5MM_memcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr, + H5MM_memcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr, page_buf->page_size); } /* end else */ } /* end if */ @@ -1039,7 +1039,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, page_buf->bypasses[0]++; } /* end if */ - /* If page buffering is disabled, or if this is a large metadata access, + /* If page buffering is disabled, or if this is a large metadata access, * or if this is a parallel raw data access, we are done here */ if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) || @@ -1073,7 +1073,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, last_page_addr = (addr + size - 1) / page_buf->page_size * page_buf->page_size; /* how many pages does this write span */ - num_touched_pages = (last_page_addr/page_buf->page_size + 1) - + num_touched_pages = (last_page_addr/page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if(first_page_addr == last_page_addr) { HDassert(1 == num_touched_pages); @@ -1114,18 +1114,18 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, } /* end if */ } /* end if */ /* Special handling for the last page if it is not a full page update */ - else if(num_touched_pages > 1 && i == (num_touched_pages - 1) && + else if(num_touched_pages > 1 && i == (num_touched_pages - 1) && (search_addr + page_buf->page_size) != (addr + size)) { HDassert(search_addr+page_buf->page_size > addr+size); /* Lookup the page in the skip list */ page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&search_addr)); if(page_entry) { - offset = (num_touched_pages - 2) * page_buf->page_size + + offset = (num_touched_pages - 2) * page_buf->page_size + (page_buf->page_size - (addr - first_page_addr)); /* Update page's data */ - H5MM_memcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset, + H5MM_memcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset, (size_t)((addr + size) - last_page_addr)); /* Mark page dirty and push to top of LRU */ @@ -1313,7 +1313,7 @@ done: /*------------------------------------------------------------------------- * Function: H5PB__insert_entry() * - * Purpose: ??? + * Purpose: ??? * * This function was created without documentation. * What follows is my best understanding of Mohamad's intent. @@ -1334,7 +1334,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1399,7 +1399,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* check the metadata threshold before evicting metadata items */ while(1) { - if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type && + if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type && page_buf->min_meta_count >= page_buf->meta_count) page_entry = page_entry->prev; else @@ -1416,7 +1416,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* check the raw data threshold before evicting raw data items */ while(1) { - if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) && + if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) && page_buf->min_raw_count >= page_buf->raw_count) page_entry = page_entry->prev; else @@ -1461,7 +1461,7 @@ done: /*------------------------------------------------------------------------- * Function: H5PB__write_entry() * - * Purpose: ??? + * Purpose: ??? * * This function was created without documentation. * What follows is my best understanding of Mohamad's intent. diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 7b98f1e..7e49c4b 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -246,30 +246,30 @@ static hbool_t H5P_dcrt_def_layout_init_g = FALSE; static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Register the storage layout property */ - if(H5P__register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, + if(H5P__register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, NULL, H5D_CRT_LAYOUT_SET, H5D_CRT_LAYOUT_GET, H5D_CRT_LAYOUT_ENC, H5D_CRT_LAYOUT_DEC, H5D_CRT_LAYOUT_DEL, H5D_CRT_LAYOUT_COPY, H5D_CRT_LAYOUT_CMP, H5D_CRT_LAYOUT_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the fill value property */ - if(H5P__register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, + if(H5P__register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, NULL, H5D_CRT_FILL_VALUE_SET, H5D_CRT_FILL_VALUE_GET, H5D_CRT_FILL_VALUE_ENC, H5D_CRT_FILL_VALUE_DEC, H5D_CRT_FILL_VALUE_DEL, H5D_CRT_FILL_VALUE_COPY, H5D_CRT_FILL_VALUE_CMP, H5D_CRT_FILL_VALUE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the space allocation time state property */ - if(H5P__register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, + if(H5P__register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, NULL, NULL, NULL, H5D_CRT_ALLOC_TIME_STATE_ENC, H5D_CRT_ALLOC_TIME_STATE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file list property */ - if(H5P__register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, + if(H5P__register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, NULL, H5D_CRT_EXT_FILE_LIST_SET, H5D_CRT_EXT_FILE_LIST_GET, H5D_CRT_EXT_FILE_LIST_ENC, H5D_CRT_EXT_FILE_LIST_DEC, H5D_CRT_EXT_FILE_LIST_DEL, H5D_CRT_EXT_FILE_LIST_COPY, H5D_CRT_EXT_FILE_LIST_CMP, H5D_CRT_EXT_FILE_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -1512,7 +1512,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) size_t len; if(efl->nused >= efl->nalloc) { size_t na = efl->nalloc + H5O_EFL_ALLOC; - H5O_efl_entry_t *x = (H5O_efl_entry_t *)H5MM_realloc(efl->slot, + H5O_efl_entry_t *x = (H5O_efl_entry_t *)H5MM_realloc(efl->slot, na * sizeof(H5O_efl_entry_t)); if(!x) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -2222,7 +2222,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, if((ent->psfn_nsubs == 0) && (ent->psdn_nsubs == 0)) { if(ent->parsed_source_file_name) ent->source_dset.file_name = ent->parsed_source_file_name->name_segment; - else + else ent->source_dset.file_name = ent->source_file_name; if(ent->parsed_source_dset_name) ent->source_dset.dset_name = ent->parsed_source_dset_name->name_segment; @@ -2342,7 +2342,7 @@ done: * Purpose: Takes the dataset creation property list for the virtual * dataset, dcpl_id, and the mapping index, index, and * returns a dataspace identifier for the selection within - * the virtual dataset used in the mapping. + * the virtual dataset used in the mapping. * * Return: Returns a dataspace identifier if successful; otherwise * returns a negative value. @@ -2400,7 +2400,7 @@ done: * Purpose: Takes the dataset creation property list for the virtual * dataset, dcpl_id, and the mapping index, index, and * returns a dataspace identifier for the selection within - * the source dataset used in the mapping. + * the source dataset used in the mapping. * * Return: Returns a dataspace identifier if successful; otherwise * returns a negative value. @@ -2504,7 +2504,7 @@ done: * be the size in bytes of the filename. That value, plus 1 * for a NULL terminator, is then assigned to size for a * second H5Pget_virtual_filename call, which will retrieve - * the actual filename. + * the actual filename. * * Return: Returns the length of the name if successful, otherwise * returns a negative value. @@ -2567,7 +2567,7 @@ done: * be the size in bytes of the dataset name. That value, plus 1 * for a NULL terminator, is then assigned to size for a * second H5Pget_virtual_dsetname call, which will retrieve - * the actual dataset name. + * the actual dataset name. * * Return: Returns the length of the name if successful, otherwise * returns a negative value. diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 1b5f581..b9efaee 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -563,9 +563,9 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid strategy") /* * For 1.10.0 H5Pset_file_space: - * If strategy is zero, the property is not changed; + * If strategy is zero, the property is not changed; * the existing strategy is retained. - * If threshold is zero, the property is not changed; + * If threshold is zero, the property is not changed; * the existing threshold is retained. */ if(!in_strategy) @@ -579,7 +579,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh new_persist = TRUE; new_threshold = in_threshold; break; - + case H5F_FILE_SPACE_ALL: new_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; new_threshold = in_threshold; @@ -592,7 +592,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh case H5F_FILE_SPACE_VFD: new_strategy = H5F_FSPACE_STRATEGY_NONE; break; - + case H5F_FILE_SPACE_NTYPES: case H5F_FILE_SPACE_DEFAULT: default: diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 9baa201..3f5754e 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -128,7 +128,7 @@ #define H5D_MPIO_ACTUAL_IO_MODE_DEF H5D_MPIO_NO_COLLECTIVE /* Definitions for cause of broken collective io property */ #define H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE sizeof(uint32_t) -#define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE +#define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE /* Definitions for EDC property */ #define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) @@ -245,7 +245,7 @@ static const unsigned H5D_def_mpio_chunk_opt_num_g = H5D_XFER_MPIO_CHUNK_OPT_NUM static const unsigned H5D_def_mpio_chunk_opt_ratio_g = H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF; static const H5D_mpio_actual_chunk_opt_mode_t H5D_def_mpio_actual_chunk_opt_mode_g = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; static const H5D_mpio_actual_io_mode_t H5D_def_mpio_actual_io_mode_g = H5D_MPIO_ACTUAL_IO_MODE_DEF; -static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; +static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; static const H5Z_EDC_t H5D_def_enable_edc_g = H5D_XFER_EDC_DEF; /* Default value for EDC property */ static const H5Z_cb_t H5D_def_filter_cb_g = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ static const H5T_conv_cb_t H5D_def_conv_cb_g = H5D_XFER_CONV_CB_DEF; /* Default value for datatype conversion callback */ @@ -271,96 +271,96 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the max. temp buffer size property */ - if(H5P__register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, + if(H5P__register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, NULL, NULL, NULL, H5D_XFER_MAX_TEMP_BUF_ENC, H5D_XFER_MAX_TEMP_BUF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the type conversion buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, + if(H5P__register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer type property */ - if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, NULL, NULL, NULL, H5D_XFER_BKGR_BUF_TYPE_ENC, H5D_XFER_BKGR_BUF_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the B-Tree node splitting ratios property */ - if(H5P__register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, NULL, NULL, NULL, H5D_XFER_BTREE_SPLIT_RATIO_ENC, H5D_XFER_BTREE_SPLIT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vector size property */ - if(H5P__register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, + if(H5P__register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, NULL, NULL, NULL, H5D_XFER_HYPER_VECTOR_SIZE_ENC, H5D_XFER_HYPER_VECTOR_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the I/O transfer mode properties */ - if(H5P__register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, + if(H5P__register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, NULL, NULL, NULL, H5D_XFER_IO_XFER_MODE_ENC, H5D_XFER_IO_XFER_MODE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_COLLECTIVE_OPT_ENC, H5D_XFER_MPIO_COLLECTIVE_OPT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_HARD_ENC, H5D_XFER_MPIO_CHUNK_OPT_HARD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_NUM_ENC, H5D_XFER_MPIO_CHUNK_OPT_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_RATIO_ENC, H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the chunk optimization mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the actual I/O mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -396,7 +396,7 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) /* Register the data transform property */ if(H5P__register_real(pclass, H5D_XFER_XFORM_NAME, H5D_XFER_XFORM_SIZE, &H5D_def_xfer_xform_g, - NULL, H5D_XFER_XFORM_SET, H5D_XFER_XFORM_GET, H5D_XFER_XFORM_ENC, H5D_XFER_XFORM_DEC, + NULL, H5D_XFER_XFORM_SET, H5D_XFER_XFORM_GET, H5D_XFER_XFORM_ENC, H5D_XFER_XFORM_DEC, H5D_XFER_XFORM_DEL, H5D_XFER_XFORM_COPY, H5D_XFER_XFORM_CMP, H5D_XFER_XFORM_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -860,7 +860,7 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU if(*xform1) { HDassert(*xform2); - + /* Get the transform expressions */ pexp1 = H5Z_xform_extract_xform_str(*xform1); pexp2 = H5Z_xform_extract_xform_str(*xform2); @@ -1964,7 +1964,7 @@ H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); @@ -2000,7 +2000,7 @@ H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_ { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Di", plist_id, actual_io_mode); @@ -2034,7 +2034,7 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause); diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 2a07a67..d4b6b5f 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -687,7 +687,7 @@ done: on failure. DESCRIPTION Decodes a property list from a binary buffer. The contents of the buffer - contain the values for the correponding properties of the plist. The decode + contain the values for the correponding properties of the plist. The decode callback of a certain property decodes its value from the buffer and sets it in the property list. GLOBAL VARIABLES diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 3668229..b157e5e 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5789,7 +5789,7 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED /* Set return value */ ret_value = cmp_value; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_vol_cmp() */ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 56af8b1..3b0ce66 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -212,38 +212,38 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register the user block size */ - if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, - NULL, NULL, NULL, H5F_CRT_USER_BLOCK_ENC, H5F_CRT_USER_BLOCK_DEC, + if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, + NULL, NULL, NULL, H5F_CRT_USER_BLOCK_ENC, H5F_CRT_USER_BLOCK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for symbol table leaf nodes */ - if(H5P__register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, - NULL, NULL, NULL, H5F_CRT_SYM_LEAF_ENC, H5F_CRT_SYM_LEAF_DEC, + if(H5P__register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, + NULL, NULL, NULL, H5F_CRT_SYM_LEAF_ENC, H5F_CRT_SYM_LEAF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for btree internal nodes */ - if(H5P__register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, - NULL, NULL, NULL, H5F_CRT_BTREE_RANK_ENC, H5F_CRT_BTREE_RANK_DEC, + if(H5P__register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, + NULL, NULL, NULL, H5F_CRT_BTREE_RANK_ENC, H5F_CRT_BTREE_RANK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for an address */ - if(H5P__register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, - NULL, NULL, NULL, H5F_CRT_ADDR_BYTE_NUM_ENC, H5F_CRT_ADDR_BYTE_NUM_DEC, + if(H5P__register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, + NULL, NULL, NULL, H5F_CRT_ADDR_BYTE_NUM_ENC, H5F_CRT_ADDR_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for object size */ - if(H5P__register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, - NULL, NULL, NULL, H5F_CRT_OBJ_BYTE_NUM_ENC, H5F_CRT_OBJ_BYTE_NUM_DEC, + if(H5P__register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, + NULL, NULL, NULL, H5F_CRT_OBJ_BYTE_NUM_ENC, H5F_CRT_OBJ_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the superblock version number */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, + if(H5P__register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -272,8 +272,8 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file space handling strategy */ - if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, - NULL, NULL, NULL, H5F_CRT_FILE_SPACE_STRATEGY_ENC, H5F_CRT_FILE_SPACE_STRATEGY_DEC, + if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, + NULL, NULL, NULL, H5F_CRT_FILE_SPACE_STRATEGY_ENC, H5F_CRT_FILE_SPACE_STRATEGY_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -284,8 +284,8 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free space section threshold */ - if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, - NULL, NULL, NULL, H5F_CRT_FREE_SPACE_THRESHOLD_ENC, H5F_CRT_FREE_SPACE_THRESHOLD_DEC, + if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, + NULL, NULL, NULL, H5F_CRT_FREE_SPACE_THRESHOLD_ENC, H5F_CRT_FREE_SPACE_THRESHOLD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -1333,7 +1333,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_space_strategy * - * Purpose: Retrieves the strategy, persist, and threshold that the library + * Purpose: Retrieves the strategy, persist, and threshold that the library * uses in managing file space. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 1e39749..41ad078 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -124,7 +124,7 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register property of whether symlinks is local to file */ - if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, + if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index e2fdcea..03874c8 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -133,13 +133,13 @@ H5P__gcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register group info property */ - if(H5P__register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, + if(H5P__register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, NULL, NULL, NULL, H5G_CRT_GROUP_INFO_ENC, H5G_CRT_GROUP_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register link info property */ - if(H5P__register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, + if(H5P__register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, NULL, NULL, NULL, H5G_CRT_LINK_INFO_ENC, H5G_CRT_LINK_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -545,7 +545,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)value; /* Create local aliases for values */ @@ -558,7 +558,7 @@ H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) UINT16ENCODE(*pp, ginfo->max_compact) UINT16ENCODE(*pp, ginfo->min_dense) UINT16ENCODE(*pp, ginfo->est_num_entries) - UINT16ENCODE(*pp, ginfo->est_name_len) + UINT16ENCODE(*pp, ginfo->est_name_len) } /* end if */ *size += sizeof(uint16_t) * 4 + sizeof(uint32_t); @@ -582,7 +582,7 @@ H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_group_info_dec(const void **_pp, void *_value) { H5O_ginfo_t *ginfo = (H5O_ginfo_t *)_value; /* Group info settings */ @@ -599,16 +599,16 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) UINT16DECODE(*pp, ginfo->max_compact) UINT16DECODE(*pp, ginfo->min_dense) UINT16DECODE(*pp, ginfo->est_num_entries) - UINT16DECODE(*pp, ginfo->est_name_len) + UINT16DECODE(*pp, ginfo->est_name_len) /* Update fields */ - if(ginfo->max_compact != H5G_CRT_GINFO_MAX_COMPACT || + if(ginfo->max_compact != H5G_CRT_GINFO_MAX_COMPACT || ginfo->min_dense != H5G_CRT_GINFO_MIN_DENSE) ginfo->store_link_phase_change = TRUE; else ginfo->store_link_phase_change = FALSE; - if(ginfo->est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || + if(ginfo->est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || ginfo->est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) ginfo->store_est_entry_info = TRUE; else @@ -633,7 +633,7 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)value; /* Create local aliases for values */ @@ -675,7 +675,7 @@ H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_link_info_dec(const void **_pp, void *_value) { H5O_linfo_t *linfo = (H5O_linfo_t *)_value; /* Link info settings */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 0810427..3cefb64 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -111,7 +111,7 @@ static H5P_genprop_t *H5P__create_prop(const char *name, size_t size, H5P_prop_w static H5P_genprop_t *H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type); static herr_t H5P__free_prop(H5P_genprop_t *prop); static int H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2); -static herr_t H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, +static herr_t H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, H5P_do_pclass_op_t pclass_op, void *udata); static int H5P__open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key); static H5P_genprop_t *H5P__find_prop_pclass(H5P_genclass_t *pclass, const char *name); @@ -1947,7 +1947,7 @@ done: PURPOSE Internal routine to register a new property in a property list class. USAGE - herr_t H5P__register_real(class, name, size, default, prp_create, prp_set, + herr_t H5P__register_real(class, name, size, default, prp_create, prp_set, prp_get, prp_close, prp_encode, prp_decode) H5P_genclass_t *class; IN: Property list class to modify const char *name; IN: Name of property to register @@ -2081,7 +2081,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2090,12 +2090,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2150,7 +2150,7 @@ H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, HGOTO_ERROR(H5E_PLIST, H5E_EXISTS, FAIL, "property already exists") /* Create property object from parameters */ - if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_CLASS, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_CLASS, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL,"Can't create property") @@ -2259,7 +2259,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2268,12 +2268,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2416,7 +2416,7 @@ H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, } /* end if */ /* Really register the property in the class */ - if(H5P__register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, + if(H5P__register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't register property") @@ -2439,7 +2439,7 @@ done: PURPOSE Internal routine to insert a new property in a property list. USAGE - herr_t H5P_insert(plist, name, size, value, prp_set, prp_get, prp_close, + herr_t H5P_insert(plist, name, size, value, prp_set, prp_get, prp_close, prp_encode, prp_decode) H5P_genplist_t *plist; IN: Property list to add property to const char *name; IN: Name of property to add @@ -2500,7 +2500,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2509,12 +2509,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2653,8 +2653,8 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, /* Ok to add to property list */ /* Create property object from parameters */ - if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, - prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, + prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "Can't create property") @@ -2698,7 +2698,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, +H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, H5P_do_pclass_op_t pclass_op, void *udata) { H5P_genclass_t *tclass; /* Temporary class pointer */ @@ -2780,7 +2780,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, +H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop, void *_udata) { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ @@ -3149,7 +3149,7 @@ done: COMMENTS, BUGS, ASSUMPTIONS The 'get' callback routine registered for this property will _NOT_ be called, this routine is designed for internal library use only! - + This routine may not be called for zero-sized properties and will return an error in that case. EXAMPLES @@ -3203,7 +3203,7 @@ done: COMMENTS, BUGS, ASSUMPTIONS The 'set' callback routine registered for this property will _NOT_ be called, this routine is designed for internal library use only! - + This routine may not be called for zero-sized properties and will return an error in that case. @@ -4396,7 +4396,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, +H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop, void *_udata) { H5P_prop_get_ud_t *udata = (H5P_prop_get_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 6e582fb..3d00c12 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -194,39 +194,39 @@ H5P__lacc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register property for number of links traversed */ - if(H5P__register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, + if(H5P__register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, NULL, NULL, NULL, H5L_ACS_NLINKS_ENC, H5L_ACS_NLINKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link prefix */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, NULL, H5L_ACS_ELINK_PREFIX_SET, H5L_ACS_ELINK_PREFIX_GET, H5L_ACS_ELINK_PREFIX_ENC, H5L_ACS_ELINK_PREFIX_DEC, H5L_ACS_ELINK_PREFIX_DEL, H5L_ACS_ELINK_PREFIX_COPY, H5L_ACS_ELINK_PREFIX_CMP, H5L_ACS_ELINK_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register fapl for link access */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, NULL, H5L_ACS_ELINK_FAPL_SET, H5L_ACS_ELINK_FAPL_GET, H5L_ACS_ELINK_FAPL_ENC, H5L_ACS_ELINK_FAPL_DEC, H5L_ACS_ELINK_FAPL_DEL, H5L_ACS_ELINK_FAPL_COPY, H5L_ACS_ELINK_FAPL_CMP, H5L_ACS_ELINK_FAPL_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file access flags */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, NULL, NULL, NULL, H5L_ACS_ELINK_FLAGS_ENC, H5L_ACS_ELINK_FLAGS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file traversal callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, - NULL, NULL, NULL, H5L_ACS_COLL_MD_READ_ENC, H5L_ACS_COLL_MD_READ_DEC, + if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, + NULL, NULL, NULL, H5L_ACS_COLL_MD_READ_ENC, H5L_ACS_COLL_MD_READ_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 5079548..fc1a3b9 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -48,6 +48,7 @@ #define H5L_CRT_INTERMEDIATE_GROUP_ENC H5P__encode_unsigned #define H5L_CRT_INTERMEDIATE_GROUP_DEC H5P__decode_unsigned + /******************/ /* Local Typedefs */ /******************/ @@ -118,12 +119,12 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Register create intermediate groups property */ - if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, + if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, NULL, NULL, NULL, H5L_CRT_INTERMEDIATE_GROUP_ENC, H5L_CRT_INTERMEDIATE_GROUP_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 2dc92f9..7390cae 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -64,7 +64,7 @@ #define H5O_CPY_MERGE_COMM_DT_LIST_CLOSE H5P__ocpy_merge_comm_dt_list_close /* Definitions for callback function when completing the search for a matching committed datatype from the committed dtype list */ #define H5O_CPY_MCDT_SEARCH_CB_SIZE sizeof(H5O_mcdt_cb_info_t) -#define H5O_CPY_MCDT_SEARCH_CB_DEF {NULL,NULL} +#define H5O_CPY_MCDT_SEARCH_CB_DEF {NULL,NULL} /******************/ @@ -161,20 +161,20 @@ H5P__ocpy_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register copy options property */ - if(H5P__register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, + if(H5P__register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, NULL, NULL, NULL, H5O_CPY_OPTION_ENC, H5O_CPY_OPTION_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register merge named dtype list property */ - if(H5P__register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, + if(H5P__register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, NULL, H5O_CPY_MERGE_COMM_DT_LIST_SET, H5O_CPY_MERGE_COMM_DT_LIST_GET, H5O_CPY_MERGE_COMM_DT_LIST_ENC, H5O_CPY_MERGE_COMM_DT_LIST_DEC, H5O_CPY_MERGE_COMM_DT_LIST_DEL, H5O_CPY_MERGE_COMM_DT_LIST_COPY, H5O_CPY_MERGE_COMM_DT_LIST_CMP, H5O_CPY_MERGE_COMM_DT_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for callback when completing the search for a matching named datatype from the named dtype list */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, + if(H5P__register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -421,7 +421,7 @@ H5P__ocpy_merge_comm_dt_list_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) { H5O_copy_dtype_merge_list_t **dt_list = (H5O_copy_dtype_merge_list_t **)_value; /* Pointer to merge named datatype list */ @@ -439,7 +439,7 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) /* Start off with NULL (default value) */ *dt_list = NULL; - + /* Decode the string sequence */ len = HDstrlen(*(const char **)pp); while(len > 0) { @@ -469,7 +469,7 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) /* Advance past terminator for string sequence */ *pp += 1; -done: +done: if(ret_value < 0) { *dt_list = H5P__free_merge_comm_dtype_list(*dt_list); if(tmp_dt_list) { @@ -874,7 +874,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_mcdt_search_cb * - * Purpose: Retrieves the callback function and user data from the specified + * Purpose: Retrieves the callback function and user data from the specified * object copy property list. * * Usage: H5Pget_mcdt_search_cb(plist_id, H5O_mcdt_search_cb_t *func, void **op_data) @@ -905,7 +905,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data /* Get callback info */ if(H5P_get(plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get callback info") - + if(func) *func = cb_info.func; diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 45343c6..97d6119 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -130,7 +130,7 @@ H5P__strcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register character encoding */ - if(H5P__register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, + if(H5P__register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, NULL, NULL, NULL, H5P_STRCRT_CHAR_ENCODING_ENC, H5P_STRCRT_CHAR_ENCODING_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Rint.c b/src/H5Rint.c index 131336b..30f3dbb 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -157,7 +157,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Flag indicating "top" of interface has been initialized */ static hbool_t H5R_top_package_initialize_s = FALSE; - + /*-------------------------------------------------------------------------- NAME H5R__init_package -- Initialize interface-specific information @@ -184,7 +184,7 @@ H5R__init_package(void) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5R__init_package() */ - + /*-------------------------------------------------------------------------- NAME H5R_top_term_package @@ -206,7 +206,7 @@ H5R__init_package(void) int H5R_top_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -218,7 +218,7 @@ H5R_top_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5R_top_term_package() */ - + /*-------------------------------------------------------------------------- NAME H5R_term_package @@ -242,7 +242,7 @@ H5R_top_term_package(void) int H5R_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -258,7 +258,7 @@ H5R_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5R_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5R__create_object * @@ -299,7 +299,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__create_object() */ - + /*------------------------------------------------------------------------- * Function: H5R__create_region * @@ -350,7 +350,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5R__create_region */ - + /*------------------------------------------------------------------------- * Function: H5R__create_attr * @@ -404,7 +404,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5R__create_attr */ - + /*------------------------------------------------------------------------- * Function: H5R__destroy * @@ -469,7 +469,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__destroy() */ - + /*------------------------------------------------------------------------- * Function: H5R__set_loc_id * @@ -514,7 +514,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__set_loc_id() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_loc_id * @@ -538,7 +538,7 @@ H5R__get_loc_id(const H5R_ref_priv_t *ref) FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_loc_id() */ - + /*------------------------------------------------------------------------- * Function: H5R__reopen_file * @@ -607,7 +607,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__reopen_file() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_type * @@ -631,7 +631,7 @@ H5R__get_type(const H5R_ref_priv_t *ref) FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_type() */ - + /*------------------------------------------------------------------------- * Function: H5R__equal * @@ -696,7 +696,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__equal() */ - + /*------------------------------------------------------------------------- * Function: H5R__copy * @@ -762,7 +762,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__copy() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_obj_token * @@ -795,7 +795,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_obj_token() */ - + /*------------------------------------------------------------------------- * Function: H5R__set_obj_token * @@ -825,7 +825,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token, FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__set_obj_token() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_region * @@ -856,7 +856,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_region() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_file_name * @@ -898,7 +898,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_file_name() */ - + /*------------------------------------------------------------------------- * Function: H5R__get_attr_name * @@ -936,7 +936,7 @@ H5R__get_attr_name(const H5R_ref_priv_t *ref, char *buf, size_t size) FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__get_attr_name() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode * @@ -1034,7 +1034,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode * @@ -1127,7 +1127,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_obj_token * @@ -1162,7 +1162,7 @@ H5R__encode_obj_token(const H5O_token_t *obj_token, size_t token_size, FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode_obj_token() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_obj_token * @@ -1207,7 +1207,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode_obj_token() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_region * @@ -1256,7 +1256,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode_region() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_region * @@ -1312,7 +1312,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode_region() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_string * @@ -1354,7 +1354,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode_string() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_string * @@ -1401,7 +1401,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode_string() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_heap * @@ -1442,7 +1442,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode_heap() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_heap * @@ -1489,7 +1489,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode_heap() */ - + /*------------------------------------------------------------------------- * Function: H5R__free_heap * @@ -1534,7 +1534,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__free_heap() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_token_compat * @@ -1606,7 +1606,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__decode_token_compat() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_token_obj_compat * @@ -1637,7 +1637,7 @@ H5R__encode_token_obj_compat(const H5O_token_t *obj_token, size_t token_size, FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__encode_token_obj_compat() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_token_obj_compat * @@ -1672,7 +1672,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5R__decode_token_obj_compat() */ - + /*------------------------------------------------------------------------- * Function: H5R__encode_token_region_compat * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5R__encode_token_region_compat() */ - + /*------------------------------------------------------------------------- * Function: H5R__decode_token_region_compat * @@ -57,7 +57,7 @@ static herr_t H5SM__create_index(H5F_t *f, H5SM_index_header_t *header); static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap); static haddr_t H5SM__create_list(H5F_t *f, H5SM_index_header_t *header); -static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, +static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *empty_pos, size_t *list_pos); static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 6d0f2b0..7f243a6 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -59,16 +59,16 @@ static herr_t H5SM__cache_table_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_table_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5SM__cache_table_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_table_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5SM__cache_table_free_icr(void *thing); static herr_t H5SM__cache_list_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_list_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5SM__cache_list_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_list_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -129,7 +129,7 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{ /*------------------------------------------------------------------------- * Function: H5SM__cache_table_get_initial_load_size() * - * Purpose: Return the size of the master table of Shared Object Header + * Purpose: Return the size of the master table of Shared Object Header * Message indexes on disk. * * Return: Success: SUCCEED @@ -198,9 +198,9 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU /*------------------------------------------------------------------------- * Function: H5SM__cache_table_deserialize * - * Purpose: Given a buffer containing the on disk representation of the + * Purpose: Given a buffer containing the on disk representation of the * master table of Shared Object Header Message indexes, deserialize - * the table, copy the contents into a newly allocated instance of + * the table, copy the contents into a newly allocated instance of * H5SM_master_table_t, and return a pointer to the new instance. * * Return: Success: Pointer to in core representation @@ -212,7 +212,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static void * -H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5F_t *f; /* File pointer -- from user data */ @@ -264,7 +264,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* Read in the index headers */ for(u = 0; u < table->num_indexes; ++u) { /* Verify correct version of index list */ - if(H5SM_LIST_VERSION != *image++) + if(H5SM_LIST_VERSION != *image++) HGOTO_ERROR(H5E_SOHM, H5E_VERSION, NULL, "bad shared message list version number") /* Type of the index (list or B-tree) */ @@ -555,8 +555,8 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo /*------------------------------------------------------------------------- * Function: H5SM__cache_list_deserialize * - * Purpose: Given a buffer containing the on disk image of a list of - * SOHM message, deserialize the list, load it into a newly allocated + * Purpose: Given a buffer containing the on disk image of a list of + * SOHM message, deserialize the list, load it into a newly allocated * instance of H5SM_list_t, and return a pointer to same. * * Return: Success: Pointer to in core representation @@ -568,7 +568,7 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo *------------------------------------------------------------------------- */ static void * -H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5SM_list_t *list = NULL; /* The SOHM list being read in */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 77fb582..8290ae2 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -675,7 +675,7 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p) HDassert(*p); /* As part of the efforts to push all selection-type specific coding - to the callbacks, the coding for the allocation of a null dataspace + to the callbacks, the coding for the allocation of a null dataspace is moved from H5S_select_deserialize() in H5Sselect.c. This is needed for decoding virtual layout in H5O__layout_decode() */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 6397f4b..33dd492 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -899,7 +899,7 @@ if(H5DEBUG(S)) /* Calculate start and extent values of this dimension */ /* Check if value overflow to cast to type MPI_Aint */ - if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX) + if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow") start_disp = (MPI_Aint)d[i].start * (MPI_Aint)offset[i] * (MPI_Aint)elmt_size; diff --git a/src/H5Spublic.h b/src/H5Spublic.h index f7c5ae7..1ca79ea 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -47,7 +47,7 @@ #define H5S_SEL_ITER_SHARE_WITH_DATASPACE 0x0002 /* Don't copy the dataspace * selection when creating the * selection iterator. - * + * * This can improve performance * of creating the iterator, but * the dataspace _MUST_NOT_ be diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 9814e38..e433dc1 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3036,7 +3036,7 @@ done: Retrieve a list of offset / length pairs (a list of "sequences") matching the selected elements for an iterator, according to the iteration order for the iterator. The lengths returned are in _bytes_, not elements. - + Note that the iteration order for "all" and "hyperslab" selections is row-major (i.e. "C-ordered"), but the iteration order for "point" selections is "in order selected", unless the H5S_SEL_ITER_GET_SEQ_LIST_SORTED @@ -179,7 +179,7 @@ H5TS_thread_id(void) /* An ID is *not* already assigned: reuse an ID that's on the * free list, or else generate a new ID. - * + * * Allocating memory while holding a mutex is bad form, so * point `tid` at `proto_tid` if we need to allocate some * memory. @@ -292,7 +292,7 @@ herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) { #ifdef H5_HAVE_WIN_THREADS - EnterCriticalSection( &mutex->CriticalSection); + EnterCriticalSection( &mutex->CriticalSection); return 0; #else /* H5_HAVE_WIN_THREADS */ herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); @@ -313,7 +313,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) mutex->lock_count = 1; } - return pthread_mutex_unlock(&mutex->atomic_lock); + return pthread_mutex_unlock(&mutex->atomic_lock); #endif /* H5_HAVE_WIN_THREADS */ } @@ -344,7 +344,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) #ifdef H5_HAVE_WIN_THREADS /* Releases ownership of the specified critical section object. */ LeaveCriticalSection(&mutex->CriticalSection); - return 0; + return 0; #else /* H5_HAVE_WIN_THREADS */ herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); @@ -363,7 +363,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) ret_value = err; } /* end if */ - return ret_value; + return ret_value; #endif /* H5_HAVE_WIN_THREADS */ } /* H5TS_mutex_unlock */ @@ -400,15 +400,15 @@ H5TS_cancel_count_inc(void) return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); if (!cancel_counter) { /* * First time thread calls library - create new counter and associate * with key. - * + * * Don't use H5MM calls here since the destructor has to use HDfree in * order to avoid codestack calls. */ @@ -429,7 +429,7 @@ H5TS_cancel_count_inc(void) ++cancel_counter->cancel_count; - return ret_value; + return ret_value; #endif /* H5_HAVE_WIN_THREADS */ } @@ -459,19 +459,19 @@ H5TS_cancel_count_inc(void) herr_t H5TS_cancel_count_dec(void) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* unsupported; will just return 0 */ return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ - register H5TS_cancel_t *cancel_counter; + register H5TS_cancel_t *cancel_counter; herr_t ret_value = SUCCEED; - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); if (cancel_counter->cancel_count == 1) ret_value = pthread_setcancelstate(cancel_counter->previous_state, NULL); - --cancel_counter->cancel_count; + --cancel_counter->cancel_count; return ret_value; #endif /* H5_HAVE_WIN_THREADS */ @@ -491,7 +491,7 @@ H5TS_cancel_count_dec(void) * *-------------------------------------------------------------------------- */ -H5_DLL BOOL CALLBACK +H5_DLL BOOL CALLBACK H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) { BOOL ret_value = TRUE; @@ -653,7 +653,7 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* When calling C runtime functions, you should use _beginthread or * _beginthreadex instead of CreateThread. Threads created with diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 7d26af3..bb660c2 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -1084,7 +1084,7 @@ H5T_update_shared(H5T_t *dt) /*------------------------------------------------------------------------- * Function: H5T_construct_datatype * - * Purpose: Create a Library datatype with a connector specific datatype object + * Purpose: Create a Library datatype with a connector specific datatype object * * Return: Success: A type structure * Failure: NULL @@ -1156,7 +1156,7 @@ H5T_get_named_type(const H5T_t *dt) * Function: H5T_get_actual_type * * Purpose: Returns underlying native datatype created by native connector - * if datatype is committed, otherwise return the datatype + * if datatype is committed, otherwise return the datatype * object associate with the ID. * * Return: Success: Pointer to the VOL-managed data for this datatype diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 2b1283e..06eb44e 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -2157,7 +2157,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_COMPOUND != dst->shared->type) + if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") if(H5T_conv_struct_init(src, dst, cdata) < 0) @@ -2385,7 +2385,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_COMPOUND != dst->shared->type) + if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ @@ -2648,14 +2648,14 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * that array are the index numbers in the destination type or negative * if the entry is unused. * - * (This optimized algorithm doesn't work when the byte orders are different. + * (This optimized algorithm doesn't work when the byte orders are different. * The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));" * can change the value significantly. i.g. if the source value is big-endian 0x0000000f, * executing the casting on little-endian machine will get a big number 0x0f000000. - * Then it can't meet the condition + * Then it can't meet the condition * "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)" - * Because this is the optimized code, we won't fix it. It should still work in some - * situations. SLU - 2011/5/24) + * Because this is the optimized code, we won't fix it. It should still work in some + * situations. SLU - 2011/5/24) */ if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { for(i = 0; i < src->shared->u.enumer.nmembs; i++) { @@ -2763,7 +2763,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_ENUM != dst->shared->type) + if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") if(H5T_conv_enum_init(src, dst, cdata) < 0) @@ -2790,7 +2790,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_ENUM != dst->shared->type) + if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") /* priv->src2dst map was computed for certain sort keys. Make sure those same @@ -2830,10 +2830,10 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Use O(1) lookup */ /* (The casting won't work when the byte orders are different. i.g. if the source value * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big - * number 0x0f000000 on little-endian machine. But we won't fix it because it's an + * number 0x0f000000 on little-endian machine. But we won't fix it because it's an * optimization code. Please also see the comment in the H5T_conv_enum_init() function. * SLU - 2011/5/24) - */ + */ if(1 == src->shared->size) n = *((signed char*)s); else if(sizeof(short) == src->shared->size) @@ -2912,9 +2912,9 @@ done: /*------------------------------------------------------------------------- * Function: H5T__conv_enum_numeric * - * Purpose: Converts enumerated data to a numeric type (integer or - * floating-point number). This function is registered into - * the conversion table twice in H5T_init_interface in H5T.c. + * Purpose: Converts enumerated data to a numeric type (integer or + * floating-point number). This function is registered into + * the conversion table twice in H5T_init_interface in H5T.c. * Once for enum-integer conversion. Once for enum-float conversion. * * Return: Success: Non-negative @@ -2966,7 +2966,7 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne if(NULL == (tpath = H5T_path_find(src_parent, dst))) { HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") } else if(!H5T_path_noop(tpath)) { - if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) + if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Convert the data */ @@ -3059,7 +3059,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_VLEN != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype") if(H5T_VLEN_STRING == src->shared->u.vlen.type && H5T_VLEN_STRING == dst->shared->u.vlen.type) { - if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset) + if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset) || (H5T_CSET_ASCII == dst->shared->u.vlen.cset && H5T_CSET_UTF8 == src->shared->u.vlen.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") } /* end if */ @@ -4701,7 +4701,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set") if(H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set") - if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) + if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || diff --git a/src/H5Torder.c b/src/H5Torder.c index 62662d6..b4babfa 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -86,7 +86,7 @@ static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order); * * Programmer: Robb Matzke * Wednesday, January 7, 1998 - * + * *------------------------------------------------------------------------- */ H5T_order_t @@ -159,7 +159,7 @@ H5T_get_order(const H5T_t *dtype) if(memb_order != H5T_ORDER_NONE && ret_value == H5T_ORDER_NONE) ret_value = memb_order; - /* If the orders are mixed, stop the loop and report it. + /* If the orders are mixed, stop the loop and report it. * (H5T_ORDER_NONE is ignored) */ if(memb_order != H5T_ORDER_NONE && ret_value != H5T_ORDER_NONE @@ -186,7 +186,7 @@ done: * 2. H5T_ORDER_NONE only works for reference and fixed-length * string. * 3. For opaque type, the order will be ignored. - * 4. For compound type, all restrictions above apply to the + * 4. For compound type, all restrictions above apply to the * members. * * Return: Non-negative on success/Negative on failure @@ -246,12 +246,12 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order) if(H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined") - /* For derived data type, defer to parent */ + /* For derived data type, defer to parent */ while(dtype->shared->parent) dtype = dtype->shared->parent; /* Check for setting order on inappropriate datatype */ - if(order == H5T_ORDER_NONE && !(H5T_REFERENCE == dtype->shared->type || + if(order == H5T_ORDER_NONE && !(H5T_REFERENCE == dtype->shared->type || H5T_OPAQUE == dtype->shared->type || H5T_IS_FIXED_STRING(dtype->shared))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "illegal byte order for type") @@ -16,7 +16,7 @@ * * These are used for various internal buffers which are shared. * - * The module used to be H5RC, but changed to H5UC because of + * The module used to be H5RC, but changed to H5UC because of * conflicting requirement for the use of H5RC. * */ diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index c451f31..e4916df 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -13,7 +13,7 @@ /* * This file contains private information about the H5UC module - * The module used to be H5RC, but changed to H5UC because of + * The module used to be H5RC, but changed to H5UC because of * conflicting requirement for the use of H5RC. */ diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c index e54c49f..16d3527 100644 --- a/src/H5VLnative_attr.c +++ b/src/H5VLnative_attr.c @@ -49,7 +49,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c { H5G_loc_t loc; /* Object location */ H5G_loc_t obj_loc; /* Location used to open group */ - hbool_t loc_found = FALSE; + hbool_t loc_found = FALSE; H5T_t *type, *dt; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ H5A_t *attr = NULL; @@ -89,7 +89,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_attr_create() */ @@ -106,7 +106,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, +H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Object location */ @@ -134,9 +134,9 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Aopen_by_idx */ /* Open the attribute in the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute") } /* end else-if */ @@ -279,15 +279,15 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, } else if(H5VL_OBJECT_BY_IDX == loc_params->type) { H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Open the attribute on the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") @@ -326,7 +326,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, else if(H5VL_OBJECT_BY_NAME == loc_params->type) { char *attr_name = HDva_arg(arguments, char *); H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -345,15 +345,15 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, } else if(H5VL_OBJECT_BY_IDX == loc_params->type) { H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Open the attribute on the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") @@ -400,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type, +H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index 8660e80..3f62e00 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -108,7 +108,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_dataset_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_dataset_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5D_t *dset = NULL; @@ -316,7 +316,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, +H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = (H5D_t *)obj; @@ -328,7 +328,7 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, /* H5Dspecific_space */ case H5VL_DATASET_SET_EXTENT: { /* H5Dset_extent (H5Dextend - deprecated) */ - const hsize_t *size = HDva_arg(arguments, const hsize_t *); + const hsize_t *size = HDva_arg(arguments, const hsize_t *); if(H5D__set_extent(dset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extent of dataset") diff --git a/src/H5VLnative_datatype.c b/src/H5VLnative_datatype.c index 3c9463d..1e9d739 100644 --- a/src/H5VLnative_datatype.c +++ b/src/H5VLnative_datatype.c @@ -112,7 +112,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t H5_ATTR_UNUSED tapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5T_t *type = NULL; /* Datatype opened in file */ @@ -147,7 +147,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, +H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; @@ -199,7 +199,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, +H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index 1f213dd..5275898 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -44,7 +44,7 @@ *------------------------------------------------------------------------- */ void * -H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, +H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; @@ -60,7 +60,7 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t flags |= H5F_ACC_EXCL; /* default */ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; - /* Create the file */ + /* Create the file */ if(NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") new_file->id_exists = TRUE; @@ -68,7 +68,7 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t ret_value = (void *)new_file; done: - if(NULL == ret_value && new_file) + if(NULL == ret_value && new_file) if(H5F__close(new_file) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") @@ -95,7 +95,7 @@ H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, FUNC_ENTER_PACKAGE - /* Open the file */ + /* Open the file */ if(NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") new_file->id_exists = TRUE; @@ -561,7 +561,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, uint32_t cur_num_entries; /* Go get the size data */ - if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, + if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, cur_size_ptr, &cur_num_entries) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_size() failed.") diff --git a/src/H5VLnative_group.c b/src/H5VLnative_group.c index 3fdb2d9..13864ab 100644 --- a/src/H5VLnative_group.c +++ b/src/H5VLnative_group.c @@ -65,7 +65,7 @@ H5VL__native_group_create(void *obj, const H5VL_loc_params_t *loc_params, const /* Create the new group & get its ID */ if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") } /* end if */ /* otherwise it's from H5Gcreate */ else { @@ -107,7 +107,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Location to open group */ @@ -216,7 +216,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, +H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_t *grp = (H5G_t *)obj; diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index 051de19..ceb8d61 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -75,7 +75,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, + if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ @@ -136,7 +136,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, +H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) @@ -161,8 +161,8 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, - dst_loc_p, loc_params2->loc_data.loc_by_name.name, + if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + dst_loc_p, loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link") @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, +H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) @@ -206,8 +206,8 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, - dst_loc_p, loc_params2->loc_data.loc_by_name.name, + if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + dst_loc_p, loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") @@ -226,7 +226,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, +H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; @@ -289,7 +289,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ if(H5L_get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, buf, size) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") } else HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") @@ -316,7 +316,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type, +H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 3a29b6c..8f60ac4 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -41,7 +41,7 @@ *------------------------------------------------------------------------- */ void * -H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, +H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; @@ -104,15 +104,15 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, - void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name, +herr_t +H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, + void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t src_loc; /* Source object group location */ H5G_loc_t dst_loc; /* Destination group location */ herr_t ret_value = FAIL; - + FUNC_ENTER_PACKAGE /* get location for objects */ @@ -123,7 +123,7 @@ H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, co /* Copy the object */ if((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") done: FUNC_LEAVE_NOAPI(ret_value) @@ -140,7 +140,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, +H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ @@ -300,7 +300,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type, +H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; @@ -579,7 +579,7 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, } default: - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't perform this operation on object"); + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't perform this operation on object"); } /* end switch */ done: diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 7c3c31e..c8df035 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -21,7 +21,6 @@ #include "H5public.h" /* Generic Functions */ #include "H5Ipublic.h" /* IDs */ - /*****************/ /* Public Macros */ /*****************/ @@ -72,7 +71,6 @@ H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name/*out*/, size_t size); H5_DLL herr_t H5VLclose(hid_t connector_id); H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); - #ifdef __cplusplus } #endif @@ -1227,7 +1227,7 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, /* Defer to H5VM_chunk_index_scaled */ chunk_idx = H5VM_chunk_index_scaled(ndims, coord, chunk, down_nchunks, scaled_coord); - + FUNC_LEAVE_NOAPI(chunk_idx) } /* end H5VM_chunk_index() */ diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 34fdfec..6d7b87e 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -26,7 +26,7 @@ #ifdef H5_HAVE_FILTER_DEFLATE -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 2f79725..8c0e876 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -751,7 +751,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, H5_CHECK_OVERFLOW(dtype_member_offset, size_t, unsigned); H5_CHECK_OVERFLOW(dtype_next_member_offset, size_t, unsigned); cd_values[(*cd_values_index)++] = (unsigned)dtype_next_member_offset - (unsigned)dtype_member_offset; - } + } break; case H5T_TIME: diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 6d07513..dfc984a 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -105,10 +105,10 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree); static void H5Z_print(H5Z_node *tree, FILE *stream); #endif /* H5Z_XFORM_DEBUG */ -/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before +/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: * *p = *p OP tree_val; p++; - * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19) + * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19) */ #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ @@ -328,9 +328,9 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ } -/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. - * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, - * these two macros are called in different ways. (SLU 2012/3/20) +/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. + * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * these two macros are called in different ways. (SLU 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ { \ @@ -1229,15 +1229,15 @@ H5Z_xform_find_type(const H5T_t* type) HDassert(type); /* Check for SHORT type */ - if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) + if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SHORT) /* Check for INT type */ - else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_INT) /* Check for LONG type */ - else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LONG) /* Check for LONGLONG type */ @@ -1370,7 +1370,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_op_is_numbs - * Purpose: Internal function to facilitate the condition check in + * Purpose: Internal function to facilitate the condition check in * H5Z_xform_reduce_tree to reduce the bulkiness of the code. * Return: TRUE or FALSE * Programmer: Raymond Lu @@ -1397,7 +1397,7 @@ H5Z_op_is_numbs(H5Z_node* _tree) /*------------------------------------------------------------------------- * Function: H5Z_op_is_numbs2 - * Purpose: Internal function to facilitate the condition check in + * Purpose: Internal function to facilitate the condition check in * H5Z_xform_reduce_tree to reduce the bulkiness of the code. * The difference from H5Z_op_is_numbs is that the left child * can be empty, like -x or +x. diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index fd67184..5f8de34 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -35,13 +35,14 @@ static const char *FileHeader = "\n\ #include <stdio.h> #include <time.h> #include "H5private.h" + /* Do NOT use HDfprintf in this file as it is not linked with the library, * which contains the H5system.c file in which the function is defined. */ #define LIBSETTINGSFNAME "libhdf5.settings" -FILE *rawoutstream = NULL; +FILE *rawoutstream = NULL; /*------------------------------------------------------------------------- @@ -216,6 +217,7 @@ information about the library build configuration\n"; HDfputc('\n', rawoutstream); } /* end if */ fprintf(rawoutstream, " *\n * Purpose:\t\t"); + for(s = purpose; *s; s++) { HDfputc(*s, rawoutstream); if('\n' == *s && s[1]) diff --git a/src/H5mpi.c b/src/H5mpi.c index d9f161c..0f8b554 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -124,7 +124,7 @@ H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new) */ if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN))) HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) - + } /* Copy the new communicator to the return argument */ @@ -138,7 +138,7 @@ done: } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5_mpi_comm_dup() */ +} /* end H5_mpi_comm_dup() */ /*------------------------------------------------------------------------- @@ -191,7 +191,7 @@ done: } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5_mpi_info_dup() */ +} /* end H5_mpi_info_dup() */ /*------------------------------------------------------------------------- diff --git a/src/H5system.c b/src/H5system.c index dd1f10d..ca0c6bf 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -422,7 +422,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) H5O_token_t token = HDva_arg(ap, H5O_token_t); /* Print the raw token. */ - n = fprintf(stream, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", + n = fprintf(stream, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", (unsigned char)token.__data[15], (unsigned char)token.__data[14], (unsigned char)token.__data[13], diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt index e29944a..18d4927 100644 --- a/test/SWMR_UseCase_UG.txt +++ b/test/SWMR_UseCase_UG.txt @@ -11,7 +11,7 @@ %%%%Use Case 1.7%%%% - + 3. Use Case [1.7]: Appending a single chunk diff --git a/test/accum.c b/test/accum.c index f7d02fd..548a04d 100644 --- a/test/accum.c +++ b/test/accum.c @@ -77,12 +77,12 @@ void accum_printf(const H5F_t *f); /*------------------------------------------------------------------------- * Function: main - * + * * Purpose: Test the metadata accumulator code - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -157,7 +157,7 @@ main(void) return 0; -error: +error: if(api_ctx_pushed) H5CX_pop(); HDputs("*** TESTS FAILED ***"); @@ -171,12 +171,12 @@ error: /*------------------------------------------------------------------------- * Function: test_write_read - * + * * Purpose: Simple test to write to then read from metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -222,17 +222,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_write_read_nonacc_front - * + * * Purpose: Simple test to write to then read from before metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -281,17 +281,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_write_read_nonacc_end - * + * * Purpose: Simple test to write to then read from after metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -340,17 +340,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_free * * Purpose: Simple test to free metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Raymond Lu * October 8, 2010 * @@ -366,7 +366,7 @@ test_free(H5F_t *f) TESTING("simple freeing metadata accumulator"); - /* Write and free the whole accumulator. */ + /* Write and free the whole accumulator. */ wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); HDassert(wbuf); rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); @@ -388,12 +388,12 @@ test_free(H5F_t *f) /* Write second quarter of the accumulator */ if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; - /* Free the second quarter of the accumulator, the requested area + /* Free the second quarter of the accumulator, the requested area * is bigger than the data region on the right side. */ if(accum_free(f, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; - /* Write half of the accumulator. */ + /* Write half of the accumulator. */ if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the first block of 4B */ @@ -525,19 +525,19 @@ error: HDfree(expect); return 1; -} /* test_free */ +} /* test_free */ /*------------------------------------------------------------------------- * Function: test_accum_overlap - * + * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of overlapping * the writes in various different ways. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -629,9 +629,9 @@ test_accum_overlap(H5F_t *f) if(accum_write(96, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; if(accum_read(96, 3 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0) TEST_ERROR; - + /* Set up expected data buffer and verify contents of - accumulator as constructed by cases 1-8, above */ + accumulator as constructed by cases 1-8, above */ for(i = 0; i < 5; i++) wbuf[i] = 4; for(i = 5; i < 6; i++) @@ -881,14 +881,14 @@ error: /*------------------------------------------------------------------------- * Function: test_accum_non_overlap_size - * + * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of not overlapping * the writes with a data size larger then the accum size. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -950,7 +950,7 @@ error: * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of overlapping - * the writes with a data size completely overlapping + * the writes with a data size completely overlapping * the accumulator at both ends. * * Return: Success: SUCCEED @@ -1015,25 +1015,25 @@ error: /*------------------------------------------------------------------------- * Function: test_accum_adjust - * + * * Purpose: This test examines the various ways the accumulator might * adjust itself as a result of data appending or prepending * to it. * - * This test program covers all the code in H5F_accum_adjust, + * This test program covers all the code in H5F_accum_adjust, * but NOT all possible paths through said code. It only covers * six potential paths through the function. (Again, though, each * piece of code within an if/else statement in H5F_accum_adjust is - * covered by one of the paths in this test function). Since there - * are a ridiculous number of total possible paths through this + * covered by one of the paths in this test function). Since there + * are a ridiculous number of total possible paths through this * function due to its large number of embedded if/else statements, - * that's certainly a lot of different test cases to write by hand. - * (Though if someone comes across this code and has some free + * that's certainly a lot of different test cases to write by hand. + * (Though if someone comes across this code and has some free * time, go for it). - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 11, 2010 * @@ -1068,7 +1068,7 @@ test_accum_adjust(H5F_t *f) * an increase in size because it's already at it's maximum size */ if(accum_write((1024 * 1024), (1024 * 1024) - 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Write a small (1KB) block that prepends to the front of the accumulator. */ + /* Write a small (1KB) block that prepends to the front of the accumulator. */ /* ==> Accumulator will need more buffer space */ /* ==> Accumulator will try to resize, but see that it's getting too big */ /* ==> Size of new block is less than half maximum size of accumulator */ @@ -1084,7 +1084,7 @@ test_accum_adjust(H5F_t *f) /* Read back and verify second write */ if(accum_read((1024 * 1024) - 1024, 1024, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; - + /* Reset accumulator for next case */ if(accum_reset(f) < 0) FAIL_STACK_ERROR; @@ -1144,7 +1144,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 1, 1024, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; @@ -1175,7 +1175,7 @@ test_accum_adjust(H5F_t *f) /* ==> Size of new block is less than than half maximum size of accumulator */ /* ==> New block being appended to accumulator */ /* ==> We can slide the dirty region down, to accomodate the request */ - /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */ + /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */ /* ==> Need to adjust location of accumulator while appending */ /* ==> Accumulator will need to be reallocated */ if(accum_write(1048571, 349523, wbuf) < 0) FAIL_STACK_ERROR; @@ -1184,7 +1184,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; @@ -1213,7 +1213,7 @@ test_accum_adjust(H5F_t *f) /* ==> Size of new block is less than than half maximum size of accumulator */ /* ==> New block being appended to accumulator */ /* ==> We can slide the dirty region down, to accomodate the request */ - /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */ + /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */ /* ==> Need to adjust location of accumulator while appending */ if(accum_write((1024 * 1024) - 5, 10, wbuf) < 0) FAIL_STACK_ERROR; @@ -1221,7 +1221,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 5, 10, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR; @@ -1253,7 +1253,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; @@ -1279,23 +1279,23 @@ error: /*------------------------------------------------------------------------- * Function: test_read_after - * - * Purpose: This test will verify the case when metadata is read partly - * from the accumulator and partly from disk. The test will + * + * Purpose: This test will verify the case when metadata is read partly + * from the accumulator and partly from disk. The test will * write a block of data at address 512, force the data to be - * written to disk, write new data partially overlapping the - * original block from below, then read data at address 512. - * The data read should be partly new and partly original. - * + * written to disk, write new data partially overlapping the + * original block from below, then read data at address 512. + * The data read should be partly new and partly original. + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Larry Knox * October 8, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_read_after(H5F_t *f) { int i = 0; @@ -1329,14 +1329,14 @@ test_read_after(H5F_t *f) of the original block */ if(accum_write(256, 512, wbuf) < 0) FAIL_STACK_ERROR; - /* Read 128 bytes at the original address, and then */ + /* Read 128 bytes at the original address, and then */ if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; - /* Set the second half of wbuf back to 1s */ + /* Set the second half of wbuf back to 1s */ for(i = 64; i < s; i++) wbuf[i] = 1; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR; @@ -1362,19 +1362,19 @@ error: /*------------------------------------------------------------------------- * Function: test_big - * + * * Purpose: This test exercises writing large pieces of metadata to the * file. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Quincey Koziol * October 12, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_big(H5F_t *f) { uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */ @@ -1670,19 +1670,19 @@ error: /*------------------------------------------------------------------------- * Function: test_random_write - * + * * Purpose: This test writes random pieces of data to the file and * then reads it all back. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Quincey Koziol * October 11, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_random_write(H5F_t *f) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ @@ -1808,23 +1808,23 @@ error: /*------------------------------------------------------------------------- * Function: test_swmr_write_big - * + * * Purpose: A SWMR test: verifies that writing "large" metadata to a file - * opened with SWMR_WRITE will flush the existing metadata in the + * opened with SWMR_WRITE will flush the existing metadata in the * accumulator to disk first before writing the "large" metadata - * to disk. + * to disk. * This test will fork and exec a reader "accum_swmr_reader" which * opens the same file with SWMR_READ and verifies that the correct * metadata is read from disk. - * + * * Return: Success: 0 * Failure: 1 - * + * * Programmer: Vailin Choi; April 2013 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_swmr_write_big(hbool_t newest_format) { hid_t fid = -1; /* File ID */ @@ -1991,11 +1991,11 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Close and remove the file */ - if(H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; /* Close the property list */ - if(H5Pclose(fapl) < 0) + if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; /* Pop API context */ @@ -2034,12 +2034,12 @@ error: /*------------------------------------------------------------------------- * Function: accum_printf - * + * * Purpose: Debug function to print some stats about the accumulator - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index ac48a13..c3be09a 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -33,15 +33,15 @@ const char *FILENAME[] = { /*------------------------------------------------------------------------- * Function: main - * - * Purpose: This is the reader forked/execved by "test_swmr_write_big()" + * + * Purpose: This is the reader forked/execved by "test_swmr_write_big()" * test in accum.c. The reader reads at address 1024 from the file * and verifies that the metadata in the accumulator at address * 1024 does get written to disk. - * + * * Return: Success: EXIT_SUCCESS * Failure: EXIT_FAILURE - * + * * Programmer: Vailin Choi; June 2013 * *------------------------------------------------------------------------- @@ -85,7 +85,7 @@ main(void) api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ - if(NULL == (f = (H5F_t *)H5VL_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* Should read in [1024, 2024] with buf data */ @@ -93,7 +93,7 @@ main(void) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(buf, rbuf, (size_t)1024) != 0) + if(HDmemcmp(buf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* CLose the file */ @@ -69,7 +69,7 @@ # define GB8LL 0 /*cannot do the test*/ #endif -/* Define Small, Large, Extra Large, Huge File which +/* Define Small, Large, Extra Large, Huge File which * corrspond to less than 2GB, 2GB, 4GB, and tens of GB file size. * NO_FILE stands for "no file" to be tested. */ @@ -633,7 +633,7 @@ error: return 1; } /* end test_sec2() */ -static int +static int test_stdio(hid_t fapl) { char filename[1024]; diff --git a/test/cache_common.c b/test/cache_common.c index 038a0ed..1dc13a1 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -724,7 +724,7 @@ variable_get_final_load_size(const void *image, size_t image_len, */ static htri_t -verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, +verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; diff --git a/test/cache_image.c b/test/cache_image.c index 9f8c4c5..59689a9 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -15,7 +15,7 @@ * 7/13/15 * * This file contains tests specific to the cache image - * feature implemented in H5C.c + * feature implemented in H5C.c */ #include "cache_common.h" #include "genall5.h" diff --git a/test/cross_read.c b/test/cross_read.c index 5444aae..c16ddbc 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -213,7 +213,7 @@ error: * Purpose: Handle each dataset from the data file. * * Return: Success: 0 - * Failure: Number of failures + * Failure: Number of failures * * Programmer: Raymond Lu * 21 January 2011 @@ -242,46 +242,46 @@ check_file(char *filename) TESTING("dataset of LE FLOAT with scale-offset filter"); nerrors += check_data_f(DATASETNAME2, fid); - + TESTING("dataset of BE FLOAT with scale-offset filter"); nerrors += check_data_f(DATASETNAME3, fid); TESTING("dataset of LE DOUBLE with scale-offset filter"); nerrors += check_data_f(DATASETNAME4, fid); - + TESTING("dataset of BE DOUBLE with scale-offset filter"); nerrors += check_data_f(DATASETNAME5, fid); - + TESTING("dataset of LE CHAR with scale-offset filter"); nerrors += check_data_i(DATASETNAME6, fid); - + TESTING("dataset of BE CHAR with scale-offset filter"); nerrors += check_data_i(DATASETNAME7, fid); - + TESTING("dataset of LE SHORT with scale-offset filter"); nerrors += check_data_i(DATASETNAME8, fid); - + TESTING("dataset of BE SHORT with scale-offset filter"); nerrors += check_data_i(DATASETNAME9, fid); TESTING("dataset of LE INT with scale-offset filter"); nerrors += check_data_i(DATASETNAME10, fid); - + TESTING("dataset of BE INT with scale-offset filter"); nerrors += check_data_i(DATASETNAME11, fid); TESTING("dataset of LE LONG LONG with scale-offset filter"); nerrors += check_data_i(DATASETNAME12, fid); - + TESTING("dataset of BE LONG LONG with scale-offset filter"); nerrors += check_data_i(DATASETNAME13, fid); TESTING("dataset of LE FLOAT with Fletcher32 filter"); nerrors += check_data_f(DATASETNAME14, fid); - + TESTING("dataset of BE FLOAT with Fletcher32 filter"); nerrors += check_data_f(DATASETNAME15, fid); - + TESTING("dataset of LE FLOAT with Deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE nerrors += check_data_f(DATASETNAME16, fid); diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index ada7a6f..4c1efae 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -13,7 +13,7 @@ /* * Purpose: Test to verify that the infinite loop closing library/abort failure - * is fixed when the application creates and removes dense attributes + * is fixed when the application creates and removes dense attributes * (See HDFFV-10659). */ @@ -22,7 +22,7 @@ /* The test file name */ const char *FILENAME[] = { - "del_many_dense_attrs", + "del_many_dense_attrs", NULL }; @@ -49,7 +49,7 @@ static void catch_signal(int H5_ATTR_UNUSED signo) * Function: main * * Purpose: Test to verify that the infinite loop closing library/abort failure - * is fixed when the application creates and removes dense attributes + * is fixed when the application creates and removes dense attributes * (See HDFFV-10659). * * Return: Success: exit(EXIT_SUCCESS) @@ -137,7 +137,7 @@ main(void) if(H5Aclose(aid) < 0) TEST_ERROR } - + /* Close the datatype */ if(H5Tclose(tid) < 0) TEST_ERROR @@ -630,7 +630,7 @@ test_graph_nocycle(void) /* Test 3: Simple "inverted" tree. Two parent files share a child file, * which has its own child file. Verify that the child's child is not * closed until both parents' EFCs are released. First release through one - * parent, then reopen through that parent and release the other, then + * parent, then reopen through that parent and release the other, then * re-release the first parent. */ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) @@ -861,7 +861,7 @@ test_graph_cycle(void) /* Test 1: File caches itself. Verify that closing the file causes it to be - * actually closed, and there is no other unexpected behavior. + * actually closed, and there is no other unexpected behavior. */ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) @@ -2942,7 +2942,8 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); /* Pop API context */ - if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + if(api_ctx_pushed && H5CX_pop() < 0) + FAIL_STACK_ERROR api_ctx_pushed = FALSE; if(nerrors) diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c index 15c7391..f54f675 100644 --- a/test/enc_dec_plist_cross_platform.c +++ b/test/enc_dec_plist_cross_platform.c @@ -157,7 +157,7 @@ error: } static int -test_plists(const char *filename_prefix) +test_plists(const char *filename_prefix) { unsigned config_1, config_2; int fd_1, fd_2; diff --git a/test/enum.c b/test/enum.c index 26e64fd..109f7c3 100644 --- a/test/enum.c +++ b/test/enum.c @@ -128,7 +128,7 @@ test_conv(hid_t file) { hid_t cwg=-1, type=-1, space=-1, dset=-1; c_e1 val; - /* Some values are out of range for testing. The library should accept them */ + /* Some values are out of range for testing. The library should accept them */ static c_e1 data1[]={E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE, E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED, E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE, diff --git a/test/evict_on_close.c b/test/evict_on_close.c index b7d30a9..9f6607a 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -744,7 +744,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) TEST_ERROR; /* Record the number of cache entries */ - during = file_ptr->shared->cache->index_len; + during = file_ptr->shared->cache->index_len; #ifdef EOC_MANUAL_INSPECTION HDprintf("\nCACHE AFTER DATA READ (WHILE OPEN):\n"); diff --git a/test/extend.c b/test/extend.c index a31ac0e..59b4eff 100644 --- a/test/extend.c +++ b/test/extend.c @@ -63,7 +63,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me /* Write the data */ for(i = 0; i < 5; i++) - for(j = 0; j < 5; j++) { + for(j = 0; j < 5; j++) { /* Extend the dataset */ offset[0] = (hsize_t)(i * NX); @@ -78,20 +78,20 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me if(H5Dset_extent(dataset, max_size) < 0) TEST_ERROR; } /* end if */ - /* Select a hyperslab */ + /* Select a hyperslab */ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; - if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; /* Write to the hyperslab */ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR; if(H5Sclose(file_space) < 0) TEST_ERROR; - } /* end for */ + } /* end for */ /* Read the data */ if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR; if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; for(i = 0; i < 10; i++) { - for(j = 0; j < 10; j++) { + for(j = 0; j < 10; j++) { /* Select a hyperslab */ offset[0] = (hsize_t)(i * (NX / 2)); @@ -113,7 +113,6 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me } /* end for */ } /* end for */ - /* Cleanup */ if(H5Dclose(dataset) < 0) TEST_ERROR; if(H5Sclose(file_space) < 0) TEST_ERROR; @@ -159,7 +158,7 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h /* Write the data */ for(i = 0; i < 5; i++) - for(j = 0; j < 5; j++) { + for(j = 0; j < 5; j++) { /* Extend the dataset */ offset[0] = (hsize_t)(i * NX); @@ -168,20 +167,20 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h size[1] = offset[1] + NY; if(H5Dextend(dataset, size) < 0) TEST_ERROR; - /* Select a hyperslab */ + /* Select a hyperslab */ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; - if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; /* Write to the hyperslab */ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR; if(H5Sclose(file_space) < 0) TEST_ERROR; - } /* end for */ + } /* end for */ /* Read the data */ if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR; if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; for(i = 0; i < 10; i++) { - for(j = 0; j < 10; j++) { + for(j = 0; j < 10; j++) { /* Select a hyperslab */ offset[0] = (hsize_t)(i * (NX / 2)); diff --git a/test/external.c b/test/external.c index 4d9fef0..d29fb6b 100644 --- a/test/external.c +++ b/test/external.c @@ -1418,7 +1418,7 @@ main(void) nerrors += test_path_absolute(current_fapl_id); nerrors += test_path_relative(current_fapl_id); nerrors += test_path_relative_cwd(current_fapl_id); - + /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(EXT_FNAME, current_fapl_id) < 0 ? 1 : 0); diff --git a/test/external_common.c b/test/external_common.c index c9b6584..a9e600b 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -65,7 +65,7 @@ reset_raw_data_files(hbool_t is_env) HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1); if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; - + /* Write garbage data to the file. This allows us to test the * the ability to set an offset in the raw data file. */ @@ -102,7 +102,7 @@ reset_raw_data_files(hbool_t is_env) HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1); if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; - + /* Write garbage data to the file. This allows us to test the * the ability to set an offset in the raw data file. */ diff --git a/test/farray.c b/test/farray.c index d6610f2..e73a4b4 100644 --- a/test/farray.c +++ b/test/farray.c @@ -143,7 +143,7 @@ init_cparam(H5FA_create_t *cparam, farray_test_param_t *tparam) * Purpose: Create file and retrieve pointer to internal file object * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t @@ -262,7 +262,7 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state) *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id, +reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id, H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam) { /* Check for closing & re-opening the array */ diff --git a/test/fheap.c b/test/fheap.c index c907e09..d4164a2 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -82,7 +82,7 @@ /* The number of settings for testing: page buffering, file space strategy and persisting free-space */ #define NUM_PB_FS 6 -#define PAGE_BUFFER_PAGE_SIZE 4096 +#define PAGE_BUFFER_PAGE_SIZE 4096 const char *FILENAME[] = { "fheap", diff --git a/test/file_image.c b/test/file_image.c index dfb3ae8..0d4873a 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -88,16 +88,16 @@ test_properties(void) hid_t fapl_1 = -1; hid_t fapl_2 = -1; char *buffer = 0; - int count = 10; + int count = 10; void *temp = 0; char *temp2 = 0; - int i; + int i; size_t size; size_t temp_size; int retval = 1; TESTING("File image property list functions"); - + /* Initialize file image buffer * * Note: this image will not contain a valid HDF5 file, as it complicates testing @@ -122,7 +122,7 @@ test_properties(void) /* Set file image stuff */ if(H5Pset_file_image(fapl_1, (void *)buffer, size) < 0) FAIL_STACK_ERROR - + /* Get the same */ if(H5Pget_file_image(fapl_1, (void **)&temp, &temp_size) < 0) FAIL_STACK_ERROR @@ -137,9 +137,9 @@ test_properties(void) /* Get values from the new fapl */ if(H5Pget_file_image(fapl_2, (void **)&temp2, &temp_size) < 0) FAIL_STACK_ERROR - + /* Check that sizes are the same, and that the buffers are identical but separate */ - VERIFY(temp_size == size,"Sizes of buffers don't match"); + VERIFY(temp_size == size,"Sizes of buffers don't match"); VERIFY(temp2 != NULL,"Recieved buffer not set"); VERIFY(temp2 != buffer, "Retrieved buffer is the same as original"); VERIFY(temp2 != temp, "Retrieved buffer is the same as previously retrieved buffer"); @@ -334,7 +334,7 @@ reset_udata(udata_t *u) static int test_callbacks(void) { - H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; H5FD_file_image_callbacks_t callbacks; @@ -388,9 +388,9 @@ test_callbacks(void) /* Get file image callbacks */ callbacks = null_callbacks; if(H5Pget_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR - + /* Verify values */ - VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly"); + VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly"); VERIFY(callbacks.image_memcpy == &memcpy_cb, "memcpy callback was not set or retrieved properly"); VERIFY(callbacks.image_realloc == &realloc_cb, "realloc callback was not set or retrieved properly"); VERIFY(callbacks.image_free == &free_cb, "free callback was not set or retrieved properly"); @@ -398,7 +398,7 @@ test_callbacks(void) VERIFY(callbacks.udata_free == &udata_free_cb, "udata free callback was not set or retrieved properly"); VERIFY(callbacks.udata == udata, "udata was not set or retrieved properly"); - + /* * Check callbacks in internal function without a previously set file image */ @@ -406,7 +406,7 @@ test_callbacks(void) /* Copy fapl */ reset_udata(udata); if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Verify that the property's copy callback used the correct image callbacks */ VERIFY(udata->used_callbacks == (UDATA_COPY), "Copying a fapl with no image used incorrect callbacks"); @@ -419,14 +419,14 @@ test_callbacks(void) /* Copy again */ if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Remove property from fapl */ reset_udata(udata); if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR /* Verify that the property's delete callback was called using the correct image callbacks */ VERIFY(udata->used_callbacks == (UDATA_FREE), "Removing a property from a fapl with no image used incorrect callbacks"); - + /* Close it again */ if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR @@ -442,15 +442,15 @@ test_callbacks(void) if(H5Pset_file_image(fapl_1, (void *)file_image, size) < 0) FAIL_STACK_ERROR VERIFY(udata->used_callbacks == (MALLOC | MEMCPY), "Setting a file image (first time) used incorrect callbacks"); - + /* * Check callbacks in internal functions with a previously set file image */ - + /* Copy fapl */ reset_udata(udata); if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Verify that the property's copy callback used the correct image callbacks */ VERIFY(udata->used_callbacks == (MALLOC | MEMCPY | UDATA_COPY), "Copying a fapl with an image used incorrect callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, "malloc callback has wrong source"); @@ -466,7 +466,7 @@ test_callbacks(void) /* Copy again */ if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Remove property from fapl */ reset_udata(udata); if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR @@ -474,11 +474,11 @@ test_callbacks(void) /* Verify that the property's delete callback was called using the correct image callbacks */ VERIFY(udata->used_callbacks == (FREE | UDATA_FREE), "Removing a property from a fapl with an image used incorrect callbacks"); VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, "free callback has wrong source"); - + /* Close it again */ if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR - /* Get file image */ + /* Get file image */ reset_udata(udata); if(H5Pget_file_image(fapl_1, (void **)&temp_file_image, &temp_size) < 0) FAIL_STACK_ERROR @@ -538,11 +538,11 @@ test_core(void) int fd; h5_stat_t sb; herr_t ret; - H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; TESTING("Initial file image and callbacks in Core VFD"); - + /* Create fapl */ fapl = h5_fileaccess(); VERIFY(fapl >= 0, "fapl creation failed"); @@ -579,7 +579,7 @@ test_core(void) reset_udata(udata); file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl); VERIFY(file >= 0, "H5Fopen failed"); - VERIFY((udata->used_callbacks == MALLOC) || + VERIFY((udata->used_callbacks == MALLOC) || (udata->used_callbacks == (MALLOC | UDATA_COPY | UDATA_FREE)), "opening a core file used the wrong callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open"); @@ -599,24 +599,24 @@ test_core(void) dims[1] = DIM1; space = H5Screate_simple(RANK, dims, dims); VERIFY(space >= 0, "H5Screate failed"); - + /* Create new dset, invoking H5FD_core_write */ reset_udata(udata); dset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset >=0, "H5Dcreate failed"); - + /* Flush the write and check the realloc callback */ ret = H5Fflush(file, H5F_SCOPE_LOCAL); VERIFY(ret >= 0, "H5Fflush failed"); VERIFY(udata->used_callbacks == (REALLOC), "core write used the wrong callbacks"); VERIFY(udata->realloc_src == H5FD_FILE_IMAGE_OP_FILE_RESIZE, "Realloc callback came from wrong source in core write"); - + /* Close dset and space */ ret = H5Dclose(dset); VERIFY(ret >= 0, "H5Dclose failed"); ret = H5Sclose(space); VERIFY(ret >= 0, "H5Sclose failed"); - + /* Test file close */ reset_udata(udata); ret = H5Fclose(file); @@ -644,11 +644,11 @@ test_core(void) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ - h5_clean_files(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfree(udata); HDfree(file_image); HDremove(copied_filename); - + PASSED(); return 0; @@ -718,7 +718,7 @@ test_get_file_image(const char * test_banner, if(driver == H5FD_FAMILY) is_family_file = TRUE; - + /* setup the file name */ h5_fixname(FILENAME2[file_name_num], fapl, file_name, sizeof(file_name)); VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); @@ -741,7 +741,7 @@ test_get_file_image(const char * test_banner, VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); @@ -750,7 +750,7 @@ test_get_file_image(const char * test_banner, data[i] = i; err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -768,7 +768,7 @@ test_get_file_image(const char * test_banner, VERIFY(bytes_read == image_size, "H5Fget_file_image(2) failed."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -860,8 +860,8 @@ test_get_file_image(const char * test_banner, file_size -= USERBLOCK_SIZE; } - /* with latest mods to truncate call in core file drive, - * file size should match image size + /* with latest mods to truncate call in core file drive, + * file size should match image size */ VERIFY(file_size == image_size, "file size != image size."); @@ -931,13 +931,13 @@ test_get_file_image(const char * test_banner, h5_clean_files(FILENAME2, fapl); /* discard the image buffer if it exists */ - if(image_ptr != NULL) + if(image_ptr != NULL) HDfree(image_ptr); /* discard the image buffer if it exists */ - if(file_image_ptr != NULL) + if(file_image_ptr != NULL) HDfree(file_image_ptr); - + PASSED(); return 0; @@ -986,10 +986,10 @@ test_get_file_image_error_rejection(void) TESTING("H5Fget_file_image() error rejection"); /************************ Sub-Test #1 ********************************/ - /* set up a test file, and try to get its image with a buffer that is + /* set up a test file, and try to get its image with a buffer that is * too small. Call to H5Fget_file_image() should fail. * - * Since we have already done the necessary setup, verify that + * Since we have already done the necessary setup, verify that * H5Fget_file_image() will fail with: * * bad file id, or @@ -1020,17 +1020,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1066,7 +1066,7 @@ test_get_file_image_error_rejection(void) VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1079,11 +1079,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /* discard the image buffer if it exists */ - if(image_ptr != NULL) + if(image_ptr != NULL) HDfree(image_ptr); /************************** Test #2 **********************************/ - /* set up a multi file driver test file, and try to get its image + /* set up a multi file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ @@ -1130,7 +1130,7 @@ test_get_file_image_error_rejection(void) VERIFY(fapl_id >= 0, "H5Pcreate(2) failed"); /* setup the fapl for the multi file driver */ - err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name, + err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name, memb_addr, FALSE); VERIFY(err >= 0, "H5Pset_fapl_multi failed"); @@ -1149,17 +1149,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1171,7 +1171,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1184,11 +1184,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /************************** Test #3 **********************************/ - /* set up a split file driver test file, and try to get its image + /* set up a split file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ - /* create fapl */ + /* create fapl */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); @@ -1211,17 +1211,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1233,7 +1233,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1246,11 +1246,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /************************** Test #4 **********************************/ - /* set up a family file driver test file, and try to get its image + /* set up a family file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ - /* create fapl */ + /* create fapl */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); @@ -1271,17 +1271,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1293,7 +1293,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1304,7 +1304,7 @@ test_get_file_image_error_rejection(void) /* tidy up */ h5_clean_files(FILENAME2, fapl_id); - + PASSED(); return 0; @@ -1362,14 +1362,14 @@ main(void) } /* end for */ #if 0 - /* at present, H5Fget_file_image() rejects files opened with the + /* at present, H5Fget_file_image() rejects files opened with the * family file driver, due to the addition of a driver info message * in the super block. This message prevents the image being opened - * with any driver other than the family file driver, which sort of + * with any driver other than the family file driver, which sort of * defeats the purpose of the get file image operation. * * While this issues is quite fixable, we don't have time or resources - * for this right now. Once we do, the following code should be + * for this right now. Once we do, the following code should be * suitable for testing the fix. */ /* test H5Fget_file_image() with family file driver */ @@ -1386,10 +1386,10 @@ main(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - if(errors) { - HDprintf("***** %d File Image TEST%s FAILED! *****\n", - errors, errors > 1 ? "S" : ""); - return 1; + if(errors) { + HDprintf("***** %d File Image TEST%s FAILED! *****\n", + errors, errors > 1 ? "S" : ""); + return 1; } HDprintf("All File Image tests passed.\n"); diff --git a/test/filter_fail.c b/test/filter_fail.c index 4be2547..e5187be 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -50,8 +50,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{ /*------------------------------------------------------------------------- * Function: filter_fail * - * Purpose: For testing library's behavior when a mandatory filter - * fails to write a chunk. + * Purpose: For testing library's behavior when a mandatory filter + * fails to write a chunk. * * Return: Success: Data chunk size * Failure: 0 @@ -74,7 +74,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, ret_value = nbytes; } /* end if */ else { /* Write data */ - /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */ + /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */ if(*dst == 8 || *dst == 9) { ret_value = 0; } else { @@ -90,14 +90,14 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, /*------------------------------------------------------------------------- * Function: test_filter_write_failure * - * Purpose: Tests the library's behavior when a mandate filter returns + * Purpose: Tests the library's behavior when a mandate filter returns * failure. There're only 5 chunks with each of them having - * 2 integers. The filter will fail in the last chunk. The - * dataset should release all resources even though the last + * 2 integers. The filter will fail in the last chunk. The + * dataset should release all resources even though the last * chunk can't be flushed to file. The file should close * successfully. * - * Return: + * Return: * Success: 0 * Failure: -1 * @@ -107,7 +107,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, * Modifications: * Raymond Lu * 5 Oct 2010 - * Test when the chunk cache is enable and disabled to make + * Test when the chunk cache is enable and disabled to make * sure the library behaves properly. *------------------------------------------------------------------------- */ @@ -151,7 +151,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) TEST_ERROR /* create a dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* Initialize the write buffer */ for(i = 0; i < DIM; i++) @@ -160,7 +160,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) /* Write data. If the chunk cache is enabled, H5Dwrite should succeed. If it is * diabled, H5Dwrite should fail. */ if(cache_enabled) { - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) TEST_ERROR } else { /* Data writing should fail */ @@ -194,7 +194,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) TEST_ERROR } - /* Even though H5Dclose or H5Dwrite fails, it should release all resources. + /* Even though H5Dclose or H5Dwrite fails, it should release all resources. * So the file should close successfully. */ if(H5Fclose (file) < 0) TEST_ERROR @@ -215,11 +215,11 @@ error: /*------------------------------------------------------------------------- * Function: test_filter_read * - * Purpose: Tests the library's behavior when a mandate filter returns - * failure. The first 4 chunks should be in the file. The + * Purpose: Tests the library's behavior when a mandate filter returns + * failure. The first 4 chunks should be in the file. The * last chunk should not. * - * Return: + * Return: * Success: 0 * Failure: -1 * @@ -305,7 +305,7 @@ test_filter_read(char *file_name, hid_t my_fapl) if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR - /* Check that the values read are the same as the values written. + /* Check that the values read are the same as the values written. * The last chunk should not be in the file. */ for(i = 0; i < DIM; i+=2) { if(i < DIM-2 && rbuf[i] != i) { @@ -344,11 +344,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Tests the library's behavior when a mandate filter returns + * Purpose: Tests the library's behavior when a mandate filter returns * failure. * * Return: EXIT_SUCCESS/EXIT_FAILURE - * + * * Programmer: Raymond Lu * 25 August 2010 * diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c index b74e086..a9a53ae 100644 --- a/test/filter_plugin1_dsets.c +++ b/test/filter_plugin1_dsets.c @@ -69,7 +69,7 @@ add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_value /* Check that permanent parameters are set correctly */ if (cd_values[0] > 9) return 0; - + value = (int)cd_values[0]; if (flags & H5Z_FLAG_REVERSE) { diff --git a/test/flush1.c b/test/flush1.c index ac5f9ef..04f24f7 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -99,7 +99,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr) if(H5Gclose(top_gid) < 0) STACK_ERROR - + return fid; error: @@ -185,7 +185,7 @@ error: * a variety of situations. * * Part 1 of a two-part H5Fflush() test. - * + * * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke diff --git a/test/flushrefresh.c b/test/flushrefresh.c index 20a4ba4..2db1d6b 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -15,10 +15,10 @@ * Programmer: Mike McGreevy * June 30, 2010 * - * Purpose: This test file contains routines used to test flushing and - * refreshing individual objects' metadata from the cache. - * - * Note: This file should NOT be run manually. Instead, invoke it + * Purpose: This test file contains routines used to test flushing and + * refreshing individual objects' metadata from the cache. + * + * Note: This file should NOT be run manually. Instead, invoke it * via its associated test script, testflushrefresh.sh * */ @@ -119,12 +119,12 @@ herr_t end_verification(void); * Function: main * * Purpose: This function coordinates the test of flush/refresh - * functionality verification. It accepts either one, two or + * functionality verification. It accepts either one, two or * no command line parameters. The main test routine runs * with no command line parameters specified, while verification * routines run with one or two command line parameters. - * - * Note: This program should not be run manually, as the + * + * Note: This program should not be run manually, as the * test is controlled by the testflushrefresh.sh script. Running * the flushrefresh program manually will result in failure, as * it will time out waiting for a signal from the test script @@ -137,7 +137,7 @@ herr_t end_verification(void); * *------------------------------------------------------------------------- */ -int main(int argc, const char *argv[]) +int main(int argc, const char *argv[]) { /* Variables */ const char *envval = NULL; @@ -148,8 +148,8 @@ int main(int argc, const char *argv[]) /* Parse command line options */ if(argc == 1) { - /* No arguments supplied. Run main test routines if - * using sec2 or stdio driver, otherwise don't run + /* No arguments supplied. Run main test routines if + * using sec2 or stdio driver, otherwise don't run * anything. */ /* Determine driver being used */ @@ -161,7 +161,7 @@ int main(int argc, const char *argv[]) } /* end if */ else { HDfprintf(stdout, "Skipping all flush/refresh tests (only run with SWMR-enabled file drivers).\n"); - + /* Test script is expecting some signals, so send them out to end it. */ if(end_verification() < 0) TEST_ERROR; if(end_verification() < 0) TEST_ERROR; @@ -202,29 +202,29 @@ error: * *------------------------------------------------------------------------- */ -herr_t test_flush(void) +herr_t test_flush(void) { /************************************************************************** * * Test Description: * - * This test will build an HDF5 file with several objects in a varying + * This test will build an HDF5 file with several objects in a varying * hierarchical layout. It will then attempt to flush the objects * in the file one by one, individually, using the four H5*flush - * routines (D,G,T, and O). After each call to either create or flush an + * routines (D,G,T, and O). After each call to either create or flush an * object, a series of verifications will occur on each object in the file. * * Each verification consists of spawning off a new process and determining - * if the object can be opened and its information retreived in said - * alternate process. It reports the results, which are compared to an + * if the object can be opened and its information retreived in said + * alternate process. It reports the results, which are compared to an * expected value (either that the object can be found on disk, or that it * cannot). * * Note that to spawn a verification, this program sends a signal (by creating - * a file on disk) to the test script controlling it, indicating how to + * a file on disk) to the test script controlling it, indicating how to * run the verification. - * - * Implementation is funky, but basically, an example: + * + * Implementation is funky, but basically, an example: * * Step 1. Dataset is created. * Step 2. Verify that dataset can't be opened by separate process, as @@ -233,14 +233,14 @@ herr_t test_flush(void) * Step 4. Verify that group can't be opened by separate process. * Step 5. H5Gflush is called on the group. * Step 6. Verify that group CAN be opened, but dataset still has - * yet to hit disk, and CANNOT be opened. Success! Only the group + * yet to hit disk, and CANNOT be opened. Success! Only the group * was flushed. * **************************************************************************/ /************************************************************************** * Generated Test File will look like this: - * + * * GROUP "/" * DATASET "Dataset1" * GROUP "Group1" { @@ -265,14 +265,14 @@ herr_t test_flush(void) /* Cleanup any old error or signal files */ CLEANUP_FILES; - + /* ================ */ /* CREATE TEST FILE */ /* ================ */ /* Create file, open root group - have to use latest file format for SWMR */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR; + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR; if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; if((rid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR; @@ -341,7 +341,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR; if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; - /* Flush Group1 and Verify it is recently flushed, and nothing + /* Flush Group1 and Verify it is recently flushed, and nothing * else has changed. */ if((status = H5Gflush(gid)) < 0) TEST_ERROR; if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR; @@ -355,7 +355,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR; if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; - /* Flush Group2 and Verify it is recently flushed, and nothing + /* Flush Group2 and Verify it is recently flushed, and nothing * else has changed. */ if((status = H5Gflush(gid2)) < 0) TEST_ERROR; if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR; @@ -440,7 +440,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; PASSED(); - + /* ============= */ /* FLUSH OBJECTS */ /* ============= */ @@ -490,7 +490,7 @@ herr_t test_flush(void) PASSED(); /* ================== */ - /* Cleanup and Return */ + /* Cleanup and Return */ /* ================== */ if(H5Pclose(fapl) < 0) TEST_ERROR; if(H5Gclose(gid) < 0) TEST_ERROR; @@ -515,7 +515,7 @@ error: /*------------------------------------------------------------------------- * Function: test_refresh * - * Purpose: This function tests refresh (evict/reload) of individual + * Purpose: This function tests refresh (evict/reload) of individual * objects' metadata from the metadata cache. * * Return: 0 on Success, 1 on Failure @@ -525,27 +525,27 @@ error: * *------------------------------------------------------------------------- */ -herr_t test_refresh(void) +herr_t test_refresh(void) { /************************************************************************** * * Test Description: * - * This test will build an HDF5 file with several objects in a varying + * This test will build an HDF5 file with several objects in a varying * hierarchical layout. It will then flush the entire file to disk. Then, * an attribute will be added to each object in the file. - * + * * One by one, this process will flush each object to disk, individually. * It will also be coordinating with another process, which will open * the object before it is flushed by this process, and then refresh the * object after it's been flushed, comparing the before and after object * information to ensure that they are as expected. (i.e., most notably, - * that an attribute has been added, and is only visible after a + * that an attribute has been added, and is only visible after a * successful call to a H5*refresh function). - * - * As with the flush case, the implemention is a bit tricky as it's + * + * As with the flush case, the implemention is a bit tricky as it's * dealing with signals going back and forth between the two processes - * to ensure the timing is correct, but basically, an example: + * to ensure the timing is correct, but basically, an example: * * Step 1. Dataset is created. * Step 2. Dataset is flushed. @@ -555,7 +555,7 @@ herr_t test_refresh(void) * Step 5. This process flushes the dataset again (with Attribute attached). * Step 6. The other process calls H5Drefresh, which should evict/reload * the object's metadata, and thus pick up the attribute that's - * attached to it. Most other before/after object information is + * attached to it. Most other before/after object information is * compared for sanity as well. * Step 7. Rinse and Repeat for each object in the file. * @@ -563,7 +563,7 @@ herr_t test_refresh(void) /************************************************************************** * Generated Test File will look like this: - * + * * GROUP "/" * DATASET "Dataset1" * GROUP "Group1" { @@ -755,7 +755,7 @@ herr_t test_refresh(void) PASSED(); /* ================== */ - /* Cleanup and Return */ + /* Cleanup and Return */ /* ================== */ /* Close Stuff */ @@ -791,8 +791,8 @@ error: * * Purpose: This function is used to communicate with the test script * in order to spawn off a process to verify that a flush - * of an individual object was successful. - * + * of an individual object was successful. + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -800,7 +800,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t run_flush_verification_process(const char * obj_pathname, const char * expected) +herr_t run_flush_verification_process(const char * obj_pathname, const char * expected) { HDremove(SIGNAL_FROM_SCRIPT); @@ -825,10 +825,10 @@ error: * Function: flush_verification * * Purpose: This function tries to open target object in the test file. - * It compares the success of the open function to the expected + * It compares the success of the open function to the expected * value, and succeeds if they are equal and fails if they differ. * - * Note that full path to the object must be provided as the + * Note that full path to the object must be provided as the * obj_pathname argument. * * Return: 0 on Success, 1 on Failure @@ -838,7 +838,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t flush_verification(const char * obj_pathname, const char * expected) +herr_t flush_verification(const char * obj_pathname, const char * expected) { /* Variables */ hid_t oid = -1, fid = -1; @@ -887,7 +887,7 @@ error: * Purpose: This function is used to communicate with the test script * in order to spawn off a process which will test the * H5*refresh routine. - * + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -895,14 +895,14 @@ error: * *------------------------------------------------------------------------- */ -herr_t start_refresh_verification_process(const char * obj_pathname) +herr_t start_refresh_verification_process(const char * obj_pathname) { HDremove(SIGNAL_BETWEEN_PROCESSES_1); - /* Send Signal to SCRIPT indicating that it should kick off a refresh + /* Send Signal to SCRIPT indicating that it should kick off a refresh verification process */ h5_send_message(SIGNAL_TO_SCRIPT, obj_pathname, NULL); - + /* Wait for Signal from VERIFICATION PROCESS indicating that it's opened the target object and ready for MAIN PROCESS to modify it */ if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_1) < 0) TEST_ERROR; @@ -922,10 +922,10 @@ error: * Function: end_refresh_verification_process * * Purpose: This function is used to communicate with the verification - * process spawned by the start_refresh_verification_process + * process spawned by the start_refresh_verification_process * function. It gives it the go-ahead to call H5*refresh * on an object and conlcude the refresh verification. - * + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -933,8 +933,8 @@ error: * *------------------------------------------------------------------------- */ -herr_t end_refresh_verification_process(void) -{ +herr_t end_refresh_verification_process(void) +{ HDremove(SIGNAL_FROM_SCRIPT); /* Send Signal to REFRESH VERIFICATION PROCESS indicating that the object @@ -974,7 +974,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t refresh_verification(const char * obj_pathname) +herr_t refresh_verification(const char * obj_pathname) { /* Variables */ hid_t oid,fid,status = 0; @@ -985,7 +985,7 @@ herr_t refresh_verification(const char * obj_pathname) int tries = 800, sleep_tries = 400; int token_cmp; hbool_t ok = FALSE; - + HDremove(SIGNAL_BETWEEN_PROCESSES_2); /* Open Object */ @@ -1002,16 +1002,16 @@ herr_t refresh_verification(const char * obj_pathname) if(flushed_oinfo.num_attrs != 0) PROCESS_ERROR; - /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the + /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the object. */ h5_send_message(SIGNAL_BETWEEN_PROCESSES_1, obj_pathname, NULL); - /* Wait for Signal from MAIN PROCESS indicating that it's modified the + /* Wait for Signal from MAIN PROCESS indicating that it's modified the object and we can run verification now. */ if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_2) < 0) PROCESS_ERROR; - /* Get object info again. This will NOT reflect what's on disk, only what's - in the cache. Thus, all values will be unchanged from above, despite + /* Get object info again. This will NOT reflect what's on disk, only what's + in the cache. Thus, all values will be unchanged from above, despite newer information being on disk. */ if((status = H5Oget_info3(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS)) < 0) PROCESS_ERROR; if((status = H5Oget_native_info(oid, &refreshed_ninfo, H5O_NATIVE_INFO_HDR)) < 0) PROCESS_ERROR; @@ -1105,7 +1105,7 @@ error: * processes to see if they've succeeded. It checks for the * existance of flushrefresh_ERROR file. If present, that indicates * an external verification process has failed, and this function - * thus fails as well. If not present, then nothing else has + * thus fails as well. If not present, then nothing else has * failed, and this function succeeds. * * Return: 0 on Success, 1 on Failure @@ -1115,7 +1115,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t check_for_errors(void) +herr_t check_for_errors(void) { FILE * file; @@ -1131,24 +1131,24 @@ herr_t check_for_errors(void) /*------------------------------------------------------------------------- * Function: end_verification - * - * Purpose: Tells test script that verification routines are completed and - * that the test can wrap up. + * + * Purpose: Tells test script that verification routines are completed and + * that the test can wrap up. * * Return: void * * Programmer: Mike McGreevy * July 16, 2010 - * + * *------------------------------------------------------------------------- */ -herr_t end_verification(void) +herr_t end_verification(void) { HDremove(SIGNAL_FROM_SCRIPT); /* Send Signal to SCRIPT to indicate that we're done with verification. */ h5_send_message(SIGNAL_TO_SCRIPT, "VERIFICATION_DONE", "VERIFICATION_DONE"); - + /* Wait for Signal from SCRIPT indicating that we can continue. */ if(h5_wait_message(SIGNAL_FROM_SCRIPT) < 0) TEST_ERROR; diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index c52eb95..292659c 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -61,7 +61,7 @@ int main() aid = H5Acreate(gid, "attr", cmpd_dt, sid, H5P_DEFAULT); assert(aid > 0); - /* Commit the datatype */ + /* Commit the datatype */ ret = H5Tcommit(file, "cmpnd", cmpd_dt); assert(ret >= 0); diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index 82e94cd..b485e36 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -28,8 +28,8 @@ /*------------------------------------------------------------------------- * Function: main * - * Generate an HDF5 file with groups, datasets and symbolic links. - * After the file is generated, write bad offset values to + * Generate an HDF5 file with groups, datasets and symbolic links. + * After the file is generated, write bad offset values to * the heap at 3 locations in the file: * (A) Open the file: * fd = HDopen(TESTFILE, O_RDWR, 0663); @@ -37,7 +37,7 @@ * (1) HDlseek(fd, (HDoff_t)880, SEEK_SET); * "/group1/group2": replace heap offset "8" by bad offset * (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET); - * "/dsetA": replace name offset into private heap "72" by bad offset + * "/dsetA": replace name offset into private heap "72" by bad offset * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); * /soft_one: replace link value offset in the scratch pad "32" by bad offset * (C) Write the bad offset value to the file for (1), (2) and (3): @@ -98,7 +98,7 @@ main(void) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR - /* + /* * Write bad offset values at 3 locations in the file */ diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 237b024..1ab18a4 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -37,12 +37,12 @@ #ifdef H5O_ENABLE_BOGUS /* - * Create datasets in the location (in "/" or "/group") with + * Create datasets in the location (in "/" or "/group") with * message id: (a) H5O_BOGUS_VALID_ID or (b)H5O_BOGUS_INVALID_ID * and various unknown message flags */ static int -generate_datasets(hid_t loc_id, unsigned bogus_id) +generate_datasets(hid_t loc_id, unsigned bogus_id) { hid_t sid = -1; /* Dataspace ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ diff --git a/test/gen_filespace.c b/test/gen_filespace.c index f4a4f3f..bf49b7b 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -40,7 +40,7 @@ const char *FILENAMES[] = { * Move these files to 1.8 branch for compatibility testing: * test_filespace_compatible() in test/tfile.c will use these files. * - * Copy these files from the 1.8 branch back to the trunk for + * Copy these files from the 1.8 branch back to the trunk for * compatibility testing via test_filespace_round_compatible() in test/tfile.c. * */ diff --git a/test/gen_filters.c b/test/gen_filters.c index fa66078..9764830 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -29,9 +29,9 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * Function: create_file_with_bogus_filter * * Purpose: Create a dataset with the fletcher filter. - * This function is used to create the test file `test_filters.h5' - * which has a dataset with the "fletcher" I/O filter. This dataset - * will be used to verify the correct behavior of the library in + * This function is used to create the test file `test_filters.h5' + * which has a dataset with the "fletcher" I/O filter. This dataset + * will be used to verify the correct behavior of the library in * the test "dsets" * * Return: Success: 0 @@ -168,7 +168,7 @@ create_file_with_bogus_filter(void) /* create dcpl */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - /* create chunking */ + /* create chunking */ if(H5Pset_chunk(dcpl, rank, chunk_dims) < 0) goto error; /* register bogus filter */ diff --git a/test/gen_plist.c b/test/gen_plist.c index 8f38b1a..458ee97 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -37,7 +37,7 @@ main(void) hid_t acpl1; /* attribute create prop. list */ herr_t ret = 0; - hsize_t chunk_size = 16384; /* chunk size */ + hsize_t chunk_size = 16384; /* chunk size */ int fill = 2; /* Fill value */ hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; @@ -129,22 +129,22 @@ main(void) assert(ret > 0); max_size[0] = 100; - if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); if((ret = encode_plist(dcpl1, little_endian, word_length, "testfiles/plist_files/dcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dcpl1)) < 0) assert(ret > 0); @@ -156,13 +156,13 @@ main(void) if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/def_dapl_")) < 0) assert(ret > 0); - + if((ret = H5Pset_chunk_cache(dapl1, nslots, nbytes, w0)) < 0) assert(ret > 0); if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/dapl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dapl1)) < 0) assert(ret > 0); @@ -197,7 +197,7 @@ main(void) if((ret = encode_plist(dxpl1, little_endian, word_length, "testfiles/plist_files/dxpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dxpl1)) < 0) assert(ret > 0); @@ -228,7 +228,7 @@ main(void) if((ret = encode_plist(gcpl1, little_endian, word_length, "testfiles/plist_files/gcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(gcpl1)) < 0) assert(ret > 0); @@ -245,7 +245,7 @@ main(void) if((ret = encode_plist(lcpl1, little_endian, word_length, "testfiles/plist_files/lcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(lcpl1)) < 0) assert(ret > 0); @@ -268,7 +268,7 @@ main(void) if((ret = encode_plist(ocpypl1, little_endian, word_length, "testfiles/plist_files/ocpypl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(ocpypl1)) < 0) assert(ret > 0); @@ -482,7 +482,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil HDassert(write_size == (ssize_t)temp_size); HDclose(fd); - + HDfree(temp_buf); return 1; diff --git a/test/genall5.h b/test/genall5.h index 1dce195..20141de 100644 --- a/test/genall5.h +++ b/test/genall5.h @@ -34,7 +34,7 @@ void os_grp_0(hid_t fid, const char *group_name); void vrfy_os_grp_0(hid_t fid, const char *group_name); void os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); -void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, +void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); void ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); diff --git a/test/getname.c b/test/getname.c index f677d78..c301e04 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2375,7 +2375,7 @@ test_main(hid_t file_id, hid_t fapl) } H5E_END_TRY; if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR - + /* Test H5Iget_name with anonymously created datatype, should pass because committed */ if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR @@ -2585,7 +2585,7 @@ test_obj_ref(hid_t fapl) /* Make sure size parameter is ignored */ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200); if(namelen != 9) TEST_ERROR - + namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR PASSED() diff --git a/test/ohdr.c b/test/ohdr.c index 120935c..57090c8 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1053,7 +1053,7 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id) dcpl_default = H5Pcreate(H5P_DATASET_CREATE); if(dcpl_default < 0) TEST_ERROR - + dcpl_minimize = H5Pcreate(H5P_DATASET_CREATE); if(dcpl_minimize < 0) TEST_ERROR ret = H5Pset_dset_no_attrs_hint(dcpl_minimize, TRUE); diff --git a/test/page_buffer.c b/test/page_buffer.c index 21ffbf5..c4210b2 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -41,7 +41,7 @@ /* test routines */ #ifdef H5_HAVE_PARALLEL -static unsigned verify_page_buffering_disabled(hid_t orig_fapl, +static unsigned verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr); #else #define NUM_DSETS 5 @@ -72,9 +72,9 @@ const char *FILENAME[] = { * Purpose: The purpose of this function appears to be a smoke check * intended to exercise the page buffer. * - * Specifically, the function creates a file, and then goes - * through a loop in which it creates four data sets, write - * data to one of them, verifies the data written, and then + * Specifically, the function creates a file, and then goes + * through a loop in which it creates four data sets, write + * data to one of them, verifies the data written, and then * deletes the three that it didn't write to. * * Any data mis-matches or failures reported by the HDF5 @@ -158,7 +158,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl) HDmemset(data, 0, (size_t)num_elements * sizeof(int)); if((dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + FAIL_STACK_ERROR; if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR; if(H5Dclose(dset_id) < 0) @@ -213,7 +213,7 @@ error: * Purpose: The purpose of this function appears to be a smoke check * intended to exercise the page buffer. * - * Specifically, the function opens a file (created by + * Specifically, the function opens a file (created by * create_file()?), and verify the contents of its datasets. * * Any data mis-matches or failures reported by the HDF5 @@ -228,7 +228,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -open_file(char *filename, hid_t fapl, hsize_t page_size, +open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size) { hid_t file_id = -1; @@ -370,7 +370,7 @@ error: * * 1) verifying that API errors are caught. * - * 2) verifying that the page buffer behaves more or less + * 2) verifying that the page buffer behaves more or less * as advertized. * * Any data mis-matches or unexpected failures or successes @@ -404,8 +404,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer without Paged Aggregation enabled - - * should fail + /* Test setting a page buffer without Paged Aggregation enabled - + * should fail */ if(H5Pset_page_buffer_size(fapl, 512, 0, 0) < 0) TEST_ERROR; @@ -418,8 +418,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with a size smaller than a single - * page size - should fail + /* Test setting a page buffer with a size smaller than a single + * page size - should fail */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) TEST_ERROR; @@ -438,8 +438,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with sum of min meta and raw - * data percentage > 100 - should fail + /* Test setting a page buffer with sum of min meta and raw + * data percentage > 100 - should fail */ H5E_BEGIN_TRY { ret = H5Pset_page_buffer_size(fapl, 512, 50, 51); @@ -468,8 +468,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with a size slightly larger than a - * single page size + /* Test setting a page buffer with a size slightly larger than a + * single page size */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) TEST_ERROR; @@ -555,14 +555,14 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added base_page_cnt field as supporting code. This allows * the test to adjust to the number of page buffer pages * accessed during file open / create. * - * The test for the value of base_page_cnt just after file + * The test for the value of base_page_cnt just after file * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these + * any such change is not indicative of other issues, these * tests can be modified to reflect the change. * * JRM -- 2/23/17 @@ -615,7 +615,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the number of pages inserted, and verify that it is the + * Get the number of pages inserted, and verify that it is the * the expected value. */ base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr); @@ -695,8 +695,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; - /* read elements 1200 - 1201, this should read -1 and bring in an - * entire page of addr 1200 + /* read elements 1200 - 1201, this should read -1 and bring in an + * entire page of addr 1200 */ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; @@ -746,7 +746,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) } /* read elements 0 - 800 using the PB.. this should result in all - * what we have written so far and should get the updates from the PB + * what we have written so far and should get the updates from the PB */ if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; @@ -761,7 +761,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* update elements 400 - 1400 to value 0, this will go to disk but * also evict existing pages from the PB (page 400 & 1200 that are - * existing). + * existing). */ for(i=0 ; i<1000 ; i++) data[i] = 0; @@ -832,14 +832,14 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added base_page_cnt field as supporting code. This allows * the test to adjust to the number of page buffer pages * accessed during file open / create. * - * The test for the value of base_page_cnt just after file + * The test for the value of base_page_cnt just after file * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these + * any such change is not indicative of other issues, these * tests can be modified to reflect the change. * * JRM -- 2/23/17 @@ -898,7 +898,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the number of pages inserted, and verify that it is the + * Get the number of pages inserted, and verify that it is the * the expected value. */ base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr); @@ -918,7 +918,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* update the first 100 elements to have values 0-99 - this will be * a page buffer update with 1 page resulting in the page - * buffer. + * buffer. */ for(i=0 ; i<100 ; i++) data[i] = i; @@ -932,7 +932,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* update elements 300 - 450, with values 300 - 449 - this will - * bring two pages into the page buffer and evict 0. + * bring two pages into the page buffer and evict 0. */ for(i=0 ; i<150 ; i++) data[i] = i+300; @@ -1074,7 +1074,7 @@ error: /*------------------------------------------------------------------------- * Function: test_min_threshold() * - * Purpose: Tests verifying observation of minimum and maximum + * Purpose: Tests verifying observation of minimum and maximum * raw and metadata page counts in the page buffer. * * Any data mis-matches or failures reported by the HDF5 @@ -1085,16 +1085,16 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / + * supporting code. This allows the test to adjust to the + * number of page buffer pages accessed during file open / * create. * * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the + * just after file open exist detect changes in library + * behavior. Assuming any such change is not indicative of + * other issues, these tests can be modified to reflect the * change. * * JRM -- 2/23/17 @@ -1186,7 +1186,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - /* write all raw data, this would end up in page buffer since there + /* write all raw data, this would end up in page buffer since there * is no metadata yet * * Not necessarily -- opening the file may may load a metadata page. @@ -1244,7 +1244,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write and read more raw data and make sure that they don't end up in * page buffer since the minimum metadata is actually the entire - * page buffer + * page buffer */ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1320,7 +1320,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) TEST_ERROR; - /* write all meta data, this would end up in page buffer since there + /* write all meta data, this would end up in page buffer since there * is no raw data yet */ for(i=0 ; i<100 ; i++) @@ -1375,7 +1375,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write and read more meta data and make sure that they don't end up in * page buffer since the minimum metadata is actually the entire - * page buffer + * page buffer */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; @@ -1407,8 +1407,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) HDprintf("\tMinimum metadata threshold = 40%%, Minimum rawdata threshold = 40%%\n"); page_count = 0; - /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages - * minimum + /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages + * minimum */ if(H5Pset_page_buffer_size(fapl, sizeof(int)*1000, 40, 40) < 0) TEST_ERROR; @@ -1423,8 +1423,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* opening the file inserts one or more pages into the page buffer. * - * However, with the current 1 metadata page inserted into the - * the page buffer, it is not necessary to track the base raw and + * However, with the current 1 metadata page inserted into the + * the page buffer, it is not necessary to track the base raw and * metadata entry counts. */ @@ -1503,8 +1503,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 2) TEST_ERROR; - /* adding more meta entires should replace meta entries since raw data - * is at its minimum + /* adding more meta entires should replace meta entries since raw data + * is at its minimum */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1522,8 +1522,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - /* adding 2 raw entries (even with 1 call) should only evict 1 meta - * entry and another raw entry + /* adding 2 raw entries (even with 1 call) should only evict 1 meta + * entry and another raw entry */ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1647,8 +1647,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 4) TEST_ERROR; - /* write one more raw entry which should replace another raw entry - * keeping min threshold of meta entries + /* write one more raw entry which should replace another raw entry + * keeping min threshold of meta entries */ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1662,8 +1662,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 4) TEST_ERROR; - /* write a metadata entry that should replace the metadata entry - * at the bottom of the LRU + /* write a metadata entry that should replace the metadata entry + * at the bottom of the LRU */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1721,16 +1721,16 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / + * supporting code. This allows the test to adjust to the + * number of page buffer pages accessed during file open / * create. * * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the + * just after file open exist detect changes in library + * behavior. Assuming any such change is not indicative of + * other issues, these tests can be modified to reflect the * change. * * JRM -- 2/23/17 @@ -1787,7 +1787,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the raw and meta counts now, so we can adjust the expected + * Get the raw and meta counts now, so we can adjust the expected * statistics accordingly. */ HDassert(f); @@ -2014,7 +2014,7 @@ error: /*------------------------------------------------------------------------- * Function: verify_page_buffering_disabled() * - * Purpose: This function should only be called in parallel + * Purpose: This function should only be called in parallel * builds. * * At present, page buffering should be disabled in parallel @@ -2025,7 +2025,7 @@ error: * * Programmer: John Mainzer * 03/21/17 - * + * * Changes: None. * *------------------------------------------------------------------------- @@ -2072,7 +2072,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) if(file_id >= 0) TEST_ERROR; - /* now, create a file, close it, and then try to open it with page + /* now, create a file, close it, and then try to open it with page * buffering enabled. */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -2092,7 +2092,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR; - /* try to open the file using the fapl prepared above which enables + /* try to open the file using the fapl prepared above which enables * page buffering. Should fail. */ H5E_BEGIN_TRY { @@ -2158,7 +2158,7 @@ main(void) * Page buffering depends on paged aggregation which is * currently disabled for multi/split drivers. */ - if((0 == HDstrcmp(env_h5_drvr, "multi")) || + if((0 == HDstrcmp(env_h5_drvr, "multi")) || (0 == HDstrcmp(env_h5_drvr, "split"))) { SKIPPED() @@ -2175,7 +2175,7 @@ main(void) if(H5CX_push() < 0) FAIL_STACK_ERROR api_ctx_pushed = TRUE; -#ifdef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL HDputs("Page Buffering is disabled for parallel."); nerrors += verify_page_buffering_disabled(fapl, env_h5_drvr); diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index df984b1..71e4929 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -337,7 +337,7 @@ int main(int argc, const char *argv[]) verbose = 0; u++; break; - + /* Random # seed */ case 'r': use_seed = 1; diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c index e249e09..9b4fbb5 100644 --- a/test/swmr_check_compat_vfd.c +++ b/test/swmr_check_compat_vfd.c @@ -13,7 +13,7 @@ /* Purpose: This is a small program that checks if the HDF5_DRIVER * environment variable is set to a value that supports SWMR. - * + * * It is intended for use in shell scripts. */ diff --git a/test/swmr_common.c b/test/swmr_common.c index 925dc33..7ae1fad 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -27,7 +27,7 @@ #include "h5test.h" #include "swmr_common.h" #include "vds_swmr.h" - + /*******************/ /* Local Variables */ /*******************/ diff --git a/test/swmr_common.h b/test/swmr_common.h index 99d1cb2..a0bc581 100644 --- a/test/swmr_common.h +++ b/test/swmr_common.h @@ -26,7 +26,7 @@ #define NLEVELS 5 /* # of datasets in the SWMR test file */ -#define NMAPPING 9 +#define NMAPPING 9 #define FILENAME "swmr_data.h5" /* SWMR test file name */ #define DTYPE_SIZE 150 /* Data size in opaque type */ diff --git a/test/swmr_generator.c b/test/swmr_generator.c index 54a9900..f6a4fe2 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -358,7 +358,7 @@ int main(int argc, const char *argv[]) HDfprintf(stderr, "\tcompression level = %d\n", comp_level); HDfprintf(stderr, "\tindex type = %s\n", index_type); } /* end if */ - + /* Set the random seed */ if(!use_seed) { struct timeval t; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index cb354a7..ee263e3 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -329,7 +329,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, /* Emit informational message */ if(verbose) HDfprintf(verbose_file, "Closing file\n"); - + /* Close the file */ if(H5Fclose(fid) < 0) return -1; diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 9ca6045..b02d16f 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -371,7 +371,7 @@ usage(void) HDprintf("and will generate a random seed (no -r given).\n"); HDprintf("\n"); HDexit(EXIT_FAILURE); -} +} int main(int argc, const char *argv[]) { diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index e6d23de..2bebab9 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -272,7 +272,7 @@ int main(int argc, const char *argv[]) verbose = 0; u++; break; - + /* Random # seed */ case 'r': use_seed = 1; diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index f190777..2d558df 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -162,7 +162,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t * The amount of time to sleep (s). * * unsigned reopen_count - * + * * * Return: Success: 0 * Failure: -1 @@ -185,7 +185,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, HDassert(filename); HDassert(poll_time != 0); - + /* Create file access property list */ if((fapl = h5_fileaccess()) < 0) return -1; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index c4222ad..fc7e7a5 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -53,11 +53,11 @@ static void usage(void); * Purpose: Creates the HDF5 file (without SWMR access) which * which will be used for testing H5Fstart_swmr_write(). * - * Parameters: + * Parameters: * filename: The SWMR test file's name. * verbose: whether verbose console output is desired. * verbose_file: file pointer for verbose output - * random_seed: The random seed to store in the file. + * random_seed: The random seed to store in the file. * The sparse tests use this value. * * Return: Success: the file ID @@ -134,10 +134,10 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, /*------------------------------------------------------------------------- * Function: create_datasets * - * Purpose: Create datasets (and keep them opened) which will be used for testing + * Purpose: Create datasets (and keep them opened) which will be used for testing * H5Fstart_swmr_write(). * - * Parameters: + * Parameters: * fid: file ID for the SWMR test file * comp_level: the compresssion level * index_type: The chunk index type (b1 | b2 | ea | fa) @@ -212,7 +212,7 @@ create_datasets(hid_t fid, int comp_level, hbool_t verbose, FILE *verbose_file, * Purpose: Writes a specified number of records to random datasets in * the SWMR test file. * - * Parameters: + * Parameters: * fid: The file ID of the SWMR HDF5 file * verbose: Whether or not to emit verbose console messages * verbose_file: file pointer for verbose output @@ -419,7 +419,7 @@ int main(int argc, const char *argv[]) verbose = FALSE; u++; break; - + /* Random # seed */ case 'r': use_seed = TRUE; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 4c3e64a..d4387aa 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -328,7 +328,7 @@ int main(int argc, const char *argv[]) verbose = FALSE; u++; break; - + /* Random # seed */ case 'r': use_seed = TRUE; diff --git a/test/test_filter_plugin.sh.in b/test/test_filter_plugin.sh.in index 0a45c0f..e8c53e4 100644 --- a/test/test_filter_plugin.sh.in +++ b/test/test_filter_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from diff --git a/test/test_vol_plugin.sh.in b/test/test_vol_plugin.sh.in index 38220ef..32d1c12 100644 --- a/test/test_vol_plugin.sh.in +++ b/test/test_vol_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from diff --git a/test/testabort_fail.sh.in b/test/testabort_fail.sh.in index 925d8a4..c86bf8a 100644 --- a/test/testabort_fail.sh.in +++ b/test/testabort_fail.sh.in @@ -14,7 +14,7 @@ # Test to verify that the assertion/abort failure is fixed when the application # does not close the file. (See HDFFV-10160) # -# Test to verify that the infinite loop closing library/abort failure is fixed +# Test to verify that the infinite loop closing library/abort failure is fixed # when the application creates and removes dense attributes (See HDFFV-10659) srcdir=@srcdir@ @@ -33,7 +33,7 @@ TEST_NAME=filenotclosed # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary # # Run the test -$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +$RUNSERIAL $TEST_BIN >/dev/null 2>&1 exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test PASSED" @@ -47,7 +47,7 @@ echo "Testing infinite loop closing library/abort failure" TEST_NAME=del_many_dense_attrs # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary # Run the test -$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +$RUNSERIAL $TEST_BIN >/dev/null 2>&1 exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test PASSED" diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index a5641f5..836170d 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -71,7 +71,7 @@ WarnMesg(){ test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings echo "Bye..." } - + # Print warning message2 of version mismatch. WarnMesg2(){ @@ -88,13 +88,13 @@ WarnMesg2(){ echo "Headers are $xxh5versmajor.$xxh5versminor.$xxh5versrelease, library is $h5versmajor.$h5versminor.$h5versrelease" test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings } - + # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the # difference between the actual output and the expected output. The # expected output generated according to the parameter values and compared -# against actual output. +# against actual output. # The expected and actual output files are removed unless $HDF5_NOCLEANUP # has a non-zero value. # $1: the set value of $HDF5_DISABLE_VERSION_CHECK. (unset means not to set @@ -175,7 +175,7 @@ TESTING() { ) >$actual 2>$actual_err ret_code=$? cat $actual_err >> $actual - + if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then echo "*FAILED*" echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" @@ -189,7 +189,7 @@ TESTING() { test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - # Clean up output file. + # Clean up output file. # Also clean the core file generated by H5check_version's abort. if test -z "$HDF5_NOCLEANUP"; then $RM $expect $actual $actual_err @@ -211,14 +211,14 @@ nerrors=0 verbose=yes # default on debugmode= # default off H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h` -h5libsettings=../src/libhdf5.settings +h5libsettings=../src/libhdf5.settings PURPOSE # Figure out library version numbers from the header file. -h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` -h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` -h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` +h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` +h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` +h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease case "$h5versmajor$h5versminor$h5versrelease" in [0-9]*) # good. noop. diff --git a/test/testerror.sh.in b/test/testerror.sh.in index ac2a109..b5ec853 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -11,7 +11,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Tests for test_error and err_compat +# Tests for test_error and err_compat srcdir=@srcdir@ @@ -62,7 +62,7 @@ TEST() { TESTING $TEST_ERR ( # Skip the plugin for testing missing filter. - $ENVCMD $RUNSERIAL $TEST_ERR_BIN + $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ @@ -73,7 +73,7 @@ TEST() { -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ $actual_err > $actual_ext cat $actual_ext >> $actual - + if $CMP $expect1 $actual; then echo " PASSED" elif $CMP $expect2 $actual; then @@ -96,7 +96,7 @@ SKIP() { TESTING $@ echo " -SKIP-" } - + ############################################################################## ############################################################################## ### T H E T E S T S ### diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index 1dd744b..b2e8a12 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -47,7 +47,7 @@ SKIP() { LINEMSG $* echo " -SKIP-" } - + # Function definitions CHECK_LIBINFO(){ LINEMSG $1 @@ -80,9 +80,9 @@ if [ -n $Shared_Lib ]; then shlib=$(grep dlname ../src/libhdf5.la | sed -e "s/dlname='//" -e "s/'//") else h5libdir=../src -fi +fi -h5libsettings=../src/libhdf5.settings +h5libsettings=../src/libhdf5.settings # Part 1: # Verify the HDF5 library does contains an exact copy of the content of the diff --git a/test/th5s.c b/test/th5s.c index 7e1e547..a37070a 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1210,7 +1210,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) * Test encoding and decoding of simple dataspace and hyperslab selection. *------------------------------------------------------------------------- */ - + /* Create the file access property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); @@ -1569,7 +1569,7 @@ test_h5s_encode1(void) /**************************************************************** ** -** test_h5s_check_encoding(): +** test_h5s_check_encoding(): ** This is the helper routine to verify that H5Sencode2() ** works as specified in the RFC for the library format setting ** in the file access property list. @@ -1582,7 +1582,7 @@ test_h5s_encode1(void) ** ****************************************************************/ static herr_t -test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, +test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, uint8_t expected_enc_size, hbool_t expected_to_fail) { char *buf = NULL; /* Pointer to the encoded buffer */ @@ -1633,7 +1633,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, VERIFY(in_low_bounds[0], d_low_bounds[0], "Compare selection low bounds"); VERIFY(in_high_bounds[0], d_high_bounds[0], "Compare selection high bounds"); - /* + /* * See "RFC: H5Sencode/H5Sdeocde Format Change" for the verification of: * H5S_SEL_POINTS: * --the expected version for point selection info @@ -1644,7 +1644,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, */ if(H5Sget_select_type(in_sid) == H5S_SEL_POINTS) { - + /* Verify the version */ VERIFY((uint32_t)buf[35], expected_version, "Version for point selection"); @@ -1666,7 +1666,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, ret = H5Sclose(d_sid); CHECK(ret, FAIL, "H5Sclose"); - if(buf) + if(buf) HDfree(buf); } @@ -1723,15 +1723,15 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) start = 0; count = unlim? H5S_UNLIMITED : 2; - if((high <= H5F_LIBVER_V18) && + if((high <= H5F_LIBVER_V18) && (unlim || config == CONFIG_32)) expected_to_fail = TRUE; - if(low >= H5F_LIBVER_V112) + if(low >= H5F_LIBVER_V112) expected_version = 3; else if(config == CONFIG_16 && !unlim) expected_version = 1; - else + else expected_version = 2; /* test 1 */ @@ -1745,7 +1745,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) stride = POWER32 - 1; block = 4; expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); - + break; default: HDassert(0); @@ -1873,7 +1873,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) /**************************************************************** ** -** test_h5s_encode_irregular_hyper(): +** test_h5s_encode_irregular_hyper(): ** This test verifies that H5Sencode2() works as specified in ** the RFC for irregular hyperslabs. ** See "RFC: H5Sencode/H5Sdeocde Format Change". @@ -1961,7 +1961,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; case CONFIG_16: - stride = POWER16; + stride = POWER16; expected_enc_size = 4; break; @@ -2092,11 +2092,11 @@ test_h5s_encode_points(H5F_libver_t low, H5F_libver_t high) /**************************************************************** ** -** test_h5s_encode_length(): +** test_h5s_encode_length(): ** Test to verify HDFFV-10271 is fixed. ** Verify that version 2 hyperslab encoding length is correct. ** -** See "RFC: H5Sencode/H5Sdecode Format Change" for the +** See "RFC: H5Sencode/H5Sdecode Format Change" for the ** description of the encoding format. ** ****************************************************************/ diff --git a/test/thread_id.c b/test/thread_id.c index 818ab4a..24aef80 100644 --- a/test/thread_id.c +++ b/test/thread_id.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Check that a thread ID returned by H5TS_thread_id() possesses the - * following properties: + * following properties: * * 1 ID >= 1. * 2 The ID is constant over the thread's lifetime. diff --git a/test/trefer.c b/test/trefer.c index d399fef..15f9d64 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -542,7 +542,7 @@ test_reference_obj(void) ** Tests references to various kinds of objects ** ** Note: The libver_low/libver_high parameters are added to create the file -** with the low and high bounds setting in fapl. +** with the low and high bounds setting in fapl. ** Please see the RFC for "H5Sencode/H5Sdecode Format Change". ** ****************************************************************/ @@ -634,7 +634,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) H5E_BEGIN_TRY { dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - + if(dset1 < 0) { VERIFY(libver_high <= H5F_LIBVER_V110, TRUE, "H5Dcreate2"); @@ -840,7 +840,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -871,7 +871,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1196,7 +1196,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1251,7 +1251,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index a830314..db91b8e 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -491,7 +491,7 @@ test_reference_obj(void) ** Tests references to various kinds of objects ** ** Note: The libver_low/libver_high parameters are added to create the file -** with the low and high bounds setting in fapl. +** with the low and high bounds setting in fapl. ** Please see the RFC for "H5Sencode/H5Sdecode Format Change". ** ****************************************************************/ diff --git a/test/trefer_shutdown.c b/test/trefer_shutdown.c index 89a44b3..b1c43e0 100644 --- a/test/trefer_shutdown.c +++ b/test/trefer_shutdown.c @@ -50,7 +50,7 @@ main(int argc, char **argv) /* * "Forget" to call H5Rdestroy on reference objects. If H5Rdestroy * is called at least once on either reference object, or both - * objects, the infinite loop goes away. If H5Rdestroy is never + * objects, the infinite loop goes away. If H5Rdestroy is never * called, the infinite loop will appear. */ #if 0 diff --git a/test/trefstr.c b/test/trefstr.c index 83e2951..c33b5eb 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -299,7 +299,7 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK_PTR(s, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ diff --git a/test/tselect.c b/test/tselect.c index 390f61f..492a917 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15325,7 +15325,7 @@ test_select_intersect_block(void) /**************************************************************** ** -** test_hyper_io_1d(): +** test_hyper_io_1d(): ** Test to verify all the selected 10th element in the 1-d file ** dataspace is read correctly into the 1-d contiguous memory space. ** This is modeled after the test scenario described in HDFFV-10585 diff --git a/test/ttsafe.c b/test/ttsafe.c index 89c87a3..e6edd9a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) #ifdef H5_HAVE_THREADSAFE AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); -#ifdef H5_HAVE_PTHREAD_H +#ifdef H5_HAVE_PTHREAD_H /* Thread cancellability only supported with pthreads ... */ AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); #endif /* H5_HAVE_PTHREAD_H */ diff --git a/test/twriteorder.c b/test/twriteorder.c index b104b72..04f3bc5 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -187,7 +187,7 @@ parse_option(int argc, char * const argv[]) /* verify partition size must be >= blocksize */ if (part_size_g < blocksize_g ){ HDfprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n", blocksize_g, part_size_g); - Hgoto_error(-1); + Hgoto_error(-1); } done: @@ -228,7 +228,7 @@ int setup_parameters(int argc, char * const argv[]) int create_wo_file(void) { int blkaddr = 0; /* blkaddress of next linked block */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Create the data file */ if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) { @@ -252,8 +252,8 @@ int write_wo_file(void) int blkaddr_old=0; int i; char buffer[BLOCKSIZE_DFT]; - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ - + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + /* write block 1, 2, ... */ for (i = 1; i < nlinkedblock_g; i++) { @@ -345,7 +345,7 @@ int read_wo_file(void) } -/* Overall Algorithm: +/* Overall Algorithm: * Parse options from user; * Generate/pre-created the test file needed and close it; * fork: child processes become the reader processes; @@ -447,7 +447,7 @@ main(int argc, char *argv[]) Hgoto_error(2); } } - + done: /* Print result and exit */ if (ret_value != 0){ diff --git a/test/unregister.c b/test/unregister.c index ff116cf..a72b223 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -55,7 +55,7 @@ const H5Z_class2_t H5Z_DUMMY[1] = {{ * Function: do_nothing * * Purpose: A dummy compression method that doesn't do anything. This - * filter is only for test_unregister_filters. Please don't + * filter is only for test_unregister_filters. Please don't * use it for other tests because it may mess up this test. * * Return: Data chunk size @@ -115,12 +115,12 @@ test_unregister_filters(hid_t fapl_id) goto error; if (H5Zfilter_avail(H5Z_FILTER_DUMMY) != TRUE) goto error; - + /******************* * PART 1 - GROUPS * *******************/ - /* Use DUMMY filter for creating groups */ + /* Use DUMMY filter for creating groups */ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; if(H5Pset_filter(gcpl_id, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) @@ -136,7 +136,7 @@ test_unregister_filters(hid_t fapl_id) if((gid_loop = H5Gcreate2(gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Gclose(gid_loop) < 0) - goto error; + goto error; } /* Flush the file containing the groups */ @@ -165,7 +165,7 @@ test_unregister_filters(hid_t fapl_id) * PART 2 - DATASETS * *********************/ - /* Use DUMMY filter for creating datasets */ + /* Use DUMMY filter for creating datasets */ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0) @@ -218,7 +218,7 @@ test_unregister_filters(hid_t fapl_id) if(H5Dclose(did) < 0) goto error; - /* Unregister the filter after closing all objects but before closing files. + /* Unregister the filter after closing all objects but before closing files. * It should flush all files. */ if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) @@ -16,28 +16,28 @@ #include "h5test.h" /* Macro definitions */ -#define Hgoto_error(val) {ret_value=val; goto done;} -#define Hgoto_done {goto done;} -#define Chunksize_DFT 256 /* chunksize default */ -#define ErrorReportMax 10 /* max number of errors reported */ +#define Hgoto_error(val) {ret_value=val; goto done;} +#define Hgoto_done {goto done;} +#define Chunksize_DFT 256 /* chunksize default */ +#define ErrorReportMax 10 /* max number of errors reported */ /* these two definitions must match each other */ -#define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ -#define UC_CTYPE short /* use case C data type */ -#define UC_RANK 3 /* use case dataset rank */ +#define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ +#define UC_CTYPE short /* use case C data type */ +#define UC_RANK 3 /* use case dataset rank */ /* Name of message file that is sent by the writer */ #define WRITER_MESSAGE "USE_WRITER_MESSAGE" /* type declarations */ typedef enum part_t { - UC_READWRITE =0, /* both writer and reader */ - UC_WRITER, /* writer only */ - UC_READER /* reader only */ + UC_READWRITE = 0, /* both writer and reader */ + UC_WRITER, /* writer only */ + UC_READER /* reader only */ } part_t; typedef struct options_t { - hsize_t chunksize; /* chunks are chunksize^2 planes */ - hsize_t chunkplanes; /* number of planes per chunk, default 1 */ + hsize_t chunksize; /* chunks are chunksize^2 planes */ + hsize_t chunkplanes; /* number of planes per chunk, default 1 */ hsize_t chunkdims[UC_RANK]; /* chunk dims is (chunkplan, chunksize, chunksize) */ hsize_t dims[UC_RANK]; /* dataset initial dims */ hsize_t max_dims[UC_RANK]; /* dataset max dims */ diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 6b34f1e..8ab63bd 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Use Case 1.7 Appending a single chunk + * Use Case 1.7 Appending a single chunk * Description: * Appending a single chunk of raw data to a dataset along an unlimited * dimension within a pre-created file and reading the new data back. @@ -24,35 +24,36 @@ * Level: * User Level * Guarantees: - * o Readers will see the modified dimension sizes after the Writer - * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls. - * o Readers will see newly appended data after the Writer finishes - * the flush operation. - * + * o Readers will see the modified dimension sizes after the Writer + * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls. + * o Readers will see newly appended data after the Writer finishes + * the flush operation. + * * Preconditions: - * o Readers are not allowed to modify the file. o All datasets - * that are modified by the Writer exist when the Writer opens the file. - * o All datasets that are modified by the Writer exist when a Reader - * opens the file. o Data is written by a hyperslab contained in - * one chunk. - * + * o Readers are not allowed to modify the file. + * o All datasets that are modified by the Writer exist when the Writer + * opens the file. + * o All datasets that are modified by the Writer exist when a Reader + * opens the file. + * o Data is written by a hyperslab contained in one chunk. + * * Main Success Scenario: - * 1. An application creates a file with required objects (groups, - * datasets, and attributes). - * 2. The Writer application opens the file and datasets in the file - * and starts adding data along the unlimited dimension using a hyperslab - * selection that corresponds to an HDF5 chunk. - * 3. A Reader opens the file and a dataset in a file, and queries - * the sizes of the dataset; if the extent of the dataset has changed, - * reads the appended data back. - * + * 1. An application creates a file with required objects (groups, + * datasets, and attributes). + * 2. The Writer application opens the file and datasets in the file + * and starts adding data along the unlimited dimension using a hyperslab + * selection that corresponds to an HDF5 chunk. + * 3. A Reader opens the file and a dataset in a file, and queries + * the sizes of the dataset; if the extent of the dataset has changed, + * reads the appended data back. + * * Discussion points: - * 1. Since the new data is written to the file, and metadata update - * operation of adding pointer to the newly written chunk is atomic and - * happens after the chunk is on the disk, only two things may happen - * to the Reader: - * o The Reader will not see new data. - * o The Reader will see all new data written by Writer. + * 1. Since the new data is written to the file, and metadata update + * operation of adding pointer to the newly written chunk is atomic and + * happens after the chunk is on the disk, only two things may happen + * to the Reader: + * o The Reader will not see new data. + * o The Reader will see all new data written by Writer. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Created: Albert Cheng, 2013/5/28 */ @@ -107,7 +108,7 @@ int setup_parameters(int argc, char * const argv[]) } -/* Overall Algorithm: +/* Overall Algorithm: * Parse options from user; * Generate/pre-created test files needed and close it; * fork: child process becomes the reader process; @@ -119,7 +120,7 @@ main(int argc, char *argv[]) { pid_t childpid=0; pid_t mypid, tmppid; - int child_status; + int child_status; int child_wait_option=0; int ret_value = 0; int child_ret_value; @@ -134,7 +135,7 @@ main(int argc, char *argv[]) } /* Determine the need to send/wait message file*/ - if(UC_opts.launch == UC_READWRITE) { + if (UC_opts.launch == UC_READWRITE) { HDunlink(WRITER_MESSAGE); send_wait = TRUE; } @@ -144,15 +145,15 @@ main(int argc, char *argv[]) /* UC_WRITER: create datafile, skip reader, launch writer. */ /* UC_READER: skip create, launch reader, exit. */ /* ==============================================================*/ - /* ============*/ + /* =========== */ /* Create file */ - /* ============*/ - if (UC_opts.launch != UC_READER){ + /* =========== */ + if (UC_opts.launch != UC_READER) { HDprintf("Creating skeleton data file for test...\n"); if (create_uc_file() < 0){ HDfprintf(stderr, "***encounter error\n"); Hgoto_error(1); - }else + } else HDprintf("File created.\n"); } @@ -234,17 +235,17 @@ main(int argc, char *argv[]) mypid, child_ret_value); Hgoto_error(2); } - } else { - HDprintf("%d: child process terminated abnormally\n", mypid); - Hgoto_error(2); - } + } else { + HDprintf("%d: child process terminated abnormally\n", mypid); + Hgoto_error(2); + } } - + done: /* Print result and exit */ if (ret_value != 0){ HDprintf("Error(s) encountered\n"); - }else{ + } else { HDprintf("All passed\n"); } diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index b7d45a4..41d355e 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -29,14 +29,14 @@ * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls. * o Readers will see newly appended data after the Writer finishes * the flush operation. - * + * * Preconditions: * o Readers are not allowed to modify the file. * o All datasets that are modified by the Writer exist when the * Writer opens the file. * o All datasets that are modified by the Writer exist when a Reader * opens the file. - * + * * Main Success Scenario: * 1. An application creates a file with required objects (groups, * datasets, and attributes). @@ -45,7 +45,7 @@ * spans several chunks. * 3. A Reader opens the file and a dataset in a file; if the size of * the unlimited dimension has changed, reads the appended data back. - * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Created: Albert Cheng, 2013/6/1 */ @@ -100,7 +100,7 @@ int setup_parameters(int argc, char * const argv[]) } -/* Overall Algorithm: +/* Overall Algorithm: * Parse options from user; * Generate/pre-created test files needed and close it; * fork: child process becomes the reader process; @@ -112,7 +112,7 @@ main(int argc, char *argv[]) { pid_t childpid=0; pid_t mypid, tmppid; - int child_status; + int child_status; int child_wait_option=0; int ret_value = 0; int child_ret_value; @@ -127,7 +127,7 @@ main(int argc, char *argv[]) } /* Determine the need to send/wait message file*/ - if(UC_opts.launch == UC_READWRITE) { + if (UC_opts.launch == UC_READWRITE) { HDunlink(WRITER_MESSAGE); send_wait = 1; } @@ -161,9 +161,9 @@ main(int argc, char *argv[]) /* ============= */ /* launch reader */ /* ============= */ - if (UC_opts.launch != UC_WRITER){ + if (UC_opts.launch != UC_WRITER) { /* child process launch the reader */ - if(0 == childpid) { + if (0 == childpid) { HDprintf("%d: launch reader process\n", mypid); if (read_uc_file(send_wait) < 0){ HDfprintf(stderr, "read_uc_file encountered error\n"); @@ -204,8 +204,8 @@ main(int argc, char *argv[]) /* ================================================ */ /* If readwrite, collect exit code of child process */ /* ================================================ */ - if (UC_opts.launch == UC_READWRITE){ - if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){ + if (UC_opts.launch == UC_READWRITE) { + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { perror("waitpid"); Hgoto_error(1); } @@ -233,12 +233,11 @@ main(int argc, char *argv[]) Hgoto_error(2); } } - + done: - /* Print result and exit */ - if (ret_value != 0){ + if (ret_value != 0) { HDprintf("Error(s) encountered\n"); - }else{ + } else { HDprintf("All passed\n"); } @@ -618,7 +618,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) TEST_ERROR /* Get examination DCPL */ - if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, + if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (low >= H5F_LIBVER_V112)?(hsize_t)99:(low >= H5F_LIBVER_V110?174:213)) < 0) TEST_ERROR @@ -1026,7 +1026,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) } /* Get examination DCPL */ - if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, + if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (low >= H5F_LIBVER_V112)?(hsize_t)607:(hsize_t)697) < 0) TEST_ERROR @@ -12136,9 +12136,9 @@ test_dapl_values(hid_t fapl_id) * * Purpose: Tests datasets with virtual layout * - * Note: + * Note: * Tests are modified to test with the low/high bounds combination - * set in fapl. + * set in fapl. * Please see RFC for "H5Sencode/H5Sdecode Format Change". * * Return: EXIT_SUCCESS/EXIT_FAILURE @@ -12188,7 +12188,7 @@ main(void) high_string = h5_get_version_string(high); HDsprintf(msg, "Testing virtual dataset with file version bounds: (%s, %s):", low_string, high_string); HDputs(msg); - + for(test_api_config = (int)TEST_API_BASIC; test_api_config < (int)TEST_API_NTESTS; test_api_config++) nerrors += test_api((test_api_config_t)test_api_config, my_fapl, low); for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index d62ecaf..d70352d 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -43,7 +43,7 @@ main(int argc, char *argv[]) ******************************/ /* The file number is passed on the command line. - * This is an integer index into the FILE_NAMES array. + * This is an integer index into the FILE_NAMES array. */ if(argc != 2) { HDfprintf(stderr, "ERROR: Must pass the source file number on the command line.\n"); @@ -860,7 +860,7 @@ test_family(void) hid_t driver_id = -1; /* ID for this VFD */ unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; - char dname[]="dataset"; + char dname[] = "dataset"; unsigned int i, j; int *fhandle=NULL, *fhandle2=NULL; int buf[FAMILY_NUMBER][FAMILY_SIZE]; @@ -892,7 +892,7 @@ test_family(void) | H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR - if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; if(H5Fclose(file) < 0) @@ -907,7 +907,7 @@ test_family(void) if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR; - if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; /* Check file size API */ @@ -919,7 +919,7 @@ test_family(void) TEST_ERROR; /* Create and write dataset */ - if((space=H5Screate_simple(2, dims, NULL)) < 0) + if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Retrieve the access property list... */ @@ -934,7 +934,7 @@ test_family(void) if (H5Pclose(access_fapl) < 0) TEST_ERROR; - if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, 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 < FAMILY_NUMBER; i++) @@ -1148,11 +1148,11 @@ H5_GCC_DIAG_ON(format-nonliteral) static herr_t test_family_member_fapl(void) { - hid_t file = H5I_INVALID_HID; - hid_t fapl_id = H5I_INVALID_HID; - hid_t memb_fapl_id = H5I_INVALID_HID; - hid_t space = H5I_INVALID_HID; - hid_t dset = H5I_INVALID_HID; + hid_t file = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t memb_fapl_id = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; char filename[1024]; char dname[] = "dataset"; unsigned i = 0; @@ -1263,7 +1263,7 @@ error: return -1; } /* end test_family_member_fapl() */ - + /*------------------------------------------------------------------------- * Function: test_multi_opens * @@ -919,11 +919,11 @@ test_basic_object_operation(void) TEST_ERROR; /* H5Oexists_by_name */ - if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE) + if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE) TEST_ERROR; /* H5Oopen/close */ - if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0) + if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; if (H5Oclose(oid) < 0) TEST_ERROR; diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 0cdba24..4509945 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -24,7 +24,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test scripts-- # testpflush.sh: TEST_SCRIPT_PARA = testpflush.sh -SCRIPT_DEPEND = t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) +SCRIPT_DEPEND = t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) check_SCRIPTS = $(TEST_SCRIPT_PARA) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 6b9aaeb..41ecf86 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -506,17 +506,17 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] * with 2 MPI ranks and with $HDF5TestExpress == 0 * i.e. Exhaustive test run is allowed. Otherwise * the test is skipped. - * + * * Thanks to l.ferraro@cineca.it for the following test:: * - * This is a simple test case to reproduce a problem - * occurring on LUSTRE filesystem with the creation - * of a 4GB dataset using chunking with parallel HDF5. - * The test works correctly if disabling chunking or - * when the bytes assigned to each process is less - * that 4GB. if equal or more, either hangs or results - * in a PMPI_Waitall error. - * + * This is a simple test case to reproduce a problem + * occurring on LUSTRE filesystem with the creation + * of a 4GB dataset using chunking with parallel HDF5. + * The test works correctly if disabling chunking or + * when the bytes assigned to each process is less + * that 4GB. if equal or more, either hangs or results + * in a PMPI_Waitall error. + * * $> mpirun -genv I_MPI_EXTRA_FILESYSTEM on * -genv I_MPI_EXTRA_FILESYSTEM_LIST gpfs * -n 1 ./h5_mpi_big_dataset.x 1024 1024 1024 @@ -572,7 +572,7 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank ) */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); VRFY((file_id >= 0), "H5Fcreate succeeded"); - + H5Pclose(plist_id); /* @@ -4918,7 +4918,7 @@ main(int argc, char **argv) /* Display testing information */ if (MAINPROCESS) TestInfo(argv[0]); - + /* setup file access property list */ fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, test_comm, MPI_INFO_NULL); diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index e950015..740f78e 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -16,7 +16,7 @@ #define HYPER 1 #define POINT 2 -#define ALL 3 +#define ALL 3 /* some commonly used routines for collective chunk IO tests*/ diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c index d4b2106..d4aaa2e 100644 --- a/testpar/t_coll_md_read.c +++ b/testpar/t_coll_md_read.c @@ -48,7 +48,7 @@ * in strictly non-decreasing order of chunk address. For version 1 and 2 B-trees, * this caused the non-participating ranks to issue a collective MPI_Bcast() call * which the other ranks did not issue, thus causing a hang. - * + * * However, since these ranks are not actually reading/writing anything, this call * can simply be removed and the address used for the read/write can be set to an * arbitrary number (0 was chosen). diff --git a/testpar/t_file.c b/testpar/t_file.c index 6183b8d..19a75c8 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -736,7 +736,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, } /* - * NOTE: See HDFFV-10894 and add tests later to verify MPI-specific properties in the + * NOTE: See HDFFV-10894 and add tests later to verify MPI-specific properties in the * incoming fapl that could conflict with the existing values in H5F_shared_t on * multiple opens of the same file. */ diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index 62db11a..81bb7c2 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -21,11 +21,11 @@ * * Process zero: * - * 1) Creates a core file with an integer vector data set of - * length n (= mpi_size), + * 1) Creates a core file with an integer vector data set of + * length n (= mpi_size), * - * 2) Initializes the vector to zero in * location 0, and to -1 - * everywhere else. + * 2) Initializes the vector to zero in * location 0, and to -1 + * everywhere else. * * 3) Flushes the core file, and gets an image of it. Closes * the core file. @@ -35,7 +35,7 @@ * 5) Awaits receipt on a file image from process n-1. * * 6) opens the image received from process n-1, verifies that - * it contains a vector of length equal to mpi_size, and + * it contains a vector of length equal to mpi_size, and * that the vector contains (0, 1, 2, ... n-1) * * 7) closes the core file and exits. @@ -45,7 +45,7 @@ * 1) Await receipt of file image from process (i - 1). * * 2) Open the image with the core file driver, verify that i - * contains a vector v of length, and that v[j] = j for + * contains a vector v of length, and that v[j] = j for * 0 <= j < i, and that v[j] == -1 for i <= j < n * * 3) Set v[i] = i in the core file. @@ -87,13 +87,13 @@ file_image_daisy_chain_test(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup file name */ - HDsnprintf(file_name, 1024, "file_image_daisy_chain_test_%05d.h5", + HDsnprintf(file_name, 1024, "file_image_daisy_chain_test_%05d.h5", (int)mpi_rank); if(mpi_rank == 0) { - - /* 1) Creates a core file with an integer vector data set - * of length mpi_size, + + /* 1) Creates a core file with an integer vector data set + * of length mpi_size, */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl_id >= 0), "creating fapl"); @@ -111,10 +111,10 @@ file_image_daisy_chain_test(void) dset_id = H5Dcreate2(file_id, "v", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dset_id >= 0), "created data set"); - - /* 2) Initialize the vector to zero in location 0, and - * to -1 everywhere else. + + /* 2) Initialize the vector to zero in location 0, and + * to -1 everywhere else. */ vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); @@ -131,7 +131,7 @@ file_image_daisy_chain_test(void) HDfree(vector_ptr); vector_ptr = NULL; - + /* 3) Flush the core file, and get an image of it. Close * the core file. */ @@ -159,14 +159,14 @@ file_image_daisy_chain_test(void) err = H5Pclose(fapl_id); VRFY((err >= 0), "closed fapl(1)."); - + /* 4) Send the image to process 1. */ - mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image size to process 1"); - mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process 1"); @@ -190,9 +190,9 @@ file_image_daisy_chain_test(void) &rcvstat); VRFY((mpi_result == MPI_SUCCESS), \ "received file image from process n-1"); - + /* 6) open the image received from process n-1, verify that - * it contains a vector of length equal to mpi_size, and + * it contains a vector of length equal to mpi_size, and * that the vector contains (0, 1, 2, ... n-1). */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); @@ -229,7 +229,7 @@ file_image_daisy_chain_test(void) vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); - err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "read received vector."); @@ -238,7 +238,7 @@ file_image_daisy_chain_test(void) if(vector_ptr[i] != i) vector_ok = FALSE; VRFY((vector_ok), "verified received vector."); - + HDfree(vector_ptr); vector_ptr = NULL; @@ -276,9 +276,9 @@ file_image_daisy_chain_test(void) &rcvstat); VRFY((mpi_result == MPI_SUCCESS), \ "received file image from process mpi_rank-1"); - + /* 2) Open the image with the core file driver, verify that it - * contains a vector v of length, and that v[j] = j for + * contains a vector v of length, and that v[j] = j for * 0 <= j < i, and that v[j] == -1 for i <= j < n */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); @@ -316,7 +316,7 @@ file_image_daisy_chain_test(void) vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); - err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "read received vector."); @@ -331,7 +331,7 @@ file_image_daisy_chain_test(void) } } VRFY((vector_ok), "verified received vector."); - + /* 3) Set v[i] = i in the core file. */ @@ -344,7 +344,7 @@ file_image_daisy_chain_test(void) HDfree(vector_ptr); vector_ptr = NULL; - + /* 4) Flush the core file and send it to process (mpi_rank + 1) % n. */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); @@ -359,14 +359,14 @@ file_image_daisy_chain_test(void) bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); VRFY(bytes_read == image_len, "wrote file into image buffer"); - mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), - MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), \ "sent image size to process (mpi_rank + 1) % mpi_size"); - mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, - MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), \ "sent image to process (mpi_rank + 1) % mpi_size"); @@ -374,7 +374,7 @@ file_image_daisy_chain_test(void) HDfree(image_ptr); image_ptr = NULL; image_len = 0; - + /* 5) close the core file and exit. */ err = H5Sclose(space_id); diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 933fbd2..537e5fa 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -37,7 +37,7 @@ main (int argc, char **argv) /* Initialize and finalize MPI */ MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("Usage of Serial HDF5 after MPI_Finalize() is called"); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 9e5d839..0719ca6 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -302,7 +302,7 @@ static int test_mpio_gb_file(char *filename) { "proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ - for (j = 0; j < MB; j++) + for (j = 0; j < MB; j++) *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 74feeb6..ba4165e 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -281,7 +281,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) /* create a chunked dataset */ chunk[0] = COUNT/8; - + if ( pass ) { if ( (dcpl_id = H5Pcreate (H5P_DATASET_CREATE)) < 0 ) { pass = false; @@ -295,9 +295,9 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) failure_mssg = "H5Pset_chunk() failed.\n"; } } - + if ( pass ) { - + if ( (dset_id_ch = H5Dcreate2(file_id, "dataset0_chunked", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0 ) { @@ -319,7 +319,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) failure_mssg = "H5Pclose(dcpl_id) failed.\n"; } } - + if ( pass || (dset_id_ch != -1)) { if ( H5Dclose(dset_id_ch) < 0 ) { pass = false; @@ -698,8 +698,8 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) data_slice = NULL; } - /* - * Test reading proc0-read-and-bcast with sub-communicators + /* + * Test reading proc0-read-and-bcast with sub-communicators */ /* Don't test with more than LIMIT_NPROC processes to avoid memory issues */ @@ -798,7 +798,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) nextValue = 0; else /* test 2 group 1 */ nextValue = (float)((hsize_t)( mpi_size / 2 )*count); - + i = 0; while ( ( pass ) && ( i < (hsize_t)dset_size ) ) { /* what we really want is data_slice[i] != nextValue -- @@ -863,7 +863,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) nextValue = 0; else /* test 2 group 1 */ nextValue = (float)((hsize_t)( mpi_size / 2 )*count); - + i = 0; while ( ( pass ) && ( i < (hsize_t)dset_size ) ) { /* what we really want is data_slice[i] != nextValue -- @@ -893,8 +893,8 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) data_slice = NULL; } - /* - * Read an H5S_ALL filespace into a hyperslab defined memory space + /* + * Read an H5S_ALL filespace into a hyperslab defined memory space */ if ( (data_slice = (float *)HDmalloc((size_t)(dset_size*2)*filetype_size)) == NULL ) { @@ -979,14 +979,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) i++; } } - + if ( pass || (memspace != -1) ) { if ( H5Sclose(memspace) < 0 ) { pass = false; failure_mssg = "H5Sclose(memspace) failed.\n"; } } - + /* free data_slice if it has been allocated */ if ( data_slice != NULL ) { HDfree(data_slice); diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index cf974e8..831f1a2 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -48,11 +48,11 @@ main (int argc, char **argv) MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("proper shutdown of HDF5 library"); - + /* Set up file access property list with parallel I/O access */ fapl = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl >= 0), "H5Pcreate succeeded"); @@ -121,7 +121,7 @@ main (int argc, char **argv) HDremove(filename); /* release data buffers */ - if(data_array) + if(data_array) HDfree(data_array); nerrors += GetTestNumErrs(); diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 62e4dde..dde322d 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -97,7 +97,7 @@ test_plist_ed(void) int mpi_size, mpi_rank, recv_proc; - hsize_t chunk_size = 16384; /* chunk size */ + hsize_t chunk_size = 16384; /* chunk size */ double fill = 2.7f; /* Fill value */ size_t nslots = 521*2; size_t nbytes = 1048576 * 10; @@ -165,16 +165,16 @@ test_plist_ed(void) VRFY((ret>=0), "set fill-value succeeded"); max_size[0] = 100; - ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index ddbae9e..731c719 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -51,11 +51,11 @@ main (int argc, char **argv) MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("proper shutdown of HDF5 library"); - + /* Set up file access property list with parallel I/O access */ fapl = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl >= 0), "H5Pcreate succeeded"); @@ -107,7 +107,7 @@ main (int argc, char **argv) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release data buffers */ - if(data_array) + if(data_array) HDfree(data_array); MPI_Finalize(); diff --git a/testpar/testpar.h b/testpar/testpar.h index 2c1bce2..f76de51 100644 --- a/testpar/testpar.h +++ b/testpar/testpar.h @@ -34,7 +34,7 @@ if (VERBOSE_MED && *mesg != '\0') \ HDprintf("%s\n", mesg) -/* +/* * VRFY: Verify if the condition val is true. * If it is true, then call MESG to print mesg, depending on the verbose * level. diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 88473ad..affdf99 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -133,8 +133,8 @@ extern "C" { *------------------------------------------------------------------------- */ H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order); -H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, - hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, +H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, + hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata, unsigned fields); H5TOOLS_DLL herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path); H5TOOLS_DLL hbool_t symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path); diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am index beceee5..93fcc1e 100644 --- a/tools/src/Makefile.am +++ b/tools/src/Makefile.am @@ -23,6 +23,6 @@ CONFIG=ordered # All subdirectories SUBDIRS=h5diff h5ls h5dump misc h5import h5repack h5jam h5copy \ - h5format_convert h5stat + h5format_convert h5stat include $(top_srcdir)/config/conclude.am diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index e05a8e3..3b0fe1c 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -27,20 +27,20 @@ static int check_d_input(const char*); */ static const char *s_opts = "hVrv:qn:d:p:NcelxE:S"; static struct long_options l_opts[] = { - { "help", no_arg, 'h' }, - { "version", no_arg, 'V' }, - { "report", no_arg, 'r' }, - { "verbose", optional_arg, 'v' }, - { "quiet", no_arg, 'q' }, - { "count", require_arg, 'n' }, - { "delta", require_arg, 'd' }, - { "relative", require_arg, 'p' }, - { "nan", no_arg, 'N' }, - { "compare", no_arg, 'c' }, + { "help", no_arg, 'h' }, + { "version", no_arg, 'V' }, + { "report", no_arg, 'r' }, + { "verbose", optional_arg, 'v' }, + { "quiet", no_arg, 'q' }, + { "count", require_arg, 'n' }, + { "delta", require_arg, 'd' }, + { "relative", require_arg, 'p' }, + { "nan", no_arg, 'N' }, + { "compare", no_arg, 'c' }, { "use-system-epsilon", no_arg, 'e' }, - { "follow-symlinks", no_arg, 'l' }, - { "no-dangling-links", no_arg, 'x' }, - { "exclude-path", require_arg, 'E' }, + { "follow-symlinks", no_arg, 'l' }, + { "no-dangling-links", no_arg, 'x' }, + { "exclude-path", require_arg, 'E' }, { "enable-error-stack", no_arg, 'S' }, { NULL, 0, '\0' } }; @@ -78,13 +78,7 @@ static void check_options(diff_opt_t* opts) *------------------------------------------------------------------------- */ -void parse_command_line(int argc, - const char* argv[], - const char** fname1, - const char** fname2, - const char** objname1, - const char** objname2, - diff_opt_t* opts) +void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts) { int i; int opt; @@ -201,7 +195,7 @@ void parse_command_line(int argc, } else { while(NULL != exclude_prev->next) - exclude_prev=exclude_prev->next; + exclude_prev = exclude_prev->next; exclude_node->next = NULL; exclude_prev->next = exclude_node; @@ -209,7 +203,7 @@ void parse_command_line(int argc, break; case 'd': - opts->d=1; + opts->d = 1; if (check_d_input(opt_arg) == - 1) { HDprintf("<-d %s> is not a valid option\n", opt_arg); @@ -224,7 +218,7 @@ void parse_command_line(int argc, break; case 'p': - opts->p=1; + opts->p = 1; if (check_p_input(opt_arg) == -1) { HDprintf("<-p %s> is not a valid option\n", opt_arg); usage(); @@ -238,7 +232,7 @@ void parse_command_line(int argc, break; case 'n': - opts->n=1; + opts->n = 1; if ( check_n_input(opt_arg) == -1) { HDprintf("<-n %s> is not a valid option\n", opt_arg); usage(); diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index d97fdc0..d9ea4b0 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -861,14 +861,14 @@ parse_command_line(int argc, const char *argv[]) int opt; int last_was_dset = FALSE; - /* no arguments */ + /* no arguments */ if (argc == 1) { usage(h5tools_getprogname()); goto error; } /* this will be plenty big enough to hold the info */ - if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t))) == NULL) { goto error; } diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index 801f60d..ca1fef6 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -43,6 +43,7 @@ typedef struct h5dump_table_items_t { table_t *dset_table; /* Table of datasets */ table_t *type_table; /* Table of datatypes */ } h5dump_table_items_t; + typedef struct h5dump_table_list_t { size_t nalloc; size_t nused; diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index d9f1f67..1a7c3ce 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -732,7 +732,7 @@ xml_escape_the_name(const char *str) * Programmer: REMcG *------------------------------------------------------------------------- */ -static char * +static char * xml_escape_the_string(const char *str, int slen) { size_t extra; diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index bb606ac..8e0d857 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -18,7 +18,7 @@ /* * We include the private header file so we can get to the uniform - * programming environment it declares. + * programming environment it declares. * HDF5 API functions (except for H5G_basename()) */ #include "H5private.h" @@ -42,13 +42,13 @@ static int verbose_g = 0; static const char *s_opts = "hVvd:n"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, - { "hel", no_arg, 'h'}, - { "he", no_arg, 'h'}, + { "hel", no_arg, 'h'}, + { "he", no_arg, 'h'}, { "version", no_arg, 'V' }, - { "version", no_arg, 'V' }, - { "versio", no_arg, 'V' }, - { "versi", no_arg, 'V' }, - { "vers", no_arg, 'V' }, + { "version", no_arg, 'V' }, + { "versio", no_arg, 'V' }, + { "versi", no_arg, 'V' }, + { "vers", no_arg, 'V' }, { "verbose", no_arg, 'v' }, { "verbos", no_arg, 'v' }, { "verbo", no_arg, 'v' }, @@ -73,7 +73,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static void usage(const char *prog) +static void usage(const char *prog) { HDfprintf(stdout, "usage: %s [OPTIONS] file_name\n", prog); HDfprintf(stdout, " OPTIONS\n"); @@ -113,62 +113,66 @@ static void usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char **argv) +parse_command_line(int argc, const char **argv) { int opt; /* no arguments */ if (argc == 1) { usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); goto error; } /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch((char) opt) { - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - goto error; - - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - goto error; - - case 'v': - verbose_g = TRUE; - break; - - case 'd': /* -d dname */ - if(opt_arg != NULL && *opt_arg) - dname_g = HDstrdup(opt_arg); - if(dname_g == NULL) { - h5tools_setstatus(EXIT_FAILURE); - error_msg("No dataset name\n", opt_arg); - usage(h5tools_getprogname()); - goto error; - } - dset_g = TRUE; - break; - - case 'n': /* -n */ - noop_g = TRUE; - break; - - default: - h5tools_setstatus(EXIT_FAILURE); - usage(h5tools_getprogname()); - goto error; - break; - } /* switch */ + switch((char) opt) { + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + goto error; + + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + goto error; + + case 'v': + verbose_g = TRUE; + break; + + case 'd': /* -d dname */ + if(opt_arg != NULL && *opt_arg) + dname_g = HDstrdup(opt_arg); + if(dname_g == NULL) { + h5tools_setstatus(EXIT_FAILURE); + error_msg("No dataset name\n", opt_arg); + usage(h5tools_getprogname()); + goto error; + } + dset_g = TRUE; + break; + + case 'n': /* -n */ + noop_g = TRUE; + break; + + case 'E': + enable_error_stack = 1; + break; + + default: + h5tools_setstatus(EXIT_FAILURE); + usage(h5tools_getprogname()); + goto error; + break; + } /* switch */ } /* while */ if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); goto error; } @@ -327,7 +331,7 @@ done: } else if(verbose_g) HDfprintf(stdout, "Close the dataset\n"); - + /* Close the dataset creation property list */ if(H5Pclose(dcpl) < 0) { error_msg("unable to close dataset creation property list\n"); @@ -470,7 +474,7 @@ done: HDfree(fname_g); if(dname_g) HDfree(dname_g); - + H5Eset_auto2(H5E_DEFAULT, func, edata); leave(h5tools_getstatus()); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 07797c8..009e527 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -148,7 +148,7 @@ parse_command_line (int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) { diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index ad1742b..570e3a1 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -13,7 +13,7 @@ /* * A program to verify that the chunk indexing type of a dataset in a file - * is version 1 B-tree. + * is version 1 B-tree. * This is to support the testing of the tool "h5format_convert". */ @@ -32,7 +32,7 @@ usage(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: To check that the chunk indexing type for the dataset in + * Purpose: To check that the chunk indexing type for the dataset in * the file is version 1 B-tree. * * Return: 0 -- the indexing type is version 1 B-tree @@ -90,7 +90,7 @@ main(int argc, char *argv[]) } /* end if */ /* Return success when the chunk indexing type is version 1 B-tree */ - if(idx_type == H5D_CHUNK_IDX_BTREE) + if(idx_type == H5D_CHUNK_IDX_BTREE) HDexit(EXIT_SUCCESS); else { HDfprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 38f7b2f..29906a1 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -42,7 +42,7 @@ LDADD=../../src/h5repack/libh5repack.la $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) testh5repack_detect_szip_SOURCES=testh5repack_detect_szip.c -h5repacktst_SOURCES=h5repacktst.c +h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL diff --git a/tools/test/misc/vds/UC_1.h b/tools/test/misc/vds/UC_1.h index 9d1f758..d922d22 100644 --- a/tools/test/misc/vds/UC_1.h +++ b/tools/test/misc/vds/UC_1.h @@ -49,7 +49,7 @@ | | +-------M-------+ - + dim[0] / diff --git a/tools/test/misc/vds/UC_1_one_dim_gen.c b/tools/test/misc/vds/UC_1_one_dim_gen.c index b5ddae3..7c4201e 100644 --- a/tools/test/misc/vds/UC_1_one_dim_gen.c +++ b/tools/test/misc/vds/UC_1_one_dim_gen.c @@ -44,7 +44,7 @@ static char UC_1_VDS_FILE_NAME[NAME_LEN] = "1_vds.h5"; /* Dataset names */ static char UC_1_SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; static char UC_1_VDS_DSET_NAME[NAME_LEN] = "vds_dset"; - + /* Fill values */ static int UC_1_FILL_VALUES[UC_1_N_SOURCES] = { -1, @@ -162,7 +162,7 @@ main(void) value = ((i + 1) * 10) + j; for(k = 0; k < count; k++) - buffer[k] = value; + buffer[k] = value; start[0] = (hsize_t)j; start[1] = 0; diff --git a/tools/test/misc/vds/UC_2.h b/tools/test/misc/vds/UC_2.h index a3ee0f7..07f9b9a 100644 --- a/tools/test/misc/vds/UC_2.h +++ b/tools/test/misc/vds/UC_2.h @@ -45,7 +45,7 @@ | | dim[1] - + */ #define UC_2_N_SOURCES 5 @@ -98,7 +98,7 @@ static char UC_2_FILE_NAMES[UC_2_N_SOURCES][NAME_LEN] = { /* VDS file name */ #define UC_2_VDS_FILE_NAME "2_vds.h5" - + /* Dataset names */ #define UC_2_SOURCE_DSET_NAME "source_dset" #define UC_2_SOURCE_DSET_PATH "/source_dset" diff --git a/tools/test/misc/vds/UC_2_two_dims_gen.c b/tools/test/misc/vds/UC_2_two_dims_gen.c index 8e1554b..b9799d6 100644 --- a/tools/test/misc/vds/UC_2_two_dims_gen.c +++ b/tools/test/misc/vds/UC_2_two_dims_gen.c @@ -168,7 +168,7 @@ main(void) value = ((i + 1) * 10) + j; for(k = 0; k < count; k++) - buffer[k] = value; + buffer[k] = value; start[0] = (hsize_t)j; start[1] = 0; diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 5557558..e594e34 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -112,51 +112,51 @@ static int create_dset1(hid_t file) hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2}; int data[DSET1_DIM1][DSET1_DIM2]; /* data for writing */ int i, j; - + /* Create the data space. */ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) goto error; - + /* Modify dataset creation properties, i.e. enable chunking */ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0) goto error; - + /* Set the dummy filter simply for counting the number of bytes being read into the memory */ if(H5Zregister(H5Z_COUNTER) < 0) goto error; - + if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0) goto error; - + /* Create a new dataset within the file using chunk creation properties. */ if((dataset = H5Dcreate2 (file, DSET1_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - + for (i = 0; i < DSET1_DIM1; i++) for (j = 0; j < DSET1_DIM2; j++) data[i][j] = i+j; - + /* Write data to dataset */ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) goto error; - + /* Close resources */ H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); } H5E_END_TRY; - + return 1; } @@ -173,51 +173,51 @@ static int create_dset2(hid_t file) hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2}; int data[DSET2_DIM1][DSET2_DIM2]; /* data for writing */ int i, j; - + /* Create the data space. */ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) goto error; - + /* Modify dataset creation properties, i.e. enable chunking */ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0) goto error; - + /* Set the dummy filter simply for counting the number of bytes being read into the memory */ if(H5Zregister(H5Z_COUNTER) < 0) goto error; if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0) goto error; - + /* Create a new dataset within the file using chunk creation properties. */ if((dataset = H5Dcreate2 (file, DSET2_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - + for (i = 0; i < DSET2_DIM1; i++) for (j = 0; j < DSET2_DIM2; j++) data[i][j] = i+j; - + /* Write data to dataset */ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) goto error; - + /* Close resources */ H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); - + return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); } H5E_END_TRY; - + return 1; } /*--------------------------------------------------------------------------- @@ -230,56 +230,56 @@ static int check_partial_chunks_perf(hid_t file) hid_t filespace = H5I_INVALID_HID; hid_t memspace = H5I_INVALID_HID; hid_t dapl = H5I_INVALID_HID; - + int rdata[DSET1_DIM2]; /* data for reading */ int i; - + hsize_t row_rank = 1; hsize_t row_dim[1] = {DSET1_DIM2}; hsize_t start[RANK] = {0, 0}; hsize_t count[RANK] = {1, DSET1_DIM2}; double start_t, end_t; - + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) goto error; if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0) goto error; dataset = H5Dopen2 (file, DSET1_NAME, dapl); - + H5_CHECK_OVERFLOW(row_rank, hsize_t, int); memspace = H5Screate_simple((int)row_rank, row_dim, NULL); filespace = H5Dget_space(dataset); - + nbytes_global = 0; - + start_t = retrieve_time(); - + /* Read the data row by row */ for(i = 0; i < DSET1_DIM1; i++) { start[0] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; - + if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rdata) < 0) goto error; } - + end_t = retrieve_time(); - + #ifdef H5_HAVE_GETTIMEOFDAY printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); #else printf("1. Partial chunks: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); #endif - + H5Dclose (dataset); H5Sclose (filespace); H5Sclose (memspace); H5Pclose (dapl); - + return 0; error: H5E_BEGIN_TRY { @@ -302,21 +302,21 @@ static int check_hash_value_perf(hid_t file) hid_t filespace = H5I_INVALID_HID; hid_t memspace = H5I_INVALID_HID; hid_t dapl = H5I_INVALID_HID; - + int rdata[DSET2_DIM1]; /* data for reading */ int i; - + hsize_t column_rank = 1; hsize_t column_dim[1] = {DSET2_DIM1}; hsize_t start[RANK] = {0, 0}; hsize_t count[RANK] = {DSET2_DIM1, 1}; double start_t, end_t; - + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) goto error; if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0) goto error; - + if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0) goto error; @@ -325,37 +325,37 @@ static int check_hash_value_perf(hid_t file) goto error; if((filespace = H5Dget_space(dataset)) < 0) goto error; - + nbytes_global = 0; - + start_t = retrieve_time(); - + /* Read the data column by column */ for(i = 0; i < DSET2_DIM2; i++) { start[1] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; - + if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rdata) < 0) goto error; } - + end_t = retrieve_time(); - + #ifdef H5_HAVE_GETTIMEOFDAY printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); #else printf("2. Hash value: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); #endif - + H5Dclose (dataset); H5Sclose (filespace); H5Sclose (memspace); H5Pclose (dapl); return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); @@ -377,14 +377,14 @@ main (void) { hid_t file; /* handles */ int nerrors = 0; - + /* Create a new file. If file exists its contents will be overwritten. */ if((file = H5Fcreate (FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; nerrors += create_dset1(file); nerrors += create_dset2(file); - + if(H5Fclose (file) < 0) goto error; @@ -394,14 +394,14 @@ main (void) nerrors += check_partial_chunks_perf(file); nerrors += check_hash_value_perf(file); - + if(H5Fclose (file) < 0) goto error; - + if (nerrors>0) goto error; cleanup(); return 0; - + error: fprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index f13cd24..20b7237 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -75,7 +75,7 @@ const char *FILENAME[] = { #define NX 100 #define NY 1000 #define NZ 250 -#define CHUNK_NX 1 +#define CHUNK_NX 1 #define CHUNK_NY 1000 #define CHUNK_NZ 250 @@ -108,7 +108,7 @@ void reportTime(struct timeval start, double mbytes) } /* end if */ /*printf("mbytes=%lf, sec=%lf, usec=%lf\n", mbytes, (double)timeval_diff.tv_sec, (double)timeval_diff.tv_usec);*/ - printf("MBytes/second: %lf\n", (double)mbytes/((double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0))); + printf("MBytes/second: %lf\n", (double)mbytes/((double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0))); } /*-------------------------------------------------- @@ -121,7 +121,7 @@ int create_file(hid_t fapl_id) hid_t fapl; hid_t cparms; hid_t dataspace, dataset; - hsize_t dims[RANK] = {NX, NY, NZ}; + hsize_t dims[RANK] = {NX, NY, NZ}; hsize_t chunk_dims[RANK] ={CHUNK_NX, CHUNK_NY, CHUNK_NZ}; unsigned int aggression = 9; /* Compression aggression setting */ int ret; @@ -198,7 +198,7 @@ int create_file(hid_t fapl_id) if(H5Dclose(dataset) < 0) TEST_ERROR; - if(H5Fclose(file) < 0) + if(H5Fclose(file) < 0) TEST_ERROR; if(H5Sclose(dataspace) < 0) @@ -223,7 +223,7 @@ int create_file(hid_t fapl_id) /* Initialize data for chunks */ for(i = 0; i < NX; i++) { p = direct_buf[i] = (unsigned int*)malloc(CHUNK_NY*CHUNK_NZ*sizeof(unsigned int)); - + for(j=0; j < CHUNK_NY*CHUNK_NZ; j++, p++) *p = rand() % 65000; @@ -267,7 +267,7 @@ error: } /*-------------------------------------------------- - * Benchmark the performance of the new function + * Benchmark the performance of the new function * with precompressed data. *-------------------------------------------------- */ @@ -283,8 +283,8 @@ test_direct_write_uncompressed_data(hid_t fapl_id) unsigned filter_mask = 0; hsize_t offset[RANK] = {0, 0, 0}; - struct timeval timeval_start; - + struct timeval timeval_start; + TESTING("H5Dwrite_chunk for uncompressed data"); if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -301,8 +301,8 @@ test_direct_write_uncompressed_data(hid_t fapl_id) TEST_ERROR; - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i<NX; i++) { status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, CHUNK_NY*CHUNK_NZ*sizeof(unsigned int), direct_buf[i]); (offset[0])++; @@ -315,8 +315,8 @@ test_direct_write_uncompressed_data(hid_t fapl_id) H5Pclose(dxpl); H5Fclose(file); - /* Report the performance */ - reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); + /* Report the performance */ + reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); PASSED(); return 0; @@ -332,7 +332,7 @@ error: /*-------------------------------------------------- - * Benchmark the performance of the new function + * Benchmark the performance of the new function * with precompressed data. *-------------------------------------------------- */ @@ -348,8 +348,8 @@ test_direct_write_compressed_data(hid_t fapl_id) unsigned filter_mask = 0; hsize_t offset[RANK] = {0, 0, 0}; - struct timeval timeval_start; - + struct timeval timeval_start; + TESTING("H5DOwrite_chunk for pre-compressed data"); if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -366,8 +366,8 @@ test_direct_write_compressed_data(hid_t fapl_id) TEST_ERROR; - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i<NX; i++) { status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, data_size[i], outbuf[i]); (offset[0])++; @@ -379,9 +379,9 @@ test_direct_write_compressed_data(hid_t fapl_id) H5Dclose(dataset); H5Pclose(dxpl); H5Fclose(file); - - /* Report the performance */ - reportTime(timeval_start, (double)(total_size/MB)); + + /* Report the performance */ + reportTime(timeval_start, (double)(total_size/MB)); PASSED(); return 0; @@ -416,7 +416,7 @@ test_compressed_write(hid_t fapl_id) hsize_t count[RANK]; /* Block count */ hsize_t block[RANK]; /* Block sizes */ - struct timeval timeval_start; + struct timeval timeval_start; TESTING("H5Dwrite with compression enabled"); @@ -443,14 +443,14 @@ test_compressed_write(hid_t fapl_id) stride[0] = stride[1] = stride[2] = 1; count[0] = count[1] = count[2] = 1; block[0] = CHUNK_NX; block[1] = CHUNK_NY; block[2] = CHUNK_NZ; - + for(i=0; i<NX; i++) { /* * Select hyperslab for one chunk in the file */ if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) TEST_ERROR; - (start[0])++; + (start[0])++; if((status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, direct_buf[i])) < 0) @@ -465,10 +465,10 @@ test_compressed_write(hid_t fapl_id) H5Sclose(mem_space); H5Pclose(dxpl); H5Fclose(file); - - /* Report the performance */ - reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); - + + /* Report the performance */ + reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); + PASSED(); return 0; @@ -504,7 +504,7 @@ test_no_compress_write(hid_t fapl_id) hsize_t count[RANK]; /* Block count */ hsize_t block[RANK]; /* Block sizes */ - struct timeval timeval_start; + struct timeval timeval_start; TESTING("H5Dwrite without compression"); @@ -531,14 +531,14 @@ test_no_compress_write(hid_t fapl_id) stride[0] = stride[1] = stride[2] = 1; count[0] = count[1] = count[2] = 1; block[0] = CHUNK_NX; block[1] = CHUNK_NY; block[2] = CHUNK_NZ; - + for(i=0; i<NX; i++) { /* * Select hyperslab for one chunk in the file */ if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) TEST_ERROR; - (start[0])++; + (start[0])++; if((status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, direct_buf[i])) < 0) @@ -553,10 +553,10 @@ test_no_compress_write(hid_t fapl_id) H5Sclose(mem_space); H5Pclose(dxpl); H5Fclose(file); - - /* Report the performance */ - reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); - + + /* Report the performance */ + reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB)); + PASSED(); return 0; @@ -576,13 +576,13 @@ error: * data to a Unix file *-------------------------------------------------- */ -int +int test_unix_write(void) { int file, flag; - ssize_t op_size; + ssize_t op_size; int i; - struct timeval timeval_start; + struct timeval timeval_start; TESTING("Write compressed data to a Unix file"); @@ -595,8 +595,8 @@ test_unix_write(void) if ((file=open(FILENAME[1],flag))== -1) TEST_ERROR; - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i<NX; i++) { op_size = write(file, outbuf[i],data_size[i]); if (op_size < 0) @@ -617,14 +617,14 @@ test_unix_write(void) TEST_ERROR; } - /* Report the performance */ - reportTime(timeval_start, (double)(total_size/MB)); + /* Report the performance */ + reportTime(timeval_start, (double)(total_size/MB)); PASSED(); return 0; error: - return 1; + return 1; } /*-------------------------------------------------- @@ -650,7 +650,7 @@ main (void) free(outbuf[i]); free(direct_buf[i]); } - + return 0; } diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 108d9e4..58558a5 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -217,9 +217,9 @@ test(fill_t fill_style, const double splits[], fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error; - if(FILL_RANDOM==fill_style) + if(FILL_RANDOM==fill_style) had = (int *)calloc((size_t)cur_size[0], sizeof(int)); - + for (i=1; i<=cur_size[0]; i++) { /* Decide which chunk to write to */ @@ -391,7 +391,7 @@ main(int argc, char *argv[]) nerrors += test(FILL_INWARD, splits, FALSE, use_cache); nerrors += test(FILL_OUTWARD, splits, FALSE, use_cache); nerrors += test(FILL_RANDOM, splits, FALSE, use_cache); - } + } else { if (use_cache) usage(argv[0]); nerrors += test(fill_style, splits, TRUE, FALSE); diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 826e7a9..8146d84 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,7 +80,7 @@ #define PIO_MPI 0x2 #define PIO_HDF5 0x4 -#ifdef STANDALONE +#ifdef STANDALONE #define DBL_EPSILON 2.2204460492503131e-16 #define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON) #endif diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index 9ea94cb..aa3a316 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -1321,7 +1321,7 @@ do_cleanupfile(iotype iot, char *filename) } H5Pclose(fapl); break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); |