diff options
72 files changed, 1225 insertions, 730 deletions
@@ -66,6 +66,7 @@ ./bin/runtest _DO_NOT_DISTRIBUTE_ ./bin/snapshot ./bin/snapshot_version _DO_NOT_DISTRIBUTE_ +./bin/switch_maint_mode _DO_NOT_DISTRIBUTE_ ./bin/timekeeper _DO_NOT_DISTRIBUTE_ ./bin/trace ./bin/yodconfigure @@ -380,6 +381,7 @@ ./c++/test/dsets.cpp ./c++/test/h5cpputil.cpp ./c++/test/h5cpputil.h +./c++/test/tarray.cpp ./c++/test/tattr.cpp ./c++/test/tcompound.cpp ./c++/test/tdspl.cpp @@ -1363,6 +1365,7 @@ ./tools/testfiles/filter_fail.h5 ./tools/testfiles/filter_fail.ddl ./tools/testfiles/h5dump-help.txt +./tools/testfiles/non_existing.ddl ./tools/testfiles/packedbits.ddl ./tools/testfiles/taindices.h5 ./tools/testfiles/tall-1.ddl @@ -1619,6 +1622,7 @@ # h5dump test error files ./tools/h5dump/errfiles/filter_fail.err +./tools/h5dump/errfiles/non_existing.err ./tools/h5dump/errfiles/tall-1.err ./tools/h5dump/errfiles/tall-2A.err ./tools/h5dump/errfiles/tall-2A0.err @@ -2530,9 +2534,6 @@ # Files generated by autogen ./aclocal.m4 -./autom4te.cache/output.0 -./autom4te.cache/requests -./autom4te.cache/traces.0 ./bin/compile ./bin/config.guess ./bin/config.sub diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 6e22e17..ccef469 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -46,6 +46,7 @@ cacheinit=$srcdir/config/cmake/cacheinit.cmake build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on +build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF # Threadsafe feature default off build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on @@ -82,6 +83,8 @@ Usage: $progname [<options>] enable or disable c++ API. Default is off. --enable-hl | --disable-hl: enable or disable high level API. Default is on. + --enable-threadsafe | --disable-threadsafe: + enable or disable threadsafe feature. Default is off --enable-shared | --disable-shared: enable or disable shared lib. Default is on. --enable-tools | --disable-tools: @@ -148,6 +151,10 @@ INSTALL_HDF5() $install_file --skip-license $* ;; Darwin) # Mac OSX DMG file + # These steps were a kludge. Need proper support from Cmake engineering. + echo Darwin install step needs proper implementation. Quit. + return 1 + # install_file=HDF5-${version}-Darwin.dmg test -d hdf5 || mkdir hdf5 basename=`basename $install_file .dmg` @@ -225,6 +232,12 @@ while [ $# -gt 0 ]; do --disable-hl) build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF ;; + --enable-threadsafe) + build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=ON + ;; + --disable-threadsafe) + build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF + ;; --enable-shared) shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON ;; @@ -313,8 +326,8 @@ fi # setup output of all the log files if verbose is on upon exit trap \ -"if [ $vflag -ne 0 ]; then DUMP_LOGFILE \$configlog \$makelog \$testlog \$packlog \$installlog; fi" \ -0 + "if [ $vflag -ne 0 ]; then DUMP_LOGFILE \$configlog \$makelog \$testlog \$packlog \$installlog; fi" \ + 0 echo Running Cmake for HDF5-${version} ... # 4. Configure the C library, tools and tests with this command: @@ -326,6 +339,7 @@ STEP "Configure..." \ $build_cpp_lib \ $build_fortran \ $build_hl_lib \ + $build_threadsafe \ $shared_lib \ $build_testing \ $build_tools \ @@ -343,8 +357,13 @@ STEP "Test the library and tools..." "ctest . -C Release $njobs" $testlog # 7. Create an install image with this command: STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog +# The implementation of installation is imcomplete (only works for linux). +# Screen it out for now till it is completed. +if false; then # 8. Install with this command: STEP "Install..." "INSTALL_HDF5" $installlog +fi + # save the last exit code exit_code=$? diff --git a/bin/switch_maint_mode b/bin/switch_maint_mode new file mode 100755 index 0000000..2b62545 --- /dev/null +++ b/bin/switch_maint_mode @@ -0,0 +1,83 @@ +#!/bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# +# Switch AM_MAINTAINER_MODE value in configure.ac +# Usage: See USAGE() +# Programmer: Dana Robinson +# Creation date: January 2016 + +USAGE() +{ +cat <<EOF + +switch_maint_mode reverses the status of AM_MAINTAINER_MODE in +configure.ac from enable to disable or vice-versa. When enabled, +this feature forces the autotools to run when the input files are +older than the output files. This is the default for development +branches. When disabled, the autotools will NOT be re-run regardless +of their timestamps or any modifications. This is the default for +tarballs and release branches since it avoids having end-users +requiring the autotools. + +Command Syntax +============== +switch_maint_mode [-help] [-enable|disable] <path-to-configure.ac> + +EOF +} + +MODE="notset" +CONFIG_AC_PATH= + +# Display help/usage if any options were passed in +while [ $# -gt 0 ]; do + case "$1" in + -enable) + MODE="enable" + ;; + -disable) + MODE="disable" + ;; + -help) + USAGE + exit 0 + ;; + *) + CONFIG_AC_PATH="$1" + ;; + esac + shift +done + +# Did we get a file path? +if test -z $CONFIG_AC_PATH ; then + USAGE + exit 1 +fi + +# Did we get a mode? +if test -z $MODE ; then + USAGE + exit 1 +fi + +# Run perl over configure.ac +if test "X-$MODE" = "X-enable" ; then + perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1enable$3/g' $CONFIG_AC_PATH +fi +if test "X-$MODE" = "X-disable" ; then + perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1disable$3/g' $CONFIG_AC_PATH +fi + diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 06b3e22..4e9a4d5 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -141,8 +141,11 @@ ArrayType AbstractDs::getArrayType() const // depending on which object invokes getArrayType. Then, create and // return the ArrayType object try { + // Create ArrayType and set values this way to work around the + // problem described in the JIRA issue HDFFV-7947 ArrayType arraytype; f_DataType_setId(&arraytype, p_get_type()); + arraytype.setArrayInfo(); return(arraytype); } catch (DataSetIException E) { diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 85340f8..0f09631 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -35,12 +35,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub ArrayType // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType() : DataType() -{ - // Initialize members - rank = -1; - dimensions = NULL; -} +ArrayType::ArrayType() : DataType(), rank(-1), dimensions(NULL) {} //-------------------------------------------------------------------------- // Function: ArrayType overloaded constructor @@ -51,20 +46,7 @@ ArrayType::ArrayType() : DataType() //-------------------------------------------------------------------------- ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) { - // Get the rank of the existing array and store it in this array - rank = H5Tget_array_ndims(existing_id); - if (rank < 0) - { - throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_ndims failed"); - } - - // Allocate space for the dimensions - dimensions = new hsize_t[rank]; - - // Get the dimensions of the existing array and store it in this array - int ret_value = H5Tget_array_dims2(id, dimensions); - if (ret_value < 0) - throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_dims2 failed"); + setArrayInfo(); } //-------------------------------------------------------------------------- @@ -111,25 +93,67 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) } //-------------------------------------------------------------------------- +// Function: ArrayType::setArrayInfo +///\brief Retrieves the rank and dimensions from the array datatype +/// and store the info in this ArrayType object. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - January 2016 +//-------------------------------------------------------------------------- +void ArrayType::setArrayInfo() +{ + // Get the rank of the array type specified by id from the C API + int ndims = H5Tget_array_ndims(id); + if (ndims < 0) + { + throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_ndims failed"); + } + + // Get the dimensions from the C API + hsize_t* dims; + dims = new hsize_t[ndims]; + if (dims != NULL) + { + // Get the dimensions + ndims = H5Tget_array_dims2(id, dims); + if (ndims < 0) + throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_dims2 failed"); + + // Store the array's info in memory + rank = ndims; + dimensions = new hsize_t[rank]; + for (int i = 0; i < rank; i++) + dimensions[i] = dims[i]; + delete []dims; + } +} // setArrayInfo + +//-------------------------------------------------------------------------- // Function: ArrayType::getArrayNDims ///\brief Returns the number of dimensions for an array datatype. ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 +// Modification +// Modified to use setArrayInfo(). +// If rank is positive, return rank +// If rank is invalid but object has a valid identifier, obtain the +// rank and dimensions, store them in the object, and return rank +// Otherwise, i.e., rank is invalid and object doesn't have a +// valid identifier, throw an exception //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() { - // If the array's rank has not been stored, i.e. rank is init to -1, - // retrieve it via the C API - if (rank < 0) - { - rank = H5Tget_array_ndims(id); - if (rank < 0) - { - throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); - } - } - return(rank); + // Validate the id first, this object could be a default object + if (!p_valid_id(id)) + throw DataTypeIException("ArrayType::getArrayNDims", "ArrayType object is not a valid array type."); + + // If the array's info has not been stored, i.e. "rank" still has its + // initial value, -1, and "dimensions" is still NULL, retrieve rank and + // dimensions via the C API and store them in this ArrayType object. + if (rank < 0 && dimensions == NULL) + setArrayInfo(); + + return(rank); } //-------------------------------------------------------------------------- @@ -139,25 +163,30 @@ int ArrayType::getArrayNDims() ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 +// Modification +// Jan, 2016 +// Modified to use setArrayInfo(). +// If the array information has not been stored, retrieve rank and +// dimensions of the array type identified by "id" via the C API. +// Copy "dimensions" to the user's buffer //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) { - // If the array's dimensions have not been stored, retrieve them via C API - if (dimensions == NULL) - { - int ndims = H5Tget_array_dims2(id, dims); - if (ndims < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); - // Store the array's info in memory - rank = ndims; - dimensions = new hsize_t[rank]; - for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; - } - // Otherwise, simply copy what's in 'dimensions' to 'dims' - for (int i = 0; i < rank; i++) - dims[i] = dimensions[i]; - return(rank); + // Validate the id first, this object could be a default object + if (!p_valid_id(id)) + throw DataTypeIException("ArrayType::getArrayDims", "ArrayType object is not a valid array type."); + + // If the array's info has not been stored, i.e. "rank" still has its + // initial value, -1, and "dimensions" is still NULL, retrieve rank and + // dimensions via the C API and store them in this ArrayType object. + if (rank < 0 && dimensions == NULL) + setArrayInfo(); + + // Copy what's in "dimensions" to user's buffer "dims" + for (int i = 0; i < rank; i++) + dims[i] = dimensions[i]; + + return(rank); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 6577a6e..c0f4b38 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -31,6 +31,9 @@ class H5_DLLCPP ArrayType : public DataType { // specified base type. ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); + // Stores the rank and dimensions in memory. + void setArrayInfo(); + // Returns the number of dimensions of this array datatype. int getArrayNDims(); diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 6d31a68..82575d6 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -228,12 +228,12 @@ hid_t CompType::p_get_member_type(unsigned member_num) const DataType CompType::getMemberDataType( unsigned member_num ) const { try { - DataType datatype; + DataType datatype; f_DataType_setId(&datatype, p_get_member_type(member_num)); - return(datatype); + return(datatype); } catch (DataTypeIException E) { - throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); + throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); } } @@ -249,9 +249,10 @@ DataType CompType::getMemberDataType( unsigned member_num ) const ArrayType CompType::getMemberArrayType( unsigned member_num ) const { try { - ArrayType arraytype(p_get_member_type(member_num)); + ArrayType arraytype; f_DataType_setId(&arraytype, p_get_member_type(member_num)); - return(arraytype); + arraytype.setArrayInfo(); + return(arraytype); } catch (DataTypeIException E) { throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 6f1d857..4bebeac 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -13,6 +13,7 @@ PROJECT (HDF5_CPP_TEST) #----------------------------------------------------------------------------- set (CPP_TEST_SRCS ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tarray.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tdspl.cpp diff --git a/c++/test/Makefile.am b/c++/test/Makefile.am index 705ec72..07fe533 100644 --- a/c++/test/Makefile.am +++ b/c++/test/Makefile.am @@ -31,9 +31,10 @@ check_PROGRAMS=$(TEST_PROG) # The tests depend on the hdf5 library, test library, and the c++ library LDADD=$(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5) -testhdf5_SOURCES=testhdf5.cpp dsets.cpp tattr.cpp tcompound.cpp \ - tdspl.cpp tfile.cpp tfilter.cpp th5s.cpp tlinks.cpp tobject.cpp \ - trefer.cpp ttypes.cpp tvlstr.cpp h5cpputil.cpp +testhdf5_SOURCES=testhdf5.cpp dsets.cpp tattr.cpp tarray.cpp \ + tcompound.cpp tdspl.cpp tfile.cpp tfilter.cpp th5s.cpp \ + tlinks.cpp tobject.cpp trefer.cpp ttypes.cpp tvlstr.cpp \ + h5cpputil.cpp # Tell conclude.am that these are C++ tests. CXX_API=yes diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 8625213..b615194 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -132,6 +132,7 @@ template <class Type1, class Type2> #ifdef __cplusplus extern "C" { #endif +void test_array(); void test_attr(); void test_compound(); void test_dsproplist(); @@ -146,6 +147,7 @@ void test_vlstrings(); void test_dset(); /* Prototypes for the cleanup routines */ +void cleanup_array(); void cleanup_attr(); void cleanup_compound(); void cleanup_dsproplist(); diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp new file mode 100644 index 0000000..69b4438 --- /dev/null +++ b/c++/test/tarray.cpp @@ -0,0 +1,312 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/***************************************************************************** + FILE + tarray.cpp - HDF5 C++ testing the array datatype functionality + + ***************************************************************************/ + +#ifdef OLD_HEADER_FILENAME +#include <iostream.h> +#else +#include <iostream> +#endif +#include <string> + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::cerr; + using std::endl; +#endif // H5_NO_STD +#endif + +#include "H5Cpp.h" // C++ API header file + +#ifndef H5_NO_NAMESPACE + using namespace H5; +#endif + +#include "h5cpputil.h" // C++ utilility header file + +const H5std_string FILENAME("tarray.h5"); +const hsize_t SPACE1_RANK = 1; +const hsize_t SPACE1_DIM1 = 4; +const hsize_t ARRAY1_RANK = 1; +const hsize_t ARRAY1_DIM1 = 4; + +typedef enum flt_t { + FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE, FLT_OTHER +} flt_t; + +typedef enum int_t { + INT_CHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT, + INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, INT_OTHER +} int_t; + + +/*------------------------------------------------------------------------- + * Function: test_array_compound_array + * + * Purpose: Tests 1-D array of compound datatypes (with array fields) + * + * Return: None. + * + * Programmer: Binh-Minh Ribler (using C version) + * January, 2016 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void test_array_compound_array() +{ + SUBTEST("ArrayType::getArrayNDims & ArrayType::getArrayDims"); + typedef struct { // Typedef for compound datatype */ + int i; + float f[ARRAY1_DIM1]; + } s1_t; + s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information to write + s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information read in + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int nmemb; // Number of compound members + int ii, jj, kk; // counting variables + H5T_class_t mclass; // Datatype class for field + + // Initialize array data to write + for (ii =0; ii < SPACE1_DIM1; ii++) + for (jj = 0; jj < ARRAY1_DIM1; jj++) { + wdata[ii][jj].i = ii * 10 + jj; + for(kk = 0; kk < ARRAY1_DIM1; kk++) + wdata[ii][jj].f[kk]=(float)(ii * 10.0F + jj * 2.5F + kk); + } // end for + + try { + // Create File + H5File file1(FILENAME, H5F_ACC_TRUNC); + + // Create dataspace for datasets + DataSpace space(SPACE1_RANK, sdims1, NULL); + + /* + * Create an array datatype of compounds, arrtype. Each compound + * datatype, comptype, contains an integer and an array of floats, + * arrfltype. + */ + + // Create a compound datatype + CompType comptype(sizeof(s1_t)); + + // Insert integer field + comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); + + // Create an array of floats datatype + ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); + + // Insert float array field + comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); + + // Close array of floats field datatype + arrfltype.close(); + + // Create an array datatype of the compound datatype + ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); + + // Close compound datatype comptype + comptype.close(); + + // Create a dataset + DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); + + // Write dataset to disk + dataset.write(wdata, arrtype); + + // Close all + dataset.close(); + arrtype.close(); + space.close(); + file1.close(); + + // Re-open file + file1.openFile(FILENAME, H5F_ACC_RDONLY); + + // Open the dataset + dataset = file1.openDataSet("Dataset1"); + + /* + * Check the datatype array of compounds + */ + + // Verify that it is an array of compounds + DataType dstype = dataset.getDataType(); + mclass = dstype.getClass(); + verify_val(mclass, H5T_ARRAY, "f2_type.getClass", __LINE__, __FILE__); + dstype.close(); + + // Get the array datatype to check + ArrayType atype_check = dataset.getArrayType(); + + // Check the array rank + int ndims = atype_check.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); + + // Get the array dimensions + hsize_t rdims1[H5S_MAX_RANK]; + atype_check.getArrayDims(rdims1); + + // Check the array dimensions + for (ii =0; ii <ndims; ii++) + if (rdims1[ii]!=tdims1[ii]) { + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", (int)ii, (int)rdims1[ii], (int)ii, (int)tdims1[ii]); + continue; + } // end if + + // Test ArrayType::ArrayType(const hid_t existing_id) + ArrayType new_arrtype(atype_check.getId()); + + // Check the array rank + ndims = new_arrtype.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "new_arrtype.getArrayNDims", __LINE__, __FILE__); + + // Get the array dimensions + new_arrtype.getArrayDims(rdims1); + + // Check the array dimensions + for (ii = 0; ii < ndims; ii++) + if (rdims1[ii] != tdims1[ii]) { + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", (int)ii, (int)rdims1[ii], (int)ii, (int)tdims1[ii]); + continue; + } // end if + + /* + * Check the compound datatype and the array of floats datatype + * in the compound. + */ + // Get the compound datatype, which is the base datatype of the + // array datatype atype_check. + DataType base_type = atype_check.getSuper(); + mclass = base_type.getClass(); + verify_val(mclass, H5T_COMPOUND, "atype_check.getClass", __LINE__, __FILE__); + + // Verify the compound datatype info + CompType ctype_check(base_type.getId()); + base_type.close(); + + // Check the number of members + nmemb = ctype_check.getNmembers(); + verify_val(nmemb, 2, "ctype_check.getNmembers", __LINE__, __FILE__); + + // Check the 2nd field's name + H5std_string field2_name = ctype_check.getMemberName(1); + if (HDstrcmp(field2_name.c_str(),"f") != 0) + TestErrPrintf("Compound field name doesn't match!, field2_name=%s\n",field2_name.c_str()); + + // Get the 2nd field's datatype + DataType f2_type = ctype_check.getMemberDataType(1); + + // Get the 2nd field's class, this 2nd field should have an array type + mclass = f2_type.getClass(); + verify_val(mclass, H5T_ARRAY, "f2_type.getClass", __LINE__, __FILE__); + f2_type.close(); + + // Get the 2nd field, array of floats datatype, to check + ArrayType f2_atype_check = ctype_check.getMemberArrayType(1); + + // Check the array rank + ndims = f2_atype_check.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "f2_atype_check.getArrayNDims", __LINE__, __FILE__); + + // Get the array dimensions + HDmemset(rdims1, 0, H5S_MAX_RANK); + f2_atype_check.getArrayDims(rdims1); + + // Check the array dimensions + for (ii = 0; ii < ndims; ii++) + if (rdims1[ii] != tdims1[ii]) { + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",(int)ii, (int)rdims1[ii], (int)ii, (int)tdims1[ii]); + continue; + } // end if + + // Close done datatypes + f2_atype_check.close(); + ctype_check.close(); + + // Read dataset from disk + dataset.read(rdata, atype_check); + + // Compare data read in + for (ii = 0; ii < SPACE1_DIM1; ii++) { + for (jj = 0; jj < ARRAY1_DIM1; jj++) { + if (wdata[ii][jj].i != rdata[ii][jj].i) { + TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n",(int)ii,(int)jj,(int)wdata[ii][jj].i,(int)ii,(int)jj,(int)rdata[ii][jj].i); + continue; + } // end if + } // end for + } // end for + + // Close all + atype_check.close(); + dataset.close(); + file1.close(); + PASSED(); + } // end of try block + catch (Exception E) { + issue_fail_msg("test_array_compound_array", __LINE__, __FILE__, E.getCDetailMsg()); + } + +} // end test_array_compound_array() + + +/**************************************************************** +** +** test_array(): Main datatypes testing routine. +** +****************************************************************/ +#ifdef __cplusplus +extern "C" +#endif +void test_array() +{ + // Output message about test being performed + MESSAGE(5, ("Testing Array Datatypes\n")); + + // Test array of compounds with array field + test_array_compound_array(); + +} // test_array() + + +/*------------------------------------------------------------------------- + * Function: cleanup_array + * + * Purpose: Cleanup temporary test files + * + * Return: none + * + * Programmer: Binh-Minh Ribler (using C version) + * January, 2016 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +#ifdef __cplusplus +extern "C" +#endif +void cleanup_array() +{ + HDremove(FILENAME.c_str()); +} // cleanup_array diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 59b16cf..b29c6fb 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -91,6 +91,7 @@ main(int argc, char *argv[]) // testing variable-length strings in tvlstr.cpp AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); + AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); @@ -100,7 +101,6 @@ main(int argc, char *argv[]) AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); - AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL); AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index aae5d86..971a06f 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -549,7 +549,6 @@ extern "C" void test_types() { // Output message about test being performed - //MESSAGE("Testing Generic Data Types\n"); MESSAGE(5, ("Testing Generic Data Types\n")); // Test basic datatypes diff --git a/configure.ac b/configure.ac index 9c1d5b0..b1c26a2 100644 --- a/configure.ac +++ b/configure.ac @@ -2284,9 +2284,6 @@ fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -## ---------------------------------------------------------------------- -## Check if Direct I/O driver is enabled by --enable-direct-vfd -## AC_CACHE_VAL([hdf5_cv_direct_io], AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include <fcntl.h>]])) AC_CACHE_VAL([hdf5_cv_posix_memalign], diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index aeb3314..fd4226c 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -1232,7 +1232,7 @@ CONTAINS ENDIF ! Case of optional parameters. ! - ! Find the rank of the dataspace to allocate memery for + ! Find the rank of the dataspace to allocate memory for ! default stride and block arrays. ! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) @@ -1378,7 +1378,7 @@ CONTAINS ! endif ! Case of optional parameters. ! - ! Find the rank of the dataspace to allocate memery for + ! Find the rank of the dataspace to allocate memory for ! default stride and block arrays. ! ! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) @@ -273,7 +273,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Go do the real work for attaching the attribute to the object */ @@ -336,7 +336,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ - hid_t dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -365,8 +365,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5G_loc_reset(&obj_loc); /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_ind_dxpl_id; - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Find the object's location */ @@ -374,11 +373,6 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; - /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_dxpl_id; - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* Go do the real work for attaching the attribute to the dataset */ if(NULL == (attr = H5A_create(&obj_loc, attr_name, type, space, acpl_id, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") @@ -421,7 +415,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -436,7 +430,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Read in attribute from object header */ @@ -488,7 +482,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -510,7 +504,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the attribute on the object header */ @@ -561,7 +555,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -586,7 +580,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the attribute in the object header */ @@ -628,6 +622,8 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ + hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -641,6 +637,10 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") + /* Verify access property list and get correct dxpl */ + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + /* Go write the actual data to the attribute */ if((ret_value = H5A__write(attr, mem_type, buf, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") @@ -671,6 +671,8 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ + hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -684,8 +686,12 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") + /* Verify access property list and get correct dxpl */ + if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + /* Go write the actual data to the attribute */ - if((ret_value = H5A__read(attr, mem_type, buf, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5A__read(attr, mem_type, buf, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: @@ -898,7 +904,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -918,7 +924,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the attribute on the object header */ @@ -1036,7 +1042,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1055,7 +1061,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the attribute on the object header */ @@ -1095,7 +1101,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1117,7 +1123,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the attribute on the object header */ @@ -1216,7 +1222,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new attribute name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Avoid thrashing things if the names are the same */ @@ -1303,7 +1309,7 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, /* Call attribute iteration routine */ last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5O_attr_iterate(loc_id, H5AC_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); /* Set the last attribute information */ @@ -1372,7 +1378,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5A_attr_iter_op_t attr_op; /* Attribute operator */ hsize_t start_idx; /* Index of attribute to start iterating at */ hsize_t last_attr; /* Index of last attribute examined */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1392,7 +1398,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -1500,7 +1506,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1517,8 +1523,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_ind_dxpl_id; - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -1531,11 +1536,6 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; - /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_dxpl_id; - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* Delete the attribute from the location */ if(H5O_attr_remove(obj_loc.oloc, attr_name, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1582,7 +1582,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1601,8 +1601,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_ind_dxpl_id; - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -1615,11 +1614,6 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; - /* Verify access property list and get correct dxpl */ - dxpl_id = H5AC_dxpl_id; - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* Delete the attribute from the location */ if(H5O_attr_remove_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1701,7 +1695,7 @@ H5Aexists(hid_t obj_id, const char *attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Check if the attribute exists */ - if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: @@ -1727,7 +1721,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1744,7 +1738,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") if((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) @@ -76,23 +76,20 @@ static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ /*****************************/ -/* Default dataset transfer property list for metadata I/O calls */ -/* (Collective set) */ -/* (Global variable definition, declaration is in H5ACprivate.h also) */ -hid_t H5AC_dxpl_id = (-1); - -/* Dataset transfer property list for independent metadata I/O calls */ -/* (Global variable definition, declaration is in H5ACprivate.h also) */ -H5P_genplist_t *H5AC_ind_dxpl_g = NULL; -hid_t H5AC_ind_dxpl_id = (-1); +/* Default dataset transfer property list for metadata I/O calls (coll write, ind read) */ +hid_t H5AC_ind_read_dxpl_id = (-1); +hid_t H5AC_dxpl_id; +#ifdef H5_HAVE_PARALLEL +/* collective metadata read property */ +hid_t H5AC_coll_read_dxpl_id = (-1); +#endif /* H5_HAVE_PARALLEL */ -hid_t H5AC_coll_write_coll_read_dxpl_id = (-1); -hid_t H5AC_ind_write_coll_read_dxpl_id = (-1); +/* global flag for collective API sanity checks */ +hbool_t H5_coll_api_sanity_check_g = false; /*******************/ /* Local Variables */ @@ -175,7 +172,6 @@ H5AC__init_package(void) { #ifdef H5_HAVE_PARALLEL H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ - hbool_t coll_meta_write; /* "collective metadata write" property value */ H5P_coll_md_read_flag_t coll_meta_read; #endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ @@ -183,87 +179,39 @@ H5AC__init_package(void) FUNC_ENTER_PACKAGE #ifdef H5_HAVE_PARALLEL - /* Sanity check */ - HDassert(H5P_CLS_DATASET_XFER_g != NULL); - - /* Get an ID for the collective H5AC dxpl */ - if((H5AC_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get the property list object */ - if(NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - - /* Insert 'collective metadata write' property */ - coll_meta_write = TRUE; - if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - - /* Get an ID for the independent H5AC dxpl */ - if((H5AC_ind_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get the property list object */ - if(NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - - /* Insert 'collective metadata write' property */ - coll_meta_write = FALSE; - if(H5P_insert(H5AC_ind_dxpl_g, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - - /* Get an ID for H5AC_coll_write_coll_read_dxpl_id */ - if((H5AC_coll_write_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) + /* check whether to enable strict collective function calling + sanity checks using MPI barriers */ + { + const char *s; /* String for environment variables */ + + s = HDgetenv("H5_COLL_API_SANITY_CHECK"); + if(s && HDisdigit(*s)) { + H5_coll_api_sanity_check_g = (hbool_t)HDstrtol(s, NULL, 0); + } + } + + /* Get an ID for the metadata (H5AC) dxpl */ + if((H5AC_ind_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_coll_write_coll_read_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - - /* Insert 'collective metadata write' property */ - coll_meta_write = TRUE; - if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - - /* set 'collective metadata read' property */ - coll_meta_read = H5P_USER_TRUE; - if(H5P_set(xfer_plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective metadata read flag") - + /* MSC - Temp. Remove later */ + H5AC_dxpl_id = H5AC_ind_read_dxpl_id; - /* Get an ID for H5AC_ind_write_coll_read_dxpl_id */ - if((H5AC_ind_write_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) + /* Get an ID for H5AC_coll_read_dxpl_id */ + if((H5AC_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_write_coll_read_dxpl_id))) + if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_coll_read_dxpl_id))) HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert 'collective metadata write' property */ - coll_meta_write = FALSE; - if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") /* set 'collective metadata read' property */ coll_meta_read = H5P_USER_TRUE; if(H5P_set(xfer_plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective metadata read flag") #else /* H5_HAVE_PARALLEL */ - /* Sanity check */ - HDassert(H5P_LST_DATASET_XFER_ID_g!=(-1)); - - H5AC_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_ind_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_coll_write_coll_read_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_ind_write_coll_read_dxpl_id = H5P_DATASET_XFER_DEFAULT; - - /* Get the property list objects for the IDs */ - if(NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") + H5AC_ind_read_dxpl_id = H5P_DATASET_XFER_DEFAULT; #endif /* H5_HAVE_PARALLEL */ done: @@ -294,26 +242,21 @@ H5AC_term_package(void) if(H5_PKG_INIT_VAR) { #ifdef H5_HAVE_PARALLEL - if(H5AC_dxpl_id > 0 || H5AC_ind_dxpl_id > 0 || - H5AC_coll_write_coll_read_dxpl_id > 0 || - H5AC_ind_write_coll_read_dxpl_id > 0) { + if(H5AC_ind_read_dxpl_id > 0 || + H5AC_coll_read_dxpl_id > 0) { /* Indicate more work to do */ n = 1; /* H5I */ /* Close H5AC dxpl */ - if(H5I_dec_ref(H5AC_dxpl_id) < 0 || H5I_dec_ref(H5AC_ind_dxpl_id) < 0 || - H5I_dec_ref(H5AC_coll_write_coll_read_dxpl_id) < 0 || - H5I_dec_ref(H5AC_ind_write_coll_read_dxpl_id) < 0) + if(H5I_dec_ref(H5AC_ind_read_dxpl_id) < 0 || + H5I_dec_ref(H5AC_coll_read_dxpl_id) < 0) H5E_clear_stack(NULL); /*ignore error*/ } /* end if */ #endif /* H5_HAVE_PARALLEL */ - /* Reset static IDs */ - H5AC_dxpl_id = (-1); - H5AC_ind_dxpl_id = (-1); + H5AC_ind_read_dxpl_id = (-1); #ifdef H5_HAVE_PARALLEL - H5AC_coll_write_coll_read_dxpl_id = (-1); - H5AC_ind_write_coll_read_dxpl_id = (-1); + H5AC_coll_read_dxpl_id = (-1); #endif /* H5_HAVE_PARALLEL */ /* Reset interface initialization flag */ @@ -534,6 +477,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); + if(aux_ptr) /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); @@ -832,7 +776,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add /* Check if we should try to flush */ if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) - if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_ind_read_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") } /* end if */ } @@ -971,7 +915,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) - if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_ind_read_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") #endif /* H5_HAVE_PARALLEL */ @@ -1453,7 +1397,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) - if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_ind_read_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 50e7ab1..17d8776 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -197,19 +197,11 @@ typedef H5C_t H5AC_t; #define H5AC_RING_NAME "H5AC_ring_type" /* Dataset transfer property list for flush calls */ -/* (Collective set, "block before metadata write" set and "library internal" set) */ -/* (Global variable declaration, definition is in H5AC.c) */ extern hid_t H5AC_dxpl_id; - -/* Dataset transfer property list for independent metadata I/O calls */ -/* (just "library internal" set - i.e. independent transfer mode) */ -/* (Global variable declaration, definition is in H5AC.c) */ -H5_DLLVAR H5P_genplist_t *H5AC_ind_dxpl_g; -H5_DLLVAR hid_t H5AC_ind_dxpl_id; - -H5_DLLVAR hid_t H5AC_coll_write_coll_read_dxpl_id; -H5_DLLVAR hid_t H5AC_ind_write_coll_read_dxpl_id; - +extern hid_t H5AC_ind_read_dxpl_id; +#ifdef H5_HAVE_PARALLEL +extern hid_t H5AC_coll_read_dxpl_id; +#endif /* H5_HAVE_PARALLEL */ /* Default cache configuration. */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index ae0f041..58f0da8 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -191,7 +191,7 @@ H5Aopen_name(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, ".", name, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id))) + if(NULL == (attr = H5A_open_by_name(&loc, ".", name, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) /* Register the attribute and get an ID for it */ @@ -247,7 +247,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Open the attribute in the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id))) + if(NULL == (attr = H5A_open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") /* Register the attribute and get an ID for it */ @@ -333,7 +333,7 @@ H5Aget_num_attrs(hid_t loc_id) } /*lint !e788 All appropriate cases are covered */ /* Look up the # of attributes for the object */ - if((ret_value = H5O_attr_count(loc, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5O_attr_count(loc, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") done: @@ -399,7 +399,7 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) /* Call attribute iteration routine */ last_attr = start_idx = (hsize_t)(attr_num ? *attr_num : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_dxpl_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5O_attr_iterate(loc_id, H5AC_dxpl_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, start_idx, &last_attr, &attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); /* Set the last attribute information */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 12ffb7d..785ddc5 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -161,7 +161,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * name, but it's going to be hard to unwind all the special cases on * failure, so just check first, for now - QAK) */ - if((exists = H5O_attr_exists(loc->oloc, name, H5AC_ind_dxpl_id)) < 0) + if((exists = H5O_attr_exists(loc->oloc, name, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "error checking attributes") else if(exists > 0) HGOTO_ERROR(H5E_ATTR, H5E_ALREADYEXISTS, NULL, "attribute already exists") @@ -2397,7 +2397,7 @@ H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_nam H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, H5AC_ind_dxpl_id) < 0) + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; diff --git a/src/H5Atest.c b/src/H5Atest.c index d57bbe1..74ed6c4 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -140,7 +140,7 @@ H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ - if(H5SM_get_refcount(attr->oloc.file, H5AC_ind_dxpl_id, H5O_ATTR_ID, + if(H5SM_get_refcount(attr->oloc.file, H5AC_dxpl_id, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") @@ -1775,7 +1775,6 @@ H5C_insert_entry(H5F_t * f, hbool_t flush_last; #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ - hbool_t flush_collectively; #endif /* H5_HAVE_PARALLEL */ hbool_t set_flush_marker; hbool_t write_permitted = TRUE; @@ -1814,9 +1813,6 @@ H5C_insert_entry(H5F_t * f, set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); insert_pinned = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); -#ifdef H5_HAVE_PARALLEL - flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); -#endif /* H5_HAVE_PARALLEL */ /* Get the dataset transfer property list */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) @@ -1861,9 +1857,6 @@ H5C_insert_entry(H5F_t * f, entry_ptr->pinned_from_client = insert_pinned; entry_ptr->pinned_from_cache = FALSE; entry_ptr->flush_me_last = flush_last; -#ifdef H5_HAVE_PARALLEL - entry_ptr->flush_me_collectively = flush_collectively; -#endif /* newly inserted entries are assumed to be dirty */ entry_ptr->is_dirty = TRUE; @@ -2632,10 +2625,10 @@ done: * This allows H5C_protect to accept flags other than * H5C__READ_ONLY_FLAG. * - * Added support for the H5C__FLUSH_LAST_FLAG and - * H5C__FLUSH_COLLECTIVELY_FLAG flags. At present, these - * flags are only applied if the entry is not in cache, and - * is loaded into the cache as a result of this call. + * Added support for the H5C__FLUSH_LAST_FLAG. + * At present, this flag is only applied if the entry is + * not in cache, and is loaded into the cache as a result of + * this call. * *------------------------------------------------------------------------- */ @@ -2654,7 +2647,6 @@ H5C_protect(H5F_t * f, hbool_t read_only = FALSE; hbool_t flush_last; #ifdef H5_HAVE_PARALLEL - hbool_t flush_collectively; hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ #endif /* H5_HAVE_PARALLEL */ hbool_t write_permitted; @@ -2689,9 +2681,6 @@ H5C_protect(H5F_t * f, read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); -#ifdef H5_HAVE_PARALLEL - flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); -#endif /* H5_HAVE_PARALLEL */ /* Get the dataset transfer property list */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) @@ -2933,20 +2922,16 @@ H5C_protect(H5F_t * f, * * ******************************************* * - * Set the flush_last (and possibly flush_collectively) fields + * Set the flush_last field * of the newly loaded entry before inserting it into the * index. Must do this, as the index tracked the number of * entries with the flush_last field set, but assumes that * the field will not change after insertion into the index. * - * Note that this means that the H5C__FLUSH_LAST_FLAG and - * H5C__FLUSH_COLLECTIVELY_FLAG flags are ignored if the - * entry is already in cache. + * Note that this means that the H5C__FLUSH_LAST_FLAG flag + * is ignored if the entry is already in cache. */ entry_ptr->flush_me_last = flush_last; -#ifdef H5_HAVE_PARALLEL - entry_ptr->flush_me_collectively = flush_collectively; -#endif H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) @@ -7819,31 +7804,6 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ entry_ptr->flush_in_progress = TRUE; entry_ptr->flush_marker = FALSE; -#ifdef H5_HAVE_PARALLEL -#ifndef NDEBUG - /* If MPI based VFD is used, do special parallel I/O sanity checks. - * Note that we only do these sanity checks when the clear_only flag - * is not set, and the entry to be flushed is dirty. Don't bother - * otherwise as no file I/O can result. - */ - if(!clear_only && entry_ptr->is_dirty && H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { - H5P_genplist_t *dxpl; /* Dataset transfer property list */ - hbool_t coll_meta; /* Collective metadata write flag */ - - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get the collective metadata write property */ - if(H5P_get(dxpl, H5AC_COLLECTIVE_META_WRITE_NAME, &coll_meta) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve xfer mode") - - /* Sanity check collective metadata write flag */ - HDassert(coll_meta); - } /* end if */ -#endif /* NDEBUG */ -#endif /* H5_HAVE_PARALLEL */ - /* serialize the entry if necessary, and then write it to disk. */ if(write_entry) { unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; @@ -8421,8 +8381,8 @@ H5C_load_entry(H5F_t * f, size_t len; /* Size of image in file */ unsigned u; /* Local index variable */ #ifdef H5_HAVE_PARALLEL - int mpi_rank; /* MPI process rank */ - MPI_Comm comm; /* File MPI Communicator */ + int mpi_rank = 0; /* MPI process rank */ + MPI_Comm comm = MPI_COMM_NULL; /* File MPI Communicator */ int mpi_code; /* MPI error code */ #endif /* H5_HAVE_PARALLEL */ void * ret_value = NULL; /* Return value */ @@ -8583,7 +8543,6 @@ H5C_load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL if(!coll_access || 0 == mpi_rank) { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_read(f, type->mem_type, addr, len, dxpl_id, image) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*") diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 0d75ac1..e17aacd 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -406,7 +406,7 @@ H5C_apply_candidate_list(H5F_t * f, * Now scan the LRU and PEL lists, flushing or clearing entries as * needed. * - * The flush_me_last and flush_me_collectively flags may dictate how or + * The flush_me_last flag may dictate how or * when some entries can be flushed, and should be addressed here. * However, in their initial implementation, these flags only apply to the * superblock, so there's only a relatively small change to this function @@ -630,11 +630,10 @@ H5C_apply_candidate_list(H5F_t * f, it is the simple case of a single pinned entry needing flushed last and collectively is just a minor addition to this routine, but signficantly buffing up the usage of - flush_me_last or flush_me_collectively will require a more + flush_me_last will require a more intense rework of this function and potentially the function of candidate lists as a whole. */ - HDassert(entry_ptr->flush_me_collectively); entries_to_flush_or_clear_last++; entries_to_flush_collectively++; HDassert(entries_to_flush_or_clear_last == 1); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index b7b1d5b..5ad026b 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1383,13 +1383,10 @@ typedef int H5C_ring_t; * flushed from the cache until all other entries without * the flush_me_last flag set have been flushed. * - * flush_me_collectively: Boolean flag indicating that this entry needs - * to be flushed collectively when in a parallel situation. - * * Note: * - * At this time, the flush_me_last and flush_me_collectively - * flags will only be applied to one entry, the superblock, + * At this time, the flush_me_last + * flag will only be applied to one entry, the superblock, * and the code utilizing these flags is protected with HDasserts * to enforce this. This restraint can certainly be relaxed in * the future if the the need for multiple entries getting flushed @@ -1609,7 +1606,6 @@ typedef struct H5C_cache_entry_t { hbool_t flush_marker; hbool_t flush_me_last; #ifdef H5_HAVE_PARALLEL - hbool_t flush_me_collectively; hbool_t clear_on_unprotect; hbool_t flush_immediately; hbool_t coll_access; @@ -139,7 +139,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Create the new dataset & get its ID */ @@ -219,7 +219,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* build and open the new dataset */ @@ -275,7 +275,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -288,7 +288,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the dataset */ @@ -410,7 +410,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Read dataspace address and return */ - if(H5D__get_space_status(dset, allocation, H5AC_ind_dxpl_id) < 0) + if(H5D__get_space_status(dset, allocation, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status") done: @@ -579,7 +579,7 @@ H5Dget_storage_size(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset") /* Set return value */ - if(H5D__get_storage_size(dset, H5AC_ind_dxpl_id, &ret_value) < 0) + if(H5D__get_storage_size(dset, H5AC_dxpl_id, &ret_value) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of dataset's storage") done: @@ -910,7 +910,7 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") /* Private function */ - if(H5D__set_extent(dset, size, H5AC_coll_write_coll_read_dxpl_id) < 0) + if(H5D__set_extent(dset, size, H5AC_coll_read_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset") done: diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index b5b9b0d..3edf8b2 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -241,7 +241,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id) using_mpi = TRUE; /* Use the internal "independent" DXPL */ - my_dxpl_id = H5AC_ind_dxpl_id; + my_dxpl_id = H5AC_dxpl_id; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 34e0ae9..559dd69 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -90,7 +90,7 @@ H5Ddebug(hid_t dset_id) /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) - (void)H5D__chunk_dump_index(dset, H5AC_ind_dxpl_id, stdout); + (void)H5D__chunk_dump_index(dset, H5AC_dxpl_id, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index f5e3996..19b9f36 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -181,7 +181,7 @@ H5Dopen1(hid_t loc_id, const char *name) H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; FUNC_ENTER_API(FAIL) diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 947a177..59925d8 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -134,7 +134,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") /* Fill the selection in the memory buffer */ - if(H5D__fill(fill, fill_type, buf, buf_type, space, H5AC_ind_dxpl_id) < 0) + if(H5D__fill(fill, fill_type, buf, buf_type, space, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: diff --git a/src/H5Dint.c b/src/H5Dint.c index ab2f8d0..a58ca56 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2769,7 +2769,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&dset->oloc, H5AC_ind_dxpl_id, new_plist) < 0) + if(H5O_get_create_plist(&dset->oloc, H5AC_dxpl_id, new_plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ @@ -2831,7 +2831,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy dataset datatype for fill value") /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type, NULL, NULL, H5AC_dxpl_id, FALSE))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* Convert disk form of fill value into memory form */ @@ -2859,7 +2859,7 @@ H5D_get_create_plist(H5D_t *dset) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf, H5AC_ind_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf, H5AC_dxpl_id) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) @@ -2992,7 +2992,7 @@ H5D_get_space(H5D_t *dset) /* If the layout is virtual, update the extent */ if(dset->shared->layout.type == H5D_VIRTUAL) - if(H5D__virtual_set_extent_unlim(dset, H5AC_ind_dxpl_id) < 0) + if(H5D__virtual_set_extent_unlim(dset, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update virtual dataset extent") /* Read the data space message and return a data space object */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index ba17ada..db413e3 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -125,7 +125,7 @@ extern int H5E_mpi_error_str_len; #define HMPI_ERROR(mpierr){ \ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \ - HERROR(H5E_INTERNAL, H5E_MPIERRSTR, H5E_mpi_error_str); \ + HERROR(H5E_INTERNAL, H5E_MPIERRSTR, "%s", H5E_mpi_error_str); \ } #define HMPI_DONE_ERROR(retcode, str, mpierr){ \ HMPI_ERROR(mpierr); \ @@ -407,7 +407,7 @@ H5Fis_hdf5(const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") /* call the private is_HDF5 function */ - if((ret_value = H5F_is_hdf5(name)) < 0) + if((ret_value = H5F_is_hdf5(name, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable open file") done: @@ -472,8 +472,9 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file create property list") + /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* @@ -566,7 +567,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file open flags") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the file */ @@ -901,7 +902,7 @@ H5Fget_freespace(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual amount of free space in the file */ - if(H5MF_get_freespace(file, H5AC_ind_dxpl_id, &tot_space, NULL) < 0) + if(H5MF_get_freespace(file, H5AC_dxpl_id, &tot_space, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") ret_value = (hssize_t)tot_space; @@ -1015,7 +1016,7 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* call private get_file_image function */ - if((ret_value = H5F_get_file_image(file, buf_ptr, buf_len)) < 0) + if((ret_value = H5F_get_file_image(file, buf_ptr, buf_len, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file image") done: @@ -1348,16 +1349,16 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) HDmemset(finfo, 0, sizeof(*finfo)); /* Get the size of the superblock and any superblock extensions */ - if(H5F__super_size(f, H5AC_ind_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) + if(H5F__super_size(f, H5AC_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock sizes") /* Get the size of any persistent free space */ - if(H5MF_get_freespace(f, H5AC_ind_dxpl_id, &finfo->free.tot_space, &finfo->free.meta_size) < 0) + if(H5MF_get_freespace(f, H5AC_dxpl_id, &finfo->free.tot_space, &finfo->free.meta_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve free space information") /* Check for SOHM info */ if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) + if(H5SM_ih_size(f, H5AC_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") /* Set version # fields */ @@ -1402,7 +1403,7 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") /* Go get the free-space section information in the file */ - if((ret_value = H5MF_get_free_sections(file, H5AC_ind_dxpl_id, type, nsects, sect_info)) < 0) + if((ret_value = H5MF_get_free_sections(file, H5AC_dxpl_id, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") done: diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 7148615..ed70e20 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -96,12 +96,6 @@ static int H5FD_mpio_mpi_rank(const H5FD_t *_file); static int H5FD_mpio_mpi_size(const H5FD_t *_file); static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file); -/* MPIO-specific file access properties */ -typedef struct H5FD_mpio_fapl_t { - MPI_Comm comm; /*communicator */ - MPI_Info info; /*file information */ -} H5FD_mpio_fapl_t; - /* The MPIO file driver information */ static const H5FD_class_mpi_t H5FD_mpio_g = { { /* Start of superclass information */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 0f195ce..fe121b3 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -96,6 +96,14 @@ typedef struct { const void *driver_info; /* Driver info, for open callbacks */ } H5FD_driver_prop_t; +#ifdef H5_HAVE_PARALLEL +/* MPIO-specific file access properties */ +typedef struct H5FD_mpio_fapl_t { + MPI_Comm comm; /*communicator */ + MPI_Info info; /*file information */ +} H5FD_mpio_fapl_t; +#endif /* H5_HAVE_PARALLEL */ + /*****************************/ /* Library Private Variables */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index d16e2d4..c995d5d 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -133,12 +133,12 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) HDmemset(finfo, 0, sizeof(*finfo)); /* Get the size of the superblock extension */ - if(H5F__super_size(f, H5AC_ind_dxpl_id, NULL, &finfo->super_ext_size) < 0) + if(H5F__super_size(f, H5AC_dxpl_id, NULL, &finfo->super_ext_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size") /* Check for SOHM info */ if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) + if(H5SM_ih_size(f, H5AC_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") done: diff --git a/src/H5Fint.c b/src/H5Fint.c index 0c4ffb9..ea6c9c1 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -501,10 +501,11 @@ done: *------------------------------------------------------------------------- */ htri_t -H5F_is_hdf5(const char *name) +H5F_is_hdf5(const char *name, hid_t dxpl_id) { H5FD_t *file = NULL; /* Low-level file struct */ haddr_t sig_addr; /* Addess of hdf5 file signature */ + H5P_genplist_t *xfer_plist= NULL; /* Dataset transfer property list object */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -513,8 +514,12 @@ H5F_is_hdf5(const char *name) if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF))) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") + /* Get the property list object */ + if(NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) + HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") + /* The file is an hdf5 file if the hdf5 file signature can be found */ - if(H5FD_locate_signature(file, H5AC_ind_dxpl_g, &sig_addr) < 0) + if(H5FD_locate_signature(file, xfer_plist, &sig_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") ret_value = (HADDR_UNDEF != sig_addr); @@ -1953,7 +1958,7 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) *------------------------------------------------------------------------- */ ssize_t -H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) +H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t dxpl_id) { H5FD_t *fd_ptr; /* file driver */ haddr_t eoa; /* End of file address */ @@ -2021,6 +2026,7 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) /* test to see if a buffer was provided -- if not, we are done */ if(buf_ptr != NULL) { size_t space_needed; /* size of file image */ + H5P_genplist_t *xfer_plist= NULL; /* Dataset transfer property list object */ /* Check for buffer too small */ if((haddr_t)buf_len < eoa) @@ -2028,9 +2034,13 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) space_needed = (size_t)eoa; + /* Get the property list object */ + if(NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) + HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") + /* read in the file image */ /* (Note compensation for base address addition in internal routine) */ - if(H5FD_read(fd_ptr, H5AC_ind_dxpl_g, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) + if(H5FD_read(fd_ptr, xfer_plist, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "file image read request failed") } /* end if */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index ae15142..5434aa5 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -287,5 +287,74 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) done: FUNC_LEAVE_API(ret_value) } + + +/*------------------------------------------------------------------------- + * Function: H5F_mpi_retrieve_comm + * + * Purpose: Retrieves an MPI communicator from the file the location ID + * is in. If the loc_id is invalid, the fapl_id is used to + * retrieve the communicator. + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(mpi_comm); + *mpi_comm = MPI_COMM_NULL; + + /* if the loc_id is valid, then get the comm from the file + attached to the loc_id */ + if(H5I_INVALID_HID != loc_id) { + H5G_loc_t loc; + H5F_t *f = NULL; + + /* retrieve the file structure */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + f = loc.oloc->file; + HDassert(f); + + /* check if MPIO driver is used */ + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + /* retrieve the file communicator */ + if(MPI_COMM_NULL == (*mpi_comm = H5F_mpi_get_comm(f))) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") + } + } + /* otherwise, this if from H5Fopen or H5Fcreate and has to be collective */ + else { + H5P_genplist_t *plist; /* Property list pointer */ + + HDassert(H5P_isa_class(acspl_id, H5P_FILE_ACCESS)); + + if(NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list") + + if(H5FD_MPIO == H5P_peek_driver(plist)) { + const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */ + + if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist))) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") + + *mpi_comm = fa->comm; + } + } +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_mpi_retrieve_comm */ + #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 55e322b..be324d0 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -341,8 +341,9 @@ H5F_t *H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); herr_t H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush); H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing); -H5_DLL htri_t H5F_is_hdf5(const char *name); +H5_DLL htri_t H5F_is_hdf5(const char *name, hid_t dxpl_id); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); +H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, hid_t dxpl_id); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index be4acb7..7decaed 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -605,7 +605,6 @@ H5_DLL unsigned H5F_get_nopen_objs(const H5F_t *f); H5_DLL unsigned H5F_incr_nopen_objs(H5F_t *f); H5_DLL unsigned H5F_decr_nopen_objs(H5F_t *f); H5_DLL hid_t H5F_get_file_id(const H5F_t *f); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len); H5_DLL H5F_t *H5F_get_parent(const H5F_t *f); H5_DLL unsigned H5F_get_nmounts(const H5F_t *f); H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); @@ -682,6 +681,7 @@ H5_DLL herr_t H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle); H5_DLL int H5F_mpi_get_rank(const H5F_t *f); H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f); H5_DLL int H5F_mpi_get_size(const H5F_t *f); +H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm); #endif /* H5_HAVE_PARALLEL */ /* External file cache routines */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index c2c7bc9..1e9e4dd 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -625,9 +625,6 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU /* (We'll rely on the cache to make sure it actually *is* flushed last (and collectively in parallel), but this check doesn't hurt) */ HDassert(sblock->cache_info.flush_me_last); -#ifdef H5_HAVE_PARALLEL - HDassert(sblock->cache_info.flush_me_collectively); -#endif /* Encode the common portion of the file superblock for all versions */ HDmemcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); diff --git a/src/H5Ftest.c b/src/H5Ftest.c index b741e0d..e8cd8f4 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -109,7 +109,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Retrieve count for message type */ - if(H5SM_get_mesg_count_test(file, H5AC_ind_dxpl_id, type_id, mesg_count) < 0) + if(H5SM_get_mesg_count_test(file, H5AC_dxpl_id, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: @@ -317,7 +317,7 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Create the new group & get its ID */ @@ -394,7 +394,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up group creation info */ @@ -453,7 +453,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -466,7 +466,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Open the group */ @@ -559,7 +559,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Retrieve the group's information */ - if(H5G__obj_info(loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(loc.oloc, grp_info/*out*/, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: @@ -589,7 +589,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, H5G_name_t grp_path; /* Opened object group hier. path */ H5O_loc_t grp_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -604,7 +604,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -652,7 +652,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5G_name_t grp_path; /* Opened object group hier. path */ H5O_loc_t grp_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -672,7 +672,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index e0bc78e..919389f 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -274,7 +274,7 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Open the group */ - if((grp = H5G__open_name(&loc, name, H5P_DEFAULT, H5AC_ind_dxpl_id)) == NULL) + if((grp = H5G__open_name(&loc, name, H5P_DEFAULT, H5AC_dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an atom for the group */ @@ -602,7 +602,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Call the new link routine which provides this capability */ - if(H5L_get_val(&loc, name, buf, size, H5P_DEFAULT, H5AC_ind_dxpl_id) < 0) + if(H5L_get_val(&loc, name, buf, size, H5P_DEFAULT, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") done: @@ -688,7 +688,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) if(bufsize > 0 && !buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") - if((ret_value = (int)H5G_loc_get_comment(&loc, name, buf, bufsize, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = (int)H5G_loc_get_comment(&loc, name, buf, bufsize, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to get comment value") done: @@ -752,7 +752,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, lnk_op.op_func.op_old = op; /* Call private function. */ - if((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") /* Set the index we stopped at */ @@ -794,7 +794,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) /* Check args */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0) + if(H5O_obj_type(loc.oloc, &obj_type, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") if(obj_type != H5O_TYPE_GROUP) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") @@ -802,7 +802,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") /* Retrieve information about the group */ - if(H5G__obj_info(loc.oloc, &grp_info, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(loc.oloc, &grp_info, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") /* Set the number of objects [sic: links] in the group */ @@ -847,7 +847,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Get info */ - if(H5G_get_objinfo(&loc, name, follow_link, statbuf, H5AC_ind_dxpl_id) < 0) + if(H5G_get_objinfo(&loc, name, follow_link, statbuf, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "cannot stat object") done: @@ -1040,13 +1040,13 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) /* Check args */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0) + if(H5O_obj_type(loc.oloc, &obj_type, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") if(obj_type != H5O_TYPE_GROUP) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a group") /* Call internal function */ - if((ret_value = H5G_obj_get_name_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_obj_get_name_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object name") done: @@ -1082,13 +1082,13 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) /* Check args */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0) + if(H5O_obj_type(loc.oloc, &obj_type, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") if(obj_type != H5O_TYPE_GROUP) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "not a group") /* Call internal function*/ - if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_ind_dxpl_id)) == H5G_UNKNOWN) + if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_dxpl_id)) == H5G_UNKNOWN) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object type") done: diff --git a/src/H5Gint.c b/src/H5Gint.c index cba4806..7bd920c 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -1200,17 +1200,17 @@ H5G_get_create_plist(H5G_t *grp) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&grp->oloc, H5AC_ind_dxpl_id, new_plist) < 0) + if(H5O_get_create_plist(&grp->oloc, H5AC_dxpl_id, new_plist) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object creation info") /* Check for the group having a group info message */ - if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_dxpl_id)) < 0) + if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(ginfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ /* Read the group info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_ind_dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_dxpl_id)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* Set the group info for the property list */ @@ -1219,7 +1219,7 @@ H5G_get_create_plist(H5G_t *grp) } /* end if */ /* Check for the group having a link info message */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(linfo_exists) { /* Set the link info for the property list */ @@ -1228,13 +1228,13 @@ H5G_get_create_plist(H5G_t *grp) } /* end if */ /* Check for the group having a pipeline message */ - if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_ind_dxpl_id)) < 0) + if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(pline_exists) { H5O_pline_t pline; /* Pipeline message */ /* Read the pipeline */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_ind_dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_dxpl_id)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") /* Set the pipeline for the property list */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index a8796fb..6b20ade 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -97,7 +97,7 @@ H5G__is_empty_test(hid_t gid) H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -209,7 +209,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -268,7 +268,7 @@ H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -319,7 +319,7 @@ H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -390,7 +390,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -471,7 +471,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -613,7 +613,7 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) { H5O_stab_t stab; /* Symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) @@ -770,7 +770,7 @@ H5G__verify_cached_stabs_test(hid_t gid) H5O_stab_t stab; /* Symbol table message */ H5G_bt_common_t udata = {NULL, NULL}; /* Dummy udata so H5B_iterate doesn't freak out */ haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* transfer property list used for this operation */ + hid_t dxpl_id = H5AC_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2049,7 +2049,7 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: diff --git a/src/H5Itest.c b/src/H5Itest.c index 9d451c6..43966e7 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -89,7 +89,7 @@ H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, cached, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_get_name(&loc, name, size, cached, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: @@ -358,7 +358,9 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), + TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up src & dst location pointers */ @@ -421,7 +423,9 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), + TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up src & dst location pointers */ @@ -482,7 +486,7 @@ H5Lcreate_soft(const char *link_target, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Create the link */ @@ -538,7 +542,7 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, cur_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up current & new location pointers */ @@ -606,7 +610,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Create external link */ @@ -652,7 +656,7 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Unlink */ @@ -706,7 +710,7 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up user data for unlink operation */ @@ -749,7 +753,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -762,7 +766,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Get the link value */ @@ -799,7 +803,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, { H5G_loc_t loc; /* Group location for location to query */ H5L_trav_gvbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -817,7 +821,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up user data for retrieving information */ @@ -856,7 +860,7 @@ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ htri_t ret_value; FUNC_ENTER_API(FAIL) @@ -869,7 +873,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Check for the existence of the link */ @@ -900,7 +904,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -913,7 +917,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Get the link information */ @@ -946,7 +950,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, { H5G_loc_t loc; /* Group location for group to query */ H5L_trav_gibi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -964,7 +968,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up user data for callback */ @@ -1135,7 +1139,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, { H5G_loc_t loc; /* Location of group */ H5L_trav_gnbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1153,7 +1157,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up user data for callback */ @@ -1233,7 +1237,7 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, lnk_op.op_func.op_new = op; /* Iterate over the links */ - if((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") /* Set the index we stopped at */ @@ -1275,7 +1279,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5G_link_iterate_t lnk_op; /* Link operator */ hsize_t last_lnk; /* Index of last object looked at */ hsize_t idx; /* Internal location to hold index */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1293,7 +1297,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up iteration beginning/end info */ @@ -1368,7 +1372,7 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") /* Call internal group visitation routine */ - if((ret_value = H5G_visit(grp_id, ".", idx_type, order, op, op_data, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_visit(grp_id, ".", idx_type, order, op, op_data, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed") done: @@ -1426,7 +1430,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Call internal group visitation routine */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 3e8be66..732eb7b 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -282,7 +282,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_file_name = H5F_OPEN_NAME(loc.oloc->file); /* Query length of parent group name */ - if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL, lapl_id, H5AC_ind_dxpl_id)) < 0) + if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL, lapl_id, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve length of group name") /* Account for null terminator */ @@ -297,7 +297,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_group_name = local_group_name; /* Get parent group name */ - if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL, lapl_id, H5AC_ind_dxpl_id) < 0) + if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL, lapl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve group name") /* Make callback */ @@ -599,7 +599,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Create an external link */ @@ -282,7 +282,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ hid_t ret_value = FAIL; @@ -300,7 +300,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -390,7 +390,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_dxpl_id, TRUE)) < 0) + if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_dxpl_id, TRUE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -450,7 +450,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, obj_id, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Link to the object */ @@ -561,7 +561,7 @@ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location info */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -574,7 +574,7 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Check if the object exists */ @@ -615,7 +615,7 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Retrieve the object's information */ - if(H5G_loc_info(&loc, ".", TRUE, oinfo/*out*/, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id) < 0) + if(H5G_loc_info(&loc, ".", TRUE, oinfo/*out*/, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: @@ -640,7 +640,7 @@ herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -655,7 +655,7 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Retrieve the object's information */ @@ -690,7 +690,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -710,7 +710,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up opened group location to fill in */ @@ -724,7 +724,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, loc_found = TRUE; /* Retrieve the object's information */ - if(H5O_get_info(obj_loc.oloc, H5AC_ind_dxpl_id, TRUE, oinfo) < 0) + if(H5O_get_info(obj_loc.oloc, H5AC_dxpl_id, TRUE, oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") done: @@ -767,7 +767,7 @@ H5Oset_comment(hid_t obj_id, const char *comment) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* (Re)set the object's comment */ - if(H5G_loc_set_comment(&loc, ".", comment, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id) < 0) + if(H5G_loc_set_comment(&loc, ".", comment, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: @@ -810,7 +810,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* (Re)set the object's comment */ @@ -852,7 +852,7 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Retrieve the object's comment */ - if((ret_value = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: @@ -881,7 +881,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -894,7 +894,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Retrieve the object's comment */ @@ -956,7 +956,7 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") /* Call internal object visitation routine */ - if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: @@ -1000,7 +1000,7 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) { - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1018,7 +1018,7 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Call internal object visitation routine */ @@ -1351,7 +1351,7 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref) H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl used by library */ hid_t ret_value = FAIL; FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 70dc560..2bb7a36 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -233,7 +233,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") /* check if destination name already exists */ - if((dst_exists = H5L_exists_tolerant(&dst_loc, dst_name, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) + if((dst_exists = H5L_exists_tolerant(&dst_loc, dst_name, H5P_DEFAULT, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists") if(TRUE == dst_exists) HGOTO_ERROR(H5E_OHDR, H5E_EXISTS, FAIL, "destination object already exists") @@ -244,7 +244,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_reset(&src_loc); /* Find the source object to copy */ - if(H5G_loc_find(&loc, src_name, &src_loc/*out*/, H5P_DEFAULT, H5AC_ind_dxpl_id) < 0) + if(H5G_loc_find(&loc, src_name, &src_loc/*out*/, H5P_DEFAULT, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found") loc_found = TRUE; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index ebcb5d3..f291305 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -527,7 +527,7 @@ H5O_fill_copy(const void *_src, void *_dst) H5T_path_t *tpath; /* Conversion information */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(src->type, dst->type, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src->type, dst->type, NULL, NULL, H5AC_dxpl_id, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_UNSUPPORTED, NULL, "unable to convert between src and dst data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -555,7 +555,7 @@ H5O_fill_copy(const void *_src, void *_dst) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf, H5AC_ind_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf, H5AC_dxpl_id) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 0c13498..0ece505 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -593,7 +593,7 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, UINT32ENCODE(heap_block_p, chksum) /* Insert block into global heap */ - if(H5HG_insert(f, H5AC_ind_dxpl_id, block_size, heap_block, &((H5O_layout_t *)mesg)->storage.u.virt.serial_list_hobjid) < 0) /* Casting away const OK --NAF */ + if(H5HG_insert(f, H5AC_dxpl_id, block_size, heap_block, &((H5O_layout_t *)mesg)->storage.u.virt.serial_list_hobjid) < 0) /* Casting away const OK --NAF */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") } /* end if */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 1c149e3..b9ed5be 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -108,14 +108,14 @@ H5O_is_attr_dense_test(hid_t oid) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (oh = H5O_protect(loc, H5AC_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + if(H5A_get_ainfo(loc->file, H5AC_dxpl_id, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -130,7 +130,7 @@ H5O_is_attr_dense_test(hid_t oid) ret_value = FALSE; done: - if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, H5AC_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -173,13 +173,13 @@ H5O_is_attr_empty_test(hid_t oid) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (oh = H5O_protect(loc, H5AC_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, H5AC_ind_dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A_get_ainfo(loc->file, H5AC_dxpl_id, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -195,10 +195,10 @@ H5O_is_attr_empty_test(hid_t oid) HDassert(nattrs == 0); /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_dxpl_id, loc->addr, FAIL); + H5_BEGIN_TAG(H5AC_dxpl_id, loc->addr, FAIL); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_dxpl_id, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Reset metadata tag in dxpl_id */ @@ -221,9 +221,9 @@ H5O_is_attr_empty_test(hid_t oid) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, H5AC_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -266,14 +266,14 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (oh = H5O_protect(loc, H5AC_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + if(H5A_get_ainfo(loc->file, H5AC_dxpl_id, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -288,10 +288,10 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) HDassert(obj_nattrs == 0); /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_dxpl_id, loc->addr, FAIL); + H5_BEGIN_TAG(H5AC_dxpl_id, loc->addr, FAIL); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_dxpl_id, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Reset metadata tag in dxpl_id */ @@ -311,9 +311,9 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, H5AC_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -358,17 +358,17 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_dxpl_id, loc->addr, FAIL); + H5_BEGIN_TAG(H5AC_dxpl_id, loc->addr, FAIL); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (oh = H5O_protect(loc, H5AC_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + if(H5A_get_ainfo(loc->file, H5AC_dxpl_id, oh, &ainfo) < 0) HGOTO_ERROR_TAG(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -379,7 +379,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) HGOTO_DONE_TAG(FAIL, FAIL) /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_dxpl_id, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ @@ -389,7 +389,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Check if there is a creation order index */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(loc->file, H5AC_dxpl_id, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ @@ -404,11 +404,11 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, H5AC_ind_dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, H5AC_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -452,7 +452,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (oh = H5O_protect(loc, H5AC_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate "unknown" message */ @@ -471,7 +471,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "'unknown' message type not found") done: - if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, H5AC_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 971394c..2abd24c 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -3125,7 +3125,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HDmemcpy(fill.buf, value, (size_t)fill.size); /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(type, type, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(type, type, NULL, NULL, H5AC_dxpl_id, FALSE))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -3137,7 +3137,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Convert the fill value */ - if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf, H5AC_ind_dxpl_id) < 0) { + if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf, H5AC_dxpl_id) < 0) { if(bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") @@ -3292,7 +3292,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get the fill value */ - if(H5P_get_fill_value(plist, type, value, H5AC_ind_dxpl_id) < 0) + if(H5P_get_fill_value(plist, type, value, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") done: diff --git a/src/H5Pint.c b/src/H5Pint.c index 75b9f1e..4064b66 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -5450,7 +5451,8 @@ H5P_get_class(const H5P_genplist_t *plist) *------------------------------------------------------------------------- */ herr_t -H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t *dxpl_id) +H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t *dxpl_id, + hid_t loc_id, hbool_t is_collective) { herr_t ret_value = SUCCEED; /* Return value */ @@ -5465,13 +5467,18 @@ H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t * if(H5P_DEFAULT == *acspl_id) *acspl_id = *libclass->def_plist_id; else { +#ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t is_collective; /* Collective metadata read flag */ H5P_genplist_t *plist; /* Property list pointer */ +#endif /* H5_HAVE_PARALLEL */ /* Sanity check the access property list class */ if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not the required access property list") + *dxpl_id = H5AC_ind_read_dxpl_id; + +#ifdef H5_HAVE_PARALLEL /* Get the plist structure for the access property list */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADATOM, FAIL, "can't find object for ID") @@ -5481,14 +5488,30 @@ H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t * HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get core collective metadata read flag") /* If collective metadata read requested and using internal DXPL, switch to internal collective DXPL */ - if(H5P_USER_TRUE == is_collective) { - if(*dxpl_id == H5AC_dxpl_id) - *dxpl_id = H5AC_coll_write_coll_read_dxpl_id; - else if(*dxpl_id == H5AC_ind_dxpl_id) - *dxpl_id = H5AC_ind_write_coll_read_dxpl_id; - } /* end if */ + if(H5P_USER_TRUE == is_collective) + *dxpl_id = H5AC_coll_read_dxpl_id; +#endif /* H5_HAVE_PARALLEL */ } /* end else */ +#ifdef H5_HAVE_PARALLEL + /* If parallel is enabled and the file driver used in the MPI-IO + VFD, issue an MPI barrier for easier debugging if the API function + calling this is supposed to be called collectively. Note that this + happens only when the environment variable H5_COLL_BARRIER is set + to non 0. */ + if(is_collective && H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; + + /* retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, *acspl_id, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + } +#endif /* H5_HAVE_PARALLEL */ + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_verify_apl_and_dxpl() */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 4e64843..9074b78 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -189,7 +189,8 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); -H5_DLL herr_t H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t *dxpl_id); +H5_DLL herr_t H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, + hid_t *dxpl_id, hid_t loc_id, hbool_t is_collective); /* Query internal fields of the property list struct */ H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist); @@ -621,7 +621,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, oapl_id, H5AC_ind_dxpl_id, ref_type, _ref, TRUE)) < 0) + if((ret_value = H5R_dereference(file, oapl_id, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") done: @@ -740,7 +740,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the dataspace with the correct region selected */ - if((space = H5R_get_region(loc.oloc->file, H5AC_ind_dxpl_id, ref)) == NULL) + if((space = H5R_get_region(loc.oloc->file, H5AC_dxpl_id, ref)) == NULL) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") /* Atomize */ @@ -880,7 +880,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the object information */ - if(H5R_get_obj_type(loc.oloc->file, H5AC_ind_dxpl_id, ref_type, ref, obj_type) < 0) + if(H5R_get_obj_type(loc.oloc->file, H5AC_dxpl_id, ref_type, ref, obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object type") done: @@ -1044,7 +1044,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, file = loc.oloc->file; /* Get name */ - if((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_ind_dxpl_id, id, ref_type, _ref, name, size)) < 0) + if((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_dxpl_id, id, ref_type, _ref, name, size)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object path") done: diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index b8133b2..4f2f37a 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -125,7 +125,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") /* Get the object information */ - if(H5R_get_obj_type(loc.oloc->file, H5AC_ind_dxpl_id, ref_type, ref, &obj_type) < 0) + if(H5R_get_obj_type(loc.oloc->file, H5AC_dxpl_id, ref_type, ref, &obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") /* Set return value */ @@ -180,7 +180,7 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_dxpl_id, ref_type, _ref, TRUE)) < 0) + if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") done: @@ -993,24 +993,24 @@ H5T__init_package(void) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; - status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T__conv_array, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T__conv_array, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); /* * Native conversions should be listed last since we can use hardware to @@ -1021,221 +1021,221 @@ H5T__init_package(void) */ /* floating point */ - status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float, H5AC_dxpl_id, FALSE); #if H5_SIZEOF_LONG_DOUBLE != 0 - status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double, H5AC_dxpl_id, FALSE); #endif /* H5_SIZEOF_LONG_DOUBLE != 0 */ /* from long long */ - status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar, H5AC_dxpl_id, FALSE); /* From long */ - status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar, H5AC_dxpl_id, FALSE); /* From short */ - status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar, H5AC_dxpl_id, FALSE); /* From int */ - status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar, H5AC_dxpl_id, FALSE); /* From char */ - status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar, H5AC_dxpl_id, FALSE); /* From char to floats */ - status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble, H5AC_dxpl_id, FALSE); /* From unsigned char to floats */ - status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble, H5AC_dxpl_id, FALSE); /* From short to floats */ - status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble, H5AC_dxpl_id, FALSE); /* From unsigned short to floats */ - status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble, H5AC_dxpl_id, FALSE); /* From int to floats */ - status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble, H5AC_dxpl_id, FALSE); /* From unsigned int to floats */ - status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble, H5AC_dxpl_id, FALSE); /* From long to floats */ - status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble, H5AC_dxpl_id, FALSE); /* From unsigned long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble, H5AC_dxpl_id, FALSE); /* From long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double, H5AC_dxpl_id, FALSE); #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_dxpl_id, FALSE); #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ /* From floats to char */ - status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar, H5AC_dxpl_id, FALSE); /* From floats to unsigned char */ - status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar, H5AC_dxpl_id, FALSE); /* From floats to short */ - status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short, H5AC_dxpl_id, FALSE); /* From floats to unsigned short */ - status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort, H5AC_dxpl_id, FALSE); /* From floats to int */ - status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int, H5AC_dxpl_id, FALSE); /* From floats to unsigned int */ - status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint, H5AC_dxpl_id, FALSE); /* From floats to long */ - status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long, H5AC_dxpl_id, FALSE); /* From floats to unsigned long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_dxpl_id, FALSE); /* From floats to long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_dxpl_id, FALSE); #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_ind_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ /* @@ -1243,7 +1243,7 @@ H5T__init_package(void) * data types we use are not important as long as the source and * destination are equal. */ - status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_ind_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_dxpl_id, FALSE); /* Initialize the +/- Infinity values for floating-point types */ status |= H5T__init_inf(); @@ -1365,7 +1365,7 @@ H5T_top_term_package(void) H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL,H5AC_ind_dxpl_id) < 0) { + (size_t)0, (size_t)0, NULL, NULL,H5AC_dxpl_id) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { fprintf(H5DEBUG(T), "H5T: conversion function " @@ -2460,7 +2460,7 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") /* Go register the function */ - if(H5T_register(pers, name, src, dst, func, H5AC_ind_dxpl_id, TRUE) < 0) + if(H5T_register(pers, name, src, dst, func, H5AC_dxpl_id, TRUE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: @@ -2599,7 +2599,7 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") - if(H5T_unregister(pers, name, src, dst, func, H5AC_ind_dxpl_id) < 0) + if(H5T_unregister(pers, name, src, dst, func, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: @@ -2643,7 +2643,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") /* Find it */ - if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_dxpl_id, FALSE))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") if(pcdata) @@ -2939,7 +2939,7 @@ H5T_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ - if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_ind_dxpl_id, NULL, H5O_DTYPE_ID, buf))) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_dxpl_id, NULL, H5O_DTYPE_ID, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ @@ -4761,7 +4761,7 @@ H5T_compiler_conv(H5T_t *src, H5T_t *dst) FUNC_ENTER_NOAPI_NOINIT /* Find it */ - if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_dxpl_id, FALSE))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") ret_value = (htri_t)path->is_hard; diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 51fb9d2..b715593 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -128,7 +128,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Commit the type */ @@ -266,7 +266,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Commit the type */ @@ -529,7 +529,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) H5O_type_t obj_type; /* Type of object at location */ H5G_loc_t type_loc; /* Group object for datatype */ hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datatype */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -542,7 +542,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0) + if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Set up datatype location to fill in */ @@ -637,7 +637,7 @@ H5Tget_create_plist(hid_t dtype_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&type->oloc, H5AC_ind_dxpl_id, new_plist) < 0) + if(H5O_get_create_plist(&type->oloc, H5AC_dxpl_id, new_plist) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") } /* end if */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index cd4de1d..89746bf 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -152,7 +152,7 @@ H5Topen1(hid_t loc_id, const char *name) H5O_type_t obj_type; /* Type of object at location */ H5G_loc_t type_loc; /* Group object for datatype */ hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datatype */ + hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 0dc12a3..89aea81 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -1005,7 +1005,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert, H5AC_ind_dxpl_id) < 0) + if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ diff --git a/src/H5private.h b/src/H5private.h index c536566..6a71dc4 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1699,6 +1699,7 @@ typedef struct H5_debug_t { H5_debug_open_stream_t *open_stream; /* Stack of open output streams */ } H5_debug_t; +extern hbool_t H5_coll_api_sanity_check_g; extern H5_debug_t H5_debug_g; #define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream) /* Do not use const else AIX strings does not show it. */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 470f7a1..4a1e7ae 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3866,26 +3866,26 @@ check_invalid_tag_application(void) /* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */ /* Ensure this returns FAILURE, as a tag has not been set up. */ - if ( H5HL_create(f, H5AC_ind_dxpl_id, (size_t)1024, &addr) >= 0) TEST_ERROR; + if ( H5HL_create(f, H5AC_dxpl_id, (size_t)1024, &addr) >= 0) TEST_ERROR; /* Now set up a tag in the dxpl */ - if ( H5AC_tag(H5AC_ind_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + if ( H5AC_tag(H5AC_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; /* Verify the same call to H5HL_create now works as intended, with a tag set up. */ - if ( H5HL_create(f, H5AC_ind_dxpl_id, (size_t)1024, &addr) < 0) TEST_ERROR; + if ( H5HL_create(f, H5AC_dxpl_id, (size_t)1024, &addr) < 0) TEST_ERROR; /* Reset dxpl to use invalid tag. */ - if ( H5AC_tag(H5AC_ind_dxpl_id, H5AC__INVALID_TAG, NULL) < 0) TEST_ERROR; + if ( H5AC_tag(H5AC_dxpl_id, H5AC__INVALID_TAG, NULL) < 0) TEST_ERROR; /* Call H5HL_protect to protect the local heap created above. */ /* This should fail as no tag is set up during the protect call */ - if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, H5AC_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; /* Again, set up a valid tag in the DXPL */ - if ( H5AC_tag(H5AC_ind_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + if ( H5AC_tag(H5AC_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; /* Call H5HL_protect again to protect the local heap. This should succeed. */ - if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, H5AC_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; /* Now unprotect the heap, as we're done with the test. */ if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR; diff --git a/test/error_test.c b/test/error_test.c index 4e4c0ef..ee181b1 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -498,7 +498,7 @@ test_create(void) if(err_num != 0) TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, err_msg) < 0) TEST_ERROR; + if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); @@ -543,7 +543,7 @@ test_copy(void) herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, err_msg) < 0) TEST_ERROR; + if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 7ab479d..b5ebb98 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -536,7 +536,6 @@ int main(int argc, char **argv) AddTest("denseattr", test_dense_attr, NULL, "Store Dense Attributes", PARATESTFILE); - /* Display testing information */ TestInfo(argv[0]); diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 00ec760..c256e11 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -4,7 +4,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- @@ -12,6 +12,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/non_existing.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl @@ -284,6 +285,7 @@ ) set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err + ${PROJECT_SOURCE_DIR}/errfiles/non_existing.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err @@ -325,7 +327,7 @@ ARGS -E copy_if_different ${tst_h5_file} ${dest} ) endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) @@ -373,7 +375,7 @@ COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - + if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") @@ -385,7 +387,7 @@ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) endif (WIN32) - + ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -730,7 +732,7 @@ add_test ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove h5dump-help.out charsets.out charsets.out.err @@ -738,6 +740,8 @@ file_space.out.err filter_fail.out filter_fail.out.err + non_existing.out + non_existing.out.err packedbits.out packedbits.out.err tall-1.out @@ -1075,9 +1079,9 @@ ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) ADD_H5_TEST_EXPORT (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -y -o) - + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) - + # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) @@ -1147,7 +1151,7 @@ # test for named data types ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5) - # test for unamed type + # test for unamed type ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") # test complicated compound datatype ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) @@ -1169,7 +1173,7 @@ # test for loop detection ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5) - # test for string + # test for string ADD_H5_TEST (tstr-1 0 --enable-error-stack tstr.h5) ADD_H5_TEST (tstr-2 0 --enable-error-stack tstr2.h5) @@ -1202,7 +1206,7 @@ #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5) - + # test for files with empty data ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) @@ -1263,7 +1267,7 @@ ADD_H5_TEST (tcontiguos 0 --enable-error-stack -H -p -d contiguous tfilters.h5) # chunked ADD_H5_TEST (tchunked 0 --enable-error-stack -H -p -d chunked tfilters.h5) - # external + # external ADD_H5_TEST (texternal 0 --enable-error-stack -H -p -d external tfilters.h5) # fill values @@ -1331,7 +1335,7 @@ # don't have). Do this by searching H5pubconf.h to see which # filters are defined. -# detect whether the encoder is present. +# detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") endif (H5_HAVE_FILTER_DEFLATE) @@ -1352,12 +1356,12 @@ # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) - # dimensions over 4GB, print boundary + # dimensions over 4GB, print boundary ADD_H5_TEST (tbigdims 0 --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5) # hyperslab read ADD_H5_TEST (thyperslab 0 --enable-error-stack thyperslab.h5) - + # test for displaying dataset and attribute of null space ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) @@ -1391,7 +1395,7 @@ ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - # test for dataset region references + # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5) @@ -1414,7 +1418,7 @@ # tests for link references and order ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5) ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5) - + # tests for floating point user defined printf format ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) @@ -1430,3 +1434,6 @@ # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) + + # test for non-existing file + ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5) diff --git a/tools/h5dump/errfiles/non_existing.err b/tools/h5dump/errfiles/non_existing.err new file mode 100644 index 0000000..f7e3afa --- /dev/null +++ b/tools/h5dump/errfiles/non_existing.err @@ -0,0 +1 @@ +h5dump error: unable to open file "non_existing.h5" diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 68889c9..ffba581 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -620,7 +620,7 @@ parse_hsize_list(const char *h_list, subset_d *d) size_count++; last_digit = 1; - } + } else { last_digit = 0; } @@ -643,7 +643,7 @@ parse_hsize_list(const char *h_list, subset_d *d) } d->data = p_list; d->len = size_count; - + return; } @@ -705,7 +705,7 @@ parse_subset_params(char *dset) * * Purpose: Parse a list of comma or space separated integers and fill * the packed_bits list and counter. The string being passed into this function - * should be at the start of the list you want to parse. + * should be at the start of the list you want to parse. * * Return: Success: SUCCEED * @@ -831,7 +831,7 @@ static void free_handler(struct handler_t *hand, int len) { int i; - + if(hand) { for (i = 0; i < len; i++) { if(hand[i].obj) { @@ -1161,7 +1161,7 @@ parse_start: } if (HDstrcmp(opt_arg,":") == 0) { xmlnsprefix = ""; - } + } else { xmlnsprefix = opt_arg; } @@ -1187,7 +1187,7 @@ parse_start: * the two. */ s = last_dset->subset_info; - } + } else { last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); } @@ -1358,7 +1358,7 @@ main(int argc, const char *argv[]) /* Disable tools error reporting */ H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - + if((hand = parse_command_line(argc, argv))==NULL) { goto done; } @@ -1444,12 +1444,12 @@ main(int argc, const char *argv[]) if (xml_dtd_uri == NULL) { if (useschema) { xml_dtd_uri = DEFAULT_XSD; - } + } else { xml_dtd_uri = DEFAULT_DTD; xmlnsprefix = ""; } - } + } else { if (useschema && HDstrcmp(xmlnsprefix,"")) { error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); @@ -1486,7 +1486,7 @@ main(int argc, const char *argv[]) /* start to dump - display file header information */ if (!doxml) { begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); - } + } else { PRINTVALSTREAM(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); @@ -1495,7 +1495,7 @@ main(int argc, const char *argv[]) if (HDstrcmp(xmlnsprefix,"") == 0) { PRINTSTREAM(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n", xml_dtd_uri); - } + } else { /* TO DO: make -url option work in this case (may need new option) */ char *ns; @@ -1511,7 +1511,7 @@ main(int argc, const char *argv[]) "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); HDfree(ns); } - } + } else { PRINTSTREAM(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri); PRINTVALSTREAM(rawoutstream, "<HDF5-File>\n"); @@ -1570,7 +1570,7 @@ main(int argc, const char *argv[]) if (!doxml) { end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); PRINTVALSTREAM(rawoutstream, "\n"); - } + } else { PRINTSTREAM(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix); } @@ -1581,13 +1581,17 @@ main(int argc, const char *argv[]) if (H5Fclose(fid) < 0) h5tools_setstatus(EXIT_FAILURE); - if(prefix) + if(prefix) { HDfree(prefix); - if(fname) + prefix = NULL; + } + if(fname) { HDfree(fname); + fname = NULL; + } } /* end while */ - if(hand) + if(hand) free_handler(hand, argc); /* To Do: clean up XML table */ @@ -1601,13 +1605,17 @@ done: if(fid >=0) if (H5Fclose(fid) < 0) h5tools_setstatus(EXIT_FAILURE); - - if(prefix) + + if(prefix) { HDfree(prefix); - if(fname) + prefix = NULL; + } + if(fname) { HDfree(fname); + fname = NULL; + } - if(hand) + if(hand) free_handler(hand, argc); /* To Do: clean up XML table */ @@ -1660,20 +1668,20 @@ h5_fileaccess(void) if (!HDstrcmp(name, "sec2")) { /* Unix read() and write() system calls */ if (H5Pset_fapl_sec2(fapl)<0) return -1; - } + } else if (!HDstrcmp(name, "stdio")) { /* Standard C fread() and fwrite() system calls */ if (H5Pset_fapl_stdio(fapl)<0) return -1; - } + } else if (!HDstrcmp(name, "core")) { /* In-core temporary file with 1MB increment */ if (H5Pset_fapl_core(fapl, 1024*1024, FALSE)<0) return -1; - } + } else if (!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ if (H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) return -1; - } + } else if (!HDstrcmp(name, "multi")) { /* Multi-file driver, general case of the split driver */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; @@ -1699,7 +1707,7 @@ h5_fileaccess(void) if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) return -1; - } + } else if (!HDstrcmp(name, "family")) { hsize_t fam_size = 100*1024*1024; /*100 MB*/ @@ -1708,7 +1716,7 @@ h5_fileaccess(void) fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1; - } + } else if (!HDstrcmp(name, "log")) { long log_flags = H5FD_LOG_LOC_IO; @@ -1718,12 +1726,12 @@ h5_fileaccess(void) if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0) return -1; - } + } else if (!HDstrcmp(name, "direct")) { /* Substitute Direct I/O driver with sec2 driver temporarily because * some output has sec2 driver as the standard. */ if (H5Pset_fapl_sec2(fapl)<0) return -1; - } + } else { /* Unknown driver */ return -1; diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 95f8091..267ac44 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -27,10 +27,10 @@ EXIT_FAILURE=1 DUMPER=h5dump # The tool name DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary -H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary -H5IMPORT=../h5import/h5import # The h5import tool name +H5IMPORT=../h5import/h5import # The h5import tool name H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary RM='rm -rf' @@ -176,6 +176,7 @@ LIST_OTHER_TEST_FILES=" $SRC_H5DUMP_TESTFILES/charsets.ddl $SRC_H5DUMP_TESTFILES/file_space.ddl $SRC_H5DUMP_TESTFILES/filter_fail.ddl +$SRC_H5DUMP_TESTFILES/non_existing.ddl $SRC_H5DUMP_TESTFILES/packedbits.ddl $SRC_H5DUMP_TESTFILES/tall-1.ddl $SRC_H5DUMP_TESTFILES/tall-2.ddl @@ -266,7 +267,7 @@ $SRC_H5DUMP_TESTFILES/tindicessub4.ddl $SRC_H5DUMP_TESTFILES/tindicesyes.ddl $SRC_H5DUMP_TESTFILES/tintsattrs.ddl $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl -#$SRC_H5DUMP_TESTFILES/tldouble.ddl +#$SRC_H5DUMP_TESTFILES/tldouble.ddl $SRC_H5DUMP_TESTFILES/tlonglinks.ddl $SRC_H5DUMP_TESTFILES/tloop-1.ddl $SRC_H5DUMP_TESTFILES/tmulti.ddl @@ -347,6 +348,7 @@ $SRC_H5DUMP_TESTFILES/tbinregR.exp LIST_ERROR_TEST_FILES=" ${SRC_H5DUMP_ERRORFILES}/filter_fail.err +${SRC_H5DUMP_ERRORFILES}/non_existing.err ${SRC_H5DUMP_ERRORFILES}/tall-1.err ${SRC_H5DUMP_ERRORFILES}/tall-2A.err ${SRC_H5DUMP_ERRORFILES}/tall-2A0.err @@ -393,10 +395,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -441,14 +443,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -537,7 +539,7 @@ TOOLTEST2() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -545,7 +547,7 @@ TOOLTEST2() { } -# same as TOOLTEST2 but compares generated file to expected ddl file +# same as TOOLTEST2 but compares generated file to expected ddl file # and compares the generated data file to the expected data file # used for the binary tests that expect a full path in -o without -b # ADD_H5_TEST_EXPORT @@ -603,7 +605,7 @@ TOOLTEST2A() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err $actualmeta @@ -642,7 +644,7 @@ TOOLTEST2B() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -859,7 +861,7 @@ TOOLTEST_HELP() { echo " Expected output (*.txt) differs from actual output (*.out)" nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actual_err @@ -872,7 +874,7 @@ SKIP() { TESTING $DUMPER $@ echo " -SKIP-" } - + # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { @@ -883,7 +885,7 @@ PRINT_H5DIFF() { # Call the h5diff tool # -DIFFTEST() +DIFFTEST() { PRINT_H5DIFF $@ ( @@ -897,7 +899,7 @@ DIFFTEST() else echo " PASSED" fi - + } # Print a line-line message left justified in a field of 70 characters @@ -910,7 +912,7 @@ PRINT_H5IMPORT() { # Call the h5import tool # -IMPORTTEST() +IMPORTTEST() { # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" @@ -921,7 +923,7 @@ IMPORTTEST() PRINT_H5IMPORT $@ ( cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -930,7 +932,7 @@ IMPORTTEST() else echo " PASSED" fi - + } @@ -1021,7 +1023,7 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5 -# test for unamed type +# test for unamed type TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 @@ -1041,7 +1043,7 @@ TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5 # test for loop detection TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5 -# test for string +# test for string TOOLTEST tstr-1.ddl --enable-error-stack tstr.h5 TOOLTEST tstr-2.ddl --enable-error-stack tstr2.h5 @@ -1136,7 +1138,7 @@ TOOLTEST tcompact.ddl --enable-error-stack -H -p -d compact tfilters.h5 TOOLTEST tcontiguos.ddl --enable-error-stack -H -p -d contiguous tfilters.h5 # chunked TOOLTEST tchunked.ddl --enable-error-stack -H -p -d chunked tfilters.h5 -# external +# external TOOLTEST texternal.ddl --enable-error-stack -H -p -d external tfilters.h5 # fill values @@ -1205,7 +1207,7 @@ fi # test for displaying objects with very long names TOOLTEST tlonglinks.ddl --enable-error-stack tlonglinks.h5 -# dimensions over 4GB, print boundary +# dimensions over 4GB, print boundary TOOLTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5 # hyperslab read @@ -1213,7 +1215,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # - + # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 @@ -1252,7 +1254,7 @@ IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5 DIFFTEST tbinary.h5 out3D.h5 /integer /integer TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 - + # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then rm -f out[1-4].bin @@ -1260,7 +1262,7 @@ if test -z "$HDF5_NOCLEANUP"; then rm -f out3.h5 fi -# test for dataset region references +# test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 @@ -1306,6 +1308,9 @@ TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 +# test for non-existing file +TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5 + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/testfiles/non_existing.ddl b/tools/testfiles/non_existing.ddl new file mode 100644 index 0000000..4377f8d --- /dev/null +++ b/tools/testfiles/non_existing.ddl @@ -0,0 +1,31 @@ +HDF5 "tgroup.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + } + GROUP "g1.2" { + } + } + GROUP "g2" { + GROUP "g2.1" { + GROUP "g2.1.1" { + } + GROUP "g2.1.2" { + } + GROUP "g2.1.3" { + } + } + } + GROUP "g3" { + GROUP "g3.1" { + } + GROUP "g3.2" { + } + GROUP "g3.3" { + } + GROUP "g3.4" { + } + } +} +} +h5dump error: unable to open file "non_existing.h5" |