diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-10-09 19:24:40 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-10-09 19:24:40 (GMT) |
commit | 356f15512249de605e409d2977b0f9f26437b64f (patch) | |
tree | badfc1c13050bc1e4f3670fd7d2db91e6137f4e2 | |
parent | 30a3aee50d29bc1cb8db1a4c88aff07757e00be4 (diff) | |
parent | 9a074a6679fa08b6aa07cc9d2599c51ddb22f514 (diff) | |
download | hdf5-356f15512249de605e409d2977b0f9f26437b64f.zip hdf5-356f15512249de605e409d2977b0f9f26437b64f.tar.gz hdf5-356f15512249de605e409d2977b0f9f26437b64f.tar.bz2 |
[svn-r25687] merge from trunk.
39 files changed, 307 insertions, 142 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index a04b06a..beeea60 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -34,7 +34,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- -# Set includess needed for build +# Set includes needed for build #----------------------------------------------------------------------------- set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} @@ -52,12 +52,12 @@ set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR}) # Configure the hdf5-config.cmake file for the build directory #----------------------------------------------------------------------------- set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR ) -set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/share" ) +set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" ) set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" ) @@ -81,12 +81,12 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR ) -set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/" ) +set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" ) set(CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" PATH_VARS HDF5_INSTALL_INCLUDE_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR ) @@ -1,4 +1,4 @@ -HDF5 version 1.9.198 currently under development +HDF5 version 1.9.199 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 5da3cca..d9d0c03 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -26,6 +26,16 @@ installlog="#${progname}_5install.log" srcdir="../hdf5" # expected source directory exit_code=0 +# Cmake build options +hdf5_src=../hdf5 +cacheinit=$hdf5_src/config/cmake/cacheinit.cmake +build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON # C++ interface default on +build_fortran= #-DHDF5_BUILD_FORTRAN:BOOL=ON # Fortran interface default off +build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on +build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on +build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on + + #============= # Function definitions #============= @@ -99,7 +109,13 @@ fi echo Running Cmake for HDF5-${version} ... # 4. Configure the C library, tools and tests with this command: -STEP "Configure..." "cmake -G 'Unix Makefiles' -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5" $configlog +STEP "Configure..." "cmake \ + $build_cpp_lib \ + $build_fortran \ + $build_hl_lib \ + $build_testing \ + $build_tools \ + $hdf5_src" $configlog # 5. Build the C library, tools and tests with this command: STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 852658b..8807dca 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -54,15 +54,16 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) rank = H5Tget_array_ndims(existing_id); if (rank < 0) { - throw DataTypeIException("ArrayType overloaded constructor", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_ndims failed"); } - // Get the dimensions of the existing array and store it in this array - dimensions = new hsize_t[rank]; - //hsize_t rdims2[H5S_MAX_RANK]; - int ret_value = H5Tget_array_dims2(id, dimensions); - if (ret_value < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); + // Allocate space for the dimensions + dimensions = new hsize_t[rank]; + + // Get the dimensions of the existing array and store it in this array + int ret_value = H5Tget_array_dims2(id, dimensions); + if (ret_value < 0) + throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_dims2 failed"); } //-------------------------------------------------------------------------- @@ -72,10 +73,13 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) //-------------------------------------------------------------------------- ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) { - rank = original.rank; - dimensions = new hsize_t[rank]; - for (int i = 0; i < rank; i++) - dimensions[i] = original.dimensions[i]; + // Copy the rank of the original array + rank = original.rank; + + // Allocate space then copy the dimensions from the original array + dimensions = new hsize_t[rank]; + for (int i = 0; i < rank; i++) + dimensions[i] = original.dimensions[i]; } //-------------------------------------------------------------------------- @@ -90,14 +94,19 @@ ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { - hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); - if (new_type_id < 0) - throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); - id = new_type_id; - rank = ndims; - dimensions = new hsize_t[rank]; - for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + // Call C API to create an array data type + hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); + if (new_type_id < 0) + throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + + // Set the id and rank for this object + id = new_type_id; + rank = ndims; + + // Allocate space then set the dimensions as provided by caller + dimensions = new hsize_t[rank]; + for (int i = 0; i < rank; i++) + dimensions[i] = dims[i]; } //-------------------------------------------------------------------------- @@ -132,19 +141,19 @@ int ArrayType::getArrayNDims() //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) { - // if the array's dimensions have not been stored, retrieve them via C API + // If the array's dimensions have not been stored, retrieve them via C API if (dimensions == NULL) { int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); - // store the array's info in memory + // Store the array's info in memory rank = ndims; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) dimensions[i] = dims[i]; } - // otherwise, simply copy what's in 'dimensions' to 'dims' + // Otherwise, simply copy what's in 'dimensions' to 'dims' for (int i = 0; i < rank; i++) dims[i] = dimensions[i]; return(rank); diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index bdd0ac0..a9e928d 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -50,7 +50,7 @@ class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate ///\brief Default constructor: Creates a stub attribute // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -Attribute::Attribute() : AbstractDs(), IdComponent(), id(0) {} +Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Attribute copy constructor @@ -162,13 +162,13 @@ void Attribute::read( const DataType& mem_type, void *buf ) const // Mar 2008 // Corrected a misunderstanding that H5Aread would allocate // space for the buffer. Obtained the attribute size and -// allocated memory properly. - BMR +// allocated memory properly. -BMR // Apr 2009 -// Used getInMemDataSize to get attribute data size. - BMR +// Used getInMemDataSize to get attribute data size. -BMR // Jul 2009 // Divided into specific private functions for fixed- and // variable-len string data: p_read_fixed_len and -// p_read_variable_len. This should improve readability. +// p_read_variable_len. This should improve readability. -BMR //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { @@ -586,7 +586,7 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c // Modification // Jul 2009 // Separated the variable length case from the original -// Attribute::read +// Attribute::read. -BMR //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { @@ -650,7 +650,7 @@ void Attribute::close() throw AttributeIException("Attribute::close", "H5Aclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index d296db4..3aa0386 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -33,6 +33,9 @@ #include "H5Alltypes.h" #include "H5private.h" // for HDstrcpy +#include <iostream> +using namespace std; + // There are a few comments that are common to most of the functions // defined in this file so they are listed here. // - getLocId is called by all functions, that call a C API, to get @@ -440,7 +443,10 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); if( ret_value < 0 ) + { + delete []value_C; throwException("getLinkval", "H5Lget_val failed"); + } value = H5std_string(value_C); delete []value_C; @@ -913,6 +919,12 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name_C, name_len+1, H5P_DEFAULT); + if (name_len < 0) + { + delete []name_C; + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + // clean up and return the string H5std_string name = H5std_string(name_C); delete []name_C; @@ -957,10 +969,15 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) char* name_C = new char[size+1]; // temporary C-string for object name HDmemset(name_C, 0, size+1); // clear buffer + // call overloaded function to get the name ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); if(name_len < 0) + { + delete []name_C; throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + // clean up and return the string name = H5std_string(name_C); delete []name_C; return (name_len); diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index c34769e..6728264 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -52,7 +52,7 @@ namespace H5 { ///\brief Default constructor: creates a stub DataSet. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet::DataSet() : AbstractDs(), H5Object(), id(0) {} +DataSet::DataSet() : AbstractDs(), H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: DataSet overloaded constructor @@ -95,7 +95,7 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0) +DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereferenced"); } @@ -114,7 +114,7 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0) +DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -788,7 +788,7 @@ void DataSet::close() throw DataSetIException("DataSet::close", "H5Dclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 6ad8c8d..20b4e5e 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -630,7 +630,7 @@ void DataSpace::close() throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 9efecdf..b007fd0 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -33,6 +33,12 @@ class H5_DLLCPP DataSpace : public IdComponent { // Creates a simple dataspace DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); + // Creates a DataSpace object using an existing dataspace id. + DataSpace(const hid_t space_id); + + // Copy constructor: makes a copy of the original DataSpace object. + DataSpace(const DataSpace& original); + // Assignment operator DataSpace& operator=( const DataSpace& rhs ); @@ -109,12 +115,6 @@ class H5_DLLCPP DataSpace : public IdComponent { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataSpace"); } - // Creates a DataSpace object using an existing dataspace id. - DataSpace(const hid_t space_id); - - // Copy constructor: makes a copy of the original DataSpace object. - DataSpace(const DataSpace& original); - // Gets the dataspace id. virtual hid_t getId() const; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index afc5678..a435b4e 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -53,7 +53,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType() : H5Object(), id(0) {} +DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: DataType overloaded constructor @@ -105,7 +105,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -124,7 +124,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -710,7 +710,7 @@ void DataType::close() throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 04bb9e0..a91c053 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -159,6 +159,7 @@ H5std_string EnumType::nameOf( void *value, size_t size ) const // If H5Tenum_nameof returns a negative value, raise an exception, if( ret_value < 0 ) { + delete []name_C; throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); } // otherwise, create the string to hold the datatype name and return it diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 5e7ccd4..f153c92 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -80,8 +80,11 @@ H5std_string Exception::getMajorString( hid_t err_major ) const // Check for failure again if( mesg_size < 0 ) + { + delete []mesg_C; throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); + } // Convert the C error description and return H5std_string major_str(mesg_C); @@ -116,8 +119,11 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const // Check for failure again if( mesg_size < 0 ) + { + delete []mesg_C; throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); + } // Convert the C error description and return H5std_string minor_str(mesg_C); diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index be5ce5e..feeb9e8 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -50,7 +50,7 @@ namespace H5 { ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File() : H5Location(), id(0) {} +H5File::H5File() : H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: H5File overloaded constructor @@ -86,7 +86,7 @@ H5File::H5File() : H5Location(), id(0) {} // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0) +H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -111,7 +111,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0) +H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -609,7 +609,7 @@ void H5File::close() throw FileIException("H5File::close", "H5Fclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 7679315..cad5e29 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -51,7 +51,7 @@ namespace H5 { ///\brief Default constructor: creates a stub Group. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group::Group() : H5Object(), id(0) {} +Group::Group() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Group copy constructor @@ -100,7 +100,7 @@ Group::Group(const hid_t existing_id) : H5Object() /// is a datatype that has been named by DataType::commit. // Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- -Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -115,7 +115,7 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- -Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -181,7 +181,7 @@ void Group::close() throw GroupIException("Group::close", "H5Gclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 99a8dc4..4a9dcac 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -145,7 +145,7 @@ int IdComponent::getCounter() const //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) { - if (obj_id == 0) + if (obj_id <= 0) return H5I_BADID; // invalid H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) @@ -317,6 +317,7 @@ H5std_string IdComponent::p_get_file_name() const // Check for failure again if( name_size < 0 ) { + delete []name_C; throw IdComponentException("", "H5Fget_name failed"); } @@ -339,7 +340,7 @@ H5std_string IdComponent::p_get_file_name() const //-------------------------------------------------------------------------- bool IdComponent::p_valid_id(const hid_t obj_id) { - if (obj_id == 0) + if (obj_id <= 0) return false; H5I_type_t id_type = H5Iget_type(obj_id); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 9d3d7bf..cd733c4 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -33,6 +33,9 @@ #include "H5DataSet.h" #include "H5Attribute.h" #include "H5private.h" // for HDmemset +#include <iostream> +using namespace std; + #ifndef H5_NO_NAMESPACE namespace H5 { @@ -551,6 +554,7 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const ssize_t comment_len = getComment(name, tmp_len+1, comment_C); if (comment_len < 0) { + delete []comment_C; throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 0b740d8..5afe80f 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -46,7 +46,7 @@ const PropList PropList::DEFAULT; ///\brief Default constructor: creates a stub property list object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList::PropList() : IdComponent(), id(0) {} +PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- // Function: PropList copy constructor @@ -74,7 +74,7 @@ PropList::PropList(const PropList& original) : IdComponent(original) //-------------------------------------------------------------------------- PropList::PropList( const hid_t plist_id ) : IdComponent() { - if (plist_id == 0) + if (plist_id <= 0) id = H5P_DEFAULT; H5I_type_t id_type = H5Iget_type(plist_id); @@ -277,7 +277,7 @@ void PropList::close() throw PropListIException(inMemFunc("close"), "H5Pclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } @@ -402,6 +402,7 @@ H5std_string PropList::getProperty(const char* name) const // Throw exception if H5Pget returns failure if (ret_value < 0) { + delete []prop_strg_C; throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); } diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index a906b72..5195bba 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -146,6 +146,13 @@ StrType::StrType( const DataSet& dataset ) : AtomType () ///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +///\note +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -166,6 +173,13 @@ H5T_cset_t StrType::getCset() const ///\brief Sets character set to be used. ///\param cset - IN: character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +///\note +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 9c932f1..9652b29 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -681,7 +681,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index ecfa8d0..ad5e6fc 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -598,7 +598,7 @@ static void test_file_attribute() } // end of try block catch (Exception E) { - issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_file_attribute() diff --git a/config/apple b/config/apple index ac93ea5..5203695 100644 --- a/config/apple +++ b/config/apple @@ -31,6 +31,20 @@ if test "X-" = "X-$CC"; then *) CC=clang CC_BASENAME=clang + + # Production + PROD_CFLAGS="-O3" + PROD_CPPFLAGS= + + # Debug + DEBUG_CFLAGS="-g -O0" + DEBUG_CPPFLAGS= + + # Profile + # Use this for profiling with gprof + # Just "-g" for now. More later. + PROFILE_CFLAGS="-g" + PROFILE_CPPFLAGS= ;; esac fi @@ -89,6 +103,16 @@ if test "X-" = "X-$CXX"; then esac fi +case $CXX_BASENAME in + clang++) + PROD_CXXFLAGS="-O3" + DEBUG_CXXFLAGS="-g -O0" + # Use this for profiling with gprof + # Just "-g" for now. More later. + PROFILE_CXXFLAGS="-g" + ;; +esac + # compiler version strings case $CC in clang) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 63a730f..5911fa7 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -13,26 +13,26 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - -if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - - # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - - # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - set (PACKAGE_VERSION_EXACT TRUE) - - if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - # not using this yet - endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") -endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ + if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x + set (PACKAGE_VERSION_COMPATIBLE TRUE) + + if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") + set (PACKAGE_VERSION_EXACT TRUE) + + if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") + # not using this yet + endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") + endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") + else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + set (PACKAGE_VERSION_COMPATIBLE FALSE) + endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") diff --git a/config/lt_vers.am b/config/lt_vers.am index 217f126..868261a 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -16,8 +16,10 @@ ## # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. +# After making changes, run bin/reconfigure to update other configure related +# files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.198. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.199. # # Report bugs to <help@hdfgroup.org>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.198' -PACKAGE_STRING='HDF5 1.9.198' +PACKAGE_VERSION='1.9.199' +PACKAGE_STRING='HDF5 1.9.199' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1489,7 +1489,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.198 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.199 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1559,7 +1559,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.198:";; + short | recursive ) echo "Configuration of HDF5 1.9.199:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.198 +HDF5 configure 1.9.199 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.198, which was +It was created by HDF5 $as_me 1.9.199, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3717,7 +3717,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.198' + VERSION='1.9.199' cat >>confdefs.h <<_ACEOF @@ -31732,7 +31732,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -HDF5 config.lt 1.9.198 +HDF5 config.lt 1.9.199 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33874,7 +33874,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.198, which was +This file was extended by HDF5 $as_me 1.9.199, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33940,7 +33940,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.198 +HDF5 config.status 1.9.199 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 691149f..5b134f1 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.198], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.199], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index a38b5ac..f497fe9 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -732,7 +732,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index e20610b..a07bb23 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -673,7 +673,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 499c5bd..362dd63 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -688,7 +688,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index d7c1d8d..35cdc87 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -669,7 +669,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This library is our main target. diff --git a/perform/perf.c b/perform/perf.c index f006afb..7d329f0 100644 --- a/perform/perf.c +++ b/perform/perf.c @@ -46,7 +46,6 @@ # include <mpio.h> #endif - /* Macro definitions */ /* Verify: * if val is false (0), print mesg and if fatal is true (non-zero), die. @@ -64,6 +63,8 @@ } \ } while(0) #define RANK 1 +#define MAX_PATH 1024 + hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t block[RANK], stride[RANK], count[RANK]; hssize_t start[RANK]; @@ -90,6 +91,11 @@ char opt_file[256] = "perftest.out"; char opt_pvfstab[256] = "notset"; int opt_pvfstab_set = 0; +const char *FILENAME[] = { + opt_file, + NULL +}; + /* function prototypes */ static int parse_args(int argc, char **argv); @@ -114,6 +120,7 @@ int main(int argc, char **argv) MPI_File fh; MPI_Status status; int nchars; + char filename[MAX_PATH]; herr_t ret; /* Generic return value */ /* startup MPI and determine the rank of this process */ @@ -126,7 +133,6 @@ int main(int argc, char **argv) if (mynod == 0) printf("# Using hdf5-io calls.\n"); - /* kindof a weird hack- if the location of the pvfstab file was * specified on the command line, then spit out this location into * the appropriate environment variable: */ @@ -198,8 +204,10 @@ int main(int argc, char **argv) } } + h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename); + /* create the parallel file */ - fid = H5Fcreate(opt_file, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL); /* define a contiquous dataset of opt_iter*nprocs*opt_block chars */ @@ -261,7 +269,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* reopen the file for reading */ - fid=H5Fopen(opt_file,H5F_ACC_RDONLY,acc_tpl); + fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl); VRFY((fid >= 0), "", H5FATAL); /* open the dataset */ @@ -382,6 +390,7 @@ die_jar_jar_die: free(tmp); if (opt_correct) free(tmp2); + MPI_Finalize(); return(0); @@ -405,6 +414,7 @@ parse_args(int argc, char **argv) break; case 'f': /* filename */ strncpy(opt_file, optarg, 255); + FILENAME[0] = opt_file; break; case 'p': /* pvfstab file */ strncpy(opt_pvfstab, optarg, 255); diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 16f37f2..3277ca2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.198 currently under development +HDF5 version 1.9.199 currently under development ================================================================================ @@ -1190,11 +1190,12 @@ Supported Platforms compilers: Version 14.0.2 (Build 20140120) - Linux 2.6.32-431.11.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - IBM XL C/C++ V11.1 - IBM XL Fortran V13.1 + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers ch5.x86_64 GNU/Linux Version 12.1.5.339 (LLNL Aztec) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 4a62bd8..38097c8 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -491,7 +491,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, } if (!memb_addr) { for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) - _memb_addr[mt] = (hsize_t)(mt ? (mt - 1) : 0) * (HADDR_MAX / H5FD_MEM_NTYPES); + _memb_addr[mt] = (hsize_t)(mt ? (mt - 1) : 0) * (HADDR_MAX / (H5FD_MEM_NTYPES-1)); memb_addr = _memb_addr; } diff --git a/src/H5public.h b/src/H5public.h index b479fe5..2ec4d37 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 198 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 199 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.198" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.199" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 98c9cec..ba33c34 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -732,7 +732,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/test/h5test.c b/test/h5test.c index d25b455..61a9ae0 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -92,6 +92,8 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ static const char *multi_letters = "msbrglo"; static herr_t h5_errors(hid_t estack, void *client_data); +static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, + char *fullname, size_t size); /*------------------------------------------------------------------------- @@ -268,9 +270,59 @@ h5_reset(void) char * h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) { + return (h5_fixname_real(base_name, fapl, ".h5", fullname, size)); +} + + +/*------------------------------------------------------------------------- + * Function: h5_fixname_no_suffix + * + * Purpose: Same as h5_fixname but with no suffix appended + * + * Return: Success: The FULLNAME pointer. + * + * Failure: NULL if BASENAME or FULLNAME is the null + * pointer or if FULLNAME isn't large enough for + * the result. + * + *------------------------------------------------------------------------- + */ +char * +h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size) +{ + return (h5_fixname_real(base_name, fapl, NULL, fullname, size)); +} + + +/*------------------------------------------------------------------------- + * Function: h5_fixname_real + * + * Purpose: Create a file name from a file base name like `test' and + * return it through the FULLNAME (at most SIZE characters + * counting the null terminator). The full name is created by + * prepending the contents of HDF5_PREFIX (separated from the + * base name by a slash) and appending a file extension based on + * the driver supplied, resulting in something like + * `ufs:/u/matzke/test.h5'. + * + * Return: Success: The FULLNAME pointer. + * + * Failure: NULL if BASENAME or FULLNAME is the null + * pointer or if FULLNAME isn't large enough for + * the result. + * + * Programmer: Robb Matzke + * Thursday, November 19, 1998 + * + *------------------------------------------------------------------------- + */ +static char * +h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, + char *fullname, size_t size) +{ const char *prefix = NULL; - const char *suffix = ".h5"; /* suffix has default */ char *ptr, last = '\0'; + const char *suffix = _suffix; size_t i, j; hid_t driver = -1; int isppdriver = 0; /* if the driver is MPI parallel */ @@ -285,10 +337,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if((driver = H5Pget_driver(fapl)) < 0) return NULL; - if(H5FD_FAMILY == driver) - suffix = "%05d.h5"; - else if (H5FD_MULTI == driver) - suffix = NULL; + if(suffix) { + if(H5FD_FAMILY == driver) + suffix = "%05d.h5"; + else if (H5FD_MULTI == driver) + suffix = NULL; + } } /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX @@ -318,11 +372,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ if(isppdriver) { #ifdef H5_HAVE_PARALLEL - /* + /* * For parallel: * First use command line option, then the environment * variable, then try the constant - */ + */ static int explained = 0; prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); @@ -335,12 +389,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if (mpi_rank == 0) printf("*** Hint ***\n" - "You can use environment variable HDF5_PARAPREFIX to " - "run parallel test files in a\n" - "different directory or to add file type prefix. E.g.,\n" - " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" - " export HDF5_PARAPREFIX\n" - "*** End of Hint ***\n"); + "You can use environment variable HDF5_PARAPREFIX to " + "run parallel test files in a\n" + "different directory or to add file type prefix. E.g.,\n" + " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" + " export HDF5_PARAPREFIX\n" + "*** End of Hint ***\n"); explained = TRUE; #ifdef HDF5_PARAPREFIX @@ -352,7 +406,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* * For serial: * First use the environment variable, then try the constant - */ + */ prefix = HDgetenv("HDF5_PREFIX"); #ifdef HDF5_PREFIX @@ -425,18 +479,18 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) return NULL; } } else if (HDstrlen(base_name) >= size) { - /* Buffer is too small */ - return NULL; + /* Buffer is too small */ + return NULL; } else { - HDstrcpy(fullname, base_name); - } + HDstrcpy(fullname, base_name); + } /* Append a suffix */ if (suffix) { - if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + if (HDstrlen(fullname) + HDstrlen(suffix) >= size) return NULL; - HDstrcat(fullname, suffix); + HDstrcat(fullname, suffix); } /* Remove any double slashes in the filename */ diff --git a/test/h5test.h b/test/h5test.h index 7813b51..ce224d8 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -142,8 +142,8 @@ extern "C" { /* Generally useful testing routines */ H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); -H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, - size_t size); +H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); +H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 2bc3b09..281b1c0 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -4365,6 +4365,11 @@ test_dense_attr(void) hid_t atFileSpace, atid; hsize_t atDims[1] = {10000}; herr_t status; + const char *filename; + + /* get filename */ + filename = (const char *)GetTestParameters(); + HDassert( filename != NULL ); /* set up MPI parameters */ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); @@ -4376,7 +4381,7 @@ test_dense_attr(void) VRFY((status >= 0), "H5Pset_libver_bounds succeeded"); status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((status >= 0), "H5Pset_fapl_mpio succeeded"); - fid = H5Fcreate("ph5Dense.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fpid); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fpid); VRFY((fid > 0), "H5Fcreate succeeded"); status = H5Pclose(fpid); VRFY((status >= 0), "H5Pclose succeeded"); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index df6257f..c55e2de 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -528,7 +528,7 @@ int main(int argc, char **argv) } AddTest("denseattr", test_dense_attr, NULL, - "Store Dense Attributes", NULL); + "Store Dense Attributes", PARATESTFILE); /* Display testing information */ diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 1154709..7f048a5 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -504,7 +504,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.198" +#define H5_PACKAGE_STRING "HDF5 1.9.199" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -513,7 +513,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.198" +#define H5_PACKAGE_VERSION "1.9.199" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -676,7 +676,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.198" +#define H5_VERSION "1.9.199" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ |