diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2017-03-28 03:29:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2017-03-28 03:29:44 (GMT) |
commit | 37de3f30e4d626b348618fd8d6d4909879b4de2b (patch) | |
tree | 2bd4a0d433ab2fb60a5a5a7eb01be60b5ab34166 | |
parent | 8859a5a27013597ec737421ea533b967807a2d4b (diff) | |
parent | be028580c8789301e4106d8d6e79a8fc8300e706 (diff) | |
download | hdf5-37de3f30e4d626b348618fd8d6d4909879b4de2b.zip hdf5-37de3f30e4d626b348618fd8d6d4909879b4de2b.tar.gz hdf5-37de3f30e4d626b348618fd8d6d4909879b4de2b.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_hyperslab_updates
105 files changed, 4151 insertions, 970 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 3f0f7ca..37f3f70 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -174,13 +174,25 @@ if (HDF5_PACK_EXAMPLES) USE_SOURCE_PERMISSIONS COMPONENT hdfdocuments ) - install ( - FILES - ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt - DESTINATION ${HDF5_INSTALL_DATA_DIR} - COMPONENT hdfdocuments - ) endif () + install ( + FILES + ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) + install ( + FILES + ${HDF_RESOURCES_DIR}/CTestScript.cmake + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) + install ( + FILES + ${HDF_RESOURCES_DIR}/HDF5_Examples_options.cmake + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) endif () #----------------------------------------------------------------------------- @@ -3153,6 +3153,8 @@ ./tools/test/perform/CMakeTests.cmake # CMake-specific User Scripts +./config/cmake/CTestScript.cmake +./config/cmake/HDF5_Examples_options.cmake ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF5config.cmake ./config/cmake/scripts/HDF5options.cmake @@ -1,4 +1,4 @@ -HDF5 version 1.9.236 currently under development +HDF5 version 1.11.0 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ @@ -196,6 +196,15 @@ die "unable to read file: $CONFIGURE\n" unless -r $file; my $CPP_DOC_CONFIG = $file; $CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/; die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file; +my $H5_JAVA = $file; +$H5_JAVA =~ s/[^\/]*$/..\/java\/src\/hdf\/hdf5lib\/H5.java/; +die "unable to read file: $H5_JAVA\n" unless -r $file; +my $TESTH5_JAVA = $file; +$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; +die "unable to read file: $TESTH5_JAVA\n" unless -r $file; +my $REPACK_LAYOUT_PLUGIN_VERSION = $file; +$REPACK_LAYOUT_PLUGIN_VERSION =~ s/[^\/]*$/..\/tools\/test\/h5repack\/testfiles\/h5repack_layout.h5-plugin_version_test.ddl/; +die "unable to read file: $REPACK_LAYOUT_PLUGIN_VERSION\n" unless -r $file; # Get the current version number. open FILE, $file or die "unable to open $file: $!\n"; @@ -351,15 +360,60 @@ if ($HDF5CONFIGCMAKE) { ); my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]); - $data =~ s/set\(CTEST_SOURCE_VERSION .*\)/set\(CTEST_SOURCE_VERSION $version_string\)/; - $data =~ s/set\(CTEST_SOURCE_VERSEXT .*\)/set\(CTEST_SOURCE_VERSEXT $sub_rel_ver_str\)/; + $data =~ s/set \(CTEST_SOURCE_VERSION .*\)/set \(CTEST_SOURCE_VERSION $version_string\)/; + $data =~ s/set \(CTEST_SOURCE_VERSEXT .*\)/set \(CTEST_SOURCE_VERSEXT $sub_rel_ver_str\)/; write_file($HDF5CONFIGCMAKE, $data); } +# Update the java/src/hdf/hdf5lib/H5.java file +if ($H5_JAVA) { + my $data = read_file($H5_JAVA); +# my $sub_rel_ver_str = ""; + my $sub_rel_ver_str = ( + $newver[3] eq "" + ? sprintf("\"%s\"", "") + : sprintf("\"%s\"", "-".$newver[3].", currently under development") + ); + my $version_string1 = sprintf("%d.%d.%d", @newver[0,1,2]); + my $version_string2 = sprintf("%d, %d, %d", @newver[0,1,2]); + + $data =~ s/\@version HDF5 .* <BR>/\@version HDF5 $version_string1 <BR>/; + $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; + + write_file($H5_JAVA, $data); +} + +# Update the java/test/TestH5.java file +if ($TESTH5_JAVA) { + my $data = read_file($TESTH5_JAVA); +# my $sub_rel_ver_str = ""; + my $sub_rel_ver_str = ( + $newver[3] eq "" + ? sprintf("\"%s\"", "") + : sprintf("\"%s\"", "-".$newver[3].", currently under development") + ); + my $version_string1 = sprintf("%d, %d, %d", @newver[0,1,2]); + my $version_string2 = sprintf("int majnum = %d, minnum = %d, relnum = %d", @newver[0,1,2]); + $data =~ s/ int libversion\[\] = { .* };/ int libversion\[\] = { $version_string1 };/; + $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; + + write_file($TESTH5_JAVA, $data); +} + +# Update the tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl file +if ($REPACK_LAYOUT_PLUGIN_VERSION) { + my $data = read_file($REPACK_LAYOUT_PLUGIN_VERSION); + my $version_string = sprintf("%d %d %d", @newver[0,1,2]); + + $data =~ s/ PARAMS { 9 \d* \d* \d* }/ PARAMS { 9 $version_string }/g; + + write_file($REPACK_LAYOUT_PLUGIN_VERSION, $data); +} -# helper function to read the file for updating c++/src/cpp_doc_config file. +# helper function to read the file for updating c++/src/cpp_doc_config, +# config/cmake/scripts/HDF5Config.cmake, and java files. # The version string in that file is not at the top, so the string replacement # is not for the first line, and reading/writing the entire file as one string # facilitates the substring replacement. @@ -375,8 +429,8 @@ sub read_file { return $all; } -# helper function to write the file for updating c++/src/cpp_doc_config -# and config/cmake/scripts/HDF5config.cmake files. +# helper function to write the file for updating c++/src/cpp_doc_config, +# config/cmake/scripts/HDF5config.cmake and java files. sub write_file { my ($filename, $content) = @_; diff --git a/bin/output_filter.sh b/bin/output_filter.sh index 58f1c48..35af819 100644 --- a/bin/output_filter.sh +++ b/bin/output_filter.sh @@ -17,6 +17,21 @@ # Created Date: 2011/5/3 +# Comment added to address HDFFV-8270: +# As I understand it, the purpose of this file is to remove extraneous messages +# that appear in stdout and stderr on some machines that have been tested outside +# of the HDF Group realm. The purpose of this script is to filter those +# extraneous messages from stdout and stderr so that when the output files are +# compared to the expected output, the extra messages will not cause failures in +# the tests. The system messages in the comments below are out of date, meaning +# I suppose that while the script code to filter messages on the system was +# correct correct when last used, the output in the comments doesn't match the +# script code that follows. I don't currently have access to any of these +# systems to see the current output and the effect of the script code. If using +# this file in the future, please update the comments to match the scripts in use. +# Larry Knox 2017/3/15 + + # Some systems will dump some messages to stdout for various reasons. # Remove them from the stdout result file. # $1 is the file name of the file to be filtered. diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index eaa9d14..f0859c8 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -91,6 +91,8 @@ class H5_DLLCPP AbstractDs { private: // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; -}; -} + +}; // end of AbstractDs +} // namespace H5 + #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 3cdcc0a..c8bd0fc 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -77,11 +77,12 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) // Function: ArrayType overloaded constructor ///\brief Creates an ArrayType instance by opening an HDF5 array datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Array type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -94,12 +95,13 @@ ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType() //-------------------------------------------------------------------------- // Function: ArrayType overloaded constructor ///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as an \c H5std_string. +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Array type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 15b6bb3..dd9db51 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -60,6 +60,8 @@ class H5_DLLCPP ArrayType : public DataType { // Default constructor ArrayType(); -}; -} + +}; // end of ArrayType +} // namespace H5 + #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index a1e0262..f4c70fd 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -78,6 +78,8 @@ class H5_DLLCPP AtomType : public DataType { // Constructor that takes an existing id AtomType(const hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of AtomType +} // namespace H5 + #endif // __H5AtomType_H diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 0243cd9..6d6df2c 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -101,6 +101,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // Friend function to set Attribute id. For library use only. friend void f_Attribute_setId(Attribute* attr, hid_t new_id); -}; -} +}; // end of Attribute +} // namespace H5 + #endif // __H5Attribute_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5c01055..f3390aa 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -381,4 +381,4 @@ void f_DataSet_setId(DataSet* dset, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS -} +} // end namespace diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 588d49a..0c7b799 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -84,10 +84,8 @@ class H5_DLLCPP CommonFG { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; // end of CommonFG declaration +}; // end of CommonFG +} // namespace H5 -#ifndef H5_NO_NAMESPACE -} -#endif #endif // __CommonFG_H diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 037527f..7db2cfe 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -91,11 +91,12 @@ CompType::CompType(const DataSet& dataset) : DataType() // Function: CompType overloaded constructor ///\brief Creates an CompType instance by opening an HDF5 compound /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Compound type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openCompType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -109,11 +110,12 @@ CompType::CompType(const H5Location& loc, const char *dtype_name) : DataType() // Function: CompType overloaded constructor ///\brief Creates an CompType instance by opening an HDF5 compound /// datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Compound type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openCompType(const H5Location&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 222044d..042b59f 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -115,6 +115,8 @@ class H5_DLLCPP CompType : public DataType { // Contains common code that is used by the member functions // getMemberXxxType hid_t p_get_member_type(unsigned member_num) const; -}; -} + +}; // end of CompType +} // namespace H5 + #endif // __H5CompType_H diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 93f9782..f9e29ff 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -130,6 +130,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Friend function to set DataSet id. For library use only. friend void f_DataSet_setId(DataSet* dset, hid_t new_id); -}; -} +}; // end of DataSet +} // namespace H5 + #endif // __H5DataSet_H diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 969e146..281e865 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -149,6 +149,8 @@ class H5_DLLCPP DataSpace : public IdComponent { friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DataSpace +} // namespace H5 + #endif // __H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index ae48d16..2795485 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -109,13 +109,13 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, //-------------------------------------------------------------------------- // Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// brief Given a reference, ref, to an hdf5 group, creates a +// DataType object +// param attr - IN: Specifying location where the referenced object is in +// param ref - IN: Reference pointer +// param ref_type - IN: Reference type - default to H5R_OBJECT +// param plist - IN: Property list - default to PropList::DEFAULT +// exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification // Jul, 2008 @@ -162,11 +162,12 @@ DataType::DataType(const PredType& pred_type) : H5Object() // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given /// its name as a char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openDataType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -180,11 +181,12 @@ DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given /// its name as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openDataType(const H5std_string&) to // improve usability. // -BMR, Dec 2016 @@ -300,27 +302,6 @@ bool DataType::operator==(const DataType& compared_type) const } //-------------------------------------------------------------------------- -// Function: DataType::p_opentype (private) -///\brief Opens an HDF5 datatype given its name -///\param dtype_name - IN: Datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 -// Description -// This function was introduced in 1.10.1 to be used by the new -// XxxType constructors that were introduced to replace the -// existing functions CommonFG::openXxxType(), which is awkward -// to use. -BMR, Dec 2016 -//-------------------------------------------------------------------------- -hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const -{ - // Call C function to open the named datatype at this location - hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); - if (ret_value < 0) - throw DataTypeIException("DataType constructor", "H5Topen2 failed"); - return(ret_value); -} - -//-------------------------------------------------------------------------- // Function: DataType::p_commit (private) //\brief Commits a transient datatype to a file, creating a new // named datatype @@ -744,6 +725,31 @@ bool DataType::isVariableStr() const } //-------------------------------------------------------------------------- +// Function: DataType::getCreatePlist +///\brief Returns a copy of the property list, which is for datatype +/// creation. +///\return A property list object +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - March, 2017 +// Description +// Currently, there is no datatype creation property list class +// in the C++ API because there is no associated functionality. +//-------------------------------------------------------------------------- +PropList DataType::getCreatePlist() const +{ + hid_t create_plist_id = H5Tget_create_plist(id); + if (create_plist_id < 0) + { + throw DataTypeIException(inMemFunc("getCreatePlist"), + "H5Tget_create_plist returns negative value"); + } + // create and return the DSetCreatPropList object + PropList create_plist; + f_PropList_setId(&create_plist, create_plist_id); + return(create_plist); +} + +//-------------------------------------------------------------------------- // Function: DataType::getId ///\brief Get the id of this datatype ///\return Datatype identifier @@ -762,6 +768,26 @@ hid_t DataType::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- +// Function: DataType::p_opentype (private) +///\brief Opens an HDF5 datatype given its name +///\param loc - IN: Location of the type +///\param dtype_name - IN: Datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 +// Description +// This function was introduced in 1.10.1 to be used by the new +// XxxType constructors that open a datatype. -BMR, Dec 2016 +//-------------------------------------------------------------------------- +hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const +{ + // Call C function to open the named datatype at this location + hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); + if (ret_value < 0) + throw DataTypeIException("DataType constructor", "H5Topen2 failed"); + return(ret_value); +} + +//-------------------------------------------------------------------------- // Function: DataType::p_setId ///\brief Sets the identifier of this object to a new value. /// @@ -836,4 +862,5 @@ DataType::~DataType() cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } + } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index fd9c17d..c2ea2a3 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -113,6 +113,9 @@ class H5_DLLCPP DataType : public H5Object { // Checks whether this datatype is a variable-length string. bool isVariableStr() const; + // Returns a copy of the creation property list of a datatype. + PropList getCreatePlist() const; + ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataType"); } @@ -152,6 +155,8 @@ class H5_DLLCPP DataType : public H5Object { friend void f_DataType_setId(DataType* dtype, hid_t new_id); void p_commit(hid_t loc_id, const char* name); -}; -} + +}; // end of DataType +} // namespace H5 + #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 86d4d9c..966ca16 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -18,6 +18,7 @@ #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" +#include "H5DataSpace.h" #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" @@ -740,6 +741,55 @@ void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, } //-------------------------------------------------------------------------- +// Function: DSetCreatPropList::setVirtual +///\brief Maps elements of a virtual dataset to elements of the source +/// dataset. +///\param vspace - IN: Dataspace the virtual dataset, possibly an +/// unlimited selection +///\param src_fname - IN: Name of the HDF5 file where the source dataset +/// is located (\a char*) +///\param src_dsname - IN: Path to the dataset in the file specified by +/// \a src_file_name (\a char*) +///\param sspace - IN: Dataspace with a selection applied, possibly +/// an unlimited selection +///\exception H5::PropListIException +///\par Description +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +// Programmer Binh-Minh Ribler - Mar, 2017 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fname, const char *src_dsname, const DataSpace& sspace) const +{ + herr_t ret_value = H5Pset_virtual(id, vspace.getId(), src_fname, src_dsname, sspace.getId()); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setVirtual", + "H5Pset_virtual failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: DSetCreatPropList::setVirtual +///\brief Maps elements of a virtual dataset to elements of the source +/// dataset. +///\param vspace - IN: Dataspace the virtual dataset, possibly an +/// unlimited selection +///\param src_fname - IN: Name of the HDF5 file where the source dataset +/// is located (\a H5std_string) +///\param src_dsname - IN: Path to the dataset in the file specified by +/// \a src_file_name (\a H5std_string) +///\param sspace - IN: Dataspace with a selection applied, possibly +/// an unlimited selection +///\exception H5::PropListIException +///\par Description +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +// Programmer Binh-Minh Ribler - Mar, 2017 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setVirtual(const DataSpace& vspace, const H5std_string src_fname, const H5std_string src_dsname, const DataSpace& sspace) const +{ + setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace); +} + +//-------------------------------------------------------------------------- // Function: DSetCreatPropList destructor ///\brief Noop destructor. // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index b536709..f0475eb 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -20,6 +20,7 @@ namespace H5 { class DataType; +class DataSpace; /*! \class DSetCreatPropList \brief Class DSetCreatPropList inherits from ObjCreatPropList and provides @@ -116,6 +117,10 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { // Sets N-bit compression method. void setNbit() const; + // Maps elements of a virtual dataset to elements of the source dataset. + void setVirtual(const DataSpace& vspace, const char *src_fname, const char *src_dsname, const DataSpace& sspace) const; + void setVirtual(const DataSpace& vspace, const H5std_string src_fname, const H5std_string src_dsname, const DataSpace& sspace) const; + ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetCreatPropList"); } @@ -141,6 +146,8 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { static DSetCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetCreatPropList +} // namespace H5 + #endif // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index f1c363f..39d3ba8 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -127,6 +127,8 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static DSetMemXferPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetMemXferPropList +} // namespace H5 + #endif // __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 49f60e6..9072aab 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -114,10 +114,11 @@ EnumType::EnumType(const IntType& data_type) : DataType() ///\brief Creates an EnumType instance by opening an HDF5 enum datatype /// given its name, provided as a C character string. ///\param dtype_name - IN: Enum datatype name +///\param loc - IN: Location of the type ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openEnumType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -131,11 +132,12 @@ EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType() // Function: EnumType overloaded constructor ///\brief Creates an EnumType instance by opening an HDF5 enum datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Enum datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openEnumType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 2fbe2cd..cd93eb5 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -78,6 +78,8 @@ class H5_DLLCPP EnumType : public DataType { EnumType(const EnumType& original); virtual ~EnumType(); -}; -} + +}; // end of EnumType +} // namespace H5 + #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 1f85711..2e68cf0 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -174,8 +174,8 @@ class H5_DLLCPP IdComponentException : public Exception { IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); IdComponentException(); virtual ~IdComponentException() throw(); -}; -} +}; // end of IdComponentException +} // namespace H5 #endif // __H5Exception_H diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index ae7c7f9..8e488e5 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -117,6 +117,12 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns the degree for the file close behavior. H5F_close_degree_t getFcloseDegree() const; + // Sets file access property list to use the H5FD_DIRECT driver. + void setFileAccDirect(size_t boundary, size_t block_size, size_t cbuf_size) const; + + // Retrieves information about the direct file access property list. + void getFileAccDirect(size_t &boundary, size_t &block_size, size_t &cbuf_size) const; + // Sets garbage collecting references flag. void setGcReferences(unsigned gc_ref = 0) const; @@ -156,6 +162,7 @@ class H5_DLLCPP FileAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileAccPropList +} // namespace H5 + #endif // __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index ea69049..b3e6b7b 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -294,12 +294,12 @@ unsigned FileCreatPropList::getIstorek() const return(ik); } -#ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setFileSpace +// Function: FileCreatPropList::setFileSpaceStrategy ///\brief Sets the strategy and the threshold value that the library /// will employ in managing file space. -///\param strategy - IN: Strategy for file space management +///\param strategy - IN: Strategy for file space management +///\param persist - IN: Whether to persist free-space ///\param threshold - IN: Free-space section threshold. The library /// default is 1, which is to track all free-space sections. ///\exception H5::PropListIException @@ -308,64 +308,76 @@ unsigned FileCreatPropList::getIstorek() const /// changed and the existing strategy will be retained. /// If the given threshold value is zero, the property will not be /// changed and the existing threshold will be retained. -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_FILE_SPACE_ALL (Default) -/// \li \c H5F_FILE_SPACE_ALL_PERSIST -/// \li \c H5F_FILE_SPACE_AGGR_VFD -/// \li \c H5F_FILE_SPACE_VFD /// For information, please see the C layer Reference Manual at: /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -void FileCreatPropList::setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const +void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const { - herr_t ret_value = H5Pset_file_space(id, strategy, threshold); + herr_t ret_value = H5Pset_file_space_strategy(id, strategy, persist, threshold); if (ret_value < 0) { - throw PropListIException("FileCreatPropList::setFileSpace", - "H5Pset_file_space failed"); + throw PropListIException("FileCreatPropList::setFileSpaceStrategy", + "H5Pset_file_space_strategy failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getFileSpaceStrategy -///\brief Returns the strategy that the library uses in managing file space. -///\return The strategy value +///\brief Retrieves the strategy, persist, and threshold that the library +/// uses in managing file space. +///\param strategy - OUT: Strategy for file space management +///\param persist - OUT: Whether to persist free-space +///\param threshold - OUT: Free-space section threshold ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -H5F_file_space_type_t FileCreatPropList::getFileSpaceStrategy() const +void FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const { - H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL; - herr_t ret_value = H5Pget_file_space(id, &strategy, NULL); + herr_t ret_value = H5Pget_file_space_strategy(id, &strategy, &persist, &threshold); if (ret_value < 0) { throw PropListIException("FileCreatPropList::getFileSpaceStrategy", - "H5Pget_file_space for strategy failed"); + "H5Pget_file_space_strategy failed"); } - return(strategy); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getFileSpaceThreshold -///\brief Returns the threshold value that the library uses in tracking -/// free space sections. -///\return The threshold value +// Function: FileCreatPropList::setFileSpacePagesize +///\brief Sets the file space page size for paged aggregation. +///\param fsp_psize - IN: Filespace's page size ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -hsize_t FileCreatPropList::getFileSpaceThreshold() const +void FileCreatPropList::setFileSpacePagesize(hsize_t fsp_psize) const { - hsize_t threshold = 0; - herr_t ret_value = H5Pget_file_space(id, NULL, &threshold); + herr_t ret_value = H5Pset_file_space_page_size(id, fsp_psize); if (ret_value < 0) { - throw PropListIException("FileCreatPropList::getFileSpaceThreshold", - "H5Pget_file_space for threshold failed"); + throw PropListIException("FileCreatPropList::setFileSpacePagesize", + "H5Pset_file_space_page_size failed"); } - return(threshold); } -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + +//-------------------------------------------------------------------------- +// Function: FileCreatPropList::getFileSpacePagesize +///\brief Returns the file space page size for aggregating small +/// metadata or raw data. +///\return File space page size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +hsize_t FileCreatPropList::getFileSpacePagesize() const +{ + hsize_t fsp_psize = 0; + herr_t ret_value = H5Pget_file_space_page_size(id, &fsp_psize); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getFileSpacePagesize", + "H5Pget_file_space_page_size failed"); + } + return(fsp_psize); +} //-------------------------------------------------------------------------- // Function: FileCreatPropList destructor diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 1d999cb..6beac02 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -65,18 +65,19 @@ class H5_DLLCPP FileCreatPropList : public PropList { // indexing chunked datasets. void setIstorek(unsigned ik) const; -#ifndef H5_NO_DEPRECATED_SYMBOLS // Sets the strategy and the threshold value that the library will // will employ in managing file space. - void setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const; + void setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const; // Returns the strategy that the library uses in managing file space. - H5F_file_space_type_t getFileSpaceStrategy() const; + void getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const; + + // Sets the file space page size for paged aggregation. + void setFileSpacePagesize(hsize_t fsp_psize) const; // Returns the threshold value that the library uses in tracking free // space sections. - hsize_t getFileSpaceThreshold() const; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + hsize_t getFileSpacePagesize() const; ///\brief Returns this class name. virtual H5std_string fromClass() const { return("FileCreatPropList"); } @@ -104,6 +105,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileCreatPropList +} // namespace H5 + #endif // __H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index cdb5837..bea4612 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -45,7 +45,7 @@ namespace H5 { using std::endl; //-------------------------------------------------------------------------- -// Function H5File default constructor +// Function H5File default constructor ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -64,30 +64,30 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} ///\par Description /// Valid values of \a flags include: /// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. +/// erasing all data previously stored in +/// the file. /// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive /// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise /// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here 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) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name, flags, create_plist, access_plist); + p_get_file(name, flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -102,17 +102,17 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here 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) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name.c_str(), flags, create_plist, access_plist); + p_get_file(name.c_str(), flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -131,23 +131,23 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // create the file. if (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate(name, flags, create_plist_id, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate(name, flags, create_plist_id, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen(name, flags, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen(name, flags, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } @@ -157,7 +157,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro ///\param existing_id - IN: Id of an existing file // Programmer Binh-Minh Ribler - 2015 // Description -// Mar 29, 2015 +// Mar 29, 2015 // Added in responding to a request from user Jason Newton. // However, it is not recommended to use the private member "id" // in applications. Unlike other situations, where similar @@ -230,9 +230,9 @@ bool H5File::isHdf5(const H5std_string& name) ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// /// H5F_ACC_RDONLY: Open with read only access. - default /// @@ -251,7 +251,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis id = H5Fopen (name, flags, access_plist_id); if (id < 0) // throw an exception when open fails { - throw FileIException("H5File::openFile", "H5Fopen failed"); + throw FileIException("H5File::openFile", "H5Fopen failed"); } } @@ -397,14 +397,14 @@ hssize_t H5File::getFreeSpace() const ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -425,19 +425,19 @@ ssize_t H5File::getObjCount(unsigned types) const /// groups and datatypes) in the same file. ///\param types - Type of object to retrieve the count ///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. +/// into obj_id_list. ///\param oid_list - List of open object identifiers ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -459,7 +459,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const /// driver. ///\param fapl - File access property list ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException ///\par Description /// For the \c FAMILY or \c MULTI drivers, \a fapl should be @@ -487,10 +487,10 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const // Purpose This is an overloaded member function, kept for backward // compatibility. It differs from the above function in that it // misses const's. This wrapper will be removed in future release. -// Param fapl - File access property list -// Param file_handle - Pointer to the file handle being used by -// the low-level virtual file driver -// Exception H5::FileIException +// Param fapl - File access property list +// Param file_handle - Pointer to the file handle being used by +// the low-level virtual file driver +// Exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 // Modification // Planned for removal. -BMR, 2014/04/16 @@ -508,7 +508,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const /// It differs from the above function only in what arguments it /// accepts. ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- @@ -547,7 +547,7 @@ hsize_t H5File::getFileSize() const ///\brief Get the id of this file ///\return File identifier // Modification -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -562,8 +562,8 @@ hid_t H5File::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5File::reopen -// Purpose Reopens this file. -// Exception H5::FileIException +// Purpose Reopens this file. +// Exception H5::FileIException // Description // This function is replaced by the above function reOpen. // Programmer Binh-Minh Ribler - 2000 @@ -575,14 +575,15 @@ void H5File::reopen() //-------------------------------------------------------------------------- // Function: H5File::getLocId -// Purpose Get the id of this file +// Purpose Get the id of this file // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Programmer Binh-Minh Ribler - 2000 // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { @@ -626,13 +627,13 @@ void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose(id); - if (ret_value < 0) - { - throw FileIException("H5File::close", "H5Fclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Fclose(id); + if (ret_value < 0) + { + throw FileIException("H5File::close", "H5Fclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -643,7 +644,7 @@ void H5File::close() ///\param msg - Message describing the failure ///\exception H5::FileIException // Description -// This function is also used in H5Location implementation so that +// This function is also used in H5Location implementation so that // proper exception can be thrown for file or group. The // "H5File::" will be inserted to indicate the function called is // an implementation of H5File. @@ -669,9 +670,9 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m H5File::~H5File() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; + cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 5ac9118..df5cca6 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -17,7 +17,6 @@ #ifndef __H5File_H #define __H5File_H - namespace H5 { /*! \class H5File @@ -123,7 +122,8 @@ class H5_DLLCPP H5File : public Group { // constructors taking a string or a char* void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); -}; -} +}; // end of H5File +} // namespace H5 + #endif // __H5File_H diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 5902cbe..f573add 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -95,11 +95,12 @@ FloatType::FloatType(const DataSet& dataset) : AtomType() // Function: FloatType overloaded constructor ///\brief Creates an FloatType instance by opening an HDF5 float datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Float type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openFloatType(const char*) // to improve usability. // -BMR, Dec 2016 @@ -113,11 +114,12 @@ FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: FloatType overloaded constructor ///\brief Creates an FloatType instance by opening an HDF5 float datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Float type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openFloatType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 2c925de..8affa1a 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -75,6 +75,8 @@ class H5_DLLCPP FloatType : public AtomType { // Noop destructor. virtual ~FloatType(); -}; -} + +}; // end of FloatType +} // namespace H5 + #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 6b143b5..66e2339 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -64,15 +64,69 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) } //-------------------------------------------------------------------------- +// Function: Group::getObjId +///\brief Opens an object via object header. +///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// This function opens an object in a group or file, using +/// H5Oopen. Thus, an object can be opened without knowing +/// the object's type. +// Programmer Binh-Minh Ribler - March, 2017 +//-------------------------------------------------------------------------- +hid_t Group::getObjId(const char* obj_name, const PropList& plist) const +{ + hid_t ret_value = H5Oopen(getId(), obj_name, plist.getId()); + if (ret_value < 0) + { + throwException("Group::getObjId", "H5Oopen failed"); + } + return(ret_value); +} + +//-------------------------------------------------------------------------- +// Function: Group::getObjId +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the object's name. +///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - March, 2017 +//-------------------------------------------------------------------------- +hid_t Group::getObjId(const H5std_string& obj_name, const PropList& plist) const +{ + return(getObjId(obj_name.c_str(), plist)); +} + +//-------------------------------------------------------------------------- +// Function: Group::closeObjId +///\brief Closes an object, which was opened with Group::getObjId +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - March, 2017 +//-------------------------------------------------------------------------- +void Group::closeObjId(hid_t obj_id) const +{ + herr_t ret_value = H5Oclose(obj_id); + if (ret_value < 0) + { + throwException("Group::closeObjId", "H5Oclose failed"); + } +} + +//-------------------------------------------------------------------------- // Function: Group::getLocId -// Purpose: Get the id of this group +// Purpose: Get the id of this group // Programmer Binh-Minh Ribler - 2000 // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t Group::getLocId() const { @@ -110,15 +164,19 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const //-------------------------------------------------------------------------- // Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// brief Given a reference, ref, to an hdf5 group, creates a Group objec +// param attr - IN: Specifying location where the referenced object is i +// param ref - IN: Reference pointer +// param ref_type - IN: Reference type - default to H5R_OBJECT +// param plist - IN: Property list - default to PropList::DEFAULT +// exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 +// Modification +// Mar, 2017 +// Removed in 1.10.1 because H5Location is Attribute's baseclass +// now. -BMR //-------------------------------------------------------------------------- - /* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) +/* 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"); } @@ -179,13 +237,13 @@ void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose(id); - if (ret_value < 0) - { - throwException("Group::close", "H5Gclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Gclose(id); + if (ret_value < 0) + { + throwException("Group::close", "H5Gclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -222,10 +280,10 @@ void Group::throwException(const H5std_string& func_name, const H5std_string& ms Group::~Group() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; + cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 96dc5c1..c8b2961 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -52,8 +52,16 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Creates a group by way of dereference. Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Removed in 1.10.1, because H5Location is baseclass // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Opens an object within a group or a file, i.e., root group. + hid_t getObjId(const char* name, const PropList& plist = PropList::DEFAULT) const; + hid_t getObjId(const H5std_string& name, const PropList& plist = PropList::DEFAULT) const; + + // Closes an object opened by getObjId(). + void closeObjId(hid_t obj_id) const; + // default constructor Group(); @@ -77,7 +85,8 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { private: hid_t id; // HDF5 group id -}; -} +}; // end of Group +} // namespace H5 + #endif // __Group_H diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 574b28a..122479f 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -24,6 +24,7 @@ namespace H5 { +#ifndef DOXYGEN_SHOULD_SKIP_THIS // This flag indicates whether H5Library::initH5cpp has been called to register // the terminating functions with atexit() bool IdComponent::H5cppinit = false; @@ -32,6 +33,7 @@ bool IdComponent::H5cppinit = false; // Subclasses that have global constants use it. This is a temporary // work-around in 1.8.16. It will be removed after HDFFV-9540 is fixed. bool IdComponent::H5dontAtexit_called = false; +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: IdComponent::incRefCount @@ -165,7 +167,7 @@ H5I_type_t IdComponent::getHDFObjType() const // Function: getNumMembers (static) ///\brief Returns the number of members of the given type. ///\return Number of members -///\Description +///\par Description /// If there is no member of the given type, getNumMembers will /// return 0. Valid types are: /// \li \c H5I_FILE (= 1) @@ -194,11 +196,32 @@ hsize_t IdComponent::getNumMembers(H5I_type_t type) } //-------------------------------------------------------------------------- +// Function: isValid (static) +///\brief Checks if the given ID is valid. +///\return true if the given identifier is valid, and false, otherwise. +///\par Description +/// A valid ID is one that is in use and has an application +/// reference count of at least 1. +// Programmer Binh-Minh Ribler - Mar 1, 2017 +//-------------------------------------------------------------------------- +bool IdComponent::isValid(hid_t an_id) +{ + // Call C function + htri_t ret_value = H5Iis_valid(an_id); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Iis_valid returns a negative value + throw IdComponentException("isValid", "H5Iis_valid failed"); +} + +//-------------------------------------------------------------------------- // Function: typeExists (static) ///\brief Queries if a given type is currently registered with the /// library. ///\return true if the given type exists, and false, otherwise. -///\Description +///\par Description /// Valid types are: /// \li \c H5I_FILE (= 1) /// \li \c H5I_GROUP diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 6f57364..0603e5c 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -19,7 +19,6 @@ namespace H5 { -class DataSpace; /*! \class IdComponent \brief Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier. @@ -51,6 +50,9 @@ class H5_DLLCPP IdComponent { // Returns the number of members in a type. static hsize_t getNumMembers(H5I_type_t type); + // Checks if the given ID is valid. + static bool isValid(hid_t an_id); + // Determines if an type exists. static bool typeExists(H5I_type_t type); @@ -121,6 +123,6 @@ class H5_DLLCPP IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent +} // namespace H5 -} #endif // __IdComponent_H diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index c64dae9..3aadcab 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -94,11 +94,12 @@ IntType::IntType(const DataSet& dataset) : AtomType() // Function: IntType overloaded constructor ///\brief Creates a IntType instance by opening an HDF5 integer datatype /// given its name as a char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Integer type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openIntType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -112,11 +113,12 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: IntType overloaded constructor ///\brief Creates a IntType instance by opening an HDF5 integer datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Integer type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ae4b3df..1ce05c8 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -57,6 +57,8 @@ class H5_DLLCPP IntType : public AtomType { // Noop destructor. virtual ~IntType(); -}; -} + +}; // end of IntType +} // namespace H5 + #endif // __H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index e9adb12..e457e83 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -40,7 +40,7 @@ LinkAccPropList* LinkAccPropList::DEFAULT_ = 0; // If LinkAccPropList::DEFAULT_ already points to an allocated // object, throw a PropListIException. This scenario should not // happen. -// Programmer Binh-Minh Ribler - 2015 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- LinkAccPropList* LinkAccPropList::getConstant() { @@ -66,7 +66,7 @@ LinkAccPropList* LinkAccPropList::getConstant() // Purpose: Deletes the constant object that LinkAccPropList::DEFAULT_ // points to. // exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2015 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- void LinkAccPropList::deleteConstants() { @@ -84,7 +84,7 @@ const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant(); //-------------------------------------------------------------------------- // Function: Default Constructor ///\brief Creates a file access property list -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} @@ -92,7 +92,7 @@ LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} // Function: LinkAccPropList copy constructor ///\brief Copy Constructor: makes a copy of the original ///\param original - IN: LinkAccPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {} @@ -100,14 +100,51 @@ LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(ori // Function: LinkAccPropList overloaded constructor ///\brief Creates a file access property list using the id of an /// existing one. -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- +// Function: LinkAccPropList::setNumLinks +///\brief Set the number of soft or user-defined link traversals allowed +/// before the library assumes it has found a cycle and aborts the +/// traversal. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - March 1, 2017 +//-------------------------------------------------------------------------- +void LinkAccPropList::setNumLinks(size_t nlinks) const +{ + herr_t ret_value = H5Pset_nlinks(id, nlinks); + // Throw exception if H5Pset_nlinks returns failure + if (ret_value < 0) + { + throw PropListIException("setNumLinks", "H5Pset_nlinks failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList::getNumLinks +///\brief Gets the number of soft or user-defined links that can be +/// traversed before a failure occurs. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - March 1, 2017 +//-------------------------------------------------------------------------- +size_t LinkAccPropList::getNumLinks() const +{ + size_t nlinks = 0; + herr_t ret_value = H5Pget_nlinks(id, &nlinks); + // Throw exception if H5Pget_nlinks returns failure + if (ret_value < 0) + { + throw PropListIException("getNumLinks", "H5Pget_nlinks failed"); + } + return(nlinks); +} + +//-------------------------------------------------------------------------- // Function: LinkAccPropList destructor ///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- LinkAccPropList::~LinkAccPropList() {} diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 8bcdd64..f31c3fc 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -46,6 +46,13 @@ class H5_DLLCPP LinkAccPropList : public PropList { // using the property list id. LinkAccPropList (const hid_t plist_id); + // Sets the number of soft or user-defined links that can be + // traversed before a failure occurs. + void setNumLinks(size_t nlinks) const; + + // Gets the number of soft or user-defined link traversals allowed + size_t getNumLinks() const; + // Noop destructor virtual ~LinkAccPropList(); @@ -62,6 +69,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of LinkAccPropList +} // namespace H5 + #endif // __H5LinkAccPropList_H diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 018ba38..76b5f82 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -69,6 +69,7 @@ class H5_DLLCPP H5Library { ~H5Library(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of H5Library +} // namespace H5 + #endif // __H5Library_H diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 5a0bb73..79b353a 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -524,16 +524,19 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t //-------------------------------------------------------------------------- // Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an attribute. -///\param attr - IN: Attribute specifying the location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// brief Dereferences a reference into an HDF5 object, given an attribute. +// param attr - IN: Attribute specifying the location of the referenced object +// param ref - IN: Reference pointer +// param ref_type - IN: Reference type +// param plist - IN: Property list - default to PropList::DEFAULT +// exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification // May, 2008 -// Corrected missing parameters. - BMR +// Corrected missing parameters. -BMR +// Mar, 2017 +// Removed in 1.10.1 because H5Location is Attribute's baseclass +// now. -BMR //-------------------------------------------------------------------------- /* void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -865,7 +868,7 @@ DataSet H5Location::createDataSet(const char* name, const DataType& data_type, c //-------------------------------------------------------------------------- DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { - return(createDataSet( name.c_str(), data_type, data_space, create_plist)); + return(createDataSet(name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 337a2b3..48fc2b1 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -86,6 +86,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Open a referenced object whose location is specified by either // a file, an HDF5 object, or an attribute. void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Removed in 1.10.1, because H5Location is baseclass //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // Retrieves a dataspace with the region pointed to selected. @@ -220,7 +221,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Noop destructor. virtual ~H5Location(); -}; /* end class H5Location */ +}; // end of H5Location +} // namespace H5 -} #endif // __H5Location_H diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index b5d0f88..359fab2 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -51,7 +51,6 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, myData->op(*myData->location, s_attr_name, myData->opData); return 0; } -#endif //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) @@ -101,6 +100,7 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id) { attr->p_setId(new_id); } +#endif //-------------------------------------------------------------------------- // Function: H5Object::createAttribute @@ -391,6 +391,8 @@ void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newna { renameAttr (oldname.c_str(), newname.c_str()); } + +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: getObjName ///\brief Given an id, returns the type of the object. @@ -502,7 +504,6 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const return(name_size); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Object destructor ///\brief Noop destructor. diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 866d739..53f183e 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -131,7 +131,7 @@ class H5_DLLCPP H5Object : public H5Location { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; /* end class H5Object */ +}; // end of H5Object +} // namespace H5 -} #endif // __H5Object_H diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 6fdd9dc..9a3af7e 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -155,7 +155,7 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d //-------------------------------------------------------------------------- // Function: ObjCreatPropList::setAttrCrtOrder -///\brief Sets tracking and indexing of attribute creation order. +///\brief Set the flags for creation order of attributes on an object ///\param crt_order_flags - IN: Flags specifying whether to track and /// index attribute creation order. Default: No flag set ///\exception H5::PropListIException @@ -183,10 +183,9 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const //-------------------------------------------------------------------------- // Function: ObjCreatPropList::getAttrCrtOrder -///\brief Gets tracking and indexing settings for attribute -/// creation order. -///\param crt_order_flags - OUT: Flags specifying whether to track and -/// index attribute creation order +///\brief Returns the flags indicating creation order is tracked/indexed +/// for attributes on an object. +///\return The flags ///\exception H5::PropListIException ///\par Description /// When no flag is set, i.e. crt_order_flags = 0, attribute diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 4858e07..c9c245a 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -72,6 +72,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of ObjCreatPropList +} // namespace H5 + #endif // __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index a8d6e37..2fd8a6b 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -438,6 +438,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PredType +} // namespace H5 + #endif // __H5PredType_H diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c4176c2..0df0a9f 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -565,8 +565,27 @@ size_t PropList::getNumProps() const ///\param name - IN: Name of property to set - \c char pointer ///\param value - IN: Void pointer to the value for the property ///\exception H5::PropListIException +// Description +// Revision svn r29815 changed 'value' to const, hence, deprecated +// the non-const setProperty. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const char* name, const void* value) const +{ + herr_t ret_value = H5Pset(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const { herr_t ret_value = H5Pset(id, name, value); @@ -575,6 +594,7 @@ void PropList::setProperty(const char* name, void* value) const throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); } } + //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. @@ -582,11 +602,14 @@ void PropList::setProperty(const char* name, void* value) const /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param charptr - IN: Char pointer to the value for the property +// Description +// Revision svn r29815 changed 'value' to const, hence, deprecated +// the non-const setProperty. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const { - herr_t ret_value = H5Pset(id, name, (void*)charptr); + herr_t ret_value = H5Pset(id, name, (const void*)charptr); if (ret_value < 0) { throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); @@ -601,6 +624,18 @@ void PropList::setProperty(const char* name, const char* charptr) const ///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const char* name, const H5std_string& strg) const +{ + setProperty(name, strg.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const { setProperty(name, strg.c_str()); @@ -615,6 +650,18 @@ void PropList::setProperty(const char* name, H5std_string& strg) const ///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const H5std_string& name, const void* value) const +{ + setProperty(name.c_str(), value); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const { setProperty(name.c_str(), value); @@ -629,6 +676,18 @@ void PropList::setProperty(const H5std_string& name, void* value) const ///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const H5std_string& name, const H5std_string& strg) const +{ + setProperty(name.c_str(), strg.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const { setProperty(name.c_str(), strg.c_str()); diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 3977774..772e96c 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -78,8 +78,13 @@ class H5_DLLCPP PropList : public IdComponent { H5std_string getProperty(const H5std_string& name) const; // Set a property's value in a property list. - void setProperty(const char* name, void* value) const; void setProperty(const char* name, const char* charptr) const; + void setProperty(const char* name, const void* value) const; + void setProperty(const char* name, const H5std_string& strg) const; + void setProperty(const H5std_string& name, const void* value) const; + void setProperty(const H5std_string& name, const H5std_string& strg) const; + // Deprecated after 1.10.1, missing const + void setProperty(const char* name, void* value) const; void setProperty(const char* name, H5std_string& strg) const; void setProperty(const H5std_string& name, void* value) const; void setProperty(const H5std_string& name, H5std_string& strg) const; @@ -135,7 +140,8 @@ class H5_DLLCPP PropList : public IdComponent { friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PropList +} // namespace H5 + #endif // __H5PropList_H diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 54981ab..db1cf04 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -148,11 +148,12 @@ StrType::StrType(const DataSet& dataset) : AtomType () // Function: StrType overloaded constructor ///\brief Creates an StrType instance by opening an HDF5 string datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: String type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openStrType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -166,11 +167,12 @@ StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: StrType overloaded constructor ///\brief Creates an StrType instance by opening an HDF5 string datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: String type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openStrType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 3272ad3..aa87bba 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -69,6 +69,8 @@ class H5_DLLCPP StrType : public AtomType { // Noop destructor. virtual ~StrType(); -}; -} + +}; // end of StrType +} // namespace H5 + #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 7f50b9a..64029cc 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -76,11 +76,12 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() // Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as a C char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Variable length type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openVarLenType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -94,11 +95,12 @@ VarLenType::VarLenType(const H5Location& loc, const char *dtype_name) : DataType // Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Variable length type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openVarLenType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index a93f44d..4dc0eb5 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -49,6 +49,8 @@ class H5_DLLCPP VarLenType : public DataType { // Default constructor VarLenType(); -}; -} + +}; // end of VarLenType +} // namespace H5 + #endif // __H5VarLenType_H diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 5986eaa..ce23041 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.236 currently under development" +PROJECT_NUMBER = "1.11.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 48a0c4d..970f210 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -1148,6 +1148,87 @@ test_types(H5File& file) /*------------------------------------------------------------------------- + * Function: test_virtual + * + * Purpose: Tests fixed, unlimited, and printf selections in the same + * VDS + * + * Return: Success: 0 + * + * Failure: number of errors + * + * Programmer: Binh-Minh Ribler + * Friday, March 10, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +const int RANK = 2; +static herr_t +test_virtual() +{ + SUBTEST("DSetCreatPropList::setVirtual"); + + try { + // Create DCPLs + DSetCreatPropList dcpl; + DSetCreatPropList srcdcpl; + + // Set fill value + char *fill = NULL; + dcpl.setFillValue(PredType::NATIVE_INT, &fill); + + // Set chunk dimensions + hsize_t cdims[RANK]; + cdims[0] = 2; + cdims[1] = 2; + srcdcpl.setChunk(RANK, cdims); + + // Create memory space + hsize_t mdims[RANK]; + mdims[0] = 10; + mdims[1] = 10; + DataSpace memspace(RANK, mdims); + + // Get the current layout, should be default, H5D_CONTIGUOUS + H5D_layout_t layout = dcpl.getLayout(); + verify_val(layout, H5D_CONTIGUOUS, "DSetCreatPropList::getLayout", __LINE__, __FILE__); + + // Create fixed mapping + hsize_t dims[RANK]; + dims[0] = 6; + dims[1] = 6; + DataSpace vspace(RANK, dims, mdims); + + hsize_t start[RANK]; // Hyperslab start + hsize_t count[RANK]; // Hyperslab count + start[0] = start[1] = 3; + count[0] = count[1] = 3; + vspace.selectHyperslab(H5S_SELECT_SET, count, start); + + DataSpace srcspace(RANK, count); + + H5std_string src_file = "src_file_map.h5"; + H5std_string src_dset = "src_dset_fixed"; + dcpl.setVirtual(vspace, src_file, src_dset, srcspace); + + // Get and verify the new layout + layout = dcpl.getLayout(); + verify_val(layout, H5D_VIRTUAL, "DSetCreatPropList::getLayout", __LINE__, __FILE__); + + PASSED(); + return 0; + } // end top try block + + catch (Exception& E) + { + return -1; + } +} // test_virtual + + +/*------------------------------------------------------------------------- * Function: test_dset * * Purpose Tests the dataset interface (H5D) @@ -1195,6 +1276,7 @@ void test_dset() nerrors += test_nbit_compression(file) < 0 ? 1:0; nerrors += test_multiopen (file) < 0 ? 1:0; nerrors += test_types(file) < 0 ? 1:0; + nerrors += test_virtual() < 0 ? 1:0; // Close group "emit diagnostics". grp.close(); diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index eb07657..715bb30 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -812,19 +812,17 @@ const H5std_string FILE7("tfile7.h5"); * *------------------------------------------------------------------------- */ +const hsize_t FSP_SIZE_DEF = 4096; +const hsize_t FSP_SIZE512 = 512; static void test_file_info() { // Output message about test being performed SUBTEST("File general information"); -#ifndef H5_NO_DEPRECATED_SYMBOLS - hsize_t in_threshold = 2; // Free space section threshold to set */ - hsize_t out_threshold = 0; // Free space section threshold to get */ + hsize_t out_threshold = 0; // Free space section threshold to get + hbool_t out_persist = FALSE;// Persist free-space read // File space handling strategy - H5F_file_space_type_t in_strategy = H5F_FILE_SPACE_ALL; - // File space handling strategy - H5F_file_space_type_t out_strategy = H5F_FILE_SPACE_DEFAULT; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5F_fspace_strategy_t out_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; try { // Create a file using default properties. @@ -843,14 +841,30 @@ static void test_file_info() // Create file creation property list. FileCreatPropList fcpl; + // Retrieve file space information. + fcpl.getFileSpaceStrategy(out_strategy, out_persist, out_threshold); + + // Verify file space information. + verify_val(out_strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(out_persist, FALSE, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(out_threshold, 1, "H5File::getFileInfo", __LINE__, __FILE__); + + /* Retrieve file space page size */ + hsize_t out_fsp_psize = fcpl.getFileSpacePagesize(); + verify_val(out_fsp_psize, FSP_SIZE_DEF, "FileCreatPropList::getFileSpacePagesize", __LINE__, __FILE__); + // Set various file information. fcpl.setUserblock(F2_USERBLOCK_SIZE); fcpl.setSizes(F2_OFFSET_SIZE, F2_LENGTH_SIZE); fcpl.setSymk(F2_SYM_INTERN_K, F2_SYM_LEAF_K); fcpl.setIstorek(F2_ISTORE); -#ifndef H5_NO_DEPRECATED_SYMBOLS - fcpl.setFileSpace(in_strategy, in_threshold); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + hsize_t threshold = 5; // Free space section threshold to set + hbool_t persist = TRUE; // Persist free-space to set + H5F_fspace_strategy_t strategy = H5F_FSPACE_STRATEGY_PAGE; + + fcpl.setFileSpaceStrategy(strategy, persist, threshold); + fcpl.setFileSpacePagesize(FSP_SIZE512); // Creating a file with the non-default file creation property list // should create a version 1 superblock @@ -863,11 +877,7 @@ static void test_file_info() // Get the file's version information. file7.getFileInfo(finfo); -#ifndef H5_NO_DEPRECATED_SYMBOLS verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); -#else /* H5_NO_DEPRECATED_SYMBOLS */ - verify_val(finfo.super.version, 1, "H5File::getFileInfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); @@ -882,11 +892,7 @@ static void test_file_info() // Get the file's version information. file7.getFileInfo(finfo); -#ifndef H5_NO_DEPRECATED_SYMBOLS verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); -#else /* H5_NO_DEPRECATED_SYMBOLS */ - verify_val(finfo.super.version, 1, "H5File::getFileInfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); @@ -912,14 +918,14 @@ static void test_file_info() VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); */ -#ifndef H5_NO_DEPRECATED_SYMBOLS // Get and verify the file space info from the creation property list */ - out_strategy = fcpl2.getFileSpaceStrategy(); - verify_val(static_cast<unsigned>(out_strategy), static_cast<unsigned>(in_strategy), "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); + fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold); + verify_val(out_strategy, strategy, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); + verify_val(out_persist, persist, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); + verify_val(out_threshold, threshold, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); - out_threshold = fcpl2.getFileSpaceThreshold(); - verify_val(static_cast<unsigned>(out_threshold), static_cast<unsigned>(in_threshold), "FileCreatPropList::getFileSpaceThreshold", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + out_fsp_psize = fcpl2.getFileSpacePagesize(); + verify_val(out_fsp_psize, FSP_SIZE512, "FileCreatPropList::getFileSpacePagesize", __LINE__, __FILE__); PASSED(); } // end of try block diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index fce42fa..34e6892 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -503,9 +503,9 @@ void test_iterate() FileAccPropList fapl; fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - test_iter_group(fapl); // Test iterating groups - test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + test_iter_group(fapl); // Test iterating groups + test_HDFFV_9920(); // Test the fix of HDFFV-9920 + //test_iter_attr(fapl); // Test iterating attributes } // test_iterate diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index c217718..0bf6ebf 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -142,11 +142,8 @@ const char *FILENAME[] = { #define H5L_DIM2 100 /* Creation order macros */ -#define CORDER_GROUP_NAME "corder_group" #define CORDER_SOFT_GROUP_NAME "corder_soft_group" #define CORDER_NLINKS 18 -#define CORDER_ITER_STOP 3 -#define CORDER_EST_ENTRY_LEN 9 /* Timestamp macros */ #define TIMESTAMP_GROUP_1 "timestamp1" @@ -341,7 +338,7 @@ static const char *FILENAME[] = { static void test_basic_links(hid_t fapl_id, hbool_t new_format) { hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; // Use the file access template id to create a file access prop. list. FileAccPropList fapl(fapl_id); @@ -441,6 +438,55 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) /*------------------------------------------------------------------------- + * Function: test_num_links + * + * Purpose Test setting and getting limit of number of links + * + * Return Success: 0 + * + * Failure: -1 + * + * Programmer Binh-Minh Ribler + * October 16, 2009 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void test_num_links(hid_t fapl_id, hbool_t new_format) +{ + char filename[NAME_BUF_SIZE]; + + if(new_format) + SUBTEST("Setting number of links (w/new group format)") + else + SUBTEST("Setting number of links") + + try + { + // Use the file access template id to create a file access prop. list. + FileAccPropList fapl(fapl_id); + + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + + LinkAccPropList lapl; + size_t nlinks = 5; + lapl.setNumLinks(nlinks); + + // Read it back and verify + size_t read_nlinks = lapl.getNumLinks(); + verify_val(read_nlinks, nlinks, "LinkAccPropList::setNumLinks", __LINE__, __FILE__); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // test_num_links + +/*------------------------------------------------------------------------- * Function: test_links * * Purpose Test links diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 6003dd6..3c9c1b0 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -32,6 +32,7 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file const H5std_string FILE_OBJECTS("tobjects.h5"); +const H5std_string FILE_OBJHDR("tobject_header.h5"); const H5std_string GROUP1("Top Group"); const H5std_string GROUP1_PATH("/Top Group"); const H5std_string GROUP1_1("Sub-Group 1.1"); @@ -395,7 +396,126 @@ static void test_get_objtype() issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype + +/*------------------------------------------------------------------------- + * Function: test_open_object_header + * + * Purpose Test Group::getObjId function. + * + * Return None + * + * Programmer Binh-Minh Ribler (use C version) + * March, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +const H5std_string GROUPNAME("group"); +const H5std_string DTYPENAME("group/datatype"); +const H5std_string DTYPENAME_INGRP("datatype"); +const H5std_string DSETNAME("dataset"); +#define RANK 2 +#define DIM0 5 +#define DIM1 10 +static void test_open_object_header() +{ + hsize_t dims[2]; + H5G_info_t ginfo; /* Group info struct */ + + // Output message about test being performed + SUBTEST("Group::getObjId"); + + try { + // Create file FILE1 + H5File file1(FILE_OBJHDR, H5F_ACC_TRUNC); + /* Create a group, dataset, and committed datatype within the file */ + + // Create a group in the root group + Group grp(file1.createGroup(GROUPNAME)); + grp.close(); + // Commit the type inside the file + IntType dtype(PredType::NATIVE_INT); + dtype.commit(file1, DTYPENAME); + dtype.close(); + + // Create a new dataset + dims[0] = DIM0; + dims[1] = DIM1; + DataSpace dspace(RANK, dims); + DataSet dset(file1.createDataSet(DSETNAME, PredType::NATIVE_INT, dspace)); + + // Close dataset and dataspace + dset.close(); + dspace.close(); + + // Now make sure that getObjId can open all three types of objects + hid_t obj_grp = file1.getObjId(GROUPNAME); + hid_t obj_dtype = file1.getObjId(DTYPENAME); + hid_t obj_dset = file1.getObjId(DSETNAME); + + // Make sure that each is the right kind of ID + H5I_type_t id_type = IdComponent::getHDFObjType(obj_grp); + verify_val(id_type, H5I_GROUP, "H5Iget_type for group ID", __LINE__, __FILE__); + id_type = IdComponent::getHDFObjType(obj_dtype); + verify_val(id_type, H5I_DATATYPE, "H5Iget_type for datatype ID", __LINE__, __FILE__); + id_type = IdComponent::getHDFObjType(obj_dset); + verify_val(id_type, H5I_DATASET, "H5Iget_type for dataset ID", __LINE__, __FILE__); + + /* Do something more complex with each of the IDs to make sure */ + + Group grp2(obj_grp); + hsize_t num_objs = grp2.getNumObjs(); + verify_val(num_objs, 1, "H5Gget_info", __LINE__, __FILE__); + // There should be one object, the datatype + + // Close datatype object opened from the file + file1.closeObjId(obj_dtype); + + dset.setId(obj_dset); + dspace = dset.getSpace(); + bool is_simple = dspace.isSimple(); + dspace.close(); + + // Open datatype object from the group + obj_dtype = grp2.getObjId(DTYPENAME_INGRP); + + dtype.setId(obj_dtype); + H5T_class_t type_class = dtype.getClass(); + verify_val(type_class, H5T_INTEGER, "H5Tget_class", __LINE__, __FILE__); + dtype.close(); + + // Close datatype object + grp2.closeObjId(obj_dtype); + + // Close the group object + file1.closeObjId(obj_grp); + + // Try doing something with group, the ID should still work + num_objs = grp2.getNumObjs(); + verify_val(num_objs, 1, "H5Gget_info", __LINE__, __FILE__); + + // Close the cloned group + grp2.close(); + + PASSED(); + } // end of try block + // catch invalid action exception + catch (InvalidActionException& E) + { + cerr << " in InvalidActionException" << endl; + cerr << " *FAILED*" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + } + // catch all other exceptions + catch (Exception& E) + { + cerr << " in Exception" << endl; + issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} /* test_open_object_header() */ + /*------------------------------------------------------------------------- * Function: test_objects * @@ -421,6 +541,7 @@ void test_object() test_existance(); // Test check for object existance test_get_objname_ontypes(); // Test get object name from types test_get_objtype(); // Test get object type + test_open_object_header(); // Test object header functions (H5O) } // test_objects diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index d8a0d5f..c232809 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -93,7 +93,7 @@ test_reference_params(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a group @@ -172,7 +172,7 @@ test_reference_params(void) catch (Exception& E) { issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -209,7 +209,7 @@ static void test_reference_obj(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create dataset access property list @@ -364,7 +364,7 @@ static void test_reference_obj(void) catch (Exception& E) { issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -493,7 +493,7 @@ test_reference_group(void) catch (Exception& E) { issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -523,10 +523,10 @@ test_reference_region_1D(void) SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk + hdset_reg_ref_t *wbuf, // buffer to write to disk *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk // Allocate write & read buffers wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); @@ -538,7 +538,7 @@ test_reference_region_1D(void) H5File file1(FILE2, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; + hsize_t dims3[] = {SPACE3_DIM1}; DataSpace sid3(SPACE3_RANK, dims3); // Create dataset access property list @@ -558,7 +558,7 @@ test_reference_region_1D(void) dset3.close(); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a dataset @@ -785,7 +785,7 @@ test_reference_region_1D(void) catch (Exception& E) { issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 0cc8918..fee4115 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -248,17 +248,32 @@ static void test_query() index = tid2.getMemberIndex("ORANGE"); verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - // Commit compound datatype and close it + // Commit compound datatype, and test getting the datatype creation + // prop list, then close it tid1.commit(file, CompT_NAME); + PropList tcpl = tid1.getCreatePlist(); + if (!IdComponent::isValid(tcpl.getId())) + { + // Throw an invalid action exception + throw InvalidActionException("H5Object::createAttribute", "Datatype creation property list is not valid"); + } + tcpl.close(); tid1.close(); - // Commit enumeration datatype and close it + // Commit enumeration datatype, and test getting the datatype creation + // prop list, then close it tid2.commit(file, EnumT_NAME); + tcpl = tid2.getCreatePlist(); + if (!IdComponent::isValid(tcpl.getId())) + { + // Throw an invalid action exception + throw InvalidActionException("H5Object::createAttribute", "Datatype creation property list is not valid"); + } + tcpl.close(); tid2.close(); - // Open the datatypes for query + // Open the datatypes for query. Testing both ways - // Deprecated functions tid1 = file.openCompType(CompT_NAME); tid1.close(); tid2 = file.openEnumType(EnumT_NAME); diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 5dee1a2..859867b 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -57,7 +57,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) { void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -257,7 +257,7 @@ static void test_vlstring_array_dataset() for (ii = 0; ii < SPACE1_DIM1; ii++) { if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); HDfree(string_ds_check[ii]); } @@ -351,23 +351,26 @@ static void test_vlstrings_special() hsize_t ii; // counting variable for (ii=0; ii<SPACE1_DIM1; ii++) if(rdata[ii]!=NULL) - TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]); + TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]); // Write dataset to disk, then read it back. dataset.write(wdata, vlst); dataset.read(rdata, vlst); // Compare data read in. - for (ii = 0; ii < SPACE1_DIM1; ii++) { + for (ii = 0; ii < SPACE1_DIM1; ii++) + { size_t wlen = HDstrlen(wdata[ii]); size_t rlen = HDstrlen(rdata[ii]); - if(wlen != rlen) { - TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen); - continue; + if(wlen != rlen) + { + TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen); + continue; } // end if - if(HDstrcmp(wdata[ii],rdata[ii]) != 0) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]); - continue; + if(HDstrcmp(wdata[ii],rdata[ii]) != 0) + { + TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]); + continue; } // end if } // end for @@ -384,7 +387,7 @@ static void test_vlstrings_special() // Create the property list and set the fill value for the second // dataset. DSetCreatPropList dcpl; - char *fill = NULL; // Fill value + char *fill = NULL; // Fill value dcpl.setFillValue(vlst, &fill); dataset = file1.createDataSet("Dataset4", vlst, sid1, dcpl); @@ -566,12 +569,12 @@ static void test_compact_vlstring() hsize_t i; for (i=0; i<SPACE1_DIM1; i++) { if (HDstrlen(wdata[i])!=strlen(rdata[i])) { - TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); - continue; + TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); + continue; } // end if if (HDstrcmp(wdata[i],rdata[i]) != 0) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); - continue; + TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); + continue; } // end if } // end for @@ -800,7 +803,7 @@ static void test_vlstring_array_attribute() for (ii = 0; ii < SPACE1_DIM1; ii++) { if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0) - TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]); + TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]); HDfree(string_att_check[ii]); // note: no need for std::string test } @@ -821,7 +824,7 @@ static void test_vlstring_array_attribute() /* Helper routine for test_vl_rewrite() */ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { DataSet dset; try { @@ -839,7 +842,7 @@ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, /* Helper routine for test_vl_rewrite() */ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { char *data_read; DataSet dset; diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 0e1eb2e..d5d96bb 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,4 +1,9 @@ set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) +# Allow full output to go to CDash set to 0 +SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000) +SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000) +# WARNING! This could be a lot of output and could overwhelm CDash and the +# MySQL DB so this might not be a good idea! set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake new file mode 100755 index 0000000..d53d7a4 --- /dev/null +++ b/config/cmake/CTestScript.cmake @@ -0,0 +1,152 @@ +cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +######################################################## +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if (NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () + + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else () + ## machine name provided + ## -------------------------- + if (CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else () + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif () + if (SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif () + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if (APPLE) + # Compiler choice + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + + if (NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif () + + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () + +#----------------------------------------------------------------------------- +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar or zip file provided + ## -------------------------- + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () +endif () + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +else () + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () + +# Use multiple CPU cores to build +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" +) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +## -- set output to english +set ($ENV{LC_MESSAGES} "en_EN") + +#----------------------------------------------------------------------------- + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_SUBMIT reports to CDash server + ## -------------------------- + ctest_start (Experimental) + ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Configure Notes) + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () + + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () + + ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif() + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + message (FATAL_ERROR "tests FAILED") + endif () +#----------------------------------------------------------------------------- diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 5dad4f3..55de8f8 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -41,17 +41,41 @@ /* As FC_FUNC, but for C identifiers containing underscores. */ #define @H5_FC_FUNC_@ -/* Define Fortran Maximum Real Decimal Precision */ -#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ - -/* Define C Maximum Real Decimal Precision */ -#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ +/* Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE */ +#cmakedefine H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ /* Define if we have Fortran C_LONG_DOUBLE */ #cmakedefine H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@ -/* Determine if __float128 is available */ -#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@ +/* Define if we have Fortran intrinsic C_SIZEOF */ +#cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@ + +/* Define if we have Fortran intrinsic SIZEOF */ +#cmakedefine H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@ + +/* Define if we have Fortran intrinsic STORAGE_SIZE */ +#cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@ + +/* Determine the size of C long double */ +#cmakedefine H5_FORTRAN_SIZEOF_LONG_DOUBLE @H5_FORTRAN_SIZEOF_LONG_DOUBLE@ + +/* Define Fortran compiler ID */ +#cmakedefine H5_Fortran_COMPILER_ID @H5_Fortran_COMPILER_ID@ + +/* Define valid Fortran INTEGER KINDs */ +#cmakedefine H5_H5CONFIG_F_IKIND @H5_HH5_H5CONFIG_F_NUM_RKIND5CONFIG_F_IKIND@ + +/* Define number of valid Fortran INTEGER KINDs */ +#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@ + +/* Define number of valid Fortran REAL KINDs */ +#cmakedefine H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@ + +/* Define valid Fortran REAL KINDs */ +#cmakedefine H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@ + +/* Define valid Fortran REAL KINDs Sizeof */ +#cmakedefine H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@ /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ @@ -81,7 +105,7 @@ /* Define to 1 if you have the `difftime' function. */ #cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@ -/* Define if the direct I/O virtual file driver should be compiled */ +/* Define if the direct I/O virtual file driver (VFD) should be compiled */ #cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ /* Define to 1 if you have the <dirent.h> header file. */ @@ -108,6 +132,9 @@ /* Define if support for szip filter is enabled */ #cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@ +/* Determine if __float128 is available */ +#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@ + /* Define to 1 if you have the `flock' function. */ #cmakedefine H5_HAVE_FLOCK @H5_HAVE_FLOCK@ @@ -162,7 +189,7 @@ /* Define if the compiler understands inline */ #cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@ -/* Define if library will contain instrumentation to detect correct +/* Define if parallel library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -244,8 +271,8 @@ /* Define to 1 if you have the <pthread.h> header file. */ #cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@ -/* Define to 1 if you have the 'InitOnceExecuteOnce' function. */ -#cmakedefine H5_HAVE_WIN_THREADS @H5_HAVE_WIN_THREADS@ +/* Define to 1 if you have the <quadmath.h> header file. */ +#cmakedefine H5_HAVE_QUADMATH_H @H5_HAVE_QUADMATH_H@ /* Define to 1 if you have the `random' function. */ #cmakedefine H5_HAVE_RANDOM @H5_HAVE_RANDOM@ @@ -254,10 +281,10 @@ #cmakedefine H5_HAVE_RAND_R @H5_HAVE_RAND_R@ /* Define to 1 if you have the `round' function. */ -#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@ +#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@ /* Define to 1 if you have the `roundf' function. */ -#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@ +#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@ /* Define to 1 if you have the `setjmp' function. */ #cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@ @@ -292,6 +319,9 @@ /* Define if `struct stat' has the `st_blocks' field */ #cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ +/* Define to 1 if you have the <stdbool.h> header file. */ +#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ + /* Define to 1 if you have the <stddef.h> header file. */ #cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@ @@ -307,6 +337,12 @@ /* Define to 1 if you have the `strdup' function. */ #cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@ +/* Define to 1 if you have the `strtoll' function. */ +#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@ + +/* Define to 1 if you have the `strtoull' function. */ +#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@ + /* Define to 1 if you have the <strings.h> header file. */ #cmakedefine H5_HAVE_STRINGS_H @H5_HAVE_STRINGS_H@ @@ -325,6 +361,9 @@ /* Define to 1 if you have the `system' function. */ #cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ +/* Define to 1 if you have the <sys/file.h> header file. */ +#cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@ + /* Define to 1 if you have the <sys/ioctl.h> header file. */ #cmakedefine H5_HAVE_SYS_IOCTL_H @H5_HAVE_SYS_IOCTL_H@ @@ -379,6 +418,9 @@ /* Define to 1 if you have the `waitpid' function. */ #cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@ +/* Define to 1 if you have the 'InitOnceExecuteOnce' function. */ +#cmakedefine H5_HAVE_WIN_THREADS @H5_HAVE_WIN_THREADS@ + /* Define if your system has window style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ @@ -419,10 +461,12 @@ with special algorithm. */ #cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@ -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ +/* Define to enable internal memory allocation sanity checking. */ +/* #cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ ** Define in CMakeLists.txt */ + /* Define if the metadata trace file code is to be compiled in */ #cmakedefine H5_METADATA_TRACE_FILE @H5_METADATA_TRACE_FILE@ @@ -453,9 +497,18 @@ /* Define to the version of this package. */ #define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION_STRING@" +/* Determine the maximum decimal precision in C */ +#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ + +/* Define Fortran Maximum Real Decimal Precision */ +#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ + /* Width for printf() for type `long long' or `__int64', use `ll' */ #cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@ +/* The size of `bool', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@ + /* The size of `char', as computed by sizeof. */ #cmakedefine H5_SIZEOF_CHAR @H5_SIZEOF_CHAR@ @@ -589,14 +642,14 @@ /* The size of `unsigned', as computed by sizeof. */ #cmakedefine H5_SIZEOF_UNSIGNED @H5_SIZEOF_UNSIGNED@ -/* The size of `__int64', as computed by sizeof. */ -#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ +/* The size of `_Quad', as computed by sizeof. */ +#define H5_SIZEOF__QUAD @H5_SIZEOF__QUAD@ -/* Define to 1 if you have the <stdbool.h> header file. */ -#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ +/* The size of `__float128', as computed by sizeof. */ +#define H5_SIZEOF___FLOAT128 @H5_SIZEOF___FLOAT128@ -/* The size of `bool', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@ +/* The size of `__int64', as computed by sizeof. */ +#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ /* Define to 1 if you have the ANSI C header files. */ #cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index eadff5f..04f72a0 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -5,102 +5,75 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -#JAVA_LIBRARIES - Default is NO -##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) +#CTEST_SOURCE_NAME - name of source folder; HDF5Examples if (DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach (current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () -if (NOT DEFINED INSTALLDIR) - set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif () + endforeach () endif () + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "HDF5Examples") + set (CTEST_CONFIGURATION_TYPE "Release") endif () -if (NOT DEFINED STATIC_ONLY) - set (STATICONLYLIBRARIES "YES") -else () - set (STATICONLYLIBRARIES "NO") -endif () -if (NOT DEFINED FORTRAN_LIBRARIES) - set (FORTRANLIBRARIES "NO") -else () - set (FORTRANLIBRARIES "YES") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") +################################################################## + +if (NOT DEFINED INSTALLDIR) + set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") endif () -if (NOT DEFINED JAVA_LIBRARIES) - set (JAVALIBRARIES "NO") -else () - set (JAVALIBRARIES "YES") + +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "HDF5Examples") endif () + if (NOT DEFINED HDF_LOCAL) - set (CDASH_LOCAL "NO") + set (CDASH_LOCAL "NO") else () - set (CDASH_LOCAL "YES") + set (CDASH_LOCAL "YES") endif () if(NOT DEFINED CTEST_SITE) - set (CTEST_SITE "local") + set (CTEST_SITE "local") endif () -if(NOT DEFINED CTEST_BUILD_NAME) - set (CTEST_BUILD_NAME "examples") +if (NOT DEFINED CTEST_BUILD_NAME) + set (CTEST_BUILD_NAME "examples") endif () set (BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile #if (NOT DEFINED TAR_SOURCE) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source") #endif () ############################################################################################################### -# Adjust the following SET Commands as needed -############################################################################################################### if (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () + set (SITE_OS_NAME "Windows") set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else () - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif () -if (${FORTRANLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () -if(${JAVALIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif () -if(${CDASH_LOCAL}) +if (${CDASH_LOCAL}) set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") endif () set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") @@ -110,102 +83,10 @@ set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@H # ############################################################################################################### -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if (APPLE) - # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () - -#----------------------------------------------------------------------------- -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## -------------------------- -if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided - ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif() - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +if (WIN32) + include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else () - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif () - -# Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- -configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) -ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") -## NORMAL process -## -------------------------- -ctest_start (Experimental) -ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Configure Notes) -endif () -ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Build) -endif () -ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) -endif () -if (${res} LESS 0 OR ${res} GREATER 0) - message (FATAL_ERROR "tests FAILED") + include (${CTEST_SCRIPT_DIRECTORY}/HDF_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif () -#----------------------------------------------------------------------------- -############################################################################################################## -message (STATUS "DONE") diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake new file mode 100755 index 0000000..a8f0c8e --- /dev/null +++ b/config/cmake/HDF5_Examples_options.cmake @@ -0,0 +1,48 @@ +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +#### DEFAULT: ### +#### BUILD_SHARED_LIBS:BOOL=OFF ### +#### HDF_BUILD_C:BOOL=ON ### +#### HDF_BUILD_CXX:BOOL=OFF ### +#### HDF_BUILD_FORTRAN:BOOL=OFF ### +#### HDF_BUILD_JAVA:BOOL=OFF ### +#### BUILD_TESTING:BOOL=OFF ### +#### HDF_ENABLE_PARALLEL:BOOL=OFF ### +#### HDF_ENABLE_THREADSAFE:BOOL=OFF ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options +### build with shared libraries +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + +############################################################################################# +#### languages #### +### disable C builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF") + +### enable C++ builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON") + +### enable Fortran builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + +### enable JAVA builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") + +############################################################################################# +### enable parallel program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") + + +############################################################################################# +### enable threadsafe program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON") + + +############################################################################################# +### enable test program builds, requires reference files in testfiles subdirectory +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") + +############################################################################################# diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 0e0106f..67b42fb 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -25,6 +25,15 @@ if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") endif () +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file if (NOT TEST_ERRREF) if (NOT SKIP_APPEND) # append error file since skip was not defined @@ -60,6 +69,7 @@ execute_process ( message (STATUS "COMMAND Result: ${TEST_RESULT}") +# if the .err file exists and ERRROR_APPEND is enabled if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) if (TEST_MASK_FILE) @@ -75,6 +85,7 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () endif () +# if the output file or the .err file needs to mask out error stack info if (TEST_MASK_ERROR) if (NOT TEST_ERRREF) # the error stack has been appended to the output file @@ -125,7 +136,7 @@ if (NOT TEST_SKIP_COMPARE) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -137,6 +148,13 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () endforeach () + else () + if (${len_act} STREQUAL "0") + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (${len_ref} STREQUAL "0") + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + endif () endif () if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) @@ -169,7 +187,7 @@ if (NOT TEST_SKIP_COMPARE) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -181,7 +199,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () endforeach () - endif () + else () + if (${len_act} STREQUAL "0") + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") + endif () + if (${len_ref} STREQUAL "0") + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") + endif () + endif() if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index dca9631..cb92933 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -33,12 +33,12 @@ else () ## machine name provided
## --------------------------
if (CMAKE_HOST_UNIX)
- set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
+ set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
else ()
- set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
+ set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
endif ()
if (SITE_BUILDNAME_SUFFIX)
- set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
+ set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
endif ()
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
endif ()
@@ -185,17 +185,22 @@ endforeach () #-----------------------------------------------------------------------------
# Initialize the CTEST commands
#------------------------------
+if(CMAKE_GENERATOR_TOOLSET)
+ set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
+else ()
+ set(CTEST_CONFIGURE_TOOLSET "")
+endif()
if (LOCAL_MEMCHECK_TEST)
find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
else ()
if (LOCAL_COVERAGE_TEST)
find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
endif ()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
endif ()
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 55fecfb..239d517 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -4,7 +4,7 @@ ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ###
#############################################################################################
-cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR)
+cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR)
############################################################################
# Usage:
# ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log
@@ -27,8 +27,8 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
-set(CTEST_SOURCE_VERSION 1.10.1)
-set(CTEST_SOURCE_VERSEXT "")
+set (CTEST_SOURCE_VERSION "1.11.0")
+set (CTEST_SOURCE_VERSEXT "")
##############################################################################
# handle input parameters to script.
@@ -40,139 +40,139 @@ set(CTEST_SOURCE_VERSEXT "") #FORTRAN_LIBRARIES - Default is NO
#JAVA_LIBRARIES - Default is NO
#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
-if(DEFINED CTEST_SCRIPT_ARG)
+if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
# to variables with the respective names set to the respective values
- string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
- foreach(current_var ${script_args})
+ string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
+ foreach (current_var ${script_args})
if ("${current_var}" MATCHES "^([^=]+)=(.+)$")
- set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
+ set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
endif ()
endforeach ()
endif ()
# build generator must be defined
-if(NOT DEFINED BUILD_GENERATOR)
- message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
+if (NOT DEFINED BUILD_GENERATOR)
+ message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
else ()
- if(${BUILD_GENERATOR} STREQUAL "Unix")
- set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
- elseif(${BUILD_GENERATOR} STREQUAL "VS201564")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
- elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
- elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
- set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
+ if (${BUILD_GENERATOR} STREQUAL "Unix")
+ set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2015")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS201564")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2013")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS201364")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2012")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS201264")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
else ()
- message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
+ message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
endif ()
endif ()
###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
-set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
+set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
###################################################################
-if(NOT DEFINED INSTALLDIR)
- if(WIN32)
- set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}")
+if (NOT DEFINED INSTALLDIR)
+ if (WIN32)
+ set (INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}")
else ()
- set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}")
+ set (INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}")
endif ()
endif ()
-if(NOT DEFINED CTEST_CONFIGURATION_TYPE)
- set(CTEST_CONFIGURATION_TYPE "Release")
+if (NOT DEFINED CTEST_CONFIGURATION_TYPE)
+ set (CTEST_CONFIGURATION_TYPE "Release")
endif ()
-if(NOT DEFINED CTEST_SOURCE_NAME)
- set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
+if (NOT DEFINED CTEST_SOURCE_NAME)
+ set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
endif ()
-if(NOT DEFINED STATIC_ONLY)
- set(STATICONLYLIBRARIES "YES")
+if (NOT DEFINED STATIC_ONLY)
+ set (STATICONLYLIBRARIES "YES")
else ()
- set(STATICONLYLIBRARIES "NO")
+ set (STATICONLYLIBRARIES "NO")
endif ()
-if(NOT DEFINED FORTRAN_LIBRARIES)
- set(FORTRANLIBRARIES "NO")
+if (NOT DEFINED FORTRAN_LIBRARIES)
+ set (FORTRANLIBRARIES "NO")
else ()
- set(FORTRANLIBRARIES "YES")
+ set(FORTRANLIBRARIES "YES")
endif ()
-if(NOT DEFINED JAVA_LIBRARIES)
- set(JAVALIBRARIES "NO")
+if (NOT DEFINED JAVA_LIBRARIES)
+ set (JAVALIBRARIES "NO")
else ()
- set(JAVALIBRARIES "YES")
+ set (JAVALIBRARIES "YES")
endif ()
-set(CTEST_BINARY_NAME "build")
-set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
-if(WIN32)
- set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
- set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
+set (CTEST_BINARY_NAME "build")
+set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
+if (WIN32)
+ set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
+ set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else ()
- set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
- set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
+ set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
+ set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif ()
###################################################################
######### Following describes compiler ############
-if(WIN32)
- set(SITE_OS_NAME "Windows")
- set(SITE_OS_VERSION "WIN7")
- if(${BUILD_GENERATOR} STREQUAL "VS201564")
- set(SITE_OS_BITS "64")
- set(SITE_COMPILER_NAME "vs2015")
- set(SITE_COMPILER_VERSION "14")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
- set(SITE_OS_BITS "32")
- set(SITE_COMPILER_NAME "vs2015")
- set(SITE_COMPILER_VERSION "14")
- elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
- set(SITE_OS_BITS "64")
- set(SITE_COMPILER_NAME "vs2013")
- set(SITE_COMPILER_VERSION "12")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
- set(SITE_OS_BITS "32")
- set(SITE_COMPILER_NAME "vs2013")
- set(SITE_COMPILER_VERSION "12")
- elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
- set(SITE_OS_BITS "64")
- set(SITE_COMPILER_NAME "vs2012")
- set(SITE_COMPILER_VERSION "11")
- elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
- set(SITE_OS_BITS "32")
- set(SITE_COMPILER_NAME "vs2012")
- set(SITE_COMPILER_VERSION "11")
+if (WIN32)
+ set (SITE_OS_NAME "Windows")
+ set (SITE_OS_VERSION "WIN7")
+ if (${BUILD_GENERATOR} STREQUAL "VS201564")
+ set (SITE_OS_BITS "64")
+ set (SITE_COMPILER_NAME "vs2015")
+ set (SITE_COMPILER_VERSION "14")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2015")
+ set (SITE_OS_BITS "32")
+ set (SITE_COMPILER_NAME "vs2015")
+ set (SITE_COMPILER_VERSION "14")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS201364")
+ set (SITE_OS_BITS "64")
+ set (SITE_COMPILER_NAME "vs2013")
+ set (SITE_COMPILER_VERSION "12")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2013")
+ set (SITE_OS_BITS "32")
+ set (SITE_COMPILER_NAME "vs2013")
+ set (SITE_COMPILER_VERSION "12")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS201264")
+ set (SITE_OS_BITS "64")
+ set (SITE_COMPILER_NAME "vs2012")
+ set (SITE_COMPILER_VERSION "11")
+ elseif (${BUILD_GENERATOR} STREQUAL "VS2012")
+ set (SITE_OS_BITS "32")
+ set (SITE_COMPILER_NAME "vs2012")
+ set (SITE_COMPILER_VERSION "11")
endif ()
## Set the following to unique id your computer ##
- set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
+ set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
else ()
- set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
## Set the following to unique id your computer ##
- if(APPLE)
- set(CTEST_SITE "MAC.XXXX")
+ if (APPLE)
+ set (CTEST_SITE "MAC.XXXX")
else ()
- set(CTEST_SITE "LINUX.XXXX")
+ set (CTEST_SITE "LINUX.XXXX")
endif ()
- if(APPLE)
- execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(ENV{CC} "${XCODE_CC}")
- set(ENV{CXX} "${XCODE_CXX}")
- set(CTEST_USE_LAUNCHERS 1)
- set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare")
- set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized")
- set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat")
- set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2")
- set(RR_FLAGS_C "${RR_FLAGS_COMMON}")
- set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}")
- set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
- set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
+ if (APPLE)
+ execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set (ENV{CC} "${XCODE_CC}")
+ set (ENV{CXX} "${XCODE_CXX}")
+ set (CTEST_USE_LAUNCHERS 1)
+ set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare")
+ set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized")
+ set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat")
+ set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2")
+ set (RR_FLAGS_C "${RR_FLAGS_COMMON}")
+ set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}")
+ set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
+ set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
endif ()
endif ()
###################################################################
@@ -180,99 +180,99 @@ endif () ###################################################################
######### Following is for submission to CDash ############
###################################################################
-set(MODEL "Experimental")
+set (MODEL "Experimental")
###################################################################
###################################################################
##### Following controls CDash submission #####
-#set(LOCAL_SUBMIT "TRUE")
+#set (LOCAL_SUBMIT "TRUE")
##### Following controls test process #####
-#set(LOCAL_SKIP_TEST "TRUE")
-#set(LOCAL_MEMCHECK_TEST "TRUE")
-#set(LOCAL_COVERAGE_TEST "TRUE")
+#set (LOCAL_SKIP_TEST "TRUE")
+#set (LOCAL_MEMCHECK_TEST "TRUE")
+#set (LOCAL_COVERAGE_TEST "TRUE")
##### Following controls cpack command #####
-#set(LOCAL_NO_PACKAGE "TRUE")
+#set (LOCAL_NO_PACKAGE "TRUE")
##### Following controls source update #####
-#set(LOCAL_UPDATE "TRUE")
-set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git")
-set(REPOSITORY_BRANCH "develop")
+#set (LOCAL_UPDATE "TRUE")
+set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git")
+set (REPOSITORY_BRANCH "develop")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
###################################################################
###################################################################
-if(${STATICONLYLIBRARIES})
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
+if (${STATICONLYLIBRARIES})
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
######### Following describes computer ############
## following is optional to describe build ##
- set(SITE_BUILDNAME_SUFFIX "STATIC")
+ set (SITE_BUILDNAME_SUFFIX "STATIC")
endif ()
###################################################################
#### fortran ####
-if(${FORTRANLIBRARIES})
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
+if (${FORTRANLIBRARIES})
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
else ()
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
endif ()
#### java ####
-if(${JAVALIBRARIES})
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
+if (${JAVALIBRARIES})
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
else ()
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
endif ()
### change install prefix
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}")
###################################################################
-if(WIN32)
- set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}")
- include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake)
- include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+if (WIN32)
+ set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}")
+ include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake)
+ include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe")
+ file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi")
+ file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip")
+ file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
else ()
- set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
- include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake)
- include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
- if(APPLE)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
+ include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake)
+ include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
+ if (APPLE)
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
else ()
- if(CYGWIN)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (CYGWIN)
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
else ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz")
+ file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif ()
endif ()
endif ()
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index a1bf88d..bbbb8dc 100755 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -6,6 +6,10 @@ ### uncomment/comment and change the following lines for other configuration options ############################################################################################# +#### alternate toolsets #### +#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") + +############################################################################################# #### ext libraries #### ### ext libs from tgz @@ -31,7 +35,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING ### disable packaging #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) +### Create install package with external libraries (szip, zlib) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ############################################################################################# diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 2e99c94..a0ec8e3 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -198,18 +198,19 @@ endmacro () #----------------------------------------------------------------------------- # Check for the existence of certain header files #----------------------------------------------------------------------------- -CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H) CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) -CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler @@ -527,6 +528,8 @@ CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK) CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF) CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM) CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL) +CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL) CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK) CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM) @@ -585,6 +588,7 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H + HAVE_SYS_FILE_H ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index ecf3be0..3039cfd 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -237,16 +237,18 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") endif () set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "^16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^15.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "18.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^20.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () diff --git a/configure.ac b/configure.ac index 2af7988..ca4d4b6 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.236], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.11.0], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) @@ -1851,6 +1851,7 @@ AC_CHECK_FUNCS([frexpl gethostname getrusage gettimeofday]) AC_CHECK_FUNCS([lstat rand_r random setsysinfo]) AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([snprintf srandom strdup symlink system]) +AC_CHECK_FUNCS([strtoll strtoull]) AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid]) AC_CHECK_FUNCS([roundf lroundf llroundf round lround llround]) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index e325377..02f155f 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -30,9 +30,9 @@ if [[ $rc != 0 ]] ; then exit 0 fi -echo "h5watch tests are skipped temporarily." -echo -exit 0 +#echo "h5watch tests are skipped temporarily." +#echo +#exit 0 H5WATCH=h5watch # The tool name H5WATCH_BIN=`pwd`/$H5WATCH # The path of H5WATCH diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 5b35d17..a1099d8 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -216,7 +216,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. * <hr> * - * @version HDF5 1.9 <BR> + * @version HDF5 1.11.0 <BR> * <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR> * <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR> * <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR> @@ -239,7 +239,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 9, 9999 }; + public final static int LIB_VERSION[] = { 1, 11, 0 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 1a78bea..4c84988 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -164,7 +164,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { 1, 9, 0 }; + int libversion[] = { 1, 11, 0 }; try { H5.H5get_libversion(libversion); @@ -186,7 +186,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - int majnum = 1, minnum = 9, relnum = 0; + int majnum = 1, minnum = 11, relnum = 0; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 70ec47f..4c4460e 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -663,7 +663,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log @@ -686,152 +686,152 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.10.1) -set(CTEST_SOURCE_VERSEXT "") +set (CTEST_SOURCE_VERSION 1.10.1) +set (CTEST_SOURCE_VERSEXT "") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.1 +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 #STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac -if(DEFINED CTEST_SCRIPT_ARG) +if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") endif () endforeach () endif () # build generator must be defined -if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") +if (NOT DEFINED BUILD_GENERATOR) + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") else () - if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif(${BUILD_GENERATOR} STREQUAL "VS2015") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif(${BUILD_GENERATOR} STREQUAL "VS201564") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + if (${BUILD_GENERATOR} STREQUAL "Unix") + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else () - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") endif () endif () ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") ################################################################### -if(NOT DEFINED INSTALLDIR) - if(WIN32) - set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") +if (NOT DEFINED INSTALLDIR) + if (WIN32) + set (INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") else () - set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") + set (INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") endif () endif () -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") endif () -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") endif () -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") +if (NOT DEFINED STATIC_ONLY) + set (STATICONLYLIBRARIES "YES") else () - set(STATICONLYLIBRARIES "NO") + set (STATICONLYLIBRARIES "NO") endif () -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") +if (NOT DEFINED FORTRAN_LIBRARIES) + set (FORTRANLIBRARIES "NO") else () - set(FORTRANLIBRARIES "YES") + set(FORTRANLIBRARIES "YES") endif () -if(NOT DEFINED JAVA_LIBRARIES) - set(JAVALIBRARIES "NO") +if (NOT DEFINED JAVA_LIBRARIES) + set (JAVALIBRARIES "NO") else () - set(JAVALIBRARIES "YES") + set (JAVALIBRARIES "YES") endif () -set(CTEST_BINARY_NAME "build") -set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") -if(WIN32) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +set (CTEST_BINARY_NAME "build") +set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") +if (WIN32) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else () - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif () ################################################################### ######### Following describes compiler ############ -if(WIN32) - set(SITE_OS_NAME "Windows") - set(SITE_OS_VERSION "WIN7") - if(${BUILD_GENERATOR} STREQUAL "VS201564") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2015") - set(SITE_COMPILER_VERSION "14") - elseif(${BUILD_GENERATOR} STREQUAL "VS2015") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2015") - set(SITE_COMPILER_VERSION "14") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") +if (WIN32) + set (SITE_OS_NAME "Windows") + set (SITE_OS_VERSION "WIN7") + if (${BUILD_GENERATOR} STREQUAL "VS201564") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") endif () ## Set the following to unique id your computer ## - set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") + set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## - if(APPLE) - set(CTEST_SITE "MAC.XXXX") + if (APPLE) + set (CTEST_SITE "MAC.XXXX") else () - set(CTEST_SITE "LINUX.XXXX") + set (CTEST_SITE "LINUX.XXXX") endif () - if(APPLE) - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - set(CTEST_USE_LAUNCHERS 1) - set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set(RR_FLAGS_C "${RR_FLAGS_COMMON}") - set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + if (APPLE) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + set (CTEST_USE_LAUNCHERS 1) + set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set (RR_FLAGS_C "${RR_FLAGS_COMMON}") + set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") endif () endif () ################################################################### @@ -839,99 +839,99 @@ endif () ################################################################### ######### Following is for submission to CDash ############ ################################################################### -set(MODEL "Experimental") +set (MODEL "Experimental") ################################################################### ################################################################### ##### Following controls CDash submission ##### -#set(LOCAL_SUBMIT "TRUE") +#set (LOCAL_SUBMIT "TRUE") ##### Following controls test process ##### -#set(LOCAL_SKIP_TEST "TRUE") -#set(LOCAL_MEMCHECK_TEST "TRUE") -#set(LOCAL_COVERAGE_TEST "TRUE") +#set (LOCAL_SKIP_TEST "TRUE") +#set (LOCAL_MEMCHECK_TEST "TRUE") +#set (LOCAL_COVERAGE_TEST "TRUE") ##### Following controls cpack command ##### -#set(LOCAL_NO_PACKAGE "TRUE") +#set (LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### -#set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set(REPOSITORY_BRANCH "develop") +#set (LOCAL_UPDATE "TRUE") +set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set (REPOSITORY_BRANCH "develop") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### -if(${STATICONLYLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +if (${STATICONLYLIBRARIES}) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## - set(SITE_BUILDNAME_SUFFIX "STATIC") + set (SITE_BUILDNAME_SUFFIX "STATIC") endif () ################################################################### #### fortran #### -if(${FORTRANLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") +if (${FORTRANLIBRARIES}) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") else () - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") endif () #### java #### -if(${JAVALIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") +if (${JAVALIBRARIES}) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") else () - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") endif () ### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### -if(WIN32) - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") - include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) +if (WIN32) + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () else () - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") - include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if (APPLE) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () else () - if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (CYGWIN) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () else () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif () endif () endif () @@ -946,6 +946,10 @@ HDF5options.cmake: ### uncomment/comment and change the following lines for other configuration options ############################################################################################# +#### alternate toolsets #### +#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") + +############################################################################################# #### ext libraries #### ### ext libs from tgz @@ -971,7 +975,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING ### disable packaging #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) +### Create install package with external libraries (szip, zlib) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ############################################################################################# diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fdae007..22accd3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.236 currently under development +HDF5 version 1.11.0 currently under development ================================================================================ @@ -12,11 +12,11 @@ For more details check the HISTORY*.txt files in the HDF5 source. Links to HDF5 1.10.1 source code, documentation, and additional materials can be found on The HDF5 web page at: https://support.hdfgroup.org/HDF5/ - + The HDF5 1.10.1 release can be obtained from: - https://support.hdfgroup.org/HDF5/release/obtain5110.html - + https://support.hdfgroup.org/HDF5/release/obtain5110.html + User documentation for the snapshot can be accessed directly at this location: https://support.hdfgroup.org/HDF5/doc1.10/ @@ -54,77 +54,131 @@ New Features Configuration: ------------- - - CMake minimum is now 3.2.2. (ADB 2016/01/10) - + - CMake minimum is now 3.2.2. + (ADB 2017/01/10) + + - Tools folder is separated into source and test folders. This + allows autotools to skip the make command and just execute + the make check command. + (HDFFV-9719 ADB 2016/10/27) Library: -------- - - + - Paged Aggregation + + This is one of the file space management strategies. This strategy + aggregates small metadata and raw data allocations into constant-sized + well-aligned pages, which are suitable for page caching. Paged + aggregation together with the page buffering feature will allow efficient + I/O accesses. + + - Page Buffering + + The page buffering layer in the HDF5 library absorbs small accesses to + the file system. Each page in memory corresponds to a page allocated in + the file. Access to the file system is then performed as a single page + or multiple of pages, if they are contiguous. This ensures that small + accesses to the file system are avoided while providing another caching + layer for improved I/O performance. This feature works in conjunction + with the paged aggregation feature. Parallel Library: ----------------- - - + - Fortran Library: ---------------- - - + - C++ Library: ------------ - - + - Tools: ------ - - + - Add options to h5clear: + -s: clear the status_flags field in the file's superblock + -m: Remove the metadata cache image from the file + (Pull Request #361 QK 2017/03/22) High-Level APIs: --------------- C Packet Table API ------------------ - - + - Internal header file -------------------- - - + Documentation ------------- Support for new platforms, languages and compilers. ======================================= - - + - Bug Fixes since HDF5-1.10.0-patch1 release ================================== Library ------- - - + - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY + (PR 201 ADB 2016/12/12) + + - Fix error when copying dataset with attribute which is a compound datatype + consisting of a variable length string. + (HDFFV-7991 VC 2016/08/19, 2016/08/21, 2016/08/24) + + - H5DOappend will not fail if a dataset has no append callback registered. + (HDFFV-9960 VC 2016/08/05, 2016/08/14) + + - Fix the problem where the committed datatype's file location is different + from the file location of an attribute with that committed datatype. + (HDFFV-9940 VC 2016/07/03, 2016/07/06) + + - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. + (b) Modifications to better handle error recovery when conversion by + h5format_convert fails. + (HDFFV-9434 VC 2016/05/29) Configuration ------------- - - + - Configuration will check for the strtoll and strtoull functions + before using alternatives + (PR 340 ADB 2017/03/17) + + - CMake uses a Windows pdb directory variable if available and + will generate both static and shared pdb files. + (HDFFV-9875 ADB 2017/02/06) + + - CMake now builds shared versions of tools. + (HDFFV-10123 ADB 2017/02/01) Performance ------------- - - - + - + Fortran -------- - - + - Tools ----- - - + - h5diff correctly ignores strpad in comparing strings. + (HDFFV-10128 ADB 2017/03/03) + + - h5repack now correctly parses the command line filter options. + (HDFFV-10046 ADB 2017/01/24) High-Level APIs: ------ - - + - Fortran High-Level APIs: ------ - - + - Documentation ------------- @@ -132,20 +186,21 @@ Bug Fixes since HDF5-1.10.0-patch1 release F90 APIs -------- - - + - C++ APIs -------- - - - + - + + Testing ------- - - + - Supported Platforms =================== - + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (mayll/platypus) Version 4.4.7 20120313 @@ -172,7 +227,7 @@ Supported Platforms compilers: Version 15.0.3.187 Build 20150407 MPICH 3.1.4 compiled with GCC 4.9.3 - + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc (emu) Sun Fortran 95 8.6 SunOS_sparc Sun C++ 5.12 SunOS_sparc @@ -186,11 +241,12 @@ Supported Platforms Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) Visual Studio 2015 w/ Intel Fortran 16 (cmake) - + Visual Studio 2015 w/ Intel Parallel Studio 2017 (cmake) + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) - + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 64-bit gfortran GNU Fortran (GCC) 4.8.2 (swallow/kite) Intel icc/icpc/ifort version 15.0.3 @@ -226,7 +282,7 @@ Platform C F90/ F90 C++ zlib SZIP Solaris2.11 32-bit n y/y n y y y Solaris2.11 64-bit n y/n n y y y Windows 7 y y/y n y y y -Windows 7 x64 y y/y n y y y +Windows 7 x64 y y/y y y y y Windows 7 Cygwin n y/n n y y y Windows 7 x64 Cygwin n y/n n y y y Windows 10 y y/y n y y y @@ -291,7 +347,7 @@ The following platforms are not supported but have been tested for this release. GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 (cmake and autotools) - + Known Problems ============== * "make check" fails on CYGWIN when building shared lib files is enabled. The diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 87ebafc..ecf972d 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -221,7 +221,9 @@ NOTE: this file is available at the HDF web site: HDF5_Examples.cmake - +Also available at the HDF web site is a CMake application framework template. +You can quickly add files to the framework and execute the script to compile +your application with an installed HDF5 binary. ======================================================================== ctest @@ -611,6 +611,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Sanity check */ HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); #if H5AC_DUMP_STATS_ON_CLOSE @@ -641,9 +642,17 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ - if(H5AC__flush_entries(f, dxpl_id) < 0) + /* 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 + * free space manager settle routines. + */ + if ( ( H5F_ACC_RDWR & H5F_INTENT(f) ) && + ( H5AC__flush_entries(f, dxpl_id) < 0 ) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ @@ -3301,3 +3310,29 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_remove_entry() */ + +/*------------------------------------------------------------------------- + * Function: H5AC_get_mdc_image_info + * + * Purpose: Wrapper function for H5C_get_mdc_image_info(). + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if(H5C_get_mdc_image_info((H5C_t *)cache_ptr, image_addr, image_len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve cache image info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_get_mdc_image_info() */ + diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 1f8299b..a724394 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -453,6 +453,8 @@ H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, 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); H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f, hid_t dxpl_id); +H5_DLL herr_t H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, + hsize_t *image_len); /* Tag & Ring routines */ H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); @@ -761,7 +761,10 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") #ifdef H5_HAVE_PARALLEL - if(!image_generated && cache_ptr->aux_ptr != NULL && f->shared->fs_persist) { + if ( ( H5F_INTENT(f) & H5F_ACC_RDWR ) && + ( ! 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 * dirtying of entries. @@ -7295,14 +7298,20 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, prev_ptr = entry_ptr->aux_prev; + if ( ( !(entry_ptr->prefetched_dirty) ) #ifdef H5_HAVE_PARALLEL - if(!(entry_ptr->coll_access)) { + && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") -#ifdef H5_HAVE_PARALLEL + ) { + + if ( H5C__flush_single_entry(f, dxpl_id, entry_ptr, + H5C__FLUSH_INVALIDATE_FLAG | + H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to flush entry") + } /* end if */ -#endif /* H5_HAVE_PARALLEL */ /* we are scanning the clean LRU, so the serialize function * will not be called on any entry -- thus there is no diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 539dece..bdfb23e 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2321,6 +2321,7 @@ 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, 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); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 33a322d..5108013 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -454,3 +454,33 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_get_entry_ring() */ +/*------------------------------------------------------------------------- + * 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 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") + if(image_addr == NULL || image_len == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad image_addr or image_len on entry") + + *image_addr = cache_ptr->image_addr; + *image_len = cache_ptr->image_len; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_get_mdc_image_info() */ + @@ -2086,3 +2086,43 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Fget_page_buffering_stats() */ + +/*------------------------------------------------------------------------- + * Function: H5Fget_mdc_image_info + * + * Purpose: Retrieves the image_addr and image_len for the cache image in the file. + * image_addr: --base address of the on disk metadata cache image + * --HADDR_UNDEF if no cache image + * image_len: --size of the on disk metadata cache image + * --zero if no cache image + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len) +{ + H5F_t *file; /* File object for file ID */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*a*h", file_id, image_addr, image_len); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + if(NULL == image_addr || NULL == image_len) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL image addr or image len") + + /* Go get the address and size of the cache image */ + if(H5AC_get_mdc_image_info(file->shared->cache, image_addr, image_len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve cache image info") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_mdc_image_info() */ + diff --git a/src/H5Fint.c b/src/H5Fint.c index 794be50..444d409 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1006,8 +1006,15 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") + /* Set up I/O info for operation */ + fio_info.f = f; + if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) + HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) + HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + /* Shutdown the page buffer cache */ - if(H5PB_dest(f) < 0) + if(H5PB_dest(&fio_info) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing page buffer cache") @@ -1027,13 +1034,6 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f->shared->root_grp = NULL; } /* end if */ - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Destroy other components of the file */ if(H5F__accum_reset(&fio_info, TRUE) < 0) /* Push error, but keep going*/ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index f87aaad..84c0d38 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -267,6 +267,7 @@ H5_DLL herr_t H5Fformat_convert(hid_t fid); H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); +H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); @@ -1347,6 +1347,12 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r HDassert(f); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + if(f->shared->first_alloc_dealloc) { + HDassert(! H5AC_cache_image_pending(f)); + if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") + } /* end if */ + /* Set mapped type, treating global heap as raw data */ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; @@ -468,7 +468,7 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) /*------------------------------------------------------------------------- * Function: H5PB_dest * - * Purpose: destroy the PB on the file. + * Purpose: Flush and destroy the PB on the file if it exists. * * Return: Non-negative on success/Negative on failure * @@ -477,20 +477,26 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5PB_dest(H5F_t *f) +H5PB_dest(const H5F_io_info2_t *fio_info) { herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f; /* file pointer */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ + HDassert(fio_info); + f = fio_info->f; HDassert(f); - /* Destroy page buffer info, if there is any */ + /* flush and destroy the page buffer, if it exists */ if(f->shared->page_buf) { H5PB_t *page_buf = f->shared->page_buf; H5PB_ud1_t op_data; /* Iteration context */ + if(H5PB_flush(fio_info)<0) + HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer") + /* Set up context info */ op_data.page_buf = page_buf; diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index 3b5dcae..7dd4071 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -89,7 +89,7 @@ typedef struct H5PB_t { /* General routines */ H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc); H5_DLL herr_t H5PB_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5PB_dest(H5F_t *file); +H5_DLL herr_t H5PB_dest(const H5F_io_info2_t *fio_info); H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr); H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf); H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr); diff --git a/src/H5private.h b/src/H5private.h index 00de96c..61ecc5b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1386,7 +1386,13 @@ typedef off_t h5_stat_size_t; #ifndef HDstrtol #define HDstrtol(S,R,N) strtol(S,R,N) #endif /* HDstrtol */ -H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); +#ifndef HDstrtoll + #ifdef H5_HAVE_STRTOLL + #define HDstrtoll(S,R,N) strtoll(S,R,N) + #else + H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); + #endif /* H5_HAVE_STRTOLL */ +#endif /* HDstrtoll */ #ifndef HDstrtoul #define HDstrtoul(S,R,N) strtoul(S,R,N) #endif /* HDstrtoul */ diff --git a/src/H5public.h b/src/H5public.h index f0eb63a..cab90aa 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,11 +93,11 @@ 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 236 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_MINOR 11 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 0 /* 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.236" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.11.0" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5system.c b/src/H5system.c index ac323c0..1f92e19 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -32,10 +32,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -474,6 +474,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) * *------------------------------------------------------------------------- */ +#ifndef HDstrtoll int64_t HDstrtoll(const char *s, const char **rest, int base) { @@ -549,7 +550,7 @@ HDstrtoll(const char *s, const char **rest, int base) *rest = s; return acc; } /* end HDstrtoll() */ - +#endif /*------------------------------------------------------------------------- * Function: HDrand/HDsrand @@ -604,7 +605,7 @@ void HDsrand(unsigned int seed) #ifdef H5_HAVE_FCNTL int Pflock(int fd, int operation) { - + struct flock flk; /* Set the lock type */ @@ -649,18 +650,18 @@ Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation) { /*------------------------------------------------------------------------- - * Function: H5_make_time + * Function: H5_make_time * - * Purpose: Portability routine to abstract converting a 'tm' struct into - * a time_t value. + * Purpose: Portability routine to abstract converting a 'tm' struct into + * a time_t value. * - * Note: This is a little problematic because mktime() operates on - * local times. We convert to local time and then figure out the - * adjustment based on the local time zone and daylight savings - * setting. + * Note: This is a little problematic because mktime() operates on + * local times. We convert to local time and then figure out the + * adjustment based on the local time zone and daylight savings + * setting. * - * Return: Success: The value of timezone - * Failure: -1 + * Return: Success: The value of timezone + * Failure: -1 * * Programmer: Quincey Koziol * November 18, 2015 @@ -1138,7 +1139,7 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/) if(NULL == (*full_name = (char *)H5MM_strdup(path2))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end if */ + } /* end if */ else if(H5_CHECK_ABS_PATH(path2)) { /* On windows path2 is a path absolute name */ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index b419f06..e005b51 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -23,6 +23,11 @@ * */ +/* + * _MSC_VER = 1900 VS2015 + * _MSC_VER = 1800 VS2013 + * _MSC_VER = 1700 VS2012 + */ #ifdef H5_HAVE_WIN32_API typedef struct _stati64 h5_stat_t; @@ -54,13 +59,22 @@ typedef __int64 h5_stat_size_t; #define HDsleep(S) Sleep(S*1000) #define HDstat(S,B) _stati64(S,B) #define HDstrcasecmp(A,B) _stricmp(A,B) -#define HDstrtoull(S,R,N) _strtoui64(S,R,N) #define HDstrdup(S) _strdup(S) #define HDtzset() _tzset() #define HDunlink(S) _unlink(S) #define HDwrite(F,M,Z) _write(F,M,Z) #ifdef H5_HAVE_VISUAL_STUDIO + +#if (_MSC_VER < 1800) + #ifndef H5_HAVE_STRTOLL + #define HDstrtoll(S,R,N) _strtoi64(S,R,N) + #endif /* H5_HAVE_STRTOLL */ + #ifndef H5_HAVE_STRTOULL + #define HDstrtoull(S,R,N) _strtoui64(S,R,N) + #endif /* H5_HAVE_STRTOULL */ +#endif /* MSC_VER < 1800 */ + /* * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO */ diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 1cae191..a1fda0e 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -113,6 +113,33 @@ TOOLTEST() { fi } +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir usecases_test +cp twriteorder usecases_test +for FILE in use_*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE usecases_test +done + +# With the --disable-shared option, swmr program files are built in the test +# directory, otherwise they are in test/.libs with a corresponding wrapper +# script in the test directory. The programs or wrapper scripts in test should +# always be copied, swmr files in .libs should be copied only if they exists. +if [ -f .libs/use_append_chunk ]; then + mkdir usecases_test/.libs + cp .libs/use_* usecases_test/.libs + cp .libs/twriteorder usecases_test/.libs +fi + +cd usecases_test + + # run tests for H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled here temporary USECORK=use_disable_mdc_flushes for p in $USECORK; do @@ -158,10 +185,14 @@ for p in $USECASES_PROGRAMS; do fi done - +cd .. # Report test results and exit if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf usecases_test + fi else echo "$TESTNAME tests failed with $nerrors errors." EXIT_VALUE=$EXIT_FAILURE diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index 83b7134..d894cee 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -79,11 +79,23 @@ if [ $rc -ne 0 ] ; then exit 0 fi -# ======================== -# Launch the Test Program. -# ======================== -./flushrefresh & -pid_main=$! +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir flushrefresh_test +cp flushrefresh flushrefresh_test + +# With the --disable-shared option, flushrefresh is built in the test directory, +# otherwise it is in test/.libs with a wrapper script named flushrefresh in +# the test directory. test/flushrefresh should always be copied, +# .libs/flushrefresh should be copied only if it exists. +if [ -f .libs/flushrefresh ]; then + mkdir flushrefresh_test/.libs + cp .libs/flushrefresh flushrefresh_test/.libs +fi +cd flushrefresh_test # ================================================= # Set up/initialize some variables to be used later @@ -98,6 +110,12 @@ if [ -e $testfile ]; then rm $testfile fi +# ======================== +# Launch the Test Program. +# ======================== +./flushrefresh & +pid_main=$! + # ======================================= # Run flush verification on test program. # ======================================= @@ -193,6 +211,10 @@ fi if test $nerrors -eq 0 ; then echo "flush/refresh objects tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf flushrefresh_test + fi exit 0 else echo "flush/refresh objects tests failed with $nerrors errors." diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index c4a75e8..f70d083 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -123,6 +123,37 @@ while [ $# -gt 0 ]; do esac done +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir swmr_test +for FILE in swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE swmr_test +done +cp swmr* swmr_test + +# With the --disable-shared option, swmr program files are built in the test +# directory, otherwise they are in test/.libs with a corresponding wrapper +# script in the test directory. The programs or wrapper scripts in test should +# always be copied, swmr files in .libs should be copied only if they exists. +if [ -f .libs/swmr ]; then + mkdir swmr_test/.libs + for FILE in .libs/swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE swmr_test/.libs + done +fi + +cd swmr_test + + # Loop over index types for index_type in "-i ea" "-i b2" do @@ -517,10 +548,14 @@ done ############################################################################### ## Report and exit ############################################################################### - +cd .. $DPRINT nerrors=$nerrors if test $nerrors -eq 0 ; then echo "SWMR tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf swmr_test + fi exit 0 else echo "SWMR tests failed with $nerrors errors." diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index d69b8c0..3ada67b 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -109,6 +109,31 @@ while [ $# -gt 0 ]; do esac done +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir vds_swmr_test +for FILE in vds_swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE vds_swmr_test +done + +# With the --disable-shared option, swmr program files are built in the test +# directory, otherwise they are in test/.libs with a corresponding wrapper +# script in the test directory. The programs or wrapper scripts in test should +# always be copied, swmr files in .libs should be copied only if they exists. +if [ -f .libs/vds_swmr_writer ]; then + mkdir vds_swmr_test/.libs + cp .libs/vds_swmr* vds_swmr_test/.libs +fi + +cd vds_swmr_test + + echo echo "###############################################################################" echo "## Basic VDS SWMR test - writing to a tiled plane" @@ -187,10 +212,14 @@ fi ############################################################################### ## Report and exit ############################################################################### - +cd .. $DPRINT nerrors=$nerrors if test $nerrors -eq 0 ; then echo "VDS SWMR tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf vds_swmr_test + fi exit 0 else echo "VDS SWMR tests failed with $nerrors errors." diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 7283fa7..a28af8e 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -25,10 +25,13 @@ #include "cache_common.h" #include "genall5.h" +#define TEST_FILES_TO_CONSTRUCT 2 #define CHUNK_SIZE 10 #define DSET_SIZE (40 * CHUNK_SIZE) #define MAX_NUM_DSETS 256 - +#define PAR_NUM_DSETS 32 +#define PAGE_SIZE (4 * 1024) +#define PB_SIZE (64 * PAGE_SIZE) /* global variable declarations: */ @@ -36,6 +39,7 @@ const char *FILENAMES[] = { "t_cache_image_00", "t_cache_image_01", + "t_cache_image_02", NULL }; @@ -45,28 +49,48 @@ static void create_data_sets(hid_t file_id, int min_dset, int max_dset); static void delete_data_sets(hid_t file_id, int min_dset, int max_dset); static void open_hdf5_file(const hbool_t create_file, - const hbool_t mdci_sbem_expected, const hbool_t read_only, - const hbool_t set_mdci_fapl, const hbool_t config_fsm, - const char * hdf_file_name, const unsigned cache_image_flags, - hid_t * file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr, - MPI_Comm comm, MPI_Info info, int l_facc_type, - const hbool_t all_coll_metadata_ops, const hbool_t coll_metadata_write, - const int md_write_strat); + const hbool_t mdci_sbem_expected, + const hbool_t read_only, + const hbool_t set_mdci_fapl, + const hbool_t config_fsm, + const hbool_t enable_page_buffer, + const char * hdf_file_name, + const unsigned cache_image_flags, + hid_t * file_id_ptr, + H5F_t ** file_ptr_ptr, + H5C_t ** cache_ptr_ptr, + MPI_Comm comm, + MPI_Info info, + int l_facc_type, + const hbool_t all_coll_metadata_ops, + const hbool_t coll_metadata_write, + const int md_write_strat); static void verify_data_sets(hid_t file_id, int min_dset, int max_dset); /* local test function declarations */ static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr, - hbool_t display); + hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display); static void usage(void); static unsigned construct_test_file(int test_file_index); +static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, + int mpi_size); +static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank); +static void par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank); +static hbool_t serial_insert_cache_image(int file_name_idx, int mpi_size); +static void serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size); /* top level test function declarations */ +static unsigned verify_cache_image_RO(int file_name_id, + int md_write_strat, int mpi_rank); static unsigned verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank); +static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, + int mpi_rank, int mpi_size); + /****************************************************************************/ /***************************** Utility Functions ****************************/ @@ -187,6 +211,7 @@ construct_test_file(int test_file_index) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -258,6 +283,7 @@ construct_test_file(int test_file_index) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -331,6 +357,7 @@ construct_test_file(int test_file_index) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -863,6 +890,8 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) * * JRM -- 2/1/17 * + * Modified function to handle + * *------------------------------------------------------------------------- */ @@ -872,6 +901,7 @@ open_hdf5_file(const hbool_t create_file, const hbool_t read_only, const hbool_t set_mdci_fapl, const hbool_t config_fsm, + const hbool_t enable_page_buffer, const char * hdf_file_name, const unsigned cache_image_flags, hid_t * file_id_ptr, @@ -901,6 +931,8 @@ open_hdf5_file(const hbool_t create_file, FALSE, H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE}; + HDassert(!create_file || config_fsm); + if ( pass ) { /* opening the file both read only and with a cache image @@ -910,6 +942,7 @@ open_hdf5_file(const hbool_t create_file, if ( ( create_file && mdci_sbem_expected ) || ( create_file && read_only ) || ( config_fsm && !create_file ) || + ( create_file && enable_page_buffer && ! config_fsm ) || ( hdf_file_name == NULL ) || ( ( set_mdci_fapl ) && ( cache_image_flags == 0 ) ) || ( ( set_mdci_fapl ) && @@ -1029,9 +1062,32 @@ open_hdf5_file(const hbool_t create_file, } } + if ( ( pass ) && ( config_fsm ) ) { + + if ( H5Pset_file_space_page_size(fcpl_id, PAGE_SIZE) == FAIL ) { + + pass = FALSE; + failure_mssg = "H5Pset_file_space_page_size() failed.\n"; + } + } + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* setup the page buffer if indicated */ + if ( ( pass ) && ( enable_page_buffer ) ) { + + if ( H5Pset_page_buffer_size(fapl_id, PB_SIZE, 0, 0) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pset_page_buffer_size() failed.\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { /* set Parallel access with communicator */ @@ -1162,6 +1218,31 @@ open_hdf5_file(const hbool_t create_file, if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* verify expected page buffer status. At present, page buffering + * must be disabled in parallel -- hopefully this will change in the + * future. + */ + if ( pass ) { + + if ( ( file_ptr->shared->page_buf ) && + ( ( ! enable_page_buffer ) || ( l_facc_type == FACC_MPIO ) ) ) { + + pass = FALSE; + failure_mssg = "page buffer unexepectedly enabled."; + + } else if ( ( file_ptr->shared->page_buf != NULL ) && + ( ( enable_page_buffer ) || ( l_facc_type != FACC_MPIO ) ) ) { + + pass = FALSE; + failure_mssg = "page buffer unexepectedly disabled."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* verify expected metadata cache status */ /* get the cache image control structure from the cache, and verify @@ -1181,6 +1262,7 @@ open_hdf5_file(const hbool_t create_file, if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + if ( pass ) { if ( set_mdci_fapl ) { @@ -1308,6 +1390,1244 @@ open_hdf5_file(const hbool_t create_file, /*------------------------------------------------------------------------- + * Function: par_create_dataset() + * + * Purpose: Collectively create a chunked dataset, and fill it with + * known values. + * + * On failure, set pass to FALSE, and set failure_mssg + * to point to an appropriate failure message. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 3/4/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +par_create_dataset(int dset_num, + hid_t file_id, + int mpi_rank, + int mpi_size) +{ + const char * fcn_name = "par_create_dataset()"; + char dset_name[256]; + hbool_t show_progress = FALSE; + hbool_t valid_chunk; + hbool_t verbose = FALSE; + int cp = 0; + int i, j, k, l; + int data_chunk[1][CHUNK_SIZE][CHUNK_SIZE]; + hsize_t dims[3]; + hsize_t a_size[3]; + hsize_t offset[3]; + hsize_t chunk_size[3]; + hid_t status; + hid_t dataspace_id = -1; + hid_t memspace_id = -1; + hid_t dset_id = -1; + hid_t filespace_id = -1; + hid_t dcpl_id = -1; + hid_t dxpl_id = -1; + + show_progress = (show_progress && (mpi_rank == 0)); + verbose = (verbose && (mpi_rank == 0)); + + sprintf(dset_name, "/dset%03d", dset_num); + + if ( show_progress ) { + HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name); + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + } + + if ( pass ) { + + /* create a dataspace for the chunked dataset */ + dims[0] = (hsize_t)mpi_size; + dims[1] = DSET_SIZE; + dims[2] = DSET_SIZE; + dataspace_id = H5Screate_simple(3, dims, NULL); + + if ( dataspace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Screate_simple() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* set the dataset creation plist to specify that the raw data is + * to be partioned into 1X10X10 element chunks. + */ + + if ( pass ) { + + dcpl_id = H5Pcreate(H5P_DATASET_CREATE); + + if ( dcpl_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_DATASET_CREATE) failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + chunk_size[0] = 1; + chunk_size[1] = CHUNK_SIZE; + chunk_size[2] = CHUNK_SIZE; + + if ( H5Pset_chunk(dcpl_id, 3, chunk_size) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pset_chunk() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* create the dataset */ + if ( pass ) { + + dset_id = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, + dataspace_id, H5P_DEFAULT, + dcpl_id, H5P_DEFAULT); + + if ( dset_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dcreate() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* get the file space ID */ + if ( pass ) { + + filespace_id = H5Dget_space(dset_id); + + if ( filespace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dget_space() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* create the mem space to be used to read and write chunks */ + if ( pass ) { + + dims[0] = 1; + dims[1] = CHUNK_SIZE; + dims[2] = CHUNK_SIZE; + memspace_id = H5Screate_simple(3, dims, NULL); + + if ( memspace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Screate_simple() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* select in memory hyperslab */ + if ( pass ) { + + offset[0] = 0; /* offset of hyperslab in memory */ + offset[1] = 0; + offset[2] = 0; + a_size[0] = 1; /* size of hyperslab */ + a_size[1] = CHUNK_SIZE; + a_size[2] = CHUNK_SIZE; + status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, offset, NULL, + a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "H5Sselect_hyperslab() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* setup the DXPL for collective I/O */ + if ( pass ) { + + dxpl_id = H5Pcreate(H5P_DATASET_XFER); + + if ( dxpl_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_DATASET_XFER) failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + if ( H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pset_dxpl_mpio() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* initialize the dataset with collective writes */ + i = 0; + while ( ( pass ) && ( i < DSET_SIZE ) ) + { + j = 0; + while ( ( pass ) && ( j < DSET_SIZE ) ) + { + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n", + fcn_name, cp, pass); + + /* initialize the slab */ + for ( k = 0; k < CHUNK_SIZE; k++ ) + { + for ( l = 0; l < CHUNK_SIZE; l++ ) + { + data_chunk[0][k][l] = (DSET_SIZE * DSET_SIZE * mpi_rank) + + (DSET_SIZE * (i + k)) + j + l + + dset_num; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n", + fcn_name, cp, pass); + + /* select on disk hyperslab */ + offset[0] = (hsize_t)mpi_rank; /* offset of hyperslab in file */ + offset[1] = (hsize_t)i; + offset[2] = (hsize_t)j; + a_size[0] = (hsize_t)1; /* size of hyperslab */ + a_size[1] = CHUNK_SIZE; + a_size[2] = CHUNK_SIZE; + status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, + offset, NULL, a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "disk H5Sselect_hyperslab() failed."; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n", + fcn_name, cp, pass); + + /* write the chunk to file */ + status = H5Dwrite(dset_id, H5T_NATIVE_INT, memspace_id, + filespace_id, dxpl_id, data_chunk); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dwrite() failed."; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n", + fcn_name, cp, pass); + + j += CHUNK_SIZE; + } + + i += CHUNK_SIZE; + } + + cp++; + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* read data from data sets and validate it */ + i = 0; + while ( ( pass ) && ( i < DSET_SIZE ) ) + { + j = 0; + while ( ( pass ) && ( j < DSET_SIZE ) ) + { + /* select on disk hyperslab */ + offset[0] = (hsize_t)mpi_rank; + offset[1] = (hsize_t)i; /* offset of hyperslab in file */ + offset[2] = (hsize_t)j; + a_size[0] = (hsize_t)1; + a_size[1] = CHUNK_SIZE; /* size of hyperslab */ + a_size[2] = CHUNK_SIZE; + + status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, + offset, NULL, a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "disk hyperslab create failed."; + } + + /* read the chunk from file */ + if ( pass ) { + + status = H5Dread(dset_id, H5T_NATIVE_INT, + memspace_id, filespace_id, + dxpl_id, data_chunk); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "chunk read failed."; + } + } + + /* validate the slab */ + if ( pass ) { + + valid_chunk = TRUE; + for ( k = 0; k < CHUNK_SIZE; k++ ) + { + for ( l = 0; l < CHUNK_SIZE; l++ ) + { + if ( data_chunk[0][k][l] + != + ((DSET_SIZE * DSET_SIZE * mpi_rank) + + (DSET_SIZE * (i + k)) + j + l + dset_num) ) { + + valid_chunk = FALSE; + + if ( verbose ) { + + HDfprintf(stdout, + "data_chunk[%0d][%0d] = %0d, expect %0d.\n", + k, l, data_chunk[0][k][l], + ((DSET_SIZE * DSET_SIZE * mpi_rank) + + (DSET_SIZE * (i + k)) + j + l + dset_num)); + HDfprintf(stdout, + "dset_num = %d, i = %d, j = %d, k = %d, l = %d\n", + dset_num, i, j, k, l); + } + } + } + } + + if ( ! valid_chunk ) { + + pass = FALSE; + failure_mssg = "slab validation failed."; + + if ( verbose ) { + + fprintf(stdout, + "Chunk (%0d, %0d) in /dset%03d is invalid.\n", + i, j, dset_num); + } + } + } + j += CHUNK_SIZE; + } + i += CHUNK_SIZE; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* close the data space */ + if ( ( pass ) && ( H5Sclose(dataspace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(dataspace_id) failed."; + } + + /* close the file space */ + if ( ( pass ) && ( H5Sclose(filespace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(filespace_id) failed."; + } + + /* close the dataset */ + if ( ( pass ) && ( H5Dclose(dset_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Dclose(dset_id) failed."; + } + + /* close the mem space */ + if ( ( pass ) && ( H5Sclose(memspace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(memspace_id) failed."; + } + + /* close the dataset creation property list */ + if ( ( pass ) && ( H5Pclose(dcpl_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Pclose(dcpl) failed."; + } + + /* close the data access property list */ + if ( ( pass ) && ( H5Pclose(dxpl_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Pclose(dxpl) failed."; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + return; + +} /* par_create_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: par_delete_dataset() + * + * Purpose: Collectively delete the specified dataset. + * + * On failure, set pass to FALSE, and set failure_mssg + * to point to an appropriate failure message. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 3/6/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +par_delete_dataset(int dset_num, + hid_t file_id, + int mpi_rank) +{ + const char * fcn_name = "par_delete_dataset()"; + char dset_name[256]; + hbool_t show_progress = FALSE; + int cp = 0; + + show_progress = (show_progress && (mpi_rank == 0)); + + sprintf(dset_name, "/dset%03d", dset_num); + + if ( show_progress ) { + HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name); + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + } + + /* verify the target dataset */ + if ( pass ) { + + par_verify_dataset(dset_num, file_id, mpi_rank); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* delete the target dataset */ + if ( pass ) { + + if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { + + pass = FALSE; + failure_mssg = "H5Ldelete() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + return; + +} /* par_delete_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: par_insert_cache_image() + * + * Purpose: Insert a cache image in the supplied file. + * + * At present, cache image is not enabled in the parallel + * so we have to insert the cache image with a serial + * process. Do this via a fork and an execv from process 0. + * All processes wait until the child process completes, and + * then return. + * + * On failure, set pass to FALSE, and set failure_mssg + * to point to an appropriate failure message. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 3/8/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) +{ + hbool_t show_progress = FALSE; + + if ( pass ) { + + if ( mpi_rank == 0 ) { /* insert cache image in supplied test file */ + + char file_name_idx_str[32]; + char mpi_size_str[32]; + int child_status; + pid_t child_pid; + + sprintf(file_name_idx_str, "%d", file_name_idx); + sprintf(mpi_size_str, "%d", mpi_size); + + child_pid = fork(); + + if ( child_pid == 0 ) { /* this is the child process */ + + /* fun and games to shutup the compiler */ + char param0[32] = "t_cache_image"; + char param1[32] = "ici"; + char * child_argv[] = {param0, + param1, + file_name_idx_str, + mpi_size_str, + NULL}; + + /* we may need to play with the path here */ + if ( execv("t_cache_image", child_argv) == -1 ) { + + HDfprintf(stdout, + "execl() of ici process failed. errno = %d(%s)\n", + errno, strerror(errno)); + exit(1); + } + + } else if ( child_pid != -1 ) { + /* this is the parent process -- wait until child is done */ + if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) { + + HDfprintf(stdout, "can't wait on ici process.\n"); + pass = FALSE; + + } else if ( ! WIFEXITED(child_status) ) { + + HDfprintf(stdout, "ici process hasn't exitied.\n"); + pass = FALSE; + + } else if ( WEXITSTATUS(child_status) != 0 ) { + + HDfprintf(stdout, "ici process reports failure.\n"); + pass = FALSE; + + } else if ( show_progress ) { + + HDfprintf(stdout, "cache image insertion complete.\n"); + } + } else { /* fork failed */ + + HDfprintf(stdout, + "can't create process to insert cache image.\n"); + pass = FALSE; + } + } + } + + if ( pass ) { + + /* make sure insertion of the cache image is complete + * before proceeding + */ + MPI_Barrier(MPI_COMM_WORLD); + } + + return; + +} /* par_insert_cache_image() */ + + +/*------------------------------------------------------------------------- + * Function: par_verify_dataset() + * + * Purpose: Collectively verify the contents of a chunked dataset. + * + * On failure, set pass to FALSE, and set failure_mssg + * to point to an appropriate failure message. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 3/6/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +par_verify_dataset(int dset_num, + hid_t file_id, + int mpi_rank) +{ + const char * fcn_name = "par_verify_dataset()"; + char dset_name[256]; + hbool_t show_progress = FALSE; + hbool_t valid_chunk; + hbool_t verbose = FALSE; + int cp = 0; + int i, j, k, l; + int data_chunk[1][CHUNK_SIZE][CHUNK_SIZE]; + hsize_t dims[3]; + hsize_t a_size[3]; + hsize_t offset[3]; + hid_t status; + hid_t memspace_id = -1; + hid_t dset_id = -1; + hid_t filespace_id = -1; + hid_t dxpl_id = -1; + + show_progress = (show_progress && (mpi_rank == 0)); + verbose = (verbose && (mpi_rank == 0)); + + sprintf(dset_name, "/dset%03d", dset_num); + + if ( show_progress ) { + HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name); + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + } + + if ( pass ) { + + /* open the dataset */ + + dset_id = H5Dopen2(file_id, dset_name, H5P_DEFAULT); + + if ( dset_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dopen2() failed."; + } + } + + /* get the file space ID */ + if ( pass ) { + + filespace_id = H5Dget_space(dset_id); + + if ( filespace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dget_space() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* create the mem space to be used to read */ + if ( pass ) { + + dims[0] = 1; + dims[1] = CHUNK_SIZE; + dims[2] = CHUNK_SIZE; + memspace_id = H5Screate_simple(3, dims, NULL); + + if ( memspace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Screate_simple() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* select in memory hyperslab */ + if ( pass ) { + + offset[0] = 0; /* offset of hyperslab in memory */ + offset[1] = 0; + offset[2] = 0; + a_size[0] = 1; /* size of hyperslab */ + a_size[1] = CHUNK_SIZE; + a_size[2] = CHUNK_SIZE; + status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, offset, NULL, + a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "H5Sselect_hyperslab() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* setup the DXPL for collective I/O */ + if ( pass ) { + + dxpl_id = H5Pcreate(H5P_DATASET_XFER); + + if ( dxpl_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_DATASET_XFER) failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + if ( H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pset_dxpl_mpio() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* read data from data sets and validate it */ + i = 0; + while ( ( pass ) && ( i < DSET_SIZE ) ) + { + j = 0; + while ( ( pass ) && ( j < DSET_SIZE ) ) + { + /* select on disk hyperslab */ + offset[0] = (hsize_t)mpi_rank; + offset[1] = (hsize_t)i; /* offset of hyperslab in file */ + offset[2] = (hsize_t)j; + a_size[0] = (hsize_t)1; + a_size[1] = CHUNK_SIZE; /* size of hyperslab */ + a_size[2] = CHUNK_SIZE; + + status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, + offset, NULL, a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "disk hyperslab create failed."; + } + + /* read the chunk from file */ + if ( pass ) { + + status = H5Dread(dset_id, H5T_NATIVE_INT, + memspace_id, filespace_id, + dxpl_id, data_chunk); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "chunk read failed."; + } + } + + /* validate the slab */ + if ( pass ) { + + valid_chunk = TRUE; + for ( k = 0; k < CHUNK_SIZE; k++ ) + { + for ( l = 0; l < CHUNK_SIZE; l++ ) + { + if ( data_chunk[0][k][l] + != + ((DSET_SIZE * DSET_SIZE * mpi_rank) + + (DSET_SIZE * (i + k)) + j + l + dset_num) ) { + + valid_chunk = FALSE; + + if ( verbose ) { + + HDfprintf(stdout, + "data_chunk[%0d][%0d] = %0d, expect %0d.\n", + k, l, data_chunk[0][k][l], + ((DSET_SIZE * DSET_SIZE * mpi_rank) + + (DSET_SIZE * (i + k)) + j + l + dset_num)); + HDfprintf(stdout, + "dset_num = %d, i = %d, j = %d, k = %d, l = %d\n", + dset_num, i, j, k, l); + } + } + } + } + + if ( ! valid_chunk ) { + + pass = FALSE; + failure_mssg = "slab validation failed."; + + if ( verbose ) { + + fprintf(stdout, + "Chunk (%0d, %0d) in /dset%03d is invalid.\n", + i, j, dset_num); + } + } + } + j += CHUNK_SIZE; + } + i += CHUNK_SIZE; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* close the file space */ + if ( ( pass ) && ( H5Sclose(filespace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(filespace_id) failed."; + } + + /* close the dataset */ + if ( ( pass ) && ( H5Dclose(dset_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Dclose(dset_id) failed."; + } + + /* close the mem space */ + if ( ( pass ) && ( H5Sclose(memspace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(memspace_id) failed."; + } + + /* close the data access property list */ + if ( ( pass ) && ( H5Pclose(dxpl_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Pclose(dxpl) failed."; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + return; + +} /* par_verify_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: serial_insert_cache_image() + * + * Purpose: Insert a cache image in the supplied file. + * + * To populate the cache image, validate the contents + * of the file before closing. + * + * On failure, print an appropriate error message and + * return FALSE. + * + * Return: TRUE if succussful, FALSE otherwise. + * + * Programmer: John Mainzer + * 3/8/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static hbool_t +serial_insert_cache_image(int file_name_idx, int mpi_size ) +{ + const char * fcn_name = "serial_insert_cache_image()"; + char filename[512]; + hbool_t show_progress = FALSE; + int cp = 0; + int i; + int num_dsets = PAR_NUM_DSETS; + hid_t file_id = -1; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; + MPI_Comm dummy_comm = MPI_COMM_WORLD; + MPI_Info dummy_info = MPI_INFO_NULL; + + pass = TRUE; + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 1) setup the file name */ + if ( pass ) { + + HDassert(FILENAMES[file_name_idx]); + + if ( h5_fixname(FILENAMES[file_name_idx], H5P_DEFAULT, + filename, sizeof(filename)) + == NULL ) { + + pass = FALSE; + HDfprintf(stdout, "h5_fixname() failed.\n"); + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 2) Open the PHDF5 file with the cache image FAPL entry. + */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ FALSE, + /* read_only */ FALSE, + /* set_mdci_fapl */ TRUE, + /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ dummy_comm, + /* info */ dummy_info, + /* l_facc_type */ 0, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ FALSE, + /* md_write_strat */ 1); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 3) Validate contents of the file */ + + i = 0; + while ( ( pass ) && ( i < num_dsets ) ) { + + serial_verify_dataset(i, file_id, mpi_size); + i++; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 4) Close the file */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed.\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + return pass; + +} /* serial_insert_cache_image() */ + + +/*------------------------------------------------------------------------- + * Function: serial_verify_dataset() + * + * Purpose: Verify the contents of a chunked dataset. + * + * On failure, set pass to FALSE, and set failure_mssg + * to point to an appropriate failure message. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 3/6/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +serial_verify_dataset(int dset_num, + hid_t file_id, + int mpi_size) +{ + const char * fcn_name = "serial_verify_dataset()"; + char dset_name[256]; + hbool_t show_progress = FALSE; + hbool_t valid_chunk; + hbool_t verbose = FALSE; + int cp = 0; + int i, j, k, l, m; + int data_chunk[1][CHUNK_SIZE][CHUNK_SIZE]; + hsize_t dims[3]; + hsize_t a_size[3]; + hsize_t offset[3]; + hid_t status; + hid_t memspace_id = -1; + hid_t dset_id = -1; + hid_t filespace_id = -1; + + sprintf(dset_name, "/dset%03d", dset_num); + + if ( show_progress ) { + HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name); + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + } + + if ( pass ) { + + /* open the dataset */ + + dset_id = H5Dopen2(file_id, dset_name, H5P_DEFAULT); + + if ( dset_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dopen2() failed."; + } + } + + /* get the file space ID */ + if ( pass ) { + + filespace_id = H5Dget_space(dset_id); + + if ( filespace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Dget_space() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* create the mem space to be used to read */ + if ( pass ) { + + dims[0] = 1; + dims[1] = CHUNK_SIZE; + dims[2] = CHUNK_SIZE; + memspace_id = H5Screate_simple(3, dims, NULL); + + if ( memspace_id < 0 ) { + + pass = FALSE; + failure_mssg = "H5Screate_simple() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* select in memory hyperslab */ + if ( pass ) { + + offset[0] = 0; /* offset of hyperslab in memory */ + offset[1] = 0; + offset[2] = 0; + a_size[0] = 1; /* size of hyperslab */ + a_size[1] = CHUNK_SIZE; + a_size[2] = CHUNK_SIZE; + status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, offset, NULL, + a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "H5Sselect_hyperslab() failed."; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* read data from data sets and validate it */ + i = 0; + while ( ( pass ) && ( i < mpi_size ) ) + { + j = 0; + while ( ( pass ) && ( j < DSET_SIZE ) ) + { + k = 0; + while ( ( pass ) && ( k < DSET_SIZE ) ) + { + /* select on disk hyperslab */ + offset[0] = (hsize_t)i; /* offset of hyperslab in file */ + offset[1] = (hsize_t)j; /* offset of hyperslab in file */ + offset[2] = (hsize_t)k; + a_size[0] = (hsize_t)1; + a_size[1] = CHUNK_SIZE; /* size of hyperslab */ + a_size[2] = CHUNK_SIZE; + + status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, + offset, NULL, a_size, NULL); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "disk hyperslab create failed."; + } + + /* read the chunk from file */ + if ( pass ) { + + status = H5Dread(dset_id, H5T_NATIVE_INT, + memspace_id, filespace_id, + H5P_DEFAULT, data_chunk); + + if ( status < 0 ) { + + pass = FALSE; + failure_mssg = "chunk read failed."; + } + } + + /* validate the slab */ + if ( pass ) { + + valid_chunk = TRUE; + + for ( l = 0; l < CHUNK_SIZE; l++ ) + { + for ( m = 0; m < CHUNK_SIZE; m++ ) + { + if ( data_chunk[0][l][m] + != + ((DSET_SIZE * DSET_SIZE * i) + + (DSET_SIZE * (j + l)) + k + m + dset_num) ) { + + valid_chunk = FALSE; + + if ( verbose ) { + + HDfprintf(stdout, + "data_chunk[%0d][%0d] = %0d, expect %0d.\n", + j, k, data_chunk[0][j][k], + ((DSET_SIZE * DSET_SIZE * i) + + (DSET_SIZE * (j + l)) + k + m + dset_num)); + HDfprintf(stdout, + "dset_num = %d, i = %d, j = %d, k = %d, l = %d, m = %d\n", + dset_num, i, j, k, l, m); + } + } + } + } + + if ( ! valid_chunk ) { + + pass = FALSE; + failure_mssg = "slab validation failed."; + + if ( verbose ) { + + fprintf(stdout, + "Chunk (%0d, %0d) in /dset%03d is invalid.\n", + j, k, dset_num); + } + } + } + k += CHUNK_SIZE; + } + j += CHUNK_SIZE; + } + i++; + } + + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* close the file space */ + if ( ( pass ) && ( H5Sclose(filespace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(filespace_id) failed."; + } + + /* close the dataset */ + if ( ( pass ) && ( H5Dclose(dset_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Dclose(dset_id) failed."; + } + + /* close the mem space */ + if ( ( pass ) && ( H5Sclose(memspace_id) < 0 ) ) { + + pass = FALSE; + failure_mssg = "H5Sclose(memspace_id) failed."; + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + return; + +} /* serial_verify_dataset() */ + + +/*------------------------------------------------------------------------- * Function: parse_flags * * Purpose: Parse the flags passed to this program, and load the @@ -1321,50 +2641,80 @@ open_hdf5_file(const hbool_t create_file, * *------------------------------------------------------------------------- */ -hbool_t -parse_flags(int argc, char * argv[], hbool_t * setup_ptr, hbool_t display) +static hbool_t +parse_flags(int argc, char * argv[], hbool_t * setup_ptr, + hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display) { const char * fcn_name = "parse_flags()"; - const char * (ops[]) = {"setup"}; + const char * (ops[]) = {"setup", "ici"}; int success = TRUE; + HDassert(setup_ptr); + HDassert(*setup_ptr == FALSE); + HDassert(ici_ptr); + HDassert(*ici_ptr == FALSE); + HDassert(file_idx_ptr); + HDassert(mpi_size_ptr); + if ( setup_ptr == NULL ) { success = FALSE; HDfprintf(stdout, "%s: bad arg(s) on entry.\n", fcn_name); } + if ( ( success ) && - ( ( argc < 1 ) || ( argc > 2 ) ) ) { + ( ( argc != 1 ) && ( argc != 2 ) && ( argc != 4 ) ) ) { success = FALSE; usage(); } - if ( success ) { - if ( argc == 2 ) { + if ( ( success ) && ( argc >= 2 ) ) { - if ( strcmp(argv[1], ops[0]) == 0 ) { + if ( strcmp(argv[1], ops[0]) == 0 ) { - *setup_ptr = TRUE; + if ( argc != 2 ) { + + success = FALSE; + usage(); } else { + *setup_ptr = TRUE; + + } + } else if ( strcmp(argv[1], ops[1]) == 0 ) { + + if ( argc != 4 ) { + success = FALSE; usage(); - } - } else { - *setup_ptr = FALSE; + } else { + + *ici_ptr = TRUE; + *file_idx_ptr = atoi(argv[2]); + *mpi_size_ptr = atoi(argv[3]); + + } } } if ( ( success ) && ( display ) ) { if ( *setup_ptr ) + HDfprintf(stdout, "t_cache_image setup\n"); + + else if ( *ici_ptr ) + + HDfprintf(stdout, "t_cache_image ici %d %d\n", + *file_idx_ptr, *mpi_size_ptr); + else + HDfprintf(stdout, "t_cache_image\n"); } @@ -1694,6 +3044,266 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) /****************************************************************************/ /*------------------------------------------------------------------------- + * Function: verify_cache_image_RO() + * + * Purpose: Verify that a HDF5 file containing a cache image is + * opened R/O and read correctly by PHDF5 with the specified + * metadata write strategy. + * + * Basic cycle of operation is as follows: + * + * 1) Open the test file created at the beginning of this + * test read only. + * + * Verify that the file contains a cache image. + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. + * + * 2) Verify that the file contains the expected data. + * + * 3) Close the file. + * + * 4) Open the file R/O, and verify that it still contains + * a cache image. + * + * 5) Verify that the file contains the expected data. + * + * 6) Close the file. + * + * Return: void + * + * Programmer: John Mainzer + * 3/11/17 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static unsigned +verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) +{ + const char * fcn_name = "verify_cache_image_RO()"; + char filename[512]; + hbool_t show_progress = FALSE; + hid_t file_id = -1; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; + int cp = 0; + + pass = TRUE; + + if ( mpi_rank == 0 ) { + + switch(md_write_strat) { + + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + TESTING("parallel CI load test -- proc0 md write -- R/O"); + break; + + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + TESTING("parallel CI load test -- dist md write -- R/O"); + break; + + default: + TESTING("parallel CI load test -- unknown md write -- R/o"); + pass = FALSE; + break; + } + } + + show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) ); + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* setup the file name */ + if ( pass ) { + + if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, + filename, sizeof(filename)) == NULL ) { + + pass = FALSE; + failure_mssg = "h5_fixname() failed.\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 1) Open the test file created at the beginning of this test. + * + * Verify that the file contains a cache image. + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. + */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ TRUE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ MPI_COMM_WORLD, + /* info */ MPI_INFO_NULL, + /* l_facc_type */ FACC_MPIO, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ FALSE, + /* md_write_strat */ md_write_strat); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that only process 0 reads the cache image. */ + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that all other processes receive the cache image block + * from process 0. + */ + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 2) Verify that the file contains the expected data. */ + if ( pass ) { + + verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + } + +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( cache_ptr->images_loaded == 0 ) { + + pass = FALSE; + failure_mssg = "metadata cache image block not loaded(1)."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + + /* 3) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed.\n"; + + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 4) Open the file, and verify that it doesn't contain a cache image. */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ TRUE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ MPI_COMM_WORLD, + /* info */ MPI_INFO_NULL, + /* l_facc_type */ FACC_MPIO, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ FALSE, + /* md_write_strat */ md_write_strat); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 5) Verify that the file contains the expected data. */ + + if ( pass ) { + + verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + } + +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( cache_ptr->images_loaded != 1 ) { + + pass = FALSE; + failure_mssg = "metadata cache image block not loaded(2)."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + + /* 6) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed.\n"; + + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* report results */ + if ( mpi_rank == 0 ) { + + if ( pass ) { + + PASSED(); + + } else { + + H5_FAILED(); + + if ( show_progress ) + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg); + } + } + + + return !pass; + +} /* verify_cache_image_RO() */ + + +/*------------------------------------------------------------------------- * Function: verify_cache_image_RW() * * Purpose: Verify that a HDF5 file containing a cache image is @@ -1747,7 +3357,6 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; - int i; pass = TRUE; @@ -1808,6 +3417,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -1880,6 +3490,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -1969,6 +3580,338 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } /* verify_cache_imageRW() */ +/***************************************************************************** + * + * Function: smoke_check_1() + * + * Purpose: Initial smoke check to verify correct behaviour of cache + * image in combination with parallel. + * + * As cache image is currently disabled in the parallel case, + * we construct a test file in parallel, verify it in serial + * and generate a cache image in passing, and then verify + * it again in parallel. + * + * In passing, also verify that page buffering is silently + * disabled in the parallel case. Needless to say, this part + * of the test will have to be re-worked when and if page + * buffering is supported in parallel. + * + * Return: Success: TRUE + * + * Failure: FALSE + * + * Programmer: JRM -- 3/6/17 + * + *****************************************************************************/ +static hbool_t +smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) +{ + const char * fcn_name = "smoke_check_1()"; + char filename[512]; + hbool_t show_progress = FALSE; + hid_t file_id = -1; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; + int cp = 0; + int i; + int num_dsets = PAR_NUM_DSETS; + int test_file_index = 2; + h5_stat_size_t file_size; + + pass = TRUE; + + if ( mpi_rank == 0 ) { + + TESTING("parallel cache image smoke check 1"); + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* setup the file name */ + if ( pass ) { + + HDassert(FILENAMES[test_file_index]); + + if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, + filename, sizeof(filename)) + == NULL ) { + + pass = FALSE; + failure_mssg = "h5_fixname() failed.\n"; + } + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 1) Create a PHDF5 file without the cache image FAPL entry. + * + * Verify that a cache image is not requested + */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ TRUE, + /* mdci_sbem_expected */ FALSE, + /* read_only */ FALSE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ TRUE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ mpi_comm, + /* info */ mpi_info, + /* l_facc_type */ FACC_MPIO, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ TRUE, + /* md_write_strat */ 1); + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 2) Create datasets in the file */ + + i = 0; + while ( ( pass ) && ( i < num_dsets ) ) { + + par_create_dataset(i, file_id, mpi_rank, mpi_size); + i++; + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 3) Verify the datasets in the file */ + + i = 0; + while ( ( pass ) && ( i < num_dsets ) ) { + + par_verify_dataset(i, file_id, mpi_rank); + i++; + } + + + /* 4) Close the file */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed.\n"; + + } + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 5 Insert a cache image into the file */ + + if ( pass ) { + + par_insert_cache_image(test_file_index, mpi_rank, mpi_size); + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 6) Open the file R/O */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ TRUE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ mpi_comm, + /* info */ mpi_info, + /* l_facc_type */ FACC_MPIO, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ TRUE, + /* md_write_strat */ 1); + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 7) Verify the datasets in the file backwards */ + + i = num_dsets - 1; + while ( ( pass ) && ( i >= 0 ) ) { + + par_verify_dataset(i, file_id, mpi_rank); + i--; + } + + + /* 8) Close the file */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed."; + + } + } + + + /* 9) Open the file */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ FALSE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* enable_page_buffer */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr, + /* comm */ mpi_comm, + /* info */ mpi_info, + /* l_facc_type */ FACC_MPIO, + /* all_coll_metadata_ops */ FALSE, + /* coll_metadata_write */ TRUE, + /* md_write_strat */ 1); + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 10) Verify the datasets in the file */ + + i = 0; + while ( ( pass ) && ( i < num_dsets ) ) { + + par_verify_dataset(i, file_id, mpi_rank); + i++; + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 11) Delete the datasets in the file */ + + i = 0; + while ( ( pass ) && ( i < num_dsets ) ) { + + par_delete_dataset(i, file_id, mpi_rank); + i++; + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 12) Close the file */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed."; + + } + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 13) Get the size of the file. Verify that it is less + * than 20 KB. Without deletions and persistant free + * space managers, size size is about 30 MB, so this + * is sufficient to verify that the persistant free + * space managers are more or less doing their job. + * + * Note that this test will have to change if we use + * a larger page size. + */ + if ( pass ) { + + if ( ( file_size = h5_get_file_size(filename, H5P_DEFAULT) ) < 0 ) { + + pass = FALSE; + failure_mssg = "h5_get_file_size() failed."; + + } else if ( file_size > 20 * 1024 ) { + + pass = FALSE; + failure_mssg = "unexpectedly large file size."; + } + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 14) Delete the file */ + + if ( pass ) { + + /* wait for everyone to close the file */ + MPI_Barrier(MPI_COMM_WORLD); + + if ( ( mpi_rank == 0 ) && ( HDremove(filename) < 0 ) ) { + + pass = FALSE; + failure_mssg = "HDremove() failed.\n"; + } + } + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* report results */ + if ( mpi_rank == 0 ) { + + if ( pass ) { + + PASSED(); + + } else { + + H5_FAILED(); + + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", + fcn_name, failure_mssg); + } + } + + return !pass; + +} /* smoke_check_1() */ + + /*------------------------------------------------------------------------- * Function: main * @@ -1999,22 +3942,26 @@ int main(int argc, char **argv) { hbool_t setup = FALSE; + hbool_t ici = FALSE; unsigned nerrs = 0; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + int file_idx; int i; int mpi_size; int mpi_rank; - if ( ! parse_flags(argc, argv, &setup, FALSE) ) + if ( ! parse_flags(argc, argv, &setup, &ici, &file_idx, &mpi_size, FALSE) ) exit(1); /* exit now if unable to parse flags */ - if ( setup ) { /* construct test file and exit */ + if ( setup ) { /* construct test files and exit */ H5open(); HDfprintf(stdout, "Constructing test files: \n"); HDfflush(stdout); i = 0; - while ( FILENAMES[i] != NULL ) { + while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) { HDfprintf(stdout, " writing %s ... ", FILENAMES[i]); HDfflush(stdout); @@ -2032,11 +3979,26 @@ main(int argc, char **argv) } i++; } + HDfprintf(stdout, "Test file construction complete.\n"); exit(0); + + } else if ( ici ) { + + if ( serial_insert_cache_image(file_idx, mpi_size) ) { + + exit(0); + + } else { + + HDfprintf(stderr, "\n\nCache image insertion failed.\n"); + HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg); + exit(1); + } } HDassert(!setup); + HDassert(!ici); MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -2118,14 +4080,21 @@ main(int argc, char **argv) } } - /* can't start test until test file exists */ + /* can't start test until test files exist */ MPI_Barrier(MPI_COMM_WORLD); + + nerrs += verify_cache_image_RO(0, + H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); +#if 1 + nerrs += verify_cache_image_RO(1, + H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); nerrs += verify_cache_image_RW(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); nerrs += verify_cache_image_RW(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); - + nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size); +#endif finish: /* make sure all processes are finished before final report, cleanup diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index a8b4cfe..07c2b7d 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -569,7 +569,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'G': - options->fs_pagesize = HDatoll( opt_arg ); + options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0); if(options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ options->fs_pagesize = -1; diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index b6c6ea3..5c33b72 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -246,28 +246,16 @@ main (int argc, const char *argv[]) /* -m option */ if(remove_cache_image) { - H5AC_cache_image_config_t config; - - /* Retrieve cache image config */ - if((fapl = H5Fget_access_plist(fid)) < 0) { - error_msg("H5Fget_access_plist\n"); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - config.version = H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION; - if(H5Pget_mdc_image_config(fapl, &config) < 0) { - error_msg("H5Pget_mdc_image_config\n"); + if(H5Fget_mdc_image_info(fid, &image_addr, &image_len) < 0) { + error_msg("H5Fget_mdc_image_info\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } - - /* Check for image */ - if(!config.generate_image) + if(image_addr == HADDR_UNDEF && image_len == 0) warn_msg("No cache image in the file\n"); } h5tools_setstatus(EXIT_SUCCESS); - done: if(fname) HDfree(fname); @@ -281,3 +269,4 @@ done: leave(h5tools_getstatus()); } /* main() */ + diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index aa5a1b4..2bcad83 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1147,7 +1147,7 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## - ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,1,9,235) + ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index c7a9a6b..0b28f78 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -246,9 +246,10 @@ TOOLTEST_DUMP() ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,4,9,1,9,235" +arg="h5repack_layout.h5 -v -f UD=260,4,9,$version_str" TOOLTEST_DUMP plugin_version_test $arg arg="h5repack_layout.h5 -v -f UD=257,1,9" diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 3d09e14..a951638 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 9 235 } + PARAMS { 9 1 11 0 } } } FILLVALUE { |