Merge pull request #19 in ~VCHOI/my_third_fork from develop to bugfix/HDFFV-10585-investigate-slowness-of-regular

* commit '2456a36f46a15ca44840cb64c7aac213f0ca8bf8': (53 commits)
  Fixed some exit calls.
  Reworked the previously refactorred code.
  Improvement of test code
  Fix CMake build of test needing compression libs
  Fixed error code and error messages Tested on Jelly (very minor)
  Changed H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COOR to H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD per a review comment.
  Add comment to add tests later to verify conflicting values for MPI-specific properties on multiple opens.
  Updated comments
  Updated based on reviews and refactored test code
  Move ext_path field in H5F_t to H5F_shared_t. Remove unused routine H5F_set_coll_md_read().
  Move coll_md_read and coll_md_write fields in H5F_t to H5F_shared_t.
  Fix namespace usage
  Fix EXISTS test syntax
  Update settings
  Add 32-bit cross-compile toolchain
  Code cleanup and refactor
  Re-ordered items w.r.t. date.
  Whitespace and HD prefix changes
  Fixed typo
  Added notes about HDFFV-10677 and HDFFV-10661
  ...
This commit is contained in:
Vailin Choi 2019-09-10 13:27:01 -05:00
commit cf0fb665ac
224 changed files with 26775 additions and 23813 deletions

View File

@ -990,6 +990,7 @@
./test/cache_image.c
./test/cache_logging.c
./test/cache_tagging.c
./test/chunk_info.c
./test/cmpd_dset.c
./test/cork.c
./test/corrupt_stab_msg.h5
@ -3263,6 +3264,7 @@
./java/lib/ext/slf4j-simple-1.7.25.jar
# CMake-specific Files
./config/toolchain/build32.cmake
./config/toolchain/crayle.cmake
./config/toolchain/GCC.cmake
./config/toolchain/intel.cmake

View File

@ -16,7 +16,7 @@ else()
set(_JAVA_HOME_EXPLICIT 1)
else()
set(_CMD_JAVA_HOME "")
if(APPLE AND EXISTS /usr/libexec/java_home)
if(APPLE AND EXISTS "/usr/libexec/java_home")
execute_process(COMMAND /usr/libexec/java_home
OUTPUT_VARIABLE _CMD_JAVA_HOME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

View File

@ -634,7 +634,7 @@ function(add_jar _TARGET_NAME)
)
else ()
# create an empty java_class_filelist
if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
if (NOT EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist")
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
endif()
endif ()

View File

@ -191,16 +191,16 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp2}-${libtype} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
elseif (comp STREQUAL "Java")
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp})
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp})
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
endif ()
endforeach ()

View File

@ -33,11 +33,11 @@ if (NOT TEST_CLASSPATH)
message (STATUS "Require TEST_CLASSPATH to be defined")
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@ -73,7 +73,7 @@ execute_process (
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
@ -123,7 +123,7 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
if (WIN32 OR MINGW)
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
@ -254,7 +254,7 @@ if (TEST_GREP_COMPARE)
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
if (TEST_EXPECT)
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
if (TEST_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")

View File

@ -23,11 +23,11 @@ if (NOT TEST_VFD)
message (FATAL_ERROR "Require TEST_VFD to be defined")
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@ -54,7 +54,7 @@ execute_process (
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err)
if (ERROR_APPEND AND EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}")
endif ()
@ -62,7 +62,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
endif ()

View File

@ -23,11 +23,11 @@ if (NOT TEST_VOL)
message (FATAL_ERROR "Require TEST_VOL to be defined")
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@ -54,7 +54,7 @@ execute_process (
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (ERROR_APPEND AND EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}.out "${TEST_STREAM}")
endif ()
@ -62,7 +62,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM)
message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}")
endif ()

View File

@ -35,11 +35,11 @@ if (NOT TEST_REFERENCE)
message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@ -84,7 +84,7 @@ endif ()
# if the TEST_ERRREF exists grep the error output with the error reference
if (TEST_ERRREF)
# if the .err file exists grep the error output with the error reference before comparing stdout
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
# TEST_ERRREF should always be matched
@ -97,7 +97,7 @@ if (TEST_ERRREF)
#always compare output file to reference unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
if (WIN32 OR MINGW)
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})

View File

@ -27,11 +27,11 @@ if (NOT TEST_EXPECT)
message (STATUS "Require TEST_EXPECT to be defined")
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@ -88,7 +88,7 @@ endif ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
@ -113,7 +113,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
endif ()
@ -125,12 +125,31 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
if (TEST_FIND_RESULT GREATER 0)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
# remove special error output
if (NOT TEST_ERRREF)
# the error stack has been appended to the output file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
else ()
# the error stack remains in the .err file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif ()
string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
# write back the changes to the original files
if (NOT TEST_ERRREF)
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
else ()
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
endif ()
endif ()
# if the output file needs Storage text removed
if (TEST_MASK)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
@ -185,7 +204,7 @@ endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
if (WIN32 OR MINGW)
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})

View File

@ -0,0 +1,39 @@
if (WIN32)
set (CMAKE_SYSTEM_NAME Windows)
set (CMAKE_GENERATOR_PLATFORM "x86")
elseif(APPLE)
set (CMAKE_OSX_ARCHITECTURES "i386")
else ()
set (CMAKE_SYSTEM_NAME Linux)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set (LIB32 /usr/lib) # Fedora
if (EXISTS "/usr/lib32")
set (LIB32 /usr/lib32) # Arch, Solus
endif ()
set (CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
set (CMAKE_LIBRARY_PATH ${LIB32} CACHE STRING "library search path" FORCE)
# this is probably unlikely to be needed, but just in case
set (CMAKE_EXE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "executable linker flags" FORCE)
set (CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
set (CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags" FORCE)
# on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
# to include the regular system .pc files as well (at the end), because some
# are not always present in the 32 bit directory
if (EXISTS "${LIB32}/pkgconfig")
set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
endif ()
# where is the target environment
set (CMAKE_FIND_ROOT_PATH ${LIB32})
# search for programs in the build host directories
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif ()

View File

@ -2877,6 +2877,11 @@ else
ROS3_VFD=no
fi
## Read-only S3 files are not built if not required.
AM_CONDITIONAL([ROS3_VFD_CONDITIONAL], [test "X$ROS3_VFD" = "Xyes"])
## ----------------------------------------------------------------------
## Is libhdfs (Hadoop Distributed File System) present?
## It might be specified with the `--with-libhdfs' command-line switch.

View File

@ -36,22 +36,22 @@ int main(void)
}
else {
num_errors += BasicTest();
num_errors += BasicTest();
num_errors += TestCompoundDatatype();
num_errors += TestCompoundDatatype();
num_errors += TestGetPacket();
num_errors += TestGetPacket();
num_errors += TestGetNext();
num_errors += TestGetNext();
num_errors += TestCompress();
num_errors += TestCompress();
num_errors += TestErrors();
num_errors += TestErrors();
num_errors += SystemTest();
num_errors += SystemTest();
/* Test data corruption in packed structs */
num_errors += TestHDFFV_9758();
/* Test data corruption in packed structs */
num_errors += TestHDFFV_9758();
/* Terminate access to the file. */
err = H5Fclose(fileID);
@ -81,7 +81,8 @@ int BasicTest()
hsize_t count;
int error;
TESTING("basic functionality")
printf("Testing %-62s", "basic functionality");
HDfflush(stdout);
FL_PacketTable wrapper(fileID, H5P_DEFAULT, BASICTEST_PT, H5T_NATIVE_INT, 1);
if(! wrapper.IsValid())
@ -137,7 +138,8 @@ int TestCompoundDatatype()
hsize_t count;
int error;
TESTING("compound datatypes")
printf("Testing %-62s", "compound datatypes");
HDfflush(stdout);
/* Create compound datatype */
typedef struct compoundType
@ -206,7 +208,8 @@ int TestGetNext()
int records[2];
int i;
TESTING("GetNextPacket")
printf("Testing %-62s", "GetNextPacket");
HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, H5P_DEFAULT, GETNEXT_PT, H5T_NATIVE_INT, 500);
@ -268,20 +271,21 @@ int TestCompress()
unsigned int config = 0;
size_t cd_nelemts = 0;
TESTING("compression")
printf("Testing %-62s", "compression");
HDfflush(stdout);
#ifdef H5_HAVE_FILTER_DEFLATE
try {
/* Prepare property list to set compression, randomly use deflate */
DSetCreatPropList dscreatplist;
dscreatplist.setDeflate(6);
/* Prepare property list to set compression, randomly use deflate */
DSetCreatPropList dscreatplist;
dscreatplist.setDeflate(6);
/* Create packet table with compression. */
FL_PacketTable wrapper(fileID, COMPRESS_PT, H5T_NATIVE_CHAR, 100, dscreatplist.getId());
/* Close the property list */
dscreatplist.close();
/* Close the property list */
dscreatplist.close();
/* Verify that the deflate filter is set */
/* Verify that the deflate filter is set */
/* Create an HDF5 C++ file object */
H5File file;
@ -293,10 +297,10 @@ int TestCompress()
DSetCreatPropList dcpl = dset.getCreatePlist();
char filter_name[8];
char filter_name[8];
dcpl.getFilterById(H5Z_FILTER_DEFLATE, flags, cd_nelemts, NULL, 8, filter_name, config);
if (HDstrncmp(filter_name, "deflate", 7) != 0)
H5_FAILED()
if (HDstrncmp(filter_name, "deflate", 7) != 0)
H5_FAILED()
} catch (Exception e) {
H5_FAILED();
return 1;
@ -304,7 +308,7 @@ int TestCompress()
PASSED();
#else
SKIPPED();
puts(" deflate filter not enabled");
HDputs(" deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
return 0;
}
@ -315,7 +319,8 @@ int TestGetPacket()
int record;
int theRecs[3];
int i;
TESTING("GetPacket")
printf("Testing %-62s", "GetPacket");
HDfflush(stdout);
/* Create a dataset. Does not need to specify property list because
there is no compression. */
@ -353,7 +358,8 @@ const char* PT_TESTERROR = "/TestErrors";
int TestErrors()
{
TESTING("error conditions")
printf("Testing %-62s", "error conditions");
HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, PT_TESTERROR, H5T_NATIVE_INT, 1);
@ -464,7 +470,8 @@ const char* PT_SYSTEMTST1 = "/SystemTest1";
const char* PT_SYSTEMTST2 = "/SystemTest2";
int SystemTest()
{
TESTING("multiple datatypes")
printf("Testing %-62s", "multiple datatypes");
HDfflush(stdout);
hid_t dtypeID1, dtypeID2;
hsize_t count;
@ -560,16 +567,16 @@ error:
/*-------------------------------------------------------------------------
* TestHDFFV_9758(): Test that a packet table with compound datatype which
* contains string type can be created and written correctly. (HDFFV-9758)
* contains string type can be created and written correctly. (HDFFV-9758)
*
* Notes:
* Previously, data of the field that follows the string was read back
* as garbage when #pragma pack(1) is used.
* Previously, data of the field that follows the string was read back
* as garbage when #pragma pack(1) is used.
* 2016/10/20 -BMR
* Updated:
* #pragma pack(1) caused failure on Emu because Sparc cannot
* access misaligned data. Changed it to pack() to do the
* default alignment.
* #pragma pack(1) caused failure on Emu because Sparc cannot
* access misaligned data. Changed it to pack() to do the
* default alignment.
* 2016/10/25 -BMR
*-------------------------------------------------------------------------
*/
@ -592,57 +599,58 @@ int TestHDFFV_9758()
};
s1_t s1[NUM_PACKETS];
for (hsize_t i = 0; i < NUM_PACKETS; i++)
{
s1[i].a = i;
s1[i].b = 1.f * static_cast<float>(i * i);
s1[i].c = 1. / (i + 1);
sprintf(s1[i].d, "string%d", (int)i);
HDsprintf(s1[i].d, "string%d", (int)i);
s1[i].e = 100+i;
}
TESTING("data corruption in packed structs (HDFFV-9758)")
printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)");
HDfflush(stdout);
// Build a compound datatype
compound_type = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
if (compound_type < 0)
goto error;
goto error;
err = H5Tinsert(compound_type, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
if (err < 0)
goto error;
goto error;
err = H5Tinsert(compound_type, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
if (err < 0)
goto error;
goto error;
err = H5Tinsert(compound_type, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
if (err < 0)
goto error;
goto error;
strtype = H5Tcopy (H5T_C_S1);
if (compound_type < 0)
goto error;
goto error;
err = H5Tset_size (strtype, STRING_LENGTH); /* create string */
if (err < 0)
goto error;
goto error;
err = H5Tinsert(compound_type, "d_name", HOFFSET(s1_t, d), strtype);
if (err < 0)
goto error;
goto error;
err = H5Tinsert(compound_type, "e_name", HOFFSET(s1_t, e), H5T_NATIVE_INT);
if (err < 0)
goto error;
goto error;
{ // so ptable will go out of scope before PASSED
// Create a packet table
FL_PacketTable ptable(fileID, "/examplePacketTable", compound_type, 1);
if (!ptable.IsValid())
goto error;
goto error;
// Add packets to the table
for (size_t i = 0; i < NUM_PACKETS; i++)
{
/* Appends one packet at the current position */
/* Appends one packet at the current position */
err = ptable.AppendPacket(s1 + i);
if (err < 0) goto error;
}
@ -650,11 +658,11 @@ int TestHDFFV_9758()
// Check packet count
const hsize_t count = ptable.GetPacketCount(err);
if (err < 0)
goto error;
goto error;
if (count != NUM_PACKETS)
{
std::cerr
std::cerr
<< "Number of packets in packet table should be " << NUM_PACKETS
<< " but is " << count << endl;
}
@ -663,16 +671,16 @@ int TestHDFFV_9758()
ptable.ResetIndex();
for (size_t i = 0; i < NUM_PACKETS; i++)
{
s1_t s2;
memset(&s2, 0, sizeof(s1_t));
err = ptable.GetNextPacket(&s2);
if (err < 0)
goto error;
s1_t s2;
HDmemset(&s2, 0, sizeof(s1_t));
err = ptable.GetNextPacket(&s2);
if (err < 0)
goto error;
if (s2.a != s1[i].a || s2.e != s1[i].e)
goto error;
else if (HDstrcmp(s2.d, s1[i].d))
goto error;
if (s2.a != s1[i].a || s2.e != s1[i].e)
goto error;
else if (HDstrcmp(s2.d, s1[i].d))
goto error;
}
} // end of ptable block

View File

@ -21,9 +21,9 @@
#ifndef PTABLETEST
#define PTABLETEST
#include "h5hltest.h"
#include "H5PacketTable.h"
#include "H5Cpp.h"
#include "h5hltest.h"
static hid_t fileID;

View File

@ -79,12 +79,12 @@ int main(int argc , char **argv)
if (argc < 2) {
printf("Usage: gen_test [le | be]\n");
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
if ( argv[1] && (strcmp("le",argv[1])!=0) && (strcmp("be",argv[1])!=0) ) {
printf("Usage: gen_test [le | be]\n");
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
@ -103,11 +103,11 @@ int main(int argc , char **argv)
nerrors += test_long_scalenames(filename) < 0 ? 1 : 0;
if(nerrors) goto error;
printf("Dimension scales file generation passed.\n");
HDprintf("Dimension scales file generation passed.\n");
return 0;
error:
printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
return 1;
}
@ -188,11 +188,11 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
if(H5DSis_attached(did, dsid, idx) == 0) {
if(H5DSattach_scale(did, dsid, idx) >= 0) {
if(H5DSis_attached(did, dsid, idx) > 0) {
/* printf(" scale attached "); */
/* HDprintf(" scale attached "); */
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
printf(" scale not attached ");
HDprintf(" scale not attached ");
}
}
}
@ -281,7 +281,7 @@ static int test_long_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al");
TESTING2("test_long_attachscales");
HL_TESTING2("test_long_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@ -342,7 +342,7 @@ static int test_duplicatelong_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al2");
TESTING2("test_duplicatelong_attachscales");
HL_TESTING2("test_duplicatelong_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@ -406,7 +406,7 @@ static int test_long_scalenames(const char *filename) {
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
TESTING2("set long scale/cmp scale name");
HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@ -483,7 +483,7 @@ static int test_samelong_scalenames(const char *filename) {
if((fid = open_test_file(filename)) < 0)
goto out;
TESTING2("set same long scale/cmp scale name");
HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@ -554,7 +554,7 @@ static int test_foreign_scaleattached(const char *filename)
hid_t did = -1;
hid_t dsid = -1;
TESTING2("test_foreign_scaleattached");
HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;

View File

@ -28,8 +28,8 @@
#include "H5HLprivate2.h"
/* Macros used in HL tests */
#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
#define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);}
#define HL_TESTING2(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
#define HL_TESTING3(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0)

View File

@ -1049,7 +1049,7 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
printf(" scale not attached ");
HDprintf(" scale not attached ");
}
}
}
@ -1146,21 +1146,21 @@ static int test_detachscales(void)
and detach them to check that at the end there is no attributes
REFERENCE_LIST on a dimension scale and DIMENSION_LIST on a dataset */
TESTING2("test_detachscales");
HL_TESTING2("test_detachscales");
if((fid = H5Fcreate("test_detach.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* make datasets; they are three dimensional*/
for (i=0; i < 2; i++) {
sprintf(dname,"D%d", i);
HDsprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
sprintf(dname, "DS%d", i);
HDsprintf(dname, "DS%d", i);
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
@ -1280,7 +1280,7 @@ static int test_char_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
TESTING2("test_char_attachscales");
HL_TESTING2("test_char_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1333,7 +1333,7 @@ static int test_short_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
TESTING2("test_short_attachscales");
HL_TESTING2("test_short_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1410,7 +1410,7 @@ static int test_int_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
TESTING2("test_int_attachscales");
HL_TESTING2("test_int_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1471,7 +1471,7 @@ static int test_long_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
TESTING2("test_long_attachscales");
HL_TESTING2("test_long_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1528,7 +1528,7 @@ static int test_duplicatelong_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
TESTING2("test_duplicatelong_attachscales");
HL_TESTING2("test_duplicatelong_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1585,7 +1585,7 @@ static int test_float_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
TESTING2("test_float_attachscales");
HL_TESTING2("test_float_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1647,7 +1647,7 @@ static int test_numberofscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
TESTING2("test_numberofscales");
HL_TESTING2("test_numberofscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@ -1729,7 +1729,7 @@ static int test_char_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set char scale/cmp scale name");
HL_TESTING2("set char scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
@ -1789,7 +1789,7 @@ static int test_short_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set short scale/cmp scale name");
HL_TESTING2("set short scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
@ -1897,7 +1897,7 @@ static int test_int_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set int scale/cmp scale name");
HL_TESTING2("set int scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
@ -1973,7 +1973,7 @@ static int test_long_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set long scale/cmp scale name");
HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
@ -2041,7 +2041,7 @@ static int test_samelong_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set same long scale/cmp scale name");
HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
@ -2109,7 +2109,7 @@ static int test_float_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set float scale/cmp scale name");
HL_TESTING2("set float scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
@ -2181,7 +2181,7 @@ static int test_foreign_scaleattached(const char *fileforeign)
hid_t dsid = -1;
const char *filename = H5_get_srcdir_filename(fileforeign);
TESTING2("test_foreign_scaleattached");
HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
@ -2255,7 +2255,7 @@ static int test_simple(void)
char snames[3];
int i, j;
printf("Testing API functions\n");
HDprintf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -2426,7 +2426,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
TESTING2("detach scales ");
HL_TESTING2("detach scales ");
/*-------------------------------------------------------------------------
@ -2919,7 +2919,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
sprintf(sname, "ds_%d", j);
HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, DIM0) < 0)
@ -2942,7 +2942,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
sprintf(sname,"ds_%d",j);
HDsprintf(sname,"ds_%d",j);
if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,DIM0) < 0)
@ -3013,7 +3013,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
TESTING2("set/get label");
HL_TESTING2("set/get label");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@ -3103,7 +3103,7 @@ static int test_simple(void)
*/
TESTING2("set scale/get scale name");
HL_TESTING2("set scale/get scale name");
if((dsid = H5Dopen2(fid,"ds_a_1", H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"Latitude set 0") < 0)
@ -3205,7 +3205,7 @@ static int test_simple(void)
*/
TESTING2("iterate scales");
HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@ -3740,7 +3740,7 @@ static int test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9,3};
printf("Testing error conditions\n");
HDprintf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@ -3771,7 +3771,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach a dataset to itself");
HL_TESTING2("attach a dataset to itself");
if(H5DSattach_scale(did, did, 0) == SUCCEED)
goto out;
@ -3782,7 +3782,7 @@ static int test_errors(void)
* attempt to attach a group with a dataset, it should fail
*-------------------------------------------------------------------------
*/
TESTING2("attach a group with a dataset");
HL_TESTING2("attach a group with a dataset");
if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
goto out;
@ -3793,7 +3793,7 @@ static int test_errors(void)
* attempt to attach a dataset with a group, it should fail
*-------------------------------------------------------------------------
*/
TESTING2("attach a dataset with a group");
HL_TESTING2("attach a dataset with a group");
if(H5DSattach_scale(did,gid,0)==SUCCEED)
goto out;
@ -3804,7 +3804,7 @@ static int test_errors(void)
* attempt to set scale for a group, it should fail
*-------------------------------------------------------------------------
*/
TESTING2("set scale for a group");
HL_TESTING2("set scale for a group");
if(H5DSset_scale(gid,"scale 1")==SUCCEED)
goto out;
@ -3834,7 +3834,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach a scale that has scales");
HL_TESTING2("attach a scale that has scales");
/* create the data space for the scale */
if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
@ -3903,7 +3903,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach to a dataset that is a scale");
HL_TESTING2("attach to a dataset that is a scale");
/* open the previous written "ds_b", that is a scale */
if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
@ -3930,7 +3930,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach to a dataset that is a reserved class dataset");
HL_TESTING2("attach to a dataset that is a reserved class dataset");
/* make an image */
if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
@ -3965,7 +3965,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("is scale");
HL_TESTING2("is scale");
/* open a non scale dataset */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -3999,7 +3999,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("detach scale from dataset it is not attached to");
HL_TESTING2("detach scale from dataset it is not attached to");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@ -4027,7 +4027,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("detach scale from group");
HL_TESTING2("detach scale from group");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@ -4055,7 +4055,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
TESTING2("detach scale when scale is group");
HL_TESTING2("detach scale when scale is group");
/* open the previous written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -4119,7 +4119,7 @@ static int test_iterators(void)
char dname[30]; /* dataset name */
int i;
printf("Testing iterators\n");
HDprintf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@ -4147,7 +4147,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
TESTING2("iterate when the dataset has no scales ");
HL_TESTING2("iterate when the dataset has no scales ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -4169,7 +4169,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
TESTING2("iterate on dimension that is outside the rank ");
HL_TESTING2("iterate on dimension that is outside the rank ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -4190,7 +4190,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
TESTING2("iterate for dimension with many scales ");
HL_TESTING2("iterate for dimension with many scales ");
/* open the previously written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -4198,7 +4198,7 @@ static int test_iterators(void)
for(i=0; i<100; i++) {
/* make a DS */
sprintf(dname,"ds_%d",i);
HDsprintf(dname,"ds_%d",i);
if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
goto out;
/* open */
@ -4227,7 +4227,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
TESTING2("iterate on group ");
HL_TESTING2("iterate on group ");
/* open */
if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
@ -4249,7 +4249,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
TESTING2("iterate in deleted scales ");
HL_TESTING2("iterate in deleted scales ");
if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
goto out;
@ -4311,7 +4311,7 @@ static int test_rank(void)
float buff[1]={1};
int i;
printf("Testing ranks\n");
HDprintf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@ -4343,13 +4343,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach");
HL_TESTING2("attach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
@ -4371,13 +4371,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
TESTING2("detach");
HL_TESTING2("detach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
@ -4397,13 +4397,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach, set, get names, labels");
HL_TESTING2("attach, set, get names, labels");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,name) < 0)
@ -4436,7 +4436,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
TESTING2("attach a scalar scale");
HL_TESTING2("attach a scalar scale");
/* create the data space for the dataset */
if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
@ -4517,7 +4517,7 @@ static int test_types(void)
const char *s1_str = "ABC";
const char *s2_str = "ABCD";
printf("Testing scales with several datatypes\n");
HDprintf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -4549,7 +4549,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
TESTING2("floating point and short scales");
HL_TESTING2("floating point and short scales");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@ -4612,7 +4612,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
TESTING2("string scales");
HL_TESTING2("string scales");
/* get the dataset id for "dset_b" */
if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
@ -4694,7 +4694,7 @@ static int test_data(void)
float fill=-99; /* fill value */
printf("Testing reading ASCII data and generate HDF5 data with scales\n");
HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -4709,7 +4709,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
TESTING2("generating scales");
HL_TESTING2("generating scales");
/*-------------------------------------------------------------------------
* create datasets: 1 "data" dataset and 2 dimension scales
@ -4870,7 +4870,7 @@ static int read_data( const char* fname,
/* read first data file */
f = HDfopen(data_file, "r");
if( f == NULL ) {
printf( "Could not open file %s\n", data_file );
HDprintf( "Could not open file %s\n", data_file );
return -1;
}
@ -4892,7 +4892,7 @@ static int read_data( const char* fname,
*buf = (float*) HDmalloc (nelms * sizeof( float ));
if ( *buf == NULL ) {
printf( "memory allocation failed\n" );
HDprintf( "memory allocation failed\n" );
HDfclose(f);
return -1;
}
@ -4930,7 +4930,7 @@ static int test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
printf("Testing parameter errors\n");
HDprintf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@ -4954,7 +4954,7 @@ static int test_errors2(void)
goto out;
TESTING2("attach scales");
HL_TESTING2("attach scales");
/*-------------------------------------------------------------------------
@ -4977,7 +4977,7 @@ static int test_errors2(void)
PASSED();
TESTING2("detach scales");
HL_TESTING2("detach scales");
/*-------------------------------------------------------------------------
* detach with invalid indices
@ -4998,7 +4998,7 @@ static int test_errors2(void)
PASSED();
TESTING2("set/get label");
HL_TESTING2("set/get label");
/*-------------------------------------------------------------------------
* set/get label invalid indices
@ -5023,7 +5023,7 @@ static int test_errors2(void)
PASSED();
TESTING2("iterate scales");
HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@ -5122,7 +5122,7 @@ static int test_attach_detach(void)
hid_t var1_id, var2_id, var3_id; /* DS component name */
hsize_t dims[RANK1] = {DIM1};
TESTING2("permutations of attaching and detaching");
HL_TESTING2("permutations of attaching and detaching");
if((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;

View File

@ -18,7 +18,7 @@
#include "h5hltest.h"
#include "H5DOpublic.h"
#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER)
#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER)
# define H5_ZLIB_HEADER "zlib.h"
#endif
#if defined(H5_ZLIB_HEADER)
@ -64,22 +64,22 @@ test_dataset_append_notset(hid_t fid)
int i, j; /* Local index variables */
h5_stat_t sb1, sb2; /* File info */
TESTING("Append flush with H5DOappend()--append rows with default dapl");
HL_TESTING2("Append flush with H5DOappend()--append rows with default dapl");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
/* Append 6 rows to the dataset */
@ -104,7 +104,7 @@ test_dataset_append_notset(hid_t fid)
TEST_ERROR;
/* File size before flushing should be less */
if(sb1.st_size > sb2.st_size)
if(sb1.st_size > sb2.st_size)
TEST_ERROR;
/* Closing */
@ -183,28 +183,28 @@ test_dataset_append_rows_columns(hid_t fid)
int i, j; /* Local index variables */
TESTING("Append flush with H5DOappend()--append rows & columns");
HL_TESTING2("Append flush with H5DOappend()--append rows & columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@ -246,7 +246,7 @@ test_dataset_append_rows_columns(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@ -336,28 +336,28 @@ test_dataset_append_rows(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append rows");
HL_TESTING2("Append flush with H5DOappend()--append rows");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@ -380,7 +380,7 @@ test_dataset_append_rows(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 10; j++)
@ -470,28 +470,28 @@ test_dataset_append_columns(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append columns");
HL_TESTING2("Append flush with H5DOappend()--append columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 3 columns to the dataset */
@ -515,7 +515,7 @@ test_dataset_append_columns(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 3; j++)
@ -614,28 +614,28 @@ test_dataset_append_BUG1(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append rows & columns--BUG1");
HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG1");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@ -677,7 +677,7 @@ test_dataset_append_BUG1(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@ -775,28 +775,28 @@ test_dataset_append_BUG2(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append rows & columns--BUG2");
HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG2");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@ -839,7 +839,7 @@ test_dataset_append_BUG2(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@ -930,28 +930,28 @@ test_dataset_append_less(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append size < boundary size");
HL_TESTING2("Append flush with H5DOappend()--append size < boundary size");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append to the dataset 2 rows at a time for 3 times */
@ -996,7 +996,7 @@ test_dataset_append_less(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@ -1057,7 +1057,7 @@ error:
*
* Purpose: Verify that the object flush property and the append flush property
* are working properly when appending rows and columns to an
* extendible dataset where
* extendible dataset where
* row: the append size is 3 times of the boundary size
* the append callback/flush is performed on the 1st boundary hit
* column: the boundary is greater than the append size
@ -1090,28 +1090,28 @@ test_dataset_append_vary(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
TESTING("Append flush with H5DOappend()--append & boundary size vary");
HL_TESTING2("Append flush with H5DOappend()--append & boundary size vary");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset, once */
@ -1151,7 +1151,7 @@ test_dataset_append_vary(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@ -1227,7 +1227,7 @@ int main(void)
int nerrors = 0; /* The # of errors encountered */
/* Get a copy of file access property list */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
/* Set to use the latest library format */

View File

@ -44,10 +44,10 @@
extend the image, and then performs writes that extend the images. The fifth
loop reads the extended images and verify that the content are correct. The
sixth and final loop closes the file images and deallocates the image
buffers if appropriate. */
buffers if appropriate. */
/*-------------------------------------------------------------------------
* test file image operations
* test file image operations
*-------------------------------------------------------------------------
*/
static int
@ -67,11 +67,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
void **buf_ptr; /* pointer to array of pointers to image buffers */
char **filename; /* pointer to array of pointers to filenames */
unsigned *input_flags; /* pointer to array of flag combinations */
size_t i, j, k, nrow, n_values;
size_t i, j, k, nrow, n_values;
herr_t status1;
void *handle_ptr = NULL; /* pointers to driver buffer */
unsigned char **core_buf_ptr_ptr = NULL;
unsigned char **core_buf_ptr_ptr = NULL;
VERIFY(open_images > 1 , "The number of open images must be greater than 1");
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
@ -100,7 +100,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
TESTING("get file images");
HL_TESTING2("get file images");
/* create several file images */
for (i = 0; i < open_images; i++) {
@ -112,17 +112,17 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
filename[i] = (char *)HDmalloc(sizeof(char) * 32);
/* create file name */
sprintf(filename[i], "image_file%d.h5", (int)i);
HDsprintf(filename[i], "image_file%d.h5", (int)i);
/* create file */
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Fcreate() failed");
/* define dataspace for the dataset */
if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
/* define dataspace for the dataset */
if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
FAIL_PUTS_ERROR("H5Screate_simple() failed");
/* create dataset property list */
/* create dataset property list */
if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_PUTS_ERROR("H5Pcreate() failed");
@ -133,8 +133,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* create and write an integer type dataset named "dset" */
if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dcreate() failed");
/* dataset in open image 1 is written with "wrong" data */
/* dataset in open image 1 is written with "wrong" data */
if (i == 1) {
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
@ -144,7 +144,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
} /* end else */
/* flush into the file */
if (H5Fflush(file_id[i], H5F_SCOPE_LOCAL) < 0)
FAIL_PUTS_ERROR("H5Fflush() failed");
@ -152,7 +152,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* close dataset property list */
if (H5Pclose(plist) < 0)
FAIL_PUTS_ERROR("H5Pclose() failed");
/* close dataspace */
if (H5Sclose(file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@ -172,7 +172,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* buffer for file image 2 is filled with counter data (non-valid image) */
if (i == 2) {
for (j = 0; j < (size_t)buf_size[i]; j++)
((char*)(buf_ptr[i]))[j] = (char)j;
((char*)(buf_ptr[i]))[j] = (char)j;
} /* end if */
/* buffers for the rest of the file images are filled with data from the respective files */
else {
@ -187,14 +187,14 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
TESTING("open file images and check image copies");
/* open the file images with the core driver for data access */
HL_TESTING2("open file images and check image copies");
/* open the file images with the core driver for data access */
for (i = 0; i < open_images; i++) {
/* open file image 2 filled with counter data (non-valid image) */
if (i == 2) {
H5E_BEGIN_TRY {
/* attempt to set file image in the core driver */
/* attempt to set file image in the core driver */
file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i]);
} H5E_END_TRY
@ -202,7 +202,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
} /* end if */
/* open rest of valid file images */
else {
/* set file image in the core driver */
/* set file image in the core driver */
if ((file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i])) < 0)
FAIL_PUTS_ERROR("H5LTopen_file_image() failed");
@ -218,7 +218,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
else
VERIFY(*core_buf_ptr_ptr != buf_ptr[i], "vfd buffer and user buffer should be different");
/*
/*
* When the vfd and user buffers are different and H5LT_FILE_IMAGE_OPEN_RW is enabled,
* status_flags in the superblock needs to be cleared in the vfd buffer for
* the comparison to proceed as expected. The user buffer as returned from H5Fget_file_image()
@ -249,7 +249,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
TESTING("read file images");
HL_TESTING2("read file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@ -259,7 +259,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
continue;
} /* end if */
/* open dataset in file image */
/* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@ -274,8 +274,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
/* compute number of elements in dataset */
/* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@ -297,15 +297,15 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (data3[j * nrow + k ] != data1[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
} /* end else */
/* close dataspace */
/* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
} /* end for */
PASSED();
PASSED();
TESTING("write and extend file images");
HL_TESTING2("write and extend file images");
/* write open file images and verify data */
for (i = 0; i < open_images; i++) {
@ -365,7 +365,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
hid_t attr_space_id = -1;
hid_t attr_id = -1;
herr_t status2;
size_t l;
size_t l;
if ((attr_space_id = H5Screate_simple(attr_rank, attr_dims, attr_dims)) < 0)
FAIL_PUTS_ERROR("attr_space H5Screate_simple() failed");
@ -396,9 +396,9 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
H5Aclose(attr_id);
} H5E_END_TRY;
#endif
if (H5Dclose(dset_id[i]) < 0)
FAIL_PUTS_ERROR("H5Dclose() failed");
dset_id[i] = -1;
if (H5Dclose(dset_id[i]) < 0)
FAIL_PUTS_ERROR("H5Dclose() failed");
dset_id[i] = -1;
} /* end if */
else {
/* write dataset without extending it */
@ -422,7 +422,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
TESTING("read extended file images");
HL_TESTING2("read extended file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@ -430,7 +430,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((dset_id[i] < 0) || (file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
continue;
/* open dataset in file image */
/* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@ -445,8 +445,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
/* compute number of elements in dataset */
/* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@ -457,8 +457,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
for (k = 0; k < nrow; k++)
if (data3[j * nrow + k ] != data4[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
/* close dataspace */
/* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@ -469,7 +469,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED()
TESTING("close file images");
HL_TESTING2("close file images");
/* close file images and release buffer if appropriate */
for (i = 0; i < open_images; i++) {
@ -489,7 +489,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
HDfree(buf_ptr[i]);
} /* end if */
} /* end for */
/* release temporary working buffers */
@ -521,8 +521,8 @@ int main( void )
size_t open_images = 10; /* number of open file images */
size_t nflags = 8; /* number of flag combinations */
unsigned flags[8]; /* array with flag combinations */
/* set flag combinations for testing */
/* set flag combinations for testing */
flags[0] = 0;
flags[1] = H5LT_FILE_IMAGE_DONT_RELEASE;
flags[2] = H5LT_FILE_IMAGE_DONT_COPY;
@ -536,11 +536,11 @@ int main( void )
nerrors += test_file_image(open_images, nflags, flags) < 0? 1 : 0;
if (nerrors) goto error;
printf("File image tests passed.\n");
HDprintf("File image tests passed.\n");
return 0;
error:
printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}

View File

@ -26,14 +26,14 @@
#define NX 8
#define CHUNK_NX 4
/*-------------------------------------------------------------------------
* Function: test_direct_chunk_write
* Function: test_direct_chunk_write
*
* Purpose: Test the basic functionality of H5DOwrite_chunk
* Purpose: Test the basic functionality of H5DOwrite_chunk
*
* Return: Success: An identifer for the dataset used in the tests
* Failure: H5I_INVALID_HID
* Return: Success: An identifer for the dataset used in the tests
* Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@ -65,7 +65,7 @@ create_dataset(hid_t fid)
/* Initialize the data */
for (i = 0; i < NX; i++)
data[i] = i;
data[i] = i;
/* Write the initialized data */
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
@ -91,14 +91,14 @@ create_dataset(hid_t fid)
} /* end create_dataset() */
/*-------------------------------------------------------------------------
* Function: test_direct_chunk_write
* Function: test_direct_chunk_write
*
* Purpose: Test the basic functionality of H5DOwrite_chunk
* Purpose: Test the basic functionality of H5DOwrite_chunk
*
* Return: Success: 0
* Failure: 1
* Return: Success: 0
* Failure: 1
*
*-------------------------------------------------------------------------
*/
@ -111,7 +111,7 @@ test_direct_chunk_write(hid_t did)
size_t data_size;
int i;
TESTING("H5DOwrite_chunk wrapper");
HL_TESTING2("H5DOwrite_chunk wrapper");
/* Set the size of the chunk data */
data_size = CHUNK_NX * sizeof(int);
@ -120,9 +120,9 @@ test_direct_chunk_write(hid_t did)
for (i = 0; i < CHUNK_NX; i++)
chunk_data[i] = (i * 10) + i;
/* Write the direct chunk data repeatedly to cover all the chunks in the
/* Write the direct chunk data repeatedly to cover all the chunks in the
* dataset, using the direct writing function.
*/
*/
offset[0] = 0;
for (i = 0; i < NX/CHUNK_NX; i++) {
if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, data_size, chunk_data) < 0)
@ -138,14 +138,14 @@ error:
return 1;
} /* test_direct_chunk_write() */
/*-------------------------------------------------------------------------
* Function: test_direct_chunk_read
* Function: test_direct_chunk_read
*
* Purpose: Test the basic functionality of H5DOread_chunk
* Purpose: Test the basic functionality of H5DOread_chunk
*
* Return: Success: 0
* Failure: 1
* Return: Success: 0
* Failure: 1
*
*-------------------------------------------------------------------------
*/
@ -169,7 +169,7 @@ test_direct_chunk_read(hid_t did)
int i,j;
TESTING("H5DOread_chunk wrapper");
HL_TESTING2("H5DOread_chunk wrapper");
/* Create dataspaces for reading */
if ((mem_sid = H5Screate_simple(1, chunk_dims, NULL)) < 0)
@ -232,15 +232,15 @@ error:
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/*-------------------------------------------------------------------------
* Function: main
* Function: main
*
* Purpose: Test direct chunk write function H5DOwrite_chunk and
* Purpose: Test direct chunk write function H5DOwrite_chunk and
* chunk direct read function H5DOread_chunk
*
* Return: Success: 0
* Failure: 1
* Return: Success: 0
* Failure: 1
*
*-------------------------------------------------------------------------
*/

View File

@ -75,11 +75,11 @@ int main(void)
nerrors += test_generate()<0 ?1:0;
if (nerrors) goto error;
printf("All image tests passed.\n");
HDprintf("All image tests passed.\n");
return 0;
error:
printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@ -169,7 +169,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
TESTING("indexed image");
HL_TESTING2("indexed image");
/* Write image */
if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf1 ) < 0 )
@ -205,7 +205,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
TESTING("true color image");
HL_TESTING2("true color image");
/* Write image */
if ( H5IMmake_image_24bit( fid, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", buf2 ) )
@ -232,7 +232,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
TESTING("pallete functions");
HL_TESTING2("pallete functions");
if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 )
goto out;
@ -344,14 +344,14 @@ static int test_data(void)
if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
printf("Testing read ascii image data and generate images\n");
HDprintf("Testing read ascii image data and generate images\n");
/*-------------------------------------------------------------------------
* read 8bit image data
*-------------------------------------------------------------------------
*/
TESTING2("make indexed image");
HL_TESTING2("make indexed image");
/* read first data file */
if (read_data(DATA_FILE1,&width,&height)<0)
@ -364,7 +364,7 @@ static int test_data(void)
PASSED();
TESTING2("attaching palettes");
HL_TESTING2("attaching palettes");
/*-------------------------------------------------------------------------
* palette #1. rainbow palette. data is contained in "pal_rgb.h"
@ -464,7 +464,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
TESTING2("make true color image with pixel interlace");
HL_TESTING2("make true color image with pixel interlace");
/* read second data file */
if ((read_data(DATA_FILE2,&width,&height))<0)
@ -481,7 +481,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
TESTING2("make true color image with plane interlace");
HL_TESTING2("make true color image with plane interlace");
/* read third data file */
if ((read_data(DATA_FILE3,&width,&height))<0)
@ -551,7 +551,7 @@ static int test_generate(void)
if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
printf("Testing read and process data and make indexed images\n");
HDprintf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
* read data; the file data format is described below
@ -561,7 +561,7 @@ static int test_generate(void)
f = HDfopen( data_file, "r" ) ;
if ( f == NULL )
{
printf( "Could not find file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not find file %s. Try set $srcdir \n", data_file );
goto out;
}
@ -602,11 +602,11 @@ static int test_generate(void)
if(fscanf( f, "%d %d %d", &imax, &jmax, &kmax ) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf( f, "%f %f %f", &valex, &xmin, &xmax ) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@ -627,7 +627,7 @@ static int test_generate(void)
goto out;
if(n_elements > INT_MAX / (int)sizeof(float))
goto out;
data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
if(NULL == data)
goto out;
@ -638,7 +638,7 @@ static int test_generate(void)
for ( i = 0; i < n_elements; i++ )
{
if(fscanf( f, "%f ", &value ) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
data[i] = value;
@ -652,7 +652,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
TESTING2("make indexed image from all the data");
HL_TESTING2("make indexed image from all the data");
for ( i = 0; i < n_elements; i++ )
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
@ -669,7 +669,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
TESTING2("make indexed image from land data");
HL_TESTING2("make indexed image from land data");
for ( i = 0; i < n_elements; i++ )
{
@ -691,7 +691,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
TESTING2("make indexed image from sea data");
HL_TESTING2("make indexed image from sea data");
for ( i = 0; i < n_elements; i++ )
{
@ -712,7 +712,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
TESTING2("attaching palettes");
HL_TESTING2("attaching palettes");
/* make a palette */
if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0)
@ -797,37 +797,37 @@ static int read_data(const char* fname, /*IN*/
*/
if(NULL == (f = HDfopen(data_file, "r"))) {
printf( "Could not open file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
goto out;
}
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%d", &h) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%d", &w) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@ -861,7 +861,7 @@ static int read_data(const char* fname, /*IN*/
/* Read data elements */
for(i = 0; i < n_elements; i++) {
if(fscanf(f, "%d", &n) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
image_data[i] = (unsigned char)n;
@ -870,7 +870,7 @@ static int read_data(const char* fname, /*IN*/
/* Indicate success */
ret_val = 1;
out:
out:
if(f)
HDfclose(f);
@ -917,7 +917,7 @@ static int read_palette(const char* fname,
/* open the input file */
if (!(file = HDfopen(data_file, "r")))
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset");
HL_TESTING2("H5LTmake_dataset");
/* Make dataset */
if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 )
@ -118,7 +118,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTread_dataset");
HL_TESTING2("H5LTread_dataset");
if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 )
goto out;
@ -143,7 +143,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_char");
HL_TESTING2("H5LTmake_dataset_char");
/* Make dataset char */
if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 )
@ -179,7 +179,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_short");
HL_TESTING2("H5LTmake_dataset_short");
/* Make dataset short */
if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 )
@ -214,7 +214,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_int");
HL_TESTING2("H5LTmake_dataset_int");
/* Make dataset int */
if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 )
@ -250,7 +250,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_long");
HL_TESTING2("H5LTmake_dataset_long");
/* Make dataset long */
if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 )
@ -286,7 +286,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_float");
HL_TESTING2("H5LTmake_dataset_float");
/* Make dataset float */
if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 )
@ -322,7 +322,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_double");
HL_TESTING2("H5LTmake_dataset_double");
/* Make dataset double */
if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 )
@ -358,7 +358,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
TESTING("H5LTmake_dataset_string");
HL_TESTING2("H5LTmake_dataset_string");
/* Make dataset string */
if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 )
@ -517,7 +517,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_string");
HL_TESTING2("H5LTset_attribute_string");
/* Set the attribute */
if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 )
@ -530,7 +530,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_string");
HL_TESTING2("H5LTget_attribute_string");
/* Get the attribute */
@ -550,7 +550,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_char");
HL_TESTING2("H5LTset_attribute_char");
/* Set the attribute */
if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 )
@ -563,7 +563,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_char");
HL_TESTING2("H5LTget_attribute_char");
/* Get the attribute */
if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 )
@ -594,7 +594,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_short");
HL_TESTING2("H5LTset_attribute_short");
/* Set the attribute */
if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 )
@ -608,7 +608,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_short");
HL_TESTING2("H5LTget_attribute_short");
/* Get the attribute */
if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 )
@ -640,7 +640,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_int");
HL_TESTING2("H5LTset_attribute_int");
/* Set the attribute */
if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 )
@ -661,7 +661,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_int");
HL_TESTING2("H5LTget_attribute_int");
/* Get the attribute */
if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 )
@ -712,7 +712,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_long");
HL_TESTING2("H5LTset_attribute_long");
/* Set the attribute */
if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 )
@ -725,7 +725,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_long");
HL_TESTING2("H5LTget_attribute_long");
/* Get the attribute */
if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 )
@ -756,7 +756,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_uchar");
HL_TESTING2("H5LTset_attribute_uchar");
/* Set the attribute */
if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 )
@ -769,7 +769,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_uchar");
HL_TESTING2("H5LTget_attribute_uchar");
/* Get the attribute */
if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 )
@ -800,7 +800,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_ushort");
HL_TESTING2("H5LTset_attribute_ushort");
/* Set the attribute */
if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 )
@ -814,7 +814,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_ushort");
HL_TESTING2("H5LTget_attribute_ushort");
/* Get the attribute */
if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 )
@ -846,7 +846,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_uint");
HL_TESTING2("H5LTset_attribute_uint");
/* Set the attribute */
if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 )
@ -859,7 +859,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_uint");
HL_TESTING2("H5LTget_attribute_uint");
/* Get the attribute */
if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 )
@ -890,7 +890,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_ulong");
HL_TESTING2("H5LTset_attribute_ulong");
/* Set the attribute */
if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 )
@ -903,7 +903,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_ulong");
HL_TESTING2("H5LTget_attribute_ulong");
/* Get the attribute */
if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 )
@ -935,7 +935,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_float");
HL_TESTING2("H5LTset_attribute_float");
/* Set the attribute */
if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 )
@ -948,7 +948,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_float");
HL_TESTING2("H5LTget_attribute_float");
/* Get the attribute */
@ -980,7 +980,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTset_attribute_double");
HL_TESTING2("H5LTset_attribute_double");
/* Set the attribute */
if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 )
@ -993,7 +993,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_double");
HL_TESTING2("H5LTget_attribute_double");
/* Get the attribute */
if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 )
@ -1026,7 +1026,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*/
TESTING("H5LTget_attribute_ndims");
HL_TESTING2("H5LTget_attribute_ndims");
if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 )
return -1;
@ -1042,7 +1042,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
TESTING("H5LTget_attribute_info");
HL_TESTING2("H5LTget_attribute_info");
if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * (size_t)rank_out ))) return -1;
@ -1079,7 +1079,7 @@ static int test_integers(void)
char* dt_str;
size_t str_len;
TESTING3("\n text for integer types");
HL_TESTING3("\n text for integer types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_INT\n", H5LT_DDL))<0)
goto out;
@ -1136,7 +1136,7 @@ static int test_fps(void)
char* dt_str;
size_t str_len;
TESTING3(" text for floating-point types");
HL_TESTING3(" text for floating-point types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_LDOUBLE\n", H5LT_DDL))<0)
goto out;
@ -1197,7 +1197,7 @@ static int test_strings(void)
char* dt_str = NULL;
size_t str_len;
TESTING3(" text for string types");
HL_TESTING3(" text for string types");
if((dtype = H5LTtext_to_dtype("H5T_STRING { STRSIZE 13; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; }", H5LT_DDL))<0)
goto out;
@ -1328,7 +1328,7 @@ static int test_opaques(void)
char* dt_str;
size_t str_len;
TESTING3(" text for opaque types");
HL_TESTING3(" text for opaque types");
if((dtype = H5LTtext_to_dtype("H5T_OPAQUE { OPQ_SIZE 19; OPQ_TAG \"This is a tag for opaque type\"; }", H5LT_DDL))<0)
goto out;
@ -1385,7 +1385,7 @@ static int test_enums(void)
char* dt_str;
size_t str_len;
TESTING3(" text for enum types");
HL_TESTING3(" text for enum types");
if((dtype = H5LTtext_to_dtype("H5T_ENUM { H5T_STD_I32LE; \"RED\" 5; \"GREEN\" 6; \"BLUE\" 7; \"WHITE\" 8; }", H5LT_DDL))<0)
goto out;
@ -1457,7 +1457,7 @@ static int test_variables(void)
char* dt_str;
size_t str_len;
TESTING3(" text for variable types");
HL_TESTING3(" text for variable types");
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_NATIVE_CHAR }\n", H5LT_DDL))<0)
goto out;
@ -1518,7 +1518,7 @@ static int test_arrays(void)
char* dt_str;
size_t str_len;
TESTING3(" text for array types");
HL_TESTING3(" text for array types");
if((dtype = H5LTtext_to_dtype("H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }", H5LT_DDL))<0)
goto out;
@ -1579,7 +1579,7 @@ static int test_compounds(void)
char* dt_str;
size_t str_len;
TESTING3(" text for compound types");
HL_TESTING3(" text for compound types");
if((dtype = H5LTtext_to_dtype("H5T_COMPOUND { H5T_STD_I16BE \"one_field\" : 2; H5T_STD_U8LE \"two_field\" : 6; }", H5LT_DDL))<0)
goto out;
@ -1673,7 +1673,7 @@ static int test_compound_bug(void)
" } } \"sub\" : 8;\n"
"}\n";
TESTING3(" text for compound type of bug fix");
HL_TESTING3(" text for compound type of bug fix");
if((dtype = H5LTtext_to_dtype(text, H5LT_DDL))<0)
goto out;
@ -1765,7 +1765,7 @@ static int test_complicated_compound(void)
size_t size = 1024;
const char *filename = H5_get_srcdir_filename(INPUT_FILE);
TESTING3(" text for complicated compound types");
HL_TESTING3(" text for complicated compound types");
/* Open input file */
fp = HDfopen(filename, "r");
@ -1834,7 +1834,7 @@ out:
*/
static int test_text_dtype(void)
{
TESTING("H5LTtext_to_dtype");
HL_TESTING2("H5LTtext_to_dtype");
if(test_integers()<0)
goto out;
@ -1882,7 +1882,7 @@ static int test_valid_path(void)
htri_t path_valid;
const char *data_string_in = "test";
TESTING("H5LTpath_valid");
HL_TESTING2("H5LTpath_valid");
/* Create a new file using default properties. */

View File

@ -178,7 +178,7 @@ static int test_create_close(hid_t fid)
hid_t table;
hid_t part_t;
TESTING("H5PTcreate_fl and H5PTclose");
HL_TESTING2("H5PTcreate_fl and H5PTclose");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@ -188,11 +188,11 @@ static int test_create_close(hid_t fid)
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
if (H5Tclose(part_t) < 0)
goto error;
goto error;
if( H5PTis_valid(table) < 0)
goto error;
goto error;
if( H5PTis_varlen(table) != 0)
goto error;
goto error;
/* Close the table */
err = H5PTclose(table);
@ -219,7 +219,7 @@ static int test_open(hid_t fid)
herr_t err;
hid_t table;
TESTING("H5PTopen");
HL_TESTING2("H5PTopen");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@ -255,7 +255,7 @@ static int test_append(hid_t fid)
hid_t table;
hsize_t count = 0;
TESTING("H5PTappend");
HL_TESTING2("H5PTappend");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@ -322,7 +322,7 @@ static int test_read(hid_t fid)
particle_t readBuf[NRECORDS];
size_t c;
TESTING("H5PTread_packets");
HL_TESTING2("H5PTread_packets");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@ -383,7 +383,7 @@ static int test_get_next(hid_t fid)
particle_t readBuf2[NRECORDS];
size_t c;
TESTING("H5PTget_next");
HL_TESTING2("H5PTget_next");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@ -454,7 +454,7 @@ static int test_big_table(hid_t fid)
particle_t readPart;
hsize_t count;
TESTING("large packet table");
HL_TESTING2("large packet table");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@ -528,7 +528,7 @@ static int test_opaque(hid_t fid)
size_t c;
particle_t readBuf[NRECORDS];
TESTING("opaque data");
HL_TESTING2("opaque data");
/* Create an opaque datatype for the particle struct */
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
@ -602,7 +602,7 @@ test_compress(void)
particle_t readPart[1];
hsize_t count;
TESTING("packet table compression");
HL_TESTING2("packet table compression");
/* Create a file. */
if((fid1 = H5Fcreate(TEST_COMPRESS_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
@ -739,7 +739,7 @@ static int test_rw_nonnative_dt(hid_t fid)
int writeBuffer[5];
int readBuffer[5];
TESTING("reading/writing non-native packet table");
HL_TESTING2("reading/writing non-native packet table");
/* Initialize buffers */
for(x=0; x<5; x++) {
@ -794,7 +794,7 @@ static int test_rw_nonnative_dt(hid_t fid)
/* Close the packet table */
if( (err = H5PTclose(ptable)) < 0)
goto error;
PASSED();
return SUCCEED;
@ -819,7 +819,7 @@ static int test_error(hid_t fid)
int id_open=0;
particle_t readBuf[1];
TESTING("error conditions");
HL_TESTING2("error conditions");
/* Create a HL table */
if(create_hl_table(fid) < 0)
@ -981,7 +981,7 @@ int main(void)
/* Close the file */
if (H5Fclose(fid) < 0)
status = 1;
status = 1;
return status;
}

File diff suppressed because it is too large Load Diff

View File

@ -51,8 +51,6 @@
#define NRECORDS 8
#define NRECORDS_ADD 3
#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
/*-------------------------------------------------------------------------
* structure used for all tests, a particle with properties
*-------------------------------------------------------------------------
@ -117,7 +115,7 @@ typedef struct particle3_t
*-------------------------------------------------------------------------
*/
/* Push current alignment rule forcing 4-byte alignment boundary
/* Push current alignment rule forcing 4-byte alignment boundary
* to the internal stack ...
*/
#pragma pack(push,4)
@ -129,7 +127,7 @@ typedef struct particle3_t
float aty[3];
float rro[2];
} particle4_t;
/*
/*
* ... and restore original alignment rules from stack
*/
#pragma pack(pop)
@ -164,14 +162,14 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
HDfprintf(stderr,"%s %ld %f %f %d\n",
wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
return 0;
@ -424,7 +422,7 @@ static int test_table(hid_t fid, int do_write)
sizeof( rbuf[0].lati)
};
const char *field_names4[NFIELDS+1] =
const char *field_names4[NFIELDS+1] =
{ "F1", "F2", "F3", "F4", "F5", "F6"};
hid_t field_type4[NFIELDS+1];
particle4_t fill_data[1] = { {9999999, -9999999, 999999, {999,999,999},{999,999,999}, {999,999}} };
@ -458,7 +456,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("making table");
HL_TESTING2("making table");
if (H5TBmake_table(TITLE,fid,"table1",FIELDS,RECORDS,type_size_mem,
field_names,field_offset,field_type,
@ -467,7 +465,7 @@ static int test_table(hid_t fid, int do_write)
PASSED();
}
TESTING2("reading table");
HL_TESTING2("reading table");
/*-------------------------------------------------------------------------
* read the table
@ -497,7 +495,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("writing records");
HL_TESTING2("writing records");
/* create an empty table */
if (H5TBmake_table(TITLE,fid,"table2",FIELDS,RECORDS,type_size_mem,
@ -540,7 +538,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
TESTING2("reading records");
HL_TESTING2("reading records");
/*-------------------------------------------------------------------------
* read records, start at 0, read 8
@ -584,7 +582,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("appending records");
HL_TESTING2("appending records");
/*-------------------------------------------------------------------------
* append 2 records
@ -630,7 +628,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("inserting records");
HL_TESTING2("inserting records");
/*-------------------------------------------------------------------------
* insert 2 records
@ -690,7 +688,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("deleting records");
HL_TESTING2("deleting records");
/*-------------------------------------------------------------------------
* Create a table
@ -883,54 +881,54 @@ static int test_table(hid_t fid, int do_write)
/*------------------------------------------------------------------------
* Functions tested:
*
* H5TBdelete_record -- With differing memory layout from machine memory
* H5TBdelete_record -- With differing memory layout from machine memory
* layout. HDFFV-8055
*
*-------------------------------------------------------------------------
*/
if (do_write)
{
TESTING2("deleting records (differing memory layout)");
HL_TESTING2("deleting records (differing memory layout)");
dims = 3;
arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
dims = 3;
arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
dims = 2;
arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
dims = 2;
arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
/* Initialize the field field_type */
field_type4[0] = H5T_NATIVE_UINT32;
field_type4[1] = H5T_NATIVE_DOUBLE;
field_type4[2] = H5T_NATIVE_DOUBLE;
field_type4[3] = arry3_32f;
field_type4[4] = arry3_32f;
field_type4[5] = arry2_32f;
/* Initialize the field field_type */
field_type4[0] = H5T_NATIVE_UINT32;
field_type4[1] = H5T_NATIVE_DOUBLE;
field_type4[2] = H5T_NATIVE_DOUBLE;
field_type4[3] = arry3_32f;
field_type4[4] = arry3_32f;
field_type4[5] = arry2_32f;
/* Make the table */
if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
/* Make the table */
if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
tbl_size, field_names4, tbl_offset, field_type4,
chunk_size, fill_data, compress, p_data)<0)
goto out;
/* Delete records */
start = 3;
nrecords = 3;
if (H5TBdelete_record(fid, "table", start, nrecords)<0)
goto out;;
/* Get table info */
if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
goto out;
/* check */
if( (int)nfields_out != (int)NFIELDS+1)
goto out;
if( (int)nrecords_out != (int)NRECORDS-3)
goto out;
/* close type */
H5Tclose(arry3_32f);
H5Tclose(arry2_32f);
goto out;
/* Delete records */
start = 3;
nrecords = 3;
if (H5TBdelete_record(fid, "table", start, nrecords)<0)
goto out;;
/* Get table info */
if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
goto out;
/* check */
if( (int)nfields_out != (int)NFIELDS+1)
goto out;
PASSED();
if( (int)nrecords_out != (int)NRECORDS-3)
goto out;
/* close type */
H5Tclose(arry3_32f);
H5Tclose(arry2_32f);
PASSED();
}
/*-------------------------------------------------------------------------
@ -945,7 +943,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
TESTING2("adding records");
HL_TESTING2("adding records");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table4",FIELDS,RECORDS,type_size_mem,
@ -1005,7 +1003,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
TESTING2("combining tables");
HL_TESTING2("combining tables");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table6",FIELDS,RECORDS,type_size_mem,
@ -1100,7 +1098,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("writing fields by name");
HL_TESTING2("writing fields by name");
/* make an empty table with fill values */
if (H5TBmake_table(TITLE,fid,"table9",FIELDS,RECORDS,type_size_mem,
@ -1138,10 +1136,10 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,(double)pressure_in[i],position_in[i].lati);
goto out;
@ -1163,7 +1161,7 @@ static int test_table(hid_t fid, int do_write)
*
*-------------------------------------------------------------------------
*/
TESTING2("reading fields by name");
HL_TESTING2("reading fields by name");
/*-------------------------------------------------------------------------
* write and read the "Pressure" field
@ -1191,7 +1189,7 @@ static int test_table(hid_t fid, int do_write)
if ( H5TBread_fields_name(fid,"table10","DoesNotExist",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out) >=0)
goto out;
/* read the "Pressure" field */
if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out)<0)
@ -1263,7 +1261,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1292,7 +1290,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@ -1311,7 +1309,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("writing fields by index");
HL_TESTING2("writing fields by index");
/* make an empty table */
if (H5TBmake_table(TITLE,fid,"table11",FIELDS,RECORDS,type_size_mem,
@ -1351,7 +1349,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@ -1369,7 +1367,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
TESTING2("reading fields by index");
HL_TESTING2("reading fields by index");
if (do_write)
{
@ -1470,8 +1468,8 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1501,7 +1499,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@ -1520,7 +1518,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
TESTING2("inserting fields");
HL_TESTING2("inserting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table13",FIELDS,RECORDS,type_size_mem,
@ -1544,8 +1542,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
!H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
!H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@ -1563,7 +1561,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
TESTING2("deleting fields");
HL_TESTING2("deleting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table14",FIELDS,RECORDS,type_size_mem,
@ -1585,7 +1583,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}
@ -1603,7 +1601,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
TESTING2("getting table info");
HL_TESTING2("getting table info");
/* get table info */
if ( H5TBget_table_info (fid, "table1", &rfields, &rrecords ) < 0 )
@ -1624,7 +1622,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
TESTING2("getting field info");
HL_TESTING2("getting field info");
/* alocate */
names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );

View File

@ -5048,10 +5048,9 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
// /////// unimplemented ////////
// herr_t H5Odisable_mdc_flushes(hid_t object_id);
// herr_t H5Oenable_mdc_flushes(hid_t object_id);
// herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled);
public synchronized static native void H5Odisable_mdc_flushes(long object_id);
public synchronized static native void H5Oenable_mdc_flushes(long object_id);
public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
// ////////////////////////////////////////////////////////////
// //

View File

@ -17,7 +17,7 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
/*
* Java representation of the HDFS VFD file access property list (fapl)
* Java representation of the HDFS VFD file access property list (fapl)
* structure.
*
* Used for the access of files hosted on the Hadoop Distributed File System.
@ -33,7 +33,7 @@ public class H5FD_hdfs_fapl_t implements Serializable {
private int namenode_port;
private int stream_buffer_size;
/**
/*
* Create a fapl_t structure with the specified components.
*/
public H5FD_hdfs_fapl_t(
@ -91,7 +91,7 @@ public class H5FD_hdfs_fapl_t implements Serializable {
public String toString() {
return "H5FD_hdfs_fapl_t (Version: " + this.version + ") {" +
"\n namenode_name: '" + this.namenode_name +
"'\n namenode_port: " + this.namenode_port +
"'\n namenode_port: " + this.namenode_port +
"\n user_name: '" + this.user_name +
"'\n kerberos_ticket_cache: '" + this.kerberos_ticket_cache +
"'\n stream_buffer_size: " + this.stream_buffer_size +

View File

@ -71,7 +71,7 @@ public class H5FD_ros3_fapl_t implements Serializable {
* @param key "secret key" or "access key" for authenticating request
*/
public H5FD_ros3_fapl_t (String region, String id, String key) {
this.version = 1; /* must equal H5FD__CURR_ROS3_FAPL_T_VERSION */
this.version = 1; /* must equal H5FD_CURR_ROS3_FAPL_T_VERSION */
/* as found in H5FDros3.h */
this.aws_region = region;
this.secret_id = id;

View File

@ -856,6 +856,66 @@ done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Orefresh */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Odisable_mdc_flushes
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
(JNIEnv *env, jclass clss, jlong loc_id)
{
UNUSED(clss);
if (H5Odisable_mdc_flushes((hid_t)loc_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oenable_mdc_flushes
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
(JNIEnv *env, jclass clss, jlong loc_id)
{
UNUSED(clss);
if (H5Oenable_mdc_flushes((hid_t)loc_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oare_mdc_flushes_disabled
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
(JNIEnv *env, jclass clss, jlong loc_id)
{
jboolean bval = JNI_FALSE;
hbool_t is_disabled = FALSE;
UNUSED(clss);
if (H5Oare_mdc_flushes_disabled((hid_t)loc_id, &is_disabled) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (is_disabled == TRUE)
bval = JNI_TRUE;
done:
return bval;
} /* end Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled */
#ifdef __cplusplus

View File

@ -202,6 +202,33 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Orefresh
(JNIEnv*, jclass, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Odisable_mdc_flushes
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
(JNIEnv*, jclass, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oenable_mdc_flushes
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
(JNIEnv*, jclass, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oare_mdc_flushes_disabled
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
(JNIEnv*, jclass, jlong);
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */

View File

@ -557,4 +557,57 @@ public class TestH5Ocreate {
}
}
@Test
public void testH5Ocork() {
boolean corked = false;
// Check cork status of the group: not corked
try {
corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
}
assertFalse("H5Oare_mdc_flushes_disabled: ", corked);
// Cork the group: an object
try {
H5.H5Odisable_mdc_flushes(H5gid);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Ocork: H5.H5Odisable_mdc_flushes: " + err);
}
// Check cork status of the group: corked
try {
corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
}
assertTrue("H5Oare_mdc_flushes_disabled: ", corked);
// Unork the group: an object
try {
H5.H5Oenable_mdc_flushes(H5gid);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Ocork: H5.H5Oenable_mdc_flushes: " + err);
}
// Check cork status of the group: corked
try {
corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
}
assertFalse("H5Oare_mdc_flushes_disabled: ", corked);
}
}

View File

@ -159,4 +159,19 @@ public class TestH5Oparams {
H5.H5Orefresh(-1);
}
@Test(expected = HDF5LibraryException.class)
public void testH5Odisable_mdc_flushes() throws Throwable {
H5.H5Odisable_mdc_flushes(-1);
}
@Test(expected = HDF5LibraryException.class)
public void testH5Oenable_mdc_flushes() throws Throwable {
H5.H5Oenable_mdc_flushes(-1);
}
@Test(expected = HDF5LibraryException.class)
public void testH5Oare_mdc_flushes_disabled() throws Throwable {
H5.H5Oare_mdc_flushes_disabled(-1);
}
}

View File

@ -4,6 +4,7 @@ JUnit version 4.11
.testH5Oget_info_softlink
.testH5Oget_info_externallink
.testH5Ocopy
.testH5Ocork
.testH5Olink
.testH5Ocomment_by_name
.testH5Oget_info_by_idx_n1_create
@ -17,5 +18,5 @@ JUnit version 4.11
Time: XXXX
OK (15 tests)
OK (16 tests)

View File

@ -3,8 +3,10 @@ JUnit version 4.11
.testH5Ovisit_by_name_nullname
.testH5Oget_info_invalid
.testH5Ovisit_by_name_null
.testH5Odisable_mdc_flushes
.testH5Oget_comment_invalid
.testH5Oset_comment_by_name_invalid
.testH5Oare_mdc_flushes_disabled
.testH5Oopen_null
.testH5Oclose_invalid
.testH5Oflush_invalid
@ -22,9 +24,10 @@ JUnit version 4.11
.testH5Ocopy_null_current
.testH5Oset_comment_invalid
.testH5Oopen_invalid
.testH5Oenable_mdc_flushes
.testH5Ovisit_null
Time: XXXX
OK (24 tests)
OK (27 tests)

View File

@ -191,10 +191,15 @@ New Features
Library:
--------
- Add new API H5M for map objects. Currently not supported by native
library, can be supported by VOL connectors.
- Added new chunk query functions
(NAF - 2019/03/01)
The following public functions were added to discover information about
the chunks in an HDF5 file.
herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks)
herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size)
herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size)
(BMR - 2019/06/11, HDFFV-10677)
- Improved the performance of virtual dataset I/O
@ -204,19 +209,6 @@ New Features
(NAF - 2019/05/31, HDFFV-10693)
- Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used.
Rather than always running H5detect and generating H5Tinit.c and
H5make_libsettings.c, supply a location for those files.
(ADB - 2018/09/18, HDFFV-10332)
- Remove H5I_REFERENCE from the library
This ID class was never used by the library and has been removed.
(DER - 2018/12/08, HDFFV-10252)
- Added the ability to open files with UTF-8 file names on Windows.
The POSIX open(2) API call on Windows is limited to ASCII
@ -226,6 +218,25 @@ New Features
(DER - 2019/03/15, HDFFV-2714, HDFFV-3914, HDFFV-3895, HDFFV-8237, HDFFV-10413, HDFFV-10691)
- Add new API H5M for map objects. Currently not supported by native
library, can be supported by VOL connectors.
(NAF - 2019/03/01)
- Remove H5I_REFERENCE from the library
This ID class was never used by the library and has been removed.
(DER - 2018/12/08, HDFFV-10252)
- Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used.
Rather than always running H5detect and generating H5Tinit.c and
H5make_libsettings.c, supply a location for those files.
(ADB - 2018/09/18, HDFFV-10332)
Parallel Library:
-----------------
- Changed the default behavior in parallel when reading the same dataset in its entirely
@ -257,17 +268,17 @@ New Features
C++ Library:
------------
- Added new wrapper for H5Ovisit2()
H5Object::visit()
(BMR - 2019/02/14, HDFFV-10532)
- Added new wrappers for H5Pset/get_create_intermediate_group()
LinkCreatPropList::setCreateIntermediateGroup()
LinkCreatPropList::getCreateIntermediateGroup()
(BMR - 2019/04/22, HDFFV-10622)
- Added new wrapper for H5Ovisit2()
H5Object::visit()
(BMR - 2019/02/14, HDFFV-10532)
Java Library:
----------------
@ -326,6 +337,20 @@ Bug Fixes since HDF5-1.10.3 release
Library
-------
- Fixed a bug caused by bad tag value when condensing object header
messages
There was an assertion failure when moving meessages from running a
user test program with library release hdf5.1.10.4. It was because
the tag value (object header's address) was not set up when entering
the library routine H5O__chunk_update_idx(), which will eventually
verifies the metadata tag value when protecting the object header.
The problem was fixed by replacing FUNC_ENTER_PACKAGE in H5O__chunk_update_idx()
with FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) to set up the metadata tag.
(VC - 2019/08/23, HDFFV-10873)
- Fixed the test failure from test_metadata_read_retry_info() in
test/swmr.c
@ -359,6 +384,18 @@ Bug Fixes since HDF5-1.10.3 release
(VC - 2019/6/25, HDFFV-10808)
- When iterating over an old-style group (i.e., when not using the latest
file format) of size 0, a NULL pointer representing the empty links
table would be sent to qsort(3) for sorting, which is undefined behavior.
Iterating over an empty group is explicitly tested in the links test.
This has not caused any failures to date and was flagged by gcc's
-fsanitize=undefined.
The library no longer attempts to sort an empty array.
(DER - 2019/06/18, HDFFV-10829)
- Fixed an issue where copying a version 1.8 dataset between files using
H5Ocopy fails due to an incompatible fill version
@ -372,6 +409,16 @@ Bug Fixes since HDF5-1.10.3 release
(VC - 2019/6/14, HDFFV-10800)
- Some oversights in the index iterating area of the library caused
a callback function to continue iterating even though it's supposed
to stop.
Added the returned value check to the for loop's conditions in
H5EA_iterate(), H5FA_iterate(), and H5D__none_idx_iterate(). The
iteration now stops when it should.
(BMR - 2019/06/11, HDFFV-10661)
- Fixed a bug that would cause an error or cause fill values to be
incorrectly read from a chunked dataset using the "single chunk" index if
the data was held in cache and there was no data on disk.
@ -466,17 +513,6 @@ Bug Fixes since HDF5-1.10.3 release
(JTH - 2018/08/25, HDFFV-10501)
- When iterating over an old-style group (i.e., when not using the latest
file format) of size 0, a NULL pointer representing the empty links
table would be sent to qsort(3) for sorting, which is undefined behavior.
Iterating over an empty group is explicitly tested in the links test.
This has not caused any failures to date and was flagged by gcc's
-fsanitize=undefined.
The library no longer attempts to sort an empty array.
(DER - 2019/06/18, HDFFV-10829)
Java Library:
----------------

2
src/.indent.pro vendored
View File

@ -68,7 +68,7 @@
-T H5E_minor_t
-T H5E_t
-T H5F_create_t
-T H5F_file_t
-T H5F_shared_t
-T H5F_isop_t
-T H5F_istore_key_t
-T H5F_istore_ud1_t

View File

@ -990,7 +990,7 @@ if (LOCAL_BATCH_TEST)
endif ()
endif ()
if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})

View File

@ -222,7 +222,7 @@ H5C_apply_candidate_list(H5F_t * f,
HDfprintf(stdout, "%s", tbl_buf);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
if(f->coll_md_write) {
if(f->shared->coll_md_write) {
/* Sanity check */
HDassert(NULL == cache_ptr->coll_write_list);
@ -386,7 +386,7 @@ H5C_apply_candidate_list(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush candidates failed")
/* If we've deferred writing to do it collectively, take care of that now */
if(f->coll_md_write) {
if(f->shared->coll_md_write) {
/* Sanity check */
HDassert(cache_ptr->coll_write_list);

179
src/H5D.c
View File

@ -457,8 +457,8 @@ done:
*
* Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Tuesday, February 3, 1998
* Programmer: Robb Matzke
* Tuesday, February 3, 1998
*
*-------------------------------------------------------------------------
*/
@ -512,8 +512,8 @@ done:
*
* Failure: H5I_INVALID_HID
*
* Programmer: Neil Fortner
* Wednesday, October 29, 2008
* Programmer: Neil Fortner
* Wednesday, October 29, 2008
*
*-------------------------------------------------------------------------
*/
@ -610,9 +610,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Diterate
* Function: H5Diterate
*
* Purpose: This routine iterates over all the elements selected in a memory
* Purpose: This routine iterates over all the elements selected in a memory
* buffer. The callback function is called once for each element selected
* in the dataspace. The selection in the dataspace is modified so
* that any elements already iterated over are removed from the selection
@ -659,11 +659,11 @@ done:
* indicating failure. The iterator can be restarted at the next
* element.
*
* Return: Returns the return value of the last operator if it was non-zero,
* Return: Returns the return value of the last operator if it was non-zero,
* or zero if all elements were processed. Otherwise returns a
* negative value.
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Friday, June 11, 1999
*
*-------------------------------------------------------------------------
@ -706,16 +706,16 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Dvlen_reclaim
* Function: H5Dvlen_reclaim
*
* Purpose: Frees the buffers allocated for storing variable-length data
* Purpose: Frees the buffers allocated for storing variable-length data
* in memory. Only frees the VL data in the selection defined in the
* dataspace. The dataset transfer property list is required to find the
* correct allocation/free methods for the VL data in the buffer.
*
* Return: Non-negative on success, negative on failure
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Thursday, June 10, 1999
*
*-------------------------------------------------------------------------
@ -756,9 +756,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Dvlen_get_buf_size
* Function: H5Dvlen_get_buf_size
*
* Purpose: This routine checks the number of bytes required to store the VL
* Purpose: This routine checks the number of bytes required to store the VL
* data from the dataset, using the space_id for the selection in the
* dataset on disk and the type_id for the memory representation of the
* VL data, in memory. The *size value is modified according to how many
@ -772,9 +772,9 @@ done:
* Kinda kludgy, but easier than the other method of trying to figure out
* the sizes without actually reading the data in... - QAK
*
* Return: Non-negative on success, negative on failure
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Wednesday, August 11, 1999
*
*-------------------------------------------------------------------------
@ -1095,3 +1095,150 @@ done:
FUNC_LEAVE_API(ret_value);
} /* H5Dget_chunk_storage_size() */
/*-------------------------------------------------------------------------
* Function: H5Dget_num_chunks
*
* Purpose: Retrieves the number of chunks that have non-empty intersection
* with a specified selection.
*
* Note: Currently, this function only gets the number of all written
* chunks, regardless the dataspace.
*
* Parameters:
* hid_t dset_id; IN: Chunked dataset ID
* hid_t fspace_id; IN: File dataspace ID
* hsize_t *nchunks; OUT: Number of non-empty chunks
*
* Return: Non-negative on success, negative on failure
*
* Programmer: Binh-Minh Ribler
* May 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks)
{
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ii*h", dset_id, fspace_id, nchunks);
/* Check arguments */
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
if(NULL == nchunks)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)")
/* Get the number of written chunks */
if(H5VL_dataset_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_DATASET_GET_NUM_CHUNKS, fspace_id, nchunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get number of chunks")
done:
FUNC_LEAVE_API(ret_value);
} /* H5Dget_num_chunks() */
/*-------------------------------------------------------------------------
* Function: H5Dget_chunk_info
*
* Purpose: Retrieves information about a chunk specified by its index.
*
* Parameters:
* hid_t dset_id; IN: Chunked dataset ID
* hid_t fspace_id; IN: File dataspace ID
* hsize_t index; IN: Index of written chunk
* hsize_t *offset OUT: Logical position of the chunks
* first element in the dataspace
* unsigned *filter_mask OUT: Mask for identifying the filters in use
* haddr_t *addr OUT: Address of the chunk
* hsize_t *size OUT: Size of the chunk
*
* Return: Non-negative on success, negative on failure
*
* Programmer: Binh-Minh Ribler
* May 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
{
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
hsize_t nchunks = 0;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset,
filter_mask, addr, size);
/* Check arguments */
if(NULL == offset && NULL == filter_mask && NULL == addr && NULL == size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid arguments, must have at least one non-null output argument")
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
/* Get the number of written chunks to check range */
if(H5VL_dataset_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_DATASET_GET_NUM_CHUNKS, fspace_id, &nchunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get number of chunks")
/* Check range for chunk index */
if(chk_index >= nchunks)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk index is out of range")
/* Call private function to get the chunk info given the chunk's index */
if(H5VL_dataset_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX, fspace_id, chk_index, offset, filter_mask, addr, size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get chunk info by index")
done:
FUNC_LEAVE_API(ret_value);
} /* H5Dget_chunk_info() */
/*-------------------------------------------------------------------------
* Function: H5Dget_chunk_info_by_coord
*
* Purpose: Retrieves information about a chunk specified by its logical
* coordinates.
*
* Parameters:
* hid_t dset_id; IN: Chunked dataset ID
* hsize_t *offset IN: Logical position of the chunks
* first element in the dataspace
* unsigned *filter_mask OUT: Mask for identifying the filters in use
* haddr_t *addr OUT: Address of the chunk
* hsize_t *size OUT: Size of the chunk
*
* Return: Non-negative on success, negative on failure
*
* Programmer: Binh-Minh Ribler
* May 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
{
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*h*Iu*a*h", dset_id, offset, filter_mask, addr, size);
/* Check arguments */
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
if(NULL == filter_mask && NULL == addr && NULL == size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid arguments, must have at least one non-null output argument")
if(NULL == offset)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)")
/* Call private function to get the chunk info given the chunk's index */
if(H5VL_dataset_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD, offset, filter_mask, addr, size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get chunk info by its logical coordinates")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_chunk_info_by_coord() */

View File

@ -216,6 +216,18 @@ typedef struct H5D_chunk_readvv_ud_t {
const H5D_t *dset; /* Dataset to operate on */
} H5D_chunk_readvv_ud_t;
typedef struct H5D_chunk_info_iter_ud_t {
hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset of the chunk */
hsize_t ndims; /* Number of dimensions in the dataset */
uint32_t nbytes; /* Size of stored data in the chunk */
unsigned filter_mask; /* Excluded filters */
haddr_t chunk_addr; /* Address of the chunk in file */
hsize_t chunk_idx; /* Chunk index, where the iteration needs to stop */
hsize_t curr_idx; /* Current index, where the iteration is */
unsigned idx_hint; /* Index of chunk in cache, if present */
hbool_t found; /* Whether the chunk was found */
} H5D_chunk_info_iter_ud_t;
/* Callback info for file selection iteration */
typedef struct H5D_chunk_file_iter_ud_t {
H5D_chunk_map_t *fm; /* File->memory chunk mapping info */
@ -252,6 +264,11 @@ static herr_t H5D__chunk_flush(H5D_t *dset);
static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm);
static herr_t H5D__chunk_dest(H5D_t *dset);
/* Chunk query operation callbacks */
static int H5D__get_num_chunks_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
static int H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
static int H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/* "Nonexistent" layout operation callback */
static ssize_t
H5D__nonexistent_readvv(const H5D_io_info_t *io_info,
@ -393,7 +410,6 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
H5D_chk_idx_info_t idx_info; /* Chunked index info */
hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */
hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */
H5D_io_info_t io_info; /* to hold the dset info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
@ -401,13 +417,17 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
/* Sanity checks */
HDassert(layout->type == H5D_CHUNKED);
io_info.dset = dset;
/* Allocate dataspace and initialize it if it hasn't been. */
if(!H5D__chunk_is_space_alloc(&layout->storage))
if(!H5D__chunk_is_space_alloc(&layout->storage)) {
H5D_io_info_t io_info; /* to hold the dset info */
io_info.dset = dset;
io_info.f_sh = H5F_SHARED(dset->oloc.file);
/* Allocate storage */
if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, FALSE, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage")
} /* end if */
/* Calculate the index of this chunk */
H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled);
@ -467,7 +487,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
} /* end if */
/* Write the data to the file */
if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, buf) < 0)
if(H5F_shared_block_write(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
/* Insert the chunk record into the index */
@ -570,9 +590,9 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t* filters,
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined")
/* Read the chunk data into the supplied buffer */
if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, buf) < 0)
if(H5F_shared_block_read(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk")
/* Return the filter mask */
*filters = udata.filter_mask;
@ -3332,7 +3352,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
/* Write the data to the file */
HDassert(H5F_addr_defined(udata.chunk_block.offset));
H5_CHECK_OVERFLOW(udata.chunk_block.length, hsize_t, size_t);
if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, buf) < 0)
if(H5F_shared_block_write(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
/* Insert the chunk record into the index */
@ -3803,7 +3823,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
* size in memory, so allocate memory big enough. */
if(NULL == (chunk = H5D__chunk_mem_alloc(my_chunk_alloc, (udata->new_unfilt_chunk ? old_pline : pline))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk")
if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, chunk) < 0)
if(H5F_shared_block_read(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, chunk) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk")
if(old_pline && old_pline->nused) {
@ -4533,7 +4553,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
} /* end if */
else {
#endif /* H5_HAVE_PARALLEL */
if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, *fill_buf) < 0)
if(H5F_shared_block_write(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, *fill_buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
#ifdef H5_HAVE_PARALLEL
} /* end else */
@ -4918,7 +4938,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode")
/* Low-level write (collective) */
if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, fill_buf) < 0)
if(H5F_shared_block_write(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, fill_buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
/* Barrier so processes don't race ahead */
@ -6953,3 +6973,373 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_format_convert() */
/*-------------------------------------------------------------------------
* Function: H5D__get_num_chunks_cb
*
* Purpose: Callback function that increments the number of written
* chunks in the dataset.
*
* Note: Currently, this function only gets the number of all written
* chunks, regardless the dataspace.
*
* Return: H5_ITER_CONT
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
static int
H5D__get_num_chunks_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *_udata)
{
hsize_t *num_chunks = (hsize_t *)_udata;
int ret_value = H5_ITER_CONT; /* Callback return value */
FUNC_ENTER_STATIC_NOERR
HDassert(num_chunks);
(*num_chunks)++;
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_num_chunks_cb() */
/*-------------------------------------------------------------------------
* Function: H5D__get_num_chunks
*
* Purpose: Gets the number of written chunks in a dataset.
*
* Note: Currently, this function only gets the number of all written
* chunks, regardless the dataspace.
*
* Return: Success: Non-negative
* Failure: Negative
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5D__get_num_chunks(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_t *nchunks)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
hsize_t num_chunks = 0; /* Number of written chunks */
H5D_rdcc_ent_t *ent; /* Cache entry */
const H5D_rdcc_t *rdcc = NULL; /* Raw data chunk cache */
const H5O_layout_t *layout; /* Dataset layout */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
HDassert(dset);
HDassert(dset->shared);
HDassert(space);
HDassert(nchunks);
layout = &(dset->shared->layout); /* Dataset layout */
rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */
HDassert(rdcc);
/* Search for cached chunks that haven't been written out */
for(ent = rdcc->head; ent; ent = ent->next)
/* Flush the chunk out to disk, to make certain the size is correct later */
if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* If the dataset is not written, number of chunks will be 0 */
if(!H5F_addr_defined(idx_info.storage->idx_addr)) {
*nchunks = 0;
}
else {
/* Iterate over the allocated chunks */
if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_num_chunks_cb, &num_chunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index")
*nchunks = num_chunks;
}
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_num_chunks() */
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_cb
*
* Purpose: Get the chunk info of the queried chunk, given by its index.
*
* Return: Success: H5_ITER_CONT or H5_ITER_STOP
* H5_ITER_STOP indicates the queried chunk is found
* Failure: Negative (H5_ITER_ERROR)
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
static int
H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
H5D_chunk_info_iter_ud_t *chunk_info = (H5D_chunk_info_iter_ud_t *)_udata;
hsize_t ii = 0; /* Dimension index */
int ret_value = H5_ITER_CONT; /* Callback return value */
FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(chunk_rec);
HDassert(chunk_info);
/* If this is the queried chunk, retrieve its info and stop iterating */
if (chunk_info->curr_idx == chunk_info->chunk_idx) {
chunk_info->filter_mask = chunk_rec->filter_mask;
chunk_info->chunk_addr = chunk_rec->chunk_addr;
chunk_info->nbytes = chunk_rec->nbytes;
for (ii = 0; ii < chunk_info->ndims; ii++)
chunk_info->scaled[ii] = chunk_rec->scaled[ii];
chunk_info->found = TRUE;
/* Stop iterating */
ret_value = H5_ITER_STOP;
}
/* Go to the next chunk */
else
chunk_info->curr_idx++;
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_chunk_info_cb() */
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info
*
* Purpose: Iterate over the chunks in the dataset to get the info
* of the desired chunk.
*
* Note: Currently, the domain of the index in this function is of all
* the written chunks, regardless the dataspace.
*
* Return: Success: SUCCEED
* Failure: FAIL
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5D__get_chunk_info(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_t chk_index, hsize_t *offset, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_chunk_info_iter_ud_t udata; /* User data for callback */
const H5D_rdcc_t *rdcc = NULL; /* Raw data chunk cache */
H5D_rdcc_ent_t *ent; /* Cache entry index */
hsize_t ii = 0; /* Dimension index */
herr_t ret_value = SUCCEED;/* Return value */
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
HDassert(dset);
HDassert(dset->shared);
HDassert(space);
/* Get the raw data chunk cache */
rdcc = &(dset->shared->cache.chunk);
HDassert(rdcc);
/* Search for cached chunks that haven't been written out */
for(ent = rdcc->head; ent; ent = ent->next)
/* Flush the chunk out to disk, to make certain the size is correct later */
if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* Set addr & size for when dset is not written or queried chunk is not found */
if (addr)
*addr = HADDR_UNDEF;
if (size)
*size = 0;
/* If the chunk is written, get its info, otherwise, return without error */
if(H5F_addr_defined(idx_info.storage->idx_addr)) {
/* Initialize before iteration */
udata.chunk_idx = chk_index;
udata.curr_idx = 0;
udata.ndims = dset->shared->ndims;
udata.nbytes = 0;
udata.filter_mask = 0;
udata.chunk_addr = HADDR_UNDEF;
udata.found = FALSE;
/* Iterate over the allocated chunks */
if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_chunk_info_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index")
/* Obtain requested info if the chunk is found */
if(udata.found) {
if(filter_mask)
*filter_mask = udata.filter_mask;
if(addr)
*addr = udata.chunk_addr;
if(size)
*size = udata.nbytes;
if(offset)
for(ii = 0; ii < udata.ndims; ii++)
offset[ii] = udata.scaled[ii] * dset->shared->layout.u.chunk.dim[ii];
}
} /* end if H5F_addr_defined */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_chunk_info() */
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_by_coord_cb
*
* Purpose: Get the chunk info of the desired chunk, given its offset
* coordinates.
*
* Return: Success: H5_ITER_CONT or H5_ITER_STOP
* Failure: Negative (H5_ITER_ERROR)
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
static int
H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
hsize_t ii;
H5D_chunk_info_iter_ud_t *chunk_info = (H5D_chunk_info_iter_ud_t *)_udata;
hbool_t different = FALSE; /* TRUE when a scaled value pair mismatch */
int ret_value = H5_ITER_CONT; /* Callback return value */
FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(chunk_rec);
HDassert(chunk_info);
/* Going through the scaled, stop when a mismatch is found */
for (ii = 0; ii < chunk_info->ndims && !different; ii++)
if (chunk_info->scaled[ii] != chunk_rec->scaled[ii])
different = TRUE;
/* Same scaled coords means the chunk is found, copy the chunk info */
if (!different) {
chunk_info->nbytes = chunk_rec->nbytes;
chunk_info->filter_mask = chunk_rec->filter_mask;
chunk_info->chunk_addr = chunk_rec->chunk_addr;
chunk_info->found = TRUE;
/* Stop iterating */
ret_value = H5_ITER_STOP;
}
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_chunk_info_by_coord_cb() */
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_by_coord
*
* Purpose: Iterate over the chunks in the dataset to get the info
* of the desired chunk, given by its offset coordinates.
*
* Return: Success: Non-negative
* Failure: Negative
*
* Programmer: Binh-Minh Ribler
* June 2019 (HDFFV-10677)
*
*-------------------------------------------------------------------------
*/
herr_t
H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned* filter_mask, haddr_t *addr, hsize_t *size)
{
const H5O_layout_t *layout = NULL; /* Dataset layout */
const H5D_rdcc_t *rdcc = NULL; /* Raw data chunk cache */
H5D_rdcc_ent_t *ent; /* Cache entry index */
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_chunk_info_iter_ud_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
/* Check args */
HDassert(dset);
HDassert(dset->shared);
HDassert(offset);
/* Get dataset layout and raw data chunk cache */
layout = &(dset->shared->layout);
rdcc = &(dset->shared->cache.chunk);
HDassert(layout);
HDassert(rdcc);
HDassert(H5D_CHUNKED == layout->type);
/* Search for cached chunks that haven't been written out */
for(ent = rdcc->head; ent; ent = ent->next)
/* Flush the chunk out to disk, to make certain the size is correct later */
if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
/* Set addr & size for when dset is not written or queried chunk is not found */
if (addr)
*addr = HADDR_UNDEF;
if (size)
*size = 0;
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* If the dataset is not written, return without errors */
if(H5F_addr_defined(idx_info.storage->idx_addr)) {
/* Calculate the scaled of this chunk */
H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, udata.scaled);
udata.scaled[dset->shared->ndims] = 0;
/* Initialize before iteration */
udata.ndims = dset->shared->ndims;
udata.nbytes = 0;
udata.filter_mask = 0;
udata.chunk_addr = HADDR_UNDEF;
udata.found = FALSE;
/* Iterate over the allocated chunks to find the requested chunk */
if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_chunk_info_by_coord_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve information of the chunk by its scaled coordinates")
/* Obtain requested info if the chunk is found */
if (udata.found) {
if(filter_mask)
*filter_mask = udata.filter_mask;
if(addr)
*addr = udata.chunk_addr;
if(size)
*size = udata.nbytes;
}
} /* end if H5F_addr_defined */
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__get_chunk_info_by_coord() */

View File

@ -58,7 +58,7 @@
/* Callback info for sieve buffer readvv operation */
typedef struct H5D_contig_readvv_sieve_ud_t {
H5F_t *file; /* File for dataset */
H5F_shared_t *f_sh; /* Shared file for dataset */
H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */
unsigned char *rbuf; /* Pointer to buffer to fill */
@ -66,14 +66,14 @@ typedef struct H5D_contig_readvv_sieve_ud_t {
/* Callback info for [plain] readvv operation */
typedef struct H5D_contig_readvv_ud_t {
H5F_t *file; /* File for dataset */
H5F_shared_t *f_sh; /* Shared file for dataset */
haddr_t dset_addr; /* Address of dataset */
unsigned char *rbuf; /* Pointer to buffer to fill */
} H5D_contig_readvv_ud_t;
/* Callback info for sieve buffer writevv operation */
typedef struct H5D_contig_writevv_sieve_ud_t {
H5F_t *file; /* File for dataset */
H5F_shared_t *f_sh; /* Shared file for dataset */
H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */
const unsigned char *wbuf; /* Pointer to buffer to write */
@ -81,7 +81,7 @@ typedef struct H5D_contig_writevv_sieve_ud_t {
/* Callback info for [plain] writevv operation */
typedef struct H5D_contig_writevv_ud_t {
H5F_t *file; /* File for dataset */
H5F_shared_t *f_sh; /* Shared file for dataset */
haddr_t dset_addr; /* Address of dataset */
const unsigned char *wbuf; /* Pointer to buffer to write */
} H5D_contig_writevv_ud_t;
@ -718,7 +718,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
void *_udata)
{
H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */
H5F_t *file = udata->file; /* File for dataset */
H5F_shared_t *f_sh = udata->f_sh; /* Shared file for dataset */
H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */
unsigned char *buf; /* Pointer to buffer to fill */
@ -750,7 +750,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
if(NULL == dset_contig->sieve_buf) {
/* Check if we can actually hold the I/O request in the sieve buffer */
if(len > dset_contig->sieve_buf_size) {
if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, addr, len, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
} /* end if */
else {
@ -762,7 +762,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
dset_contig->sieve_loc = addr;
/* Make certain we don't read off the end of the file */
if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW)))
if(HADDR_UNDEF == (rel_eoa = H5F_shared_get_eoa(f_sh, H5FD_MEM_DRAW)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size")
/* Set up the buffer parameters */
@ -773,7 +773,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t);
/* Read the new sieve buffer */
if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
@ -804,7 +804,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Flush the sieve buffer, if it's dirty */
if(dset_contig->sieve_dirty) {
/* Write to file */
if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
@ -813,7 +813,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
} /* end if */
/* Read directly into the user's buffer */
if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, addr, len, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
} /* end if */
/* Element size fits within the buffer size */
@ -821,7 +821,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Flush the sieve buffer if it's dirty */
if(dset_contig->sieve_dirty) {
/* Write to file */
if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
@ -832,7 +832,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
dset_contig->sieve_loc = addr;
/* Make certain we don't read off the end of the file */
if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW)))
if(HADDR_UNDEF == (rel_eoa = H5F_shared_get_eoa(f_sh, H5FD_MEM_DRAW)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size")
/* Only need this when resizing sieve buffer */
@ -847,7 +847,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t);
/* Read the new sieve buffer */
if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
@ -885,7 +885,7 @@ H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata
FUNC_ENTER_STATIC
/* Write data */
if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off),
if(H5F_shared_block_read(udata->f_sh, H5FD_MEM_DRAW, (udata->dset_addr + dst_off),
len, (udata->rbuf + src_off)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
@ -931,11 +931,11 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
HDassert(mem_off_arr);
/* Check if data sieving is enabled */
if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) {
if(H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_DATA_SIEVE)) {
H5D_contig_readvv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */
/* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.f_sh = io_info->f_sh;
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
udata.rbuf = (unsigned char *)io_info->u.rbuf;
@ -950,7 +950,7 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
H5D_contig_readvv_ud_t udata; /* User data for H5VM_opvv() operator */
/* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.f_sh = io_info->f_sh;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.rbuf = (unsigned char *)io_info->u.rbuf;
@ -983,7 +983,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
void *_udata)
{
H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */
H5F_t *file = udata->file; /* File for dataset */
H5F_shared_t *f_sh = udata->f_sh; /* Shared file for dataset */
H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */
const unsigned char *buf; /* Pointer to buffer to fill */
@ -1015,7 +1015,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
if(NULL == dset_contig->sieve_buf) {
/* Check if we can actually hold the I/O request in the sieve buffer */
if(len > dset_contig->sieve_buf_size) {
if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, addr, len, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
} /* end if */
else {
@ -1031,7 +1031,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
dset_contig->sieve_loc = addr;
/* Make certain we don't read off the end of the file */
if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW)))
if(HADDR_UNDEF == (rel_eoa = H5F_shared_get_eoa(f_sh, H5FD_MEM_DRAW)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size")
/* Set up the buffer parameters */
@ -1044,7 +1044,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Check if there is any point in reading the data from the file */
if(dset_contig->sieve_size > len) {
/* Read the new sieve buffer */
if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
} /* end if */
@ -1084,7 +1084,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Flush the sieve buffer, if it's dirty */
if(dset_contig->sieve_dirty) {
/* Write to file */
if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
@ -1097,7 +1097,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
} /* end if */
/* Write directly from the user's buffer */
if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, addr, len, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
} /* end if */
/* Element size fits within the buffer size */
@ -1132,7 +1132,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Flush the sieve buffer if it's dirty */
if(dset_contig->sieve_dirty) {
/* Write to file */
if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_write(f_sh, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
@ -1143,7 +1143,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
dset_contig->sieve_loc = addr;
/* Make certain we don't read off the end of the file */
if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW)))
if(HADDR_UNDEF == (rel_eoa = H5F_shared_get_eoa(f_sh, H5FD_MEM_DRAW)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size")
/* Only need this when resizing sieve buffer */
@ -1160,7 +1160,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Check if there is any point in reading the data from the file */
if(dset_contig->sieve_size > len) {
/* Read the new sieve buffer */
if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
if(H5F_shared_block_read(f_sh, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed")
} /* end if */
@ -1200,7 +1200,7 @@ H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udat
FUNC_ENTER_STATIC
/* Write data */
if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, (udata->wbuf + src_off)) < 0)
if(H5F_shared_block_write(udata->f_sh, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, (udata->wbuf + src_off)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed")
done:
@ -1245,11 +1245,11 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
HDassert(mem_off_arr);
/* Check if data sieving is enabled */
if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) {
if(H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_DATA_SIEVE)) {
H5D_contig_writevv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */
/* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.f_sh = io_info->f_sh;
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
udata.wbuf = (const unsigned char *)io_info->u.wbuf;
@ -1264,7 +1264,7 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
H5D_contig_writevv_ud_t udata; /* User data for H5VM_opvv() operator */
/* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.f_sh = io_info->f_sh;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.wbuf = (const unsigned char *)io_info->u.wbuf;

View File

@ -2932,7 +2932,7 @@ H5D__flush_sieve_buf(H5D_t *dataset)
HDassert(dataset->shared->layout.type != H5D_COMPACT); /* We should never have a sieve buffer for compact storage */
/* Write dirty data sieve buffer to file */
if(H5F_block_write(dataset->oloc.file, H5FD_MEM_DRAW, dataset->shared->cache.contig.sieve_loc,
if(H5F_shared_block_write(H5F_SHARED(dataset->oloc.file), H5FD_MEM_DRAW, dataset->shared->cache.contig.sieve_loc,
dataset->shared->cache.contig.sieve_size, dataset->shared->cache.contig.sieve_buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")

View File

@ -857,6 +857,7 @@ H5D__ioinfo_init(H5D_t *dset, const H5D_type_info_t *type_info,
/* Set up "normal" I/O fields */
io_info->dset = dset;
io_info->f_sh = H5F_SHARED(dset->oloc.file);
io_info->store = store;
/* Set I/O operations to initial values */

View File

@ -457,7 +457,7 @@ H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATT
FUNC_ENTER_PACKAGE
H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t);
if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.rbuf) < 0)
if(H5F_shared_block_read(io_info->f_sh, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.rbuf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read")
done:
@ -487,7 +487,7 @@ H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t H5_AT
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t);
if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.wbuf) < 0)
if(H5F_shared_block_write(io_info->f_sh, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.wbuf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't finish collective parallel write")
done:
@ -3153,7 +3153,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
if(H5CX_set_io_xfer_mode(H5FD_MPIO_INDEPENDENT) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode")
if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset,
if(H5F_shared_block_read(io_info->f_sh, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset,
chunk_entry->chunk_states.new_chunk.length, chunk_entry->buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data chunk")

View File

@ -242,9 +242,9 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info,
unsigned u; /* Local index variable */
int curr_dim; /* Current rank */
hsize_t idx; /* Array index of chunk */
int ret_value = -1; /* Return value */
int ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC_NOERR
FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(idx_info);
@ -266,34 +266,35 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info,
HDassert(ndims > 0);
/* Iterate over all the chunks in the dataset's dataspace */
for(u = 0; u < idx_info->layout->nchunks; u++) {
/* Calculate the index of this chunk */
idx = H5VM_array_offset_pre(ndims, idx_info->layout->max_down_chunks, chunk_rec.scaled);
for(u = 0; u < idx_info->layout->nchunks && ret_value == H5_ITER_CONT; u++) {
/* Calculate the index of this chunk */
idx = H5VM_array_offset_pre(ndims, idx_info->layout->max_down_chunks, chunk_rec.scaled);
/* Calculate the address of the chunk */
chunk_rec.chunk_addr = idx_info->storage->idx_addr + idx * idx_info->layout->size;
/* Calculate the address of the chunk */
chunk_rec.chunk_addr = idx_info->storage->idx_addr + idx * idx_info->layout->size;
/* Make "generic chunk" callback */
if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0)
HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
/* Make "generic chunk" callback */
if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, H5_ITER_ERROR, "failure in generic chunk iterator callback")
/* Update coordinates of chunk in dataset */
curr_dim = (int)(ndims - 1);
while(curr_dim >= 0) {
/* Increment coordinate in current dimension */
chunk_rec.scaled[curr_dim]++;
/* Update coordinates of chunk in dataset */
curr_dim = (int)(ndims - 1);
while(curr_dim >= 0) {
/* Increment coordinate in current dimension */
chunk_rec.scaled[curr_dim]++;
/* Check if we went off the end of the current dimension */
if(chunk_rec.scaled[curr_dim] >= idx_info->layout->chunks[curr_dim]) {
/* Reset coordinate & move to next faster dimension */
chunk_rec.scaled[curr_dim] = 0;
curr_dim--;
} /* end if */
else
break;
} /* end while */
/* Check if we went off the end of the current dimension */
if(chunk_rec.scaled[curr_dim] >= idx_info->layout->chunks[curr_dim]) {
/* Reset coordinate & move to next faster dimension */
chunk_rec.scaled[curr_dim] = 0;
curr_dim--;
} /* end if */
else
break;
} /* end while */
} /* end for */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__none_idx_iterate() */

View File

@ -47,11 +47,13 @@
/* [Simple] Macro to construct a H5D_io_info_t from it's components */
#define H5D_BUILD_IO_INFO_WRT(io_info, ds, str, buf) \
(io_info)->dset = ds; \
(io_info)->f_sh = H5F_SHARED((ds)->oloc.file); \
(io_info)->store = str; \
(io_info)->op_type = H5D_IO_OP_WRITE; \
(io_info)->u.wbuf = buf
#define H5D_BUILD_IO_INFO_RD(io_info, ds, str, buf) \
(io_info)->dset = ds; \
(io_info)->f_sh = H5F_SHARED((ds)->oloc.file); \
(io_info)->store = str; \
(io_info)->op_type = H5D_IO_OP_READ; \
(io_info)->u.rbuf = buf
@ -207,6 +209,8 @@ typedef enum H5D_io_op_type_t {
typedef struct H5D_io_info_t {
const H5D_t *dset; /* Pointer to dataset being operated on */
/* QAK: Delete the f_sh field when oloc has a shared file pointer? */
H5F_shared_t *f_sh; /* Pointer to shared file struct that dataset is within */
#ifdef H5_HAVE_PARALLEL
MPI_Comm comm; /* MPI communicator for file */
hbool_t using_mpi_vfd; /* Whether the file is using an MPI-based VFD */
@ -565,6 +569,9 @@ H5_DLL herr_t H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *alloc
H5_DLL herr_t H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]);
H5_DLL herr_t H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size);
H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage_size);
H5_DLL herr_t H5D__get_num_chunks(const H5D_t *dset, const H5S_t *space, hsize_t *nchunks);
H5_DLL herr_t H5D__get_chunk_info(const H5D_t *dset, const H5S_t *space, hsize_t chk_idx, hsize_t *coord, unsigned *filter_mask, haddr_t *offset, hsize_t *size);
H5_DLL herr_t H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size);
H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info);
H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data);

View File

@ -142,6 +142,9 @@ H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks);
H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size);
H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size);
H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t plist_id, void *buf/*out*/);

View File

@ -987,19 +987,25 @@ END_FUNC(PRIV) /* end H5EA_delete() */
* Purpose: Iterate over the elements of an extensible array
* (copied and modified from FA_iterate() in H5FA.c)
*
* Return: SUCCEED/FAIL
* Return: H5_ITER_CONT/H5_ITER_ERROR
*
* Programmer: Vailin Choi; Feb 2015
*
* Modification:
* Prototype changed (HDFFV-10661)
* - herr_t to int
* - SUCCEED/FAIL to H5_ITER_CONT/H5_ITER_ERROR
* June 6, 2019 -BMR
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PRIV, ERR,
herr_t, SUCCEED, FAIL,
int, H5_ITER_CONT, H5_ITER_ERROR,
H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata))
/* Local variables */
uint8_t *elmt = NULL;
hsize_t u;
int cb_ret = H5_ITER_CONT; /* Return value from callback */
/*
* Check arguments.
@ -1013,9 +1019,7 @@ H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array element")
/* Iterate over all elements in array */
for(u = 0; u < ea->hdr->stats.stored.max_idx_set; u++) {
int cb_ret; /* Return value from callback */
for(u = 0; u < ea->hdr->stats.stored.max_idx_set && cb_ret == H5_ITER_CONT; u++) {
/* Get array element */
if(H5EA_get(ea, u, elmt) < 0)
H5E_THROW(H5E_CANTGET, "unable to delete fixed array")

View File

@ -686,20 +686,26 @@ END_FUNC(PRIV) /* end H5FA_delete() */
* Note: This is not very efficient, we should be iterating directly
* over the fixed array's direct block [pages].
*
* Return: SUCCEED/FAIL
* Return: H5_ITER_CONT/H5_ITER_ERROR
*
* Programmer: Vailin Choi
* Thursday, April 30, 2009
*
* Modification:
* Prototype changed (HDFFV-10661)
* - herr_t to int
* - SUCCEED/FAIL to H5_ITER_CONT/H5_ITER_ERROR
* June 6, 2019 -BMR
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PRIV, ERR,
herr_t, SUCCEED, FAIL,
int, H5_ITER_CONT, H5_ITER_ERROR,
H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata))
/* Local variables */
uint8_t *elmt = NULL;
hsize_t u;
int cb_ret = H5_ITER_CONT; /* Return value from callback */
/*
* Check arguments.
@ -713,9 +719,7 @@ H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array element")
/* Iterate over all elements in array */
for(u = 0; u < fa->hdr->stats.nelmts; u++) {
int cb_ret; /* Return value from callback */
for(u = 0; u < fa->hdr->stats.nelmts && cb_ret == H5_ITER_CONT; u++) {
/* Get array element */
if(H5FA_get(fa, u, elmt) < 0)
H5E_THROW(H5E_CANTGET, "unable to delete fixed array")

View File

@ -58,27 +58,24 @@ static char H5FD_mpi_native_g[] = "native";
* driver doesn't bother to keep it updated since it's an expensive operation.
*/
typedef struct H5FD_mpio_t {
H5FD_t pub; /*public stuff, must be first */
MPI_File f; /*MPIO file handle */
MPI_Comm comm; /*communicator */
MPI_Info info; /*file information */
int mpi_rank; /* This process's rank */
int mpi_size; /* Total number of processes */
haddr_t eof; /*end-of-file marker */
haddr_t eoa; /*end-of-address marker */
haddr_t last_eoa; /* Last known end-of-address marker */
haddr_t local_eof; /* Local end-of-file address for each process */
H5FD_t pub; /* Public stuff, must be first */
MPI_File f; /* MPIO file handle */
MPI_Comm comm; /* MPI Communicator */
MPI_Info info; /* MPI info object */
int mpi_rank; /* This process's rank */
int mpi_size; /* Total number of processes */
haddr_t eof; /* End-of-file marker */
haddr_t eoa; /* End-of-address marker */
haddr_t last_eoa; /* Last known end-of-address marker */
haddr_t local_eof; /* Local end-of-file address for each process */
} H5FD_mpio_t;
/* Private Prototypes */
/* Callbacks */
static herr_t H5FD__mpio_term(void);
static void *H5FD__mpio_fapl_get(H5FD_t *_file);
static void *H5FD__mpio_fapl_copy(const void *_old_fa);
static herr_t H5FD__mpio_fapl_free(void *_fa);
static H5FD_t *H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
haddr_t maxaddr);
static herr_t H5FD__mpio_close(H5FD_t *_file);
static herr_t H5FD__mpio_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD__mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
@ -106,10 +103,10 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
sizeof(H5FD_mpio_fapl_t), /*fapl_size */
H5FD__mpio_fapl_get, /*fapl_get */
H5FD__mpio_fapl_copy, /*fapl_copy */
H5FD__mpio_fapl_free, /*fapl_free */
0, /*fapl_size */
NULL, /*fapl_get */
NULL, /*fapl_copy */
NULL, /*fapl_free */
0, /*dxpl_size */
NULL, /*dxpl_copy */
NULL, /*dxpl_free */
@ -306,7 +303,6 @@ H5FD__mpio_term(void)
herr_t
H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
{
H5FD_mpio_fapl_t fa;
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value;
@ -319,15 +315,16 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if(MPI_COMM_NULL == comm)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid communicator")
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "MPI_COMM_NULL is not a valid communicator")
/* Initialize driver specific properties */
HDmemset(&fa, 0, sizeof(H5FD_mpio_fapl_t));
fa.comm = comm;
fa.info = info;
/* Set the MPI communicator and info object */
if(H5P_set(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI communicator")
if(H5P_set(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI info object")
/* duplication is done during driver setting. */
ret_value = H5P_set_driver(plist, H5FD_MPIO, &fa);
ret_value = H5P_set_driver(plist, H5FD_MPIO, NULL);
done:
FUNC_LEAVE_API(ret_value)
@ -361,52 +358,43 @@ herr_t
H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */
MPI_Comm comm_tmp = MPI_COMM_NULL;
hbool_t comm_copied = FALSE; /* MPI Comm has been duplicated */
int mpi_code; /* MPI return code */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, comm, info);
/* Set comm and info in case we have problems */
if(comm)
*comm = MPI_COMM_NULL;
if(info)
*info = MPI_INFO_NULL;
/* Check arguments */
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if(H5FD_MPIO != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "VFL driver is not MPI-I/O")
/* Store the duplicated communicator in a temporary variable for error */
/* recovery in case the INFO duplication fails. */
if(comm) {
if(MPI_SUCCESS != (mpi_code = MPI_Comm_dup(fa->comm, &comm_tmp)))
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code)
comm_copied = TRUE;
} /* end if */
if(info) {
if(MPI_INFO_NULL != fa->info) {
if(MPI_SUCCESS != (mpi_code = MPI_Info_dup(fa->info, info)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_dup failed", mpi_code)
} /* end if */
else
/* do not dup it */
*info = MPI_INFO_NULL;
} /* end if */
/* Store the copied communicator, now that the Info object has been
* successfully copied.
*/
/* Get the MPI communicator and info object */
if(comm)
*comm = comm_tmp;
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI communicator")
if(info)
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI info object")
done:
if(ret_value < 0)
/* need to free anything created here */
if(comm_copied)
MPI_Comm_free(&comm_tmp);
/* Clean up anything duplicated on errors. The free calls will set
* the output values to MPI_COMM|INFO_NULL.
*/
if(ret_value != SUCCEED) {
if(comm)
if(H5_mpi_comm_free(comm) < 0)
HDONE_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI communicator")
if(info)
if(H5_mpi_info_free(info) < 0)
HDONE_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI info object")
}
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_fapl_mpio() */
@ -665,161 +653,6 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_chunk_opt_ratio() */
/*-------------------------------------------------------------------------
* Function: H5FD__mpio_fapl_get
*
* Purpose: Returns a file access property list which could be used to
* create another file the same as this one.
*
* Return: Success: Ptr to new file access property list with all
* fields copied from the file pointer.
* Failure: NULL
*
* Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
*/
static void *
H5FD__mpio_fapl_get(H5FD_t *_file)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
H5FD_mpio_fapl_t *fa = NULL;
void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(file);
HDassert(H5FD_MPIO == file->pub.driver_id);
/* Check arguments */
if(NULL == (fa = (H5FD_mpio_fapl_t *)H5MM_calloc(sizeof(H5FD_mpio_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
fa->comm = MPI_COMM_NULL;
fa->info = MPI_INFO_NULL;
/* Duplicate MPI communicator and info */
if(FAIL == H5_mpi_comm_dup(file->comm, &fa->comm))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "communicator duplicate failed")
if(FAIL == H5_mpi_info_dup(file->info, &fa->info))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "info duplicate failed")
/* Set return value */
ret_value = fa;
done:
/* Clean up badness if we're failing */
if(NULL == ret_value && fa) {
H5_mpi_comm_free(&fa->comm);
H5_mpi_info_free(&fa->info);
H5MM_xfree(fa);
}
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__mpio_fapl_get() */
/*-------------------------------------------------------------------------
* Function: H5FD__mpio_fapl_copy
*
* Purpose: Copies the mpio-specific file access properties.
*
* Return: Success: Ptr to a new property list
* Failure: NULL
*
* Programmer: Albert Cheng
* Jan 8, 2003
*
*-------------------------------------------------------------------------
*/
static void *
H5FD__mpio_fapl_copy(const void *_old_fa)
{
const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa;
H5FD_mpio_fapl_t *new_fa = NULL;
void *ret_value = NULL;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
HDfprintf(stderr, "%s: entering\n", FUNC);
#endif
if(NULL == (new_fa = (H5FD_mpio_fapl_t *)H5MM_malloc(sizeof(H5FD_mpio_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the general information */
H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_mpio_fapl_t));
/* Duplicate MPI communicator and info */
if(H5_mpi_comm_dup(old_fa->comm, &new_fa->comm) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "communicator duplicate failed")
if(H5_mpi_info_dup(old_fa->info, &new_fa->info) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "info duplicate failed")
/* Set return value */
ret_value = new_fa;
done:
/* Clean up badness if we're failing */
if(NULL == ret_value && new_fa) {
H5_mpi_comm_free(&new_fa->comm);
H5_mpi_info_free(&new_fa->info);
H5MM_xfree(new_fa);
}
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
HDfprintf(stderr, "%s: leaving\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__mpio_fapl_copy() */
/*-------------------------------------------------------------------------
* Function: H5FD__mpio_fapl_free
*
* Purpose: Frees the mpio-specific file access properties.
*
* Return: SUCCEED/FAIL
*
* Programmer: Albert Cheng
* Jan 8, 2003
*
*-------------------------------------------------------------------------
*/
static herr_t
H5FD__mpio_fapl_free(void *_fa)
{
H5FD_mpio_fapl_t *fa = (H5FD_mpio_fapl_t*)_fa;
FUNC_ENTER_STATIC_NOERR
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
HDfprintf(stderr, "%s: Entering\n", FUNC);
#endif
/* Sanity checks */
HDassert(fa);
/* Free the internal communicator and INFO object */
HDassert(MPI_COMM_NULL != fa->comm);
H5_mpi_comm_free(&fa->comm);
H5_mpi_info_free(&fa->info);
H5MM_xfree(fa);
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
HDfprintf(stderr, "%s: leaving\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__mpio_fapl_free() */
/*-------------------------------------------------------------------------
* Function: H5FD_set_mpio_atomicity
@ -935,20 +768,18 @@ static H5FD_t *
H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t H5_ATTR_UNUSED maxaddr)
{
H5FD_mpio_t *file = NULL;
MPI_File fh;
unsigned file_opened = 0; /* Flag to indicate that the file was successfully opened */
int mpi_amode;
int mpi_rank; /* MPI rank of this process */
int mpi_size; /* Total number of MPI processes */
int mpi_code; /* mpi return code */
MPI_Offset size;
const H5FD_mpio_fapl_t *fa = NULL;
H5FD_mpio_fapl_t _fa;
H5FD_mpio_t *file = NULL;
MPI_File fh;
hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */
int mpi_amode;
int mpi_rank; /* MPI rank of this process */
int mpi_size; /* Total number of MPI processes */
int mpi_code; /* MPI return code */
MPI_Offset size;
H5P_genplist_t *plist; /* Property list pointer */
MPI_Comm comm_dup = MPI_COMM_NULL;
MPI_Info info_dup = MPI_INFO_NULL;
H5FD_t *ret_value = NULL; /* Return value */
MPI_Comm comm = MPI_COMM_NULL;
MPI_Info info = MPI_INFO_NULL;
H5FD_t *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@ -957,26 +788,18 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
HDfprintf(stdout, "%s: Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n", FUNC, name, flags, (int)fapl_id, (unsigned long)maxaddr);
#endif
/* Obtain a pointer to mpio-specific file access properties */
/* Get a pointer to the fapl */
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
if(H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MPIO != H5P_peek_driver(plist)) {
_fa.comm = MPI_COMM_SELF; /*default*/
_fa.info = MPI_INFO_NULL; /*default*/
fa = &_fa;
} /* end if */
else
if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
/* Duplicate MPI communicator and info */
if(FAIL == H5_mpi_comm_dup(fa->comm, &comm_dup))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "communicator duplicate failed")
if(FAIL == H5_mpi_info_dup(fa->info, &info_dup))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "info duplicate failed")
/* Get the MPI communicator and info object from the property list */
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get MPI communicator")
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get MPI info object")
/* convert HDF5 flags to MPI-IO flags */
/* some combinations are illegal; let MPI-IO figure it out */
/* Convert HDF5 flags to MPI-IO flags */
/* Some combinations are illegal; let MPI-IO figure it out */
mpi_amode = (flags & H5F_ACC_RDWR) ? MPI_MODE_RDWR : MPI_MODE_RDONLY;
if(flags & H5F_ACC_CREAT)
mpi_amode |= MPI_MODE_CREATE;
@ -985,11 +808,11 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
#ifdef H5FDmpio_DEBUG
/* Check for debug commands in the info parameter */
if(MPI_INFO_NULL != info_dup) {
if(MPI_INFO_NULL != info) {
char debug_str[128];
int flag;
MPI_Info_get(fa->info, H5F_MPIO_DEBUG_KEY, sizeof(debug_str) - 1, debug_str, &flag);
MPI_Info_get(info, H5F_MPIO_DEBUG_KEY, sizeof(debug_str) - 1, debug_str, &flag);
if(flag) {
int i;
@ -1000,22 +823,22 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
} /* end if */
#endif
if(MPI_SUCCESS != (mpi_code = MPI_File_open(comm_dup, name, mpi_amode, info_dup, &fh)))
if(MPI_SUCCESS != (mpi_code = MPI_File_open(comm, name, mpi_amode, info, &fh)))
HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mpi_code)
file_opened=1;
file_opened = TRUE;
/* Get the MPI rank of this process and the total number of processes */
if (MPI_SUCCESS != (mpi_code=MPI_Comm_rank (comm_dup, &mpi_rank)))
if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank (comm, &mpi_rank)))
HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mpi_code)
if (MPI_SUCCESS != (mpi_code=MPI_Comm_size (comm_dup, &mpi_size)))
if (MPI_SUCCESS != (mpi_code = MPI_Comm_size (comm, &mpi_size)))
HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mpi_code)
/* Build the return value and initialize it */
if(NULL == (file = (H5FD_mpio_t *)H5MM_calloc(sizeof(H5FD_mpio_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
file->f = fh;
file->comm = comm_dup;
file->info = info_dup;
file->comm = comm;
file->info = info;
file->mpi_rank = mpi_rank;
file->mpi_size = mpi_size;
@ -1026,7 +849,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
} /* end if */
/* Broadcast file size */
if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm_dup)))
if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm)))
HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code)
/* Determine if the file should be truncated */
@ -1035,7 +858,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id,
HMPI_GOTO_ERROR(NULL, "MPI_File_set_size failed", mpi_code)
/* Don't let any proc return until all have truncated the file. */
if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(comm_dup)))
if (MPI_SUCCESS != (mpi_code = MPI_Barrier(comm)))
HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mpi_code)
/* File is zero size now */
@ -1053,8 +876,10 @@ done:
if(ret_value == NULL) {
if(file_opened)
MPI_File_close(&fh);
MPI_Comm_free(&comm_dup);
MPI_Info_free(&info_dup);
if(H5_mpi_comm_free(&comm) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTFREE, NULL, "unable to free MPI communicator")
if(H5_mpi_info_free(&info) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTFREE, NULL, "unable to free MPI info object")
if(file)
H5MM_xfree(file);
} /* end if */
@ -1280,37 +1105,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__mpio_get_handle() */
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_get_info
*
* Purpose: Returns the file info of MPIO file driver.
*
* Returns: SUCCEED/FAIL
*
* Programmer: John Mainzer
* April 4, 2017
*
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
if(!mpi_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid")
*mpi_info = &(file->info);
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_mpio_get_info() */
/*-------------------------------------------------------------------------
* Function: H5FD__mpio_read
@ -1697,7 +1491,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
io_size = type_size * size_i;
/* Check for write failure */
if(bytes_written != io_size)
if(bytes_written != io_size || bytes_written < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Each process will keep track of its perceived EOF value locally, and
@ -1708,8 +1502,8 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
* potentially be wrong.) */
file->eof = HADDR_UNDEF;
if(bytes_written && ((bytes_written + addr) > file->local_eof))
file->local_eof = addr + bytes_written;
if(bytes_written && (((haddr_t)bytes_written + addr) > file->local_eof))
file->local_eof = addr + (haddr_t)bytes_written;
done:
#ifdef H5FDmpio_DEBUG

View File

@ -95,14 +95,6 @@ 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 */

View File

@ -34,6 +34,8 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5FDs3comms.h" /* S3 Communications */
#ifdef H5_HAVE_ROS3_VFD
/* toggle function call prints: 1 turns on
*/
#define ROS3_DEBUG 0
@ -119,8 +121,6 @@ static unsigned long long ros3_stats_boundaries[ROS3_STATS_BIN_COUNT];
*
* Programmer: Jacob Smith
*
* Changes: None
*
***************************************************************************/
typedef struct {
unsigned long long count;
@ -190,8 +190,6 @@ typedef struct {
*
* Programmer: Jacob Smith
*
* Changes: None.
*
***************************************************************************/
typedef struct H5FD_ros3_t {
H5FD_t pub;
@ -215,9 +213,7 @@ typedef struct H5FD_ros3_t {
*
*/
#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
#ifdef H5_HAVE_ROS3_VFD
#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
#endif /* H5_HAVE_ROS3_VFD */
/* Prototypes */
static herr_t H5FD_ros3_term(void);
@ -279,10 +275,8 @@ static const H5FD_class_t H5FD_ros3_g = {
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
#ifdef H5_HAVE_ROS3_VFD
/* Declare a free list to manage the H5FD_ros3_t struct */
H5FL_DEFINE_STATIC(H5FD_ros3_t);
#endif /* H5_HAVE_ROS3_VFD */
/*-------------------------------------------------------------------------
@ -292,8 +286,7 @@ H5FL_DEFINE_STATIC(H5FD_ros3_t);
*
* Return: Non-negative on success/Negative on failure
*
* Changes: Rename as appropriate for ros3 vfd.
* Jacob Smith 2017
* Programmer: Jacob Smith 2017
*
*-------------------------------------------------------------------------
*/
@ -324,11 +317,7 @@ done:
* Return: Success: The driver ID for the ros3 driver.
* Failure: Negative
*
* Programmer: Robb Matzke
* Thursday, July 29, 1999
*
* Changes: Rename as appropriate for ros3 vfd.
* Jacob Smith 2017
* Programmer: Jacob Smith 2017
*
*-------------------------------------------------------------------------
*/
@ -372,11 +361,7 @@ done:
*
* Returns: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
* Changes: Rename as appropriate for ros3 vfd.
* Jacob Smith 2017
* Programmer: Jacob Smith 2017
*
*---------------------------------------------------------------------------
*/
@ -464,10 +449,6 @@ done:
* Programmer: Jacob Smith
* 9/10/17
*
* Changes: Add checks for authenticate flag requring populated
* `aws_region` and `secret_id` strings.
* -- Jacob Smith 2017-11-01
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -479,7 +460,7 @@ H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa)
HDassert(fa != NULL);
if ( fa->version != H5FD__CURR_ROS3_FAPL_T_VERSION ) {
if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) {
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"Unknown H5FD_ros3_fapl_t version");
}
@ -704,8 +685,6 @@ H5FD_ros3_fapl_free(void *_fa)
* Programmer: Jacob Smith
* 2017-12-08
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
static herr_t
@ -774,12 +753,8 @@ done:
* Programmer: Jacob Smith
* 2017-11-02
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
static H5FD_t *
H5FD_ros3_open(
const char *url,
@ -904,22 +879,6 @@ done:
} /* end H5FD_ros3_open() */
#else /* H5_HAVE_ROS3_VFD not defined */
static H5FD_t *
H5FD_ros3_open(
const char H5_ATTR_UNUSED *url,
unsigned H5_ATTR_UNUSED flags,
hid_t H5_ATTR_UNUSED fapl_id,
haddr_t H5_ATTR_UNUSED maxaddr)
{
H5FD_t *ret_value = NULL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_ros3_open() */
#endif /* H5_HAVE_ROS3_VFD */
#if ROS3_STATS
/*----------------------------------------------------------------------------
@ -974,8 +933,6 @@ H5FD_ros3_open(
*
* Programmer: Jacob Smith
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
static herr_t
@ -1228,12 +1185,8 @@ done:
* Programmer: Jacob Smith
* 2017-11-02
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
static herr_t
H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
{
@ -1277,18 +1230,6 @@ done:
} /* end H5FD_ros3_close() */
#else /* H5_HAVE_ROS3_VFD not defined */
static herr_t
H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
{
herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_ros3_close() */
#endif /* H5_HAVE_ROS3_VFD */
/*-------------------------------------------------------------------------
*
@ -1318,17 +1259,8 @@ H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
* Programmer: Jacob Smith
* 2017-11-06
*
* Changes:
*
* + Change from strcmp-like return values (-1, 0, 1) to instead return
* binary equivalence (0) or inequality (-1).
* + Replace "if still equal then check this" waterfall with GOTO jumps.
* Jacob Smith 2018-05-17
*
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
static int
H5FD_ros3_cmp(
const H5FD_t *_f1,
@ -1463,20 +1395,6 @@ done:
} /* H5FD_ros3_cmp() */
#else /* H5_HAVE_ROS3_VFD not defined */
static int
H5FD_ros3_cmp(
const H5FD_t H5_ATTR_UNUSED *_f1,
const H5FD_t H5_ATTR_UNUSED *_f2)
{
int ret_value = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_ros3_cmp() */
#endif /* H5_HAVE_ROS3_VFD */
/*-------------------------------------------------------------------------
* Function: H5FD_ros3_query
@ -1536,8 +1454,6 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file,
* Programmer: Jacob Smith
* 2017-11-02
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static haddr_t
@ -1572,8 +1488,6 @@ H5FD_ros3_get_eoa(const H5FD_t *_file,
* Programmer: Jacob Smith
* 2017-11-03
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1646,8 +1560,6 @@ H5FD_ros3_get_eof(const H5FD_t *_file,
* Programmer: Jacob Smith
* 2017-11-02
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1696,8 +1608,6 @@ done:
* Programmer: Jacob Smith
* 2017-11-??
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1792,8 +1702,6 @@ done:
* Programmer: Jacob Smith
* 2017-10-23
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1839,8 +1747,6 @@ done:
* Programmer: Jacob Smith
* 2017-10-23
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1884,8 +1790,6 @@ done:
* Programmer: Jacob Smith
* 2017-11-03
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1914,8 +1818,6 @@ H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file,
* Programmer: Jacob Smith
* 2017-11-03
*
* Changes: None.
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -1926,4 +1828,5 @@ H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
} /* end H5FD_ros3_unlock() */
#endif /* H5_HAVE_ROS3_VFD */

View File

@ -21,11 +21,13 @@
#ifndef H5FDros3_H
#define H5FDros3_H
#define H5FD_ROS3 (H5FD_ros3_init())
#ifdef H5_HAVE_ROS3_VFD
#define H5FD_ROS3 (H5FD_ros3_init())
#else
#define H5FD_ROS3 (H5I_INVALID_HID)
#endif /* H5_HAVE_ROS3_VFD */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef H5_HAVE_ROS3_VFD
/****************************************************************************
*
@ -46,7 +48,7 @@ extern "C" {
* to the above calls must have a recognized version number, or an error
* will be flagged.
*
* This field should be set to H5FD__CURR_ROS3_FAPL_T_VERSION.
* This field should be set to H5FD_CURR_ROS3_FAPL_T_VERSION.
*
* `authenticate` (hbool_t)
*
@ -67,31 +69,27 @@ extern "C" {
*
* String: "Secret Access Key" associated with the ID and resource.
*
*
*
* Programmer: John Mainzer
*
* Changes:
*
* - Add documentation of fields (except `version`)
* --- Jacob Smith 2017-12-04
*
****************************************************************************/
#define H5FD__CURR_ROS3_FAPL_T_VERSION 1
#define H5FD_CURR_ROS3_FAPL_T_VERSION 1
#define H5FD__ROS3_MAX_REGION_LEN 32
#define H5FD__ROS3_MAX_SECRET_ID_LEN 128
#define H5FD__ROS3_MAX_SECRET_KEY_LEN 128
#define H5FD_ROS3_MAX_REGION_LEN 32
#define H5FD_ROS3_MAX_SECRET_ID_LEN 128
#define H5FD_ROS3_MAX_SECRET_KEY_LEN 128
typedef struct H5FD_ros3_fapl_t {
int32_t version;
hbool_t authenticate;
char aws_region[H5FD__ROS3_MAX_REGION_LEN + 1];
char secret_id[H5FD__ROS3_MAX_SECRET_ID_LEN + 1];
char secret_key[H5FD__ROS3_MAX_SECRET_KEY_LEN + 1];
char aws_region[H5FD_ROS3_MAX_REGION_LEN + 1];
char secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN + 1];
char secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN + 1];
} H5FD_ros3_fapl_t;
#ifdef __cplusplus
extern "C" {
#endif
H5_DLL hid_t H5FD_ros3_init(void);
H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa_out);
H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa);
@ -100,6 +98,8 @@ H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa);
}
#endif
#endif /* H5_HAVE_ROS3_VFD */
#endif /* ifndef H5FDros3_H */

View File

@ -47,12 +47,12 @@
/* Local Macros */
/****************/
#ifdef H5_HAVE_ROS3_VFD
/* toggle debugging (enable with 1)
*/
#define S3COMMS_DEBUG 0
#ifdef H5_HAVE_ROS3_VFD
/* manipulate verbosity of CURL output
* operates separately from S3COMMS_DEBUG
*
@ -67,7 +67,6 @@
*/
#define S3COMMS_MAX_RANGE_STRING_SIZE 128
#endif /* H5_HAVE_ROS3_VFD */
/******************/
/* Local Typedefs */
@ -137,8 +136,6 @@ herr_t H5FD_s3comms_s3r_getsize(s3r_t *handle);
* Programmer: Jacob Smith
* 2017-08-17
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
size_t
@ -217,14 +214,6 @@ curlwritecallback(char *ptr,
* Programmer: Jacob Smith
* 2017-09-22
*
* Changes:
*
* - Change return value to herr_t
* - Change list pointer to pointer-to-pointer-to-node
* - Change to use singly-linked list (from twin doubly-linked lists)
* with modification to hrb_node_t
* --- Jake Smith 2017-01-17
*
*----------------------------------------------------------------------------
*/
herr_t
@ -635,19 +624,6 @@ done:
* Programmer: Jacob Smith
* 2017-07-21
*
* Changes:
*
* - Conditional free() of `hrb_node_t` pointer properties based on
* `which_free` property.
* --- Jacob Smith 2017-08-08
*
* - Integrate with HDF5.
* - Returns herr_t instead of nothing.
* --- Jacob Smith 2017-09-21
*
* - Change argument to from *buf to **buf, to null pointer within call
* --- Jacob Smith 2017-20-05
*
*----------------------------------------------------------------------------
*/
herr_t
@ -709,25 +685,6 @@ done:
* Programmer: Jacob Smith
* 2017-07-21
*
* Changes:
*
* - Update struct membership for newer 'generic' `hrb_t` format.
* --- Jacob Smith, 2017-07-24
*
* - Rename from `hrb_new()` to `hrb_request()`
* --- Jacob Smith, 2017-07-25
*
* - Integrate with HDF5.
* - Rename from 'hrb_request()` to `H5FD_s3comms_hrb_init_request()`.
* - Remove `host` from input parameters.
* - Host, as with all other fields, must now be added through the
* add-field functions.
* - Add `version` (HTTP version string, e.g. "HTTP/1.1") to parameters.
* --- Jacob Smith 2017-09-20
*
* - Update to use linked-list `hrb_node_t` headers in structure.
* --- Jacob Smith 2017-10-05
*
*----------------------------------------------------------------------------
*/
hrb_t *
@ -842,64 +799,10 @@ done:
} /* end H5FD_s3comms_hrb_init_request() */
/****************************************************************************
* S3R FUNCTIONS
****************************************************************************/
#ifndef H5_HAVE_ROS3_VFD
/* No-op, auto-fail, unused-variable implementations if ROS3 is not enabled */
herr_t
H5FD_s3comms_s3r_close(s3r_t H5_ATTR_UNUSED *handle)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_s3comms_s3r_close() */
size_t
H5FD_s3comms_s3r_get_filesize(s3r_t H5_ATTR_UNUSED *handle)
{
size_t ret_value = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_s3comms_s3r_get_filesize() */
herr_t
H5FD_s3comms_s3r_getsize(s3r_t H5_ATTR_UNUSED *handle)
{
herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_s3r_getsize() */
s3r_t *
H5FD_s3comms_s3r_open(
const char H5_ATTR_UNUSED *url,
const char H5_ATTR_UNUSED *region,
const char H5_ATTR_UNUSED *id,
const unsigned char H5_ATTR_UNUSED *signing_key)
{
s3r_t *ret_value = NULL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_s3comms_s3r_open() */
herr_t
H5FD_s3comms_s3r_read(
s3r_t H5_ATTR_UNUSED *handle,
haddr_t H5_ATTR_UNUSED offset,
size_t H5_ATTR_UNUSED len,
void H5_ATTR_UNUSED *dest)
{
herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_s3r_read() */
#else
/*----------------------------------------------------------------------------
*
@ -920,20 +823,6 @@ H5FD_s3comms_s3r_read(
* Programmer: Jacob Smith
* 2017-08-31
*
* Changes:
*
* - Remove all messiness related to the now-gone "setopt" utility
* as it no longer exists in the handle.
* - Return type to `void`.
* --- Jacob Smith 2017-09-01
*
* - Incorporate into HDF environment.
* - Rename from `s3r_close()` to `H5FD_s3comms_s3r_close()`.
* --- Jacob Smith 2017-10-06
*
* - Change separate host, resource, port info to `parsed_url_t` struct ptr.
* --- Jacob Smith 2017-11-01
*
*----------------------------------------------------------------------------
*/
herr_t
@ -995,8 +884,6 @@ done:
*
* Programmer: Jacob Smith 2017-01-14
*
* Changes: None
*
*----------------------------------------------------------------------------
*/
size_t
@ -1044,44 +931,24 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
* Programmer: Jacob Smith
* 2017-08-23
*
* Changes:
*
* - Update to revised `s3r_t` format and life cycle.
* --- Jacob Smith 2017-09-01
*
* - Conditional change to static header buffer and structure.
* --- Jacob Smith 2017-09-05
*
* - Incorporate into HDF environment.
* - Rename from `s3r_getsize()` to `H5FD_s3comms_s3r_getsize()`.
* --- Jacob Smith 2017-10-06
*
*----------------------------------------------------------------------------
*/
herr_t
H5FD_s3comms_s3r_getsize(s3r_t *handle)
{
#ifdef H5_HAVE_ROS3_VFD
uintmax_t content_length = 0;
CURL *curlh = NULL;
char *end = NULL;
char *headerresponse = NULL;
herr_t ret_value = SUCCEED;
struct s3r_datastruct sds = {
S3COMMS_CALLBACK_DATASTRUCT_MAGIC,
NULL,
0 };
char *start = NULL;
#else
herr_t ret_value = FAIL;
#endif /* H5_HAVE_ROS3_VFD */
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5_HAVE_ROS3_VFD
#if S3COMMS_DEBUG
HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n");
#endif
@ -1238,8 +1105,6 @@ done:
H5MM_xfree(headerresponse);
sds.magic += 1; /* set to bad magic */
#endif /* H5_HAVE_ROS3_VFD */
FUNC_LEAVE_NOAPI(ret_value);
} /* H5FD_s3comms_s3r_getsize */
@ -1282,20 +1147,6 @@ done:
* Programmer: Jacob Smith
* 2017-09-01
*
* Changes:
*
* - Incorporate into HDF environment.
* - Rename from `s3r_open()` to `H5FD_s3comms_s3r_open()`.
* --- Jacob Smith 2017-10-06
*
* - Remove port number from signature.
* - Name (`url`) must be complete url with http scheme and optional port
* number in string.
* - e.g., "http://bucket.aws.com:9000/myfile.dat?query=param"
* - Internal storage of host, resource, and port information moved into
* `parsed_url_t` struct pointer.
* --- Jacob Smith 2017-11-01
*
*----------------------------------------------------------------------------
*/
s3r_t *
@ -1304,20 +1155,14 @@ H5FD_s3comms_s3r_open(const char *url,
const char *id,
const unsigned char *signing_key)
{
#ifdef H5_HAVE_ROS3_VFD
size_t tmplen = 0;
CURL *curlh = NULL;
s3r_t *handle = NULL;
parsed_url_t *purl = NULL;
#endif
s3r_t *ret_value = NULL;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5_HAVE_ROS3_VFD
#if S3COMMS_DEBUG
HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n");
#endif
@ -1492,11 +1337,9 @@ H5FD_s3comms_s3r_open(const char *url,
HDmemcpy(handle->httpverb, "GET", 4);
ret_value = handle;
#endif /* H5_HAVE_ROS3_VFD */
done:
if (ret_value == NULL) {
#ifdef H5_HAVE_ROS3_VFD
if (curlh != NULL) {
curl_easy_cleanup(curlh);
}
@ -1513,7 +1356,6 @@ done:
}
H5MM_xfree(handle);
}
#endif /* H5_HAVE_ROS3_VFD */
}
FUNC_LEAVE_NOAPI(ret_value)
@ -1560,29 +1402,6 @@ done:
* Programmer: Jacob Smith
* 2017-08-22
*
* Changes:
*
* - Revise structure to prevent unnecessary hrb_t element creation.
* - Rename tmprstr -> rangebytesstr to reflect purpose.
* - Insert needed `free()`s, particularly for `sds`.
* --- Jacob Smith 2017-08-23
*
* - Revise heavily to accept buffer, range as parameters.
* - Utilize modified s3r_t format.
* --- Jacob Smith 2017-08-31
*
* - Incorporate into HDF library.
* - Rename from `s3r_read()` to `H5FD_s3comms_s3r_read()`.
* - Return `herr_t` succeed/fail instead of S3code.
* - Update to use revised `hrb_t` and `hrb_node_t` structures.
* --- Jacob Smith 2017-10-06
*
* - Update to use `parsed_url_t *purl` in handle.
* --- Jacob Smith 2017-11-01
*
* - Better define behavior upon read past EOF
* --- Jacob Smith 2017-01-19
*
*----------------------------------------------------------------------------
*/
herr_t
@ -1591,7 +1410,6 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
size_t len,
void *dest)
{
#ifdef H5_HAVE_ROS3_VFD
CURL *curlh = NULL;
CURLcode p_status = CURLE_OK;
struct curl_slist *curlheaders = NULL;
@ -1604,16 +1422,9 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
/* return value of HDsnprintf */
struct s3r_datastruct *sds = NULL;
herr_t ret_value = SUCCEED;
#else
herr_t ret_value = FAIL;
#endif /* H5_HAVE_ROS3_VFD */
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5_HAVE_ROS3_VFD
#if S3COMMS_DEBUG
HDfprintf(stdout, "called H5FD_s3comms_s3r_read.\n");
#endif
@ -2105,12 +1916,9 @@ done:
}
}
#endif /* H5_HAVE_ROS3_VFD */
FUNC_LEAVE_NOAPI(ret_value);
} /* H5FD_s3comms_s3r_read */
#endif /* H5_HAVE_ROS3_VFD */
/****************************************************************************
* MISCELLANEOUS FUNCTIONS
@ -2133,8 +1941,6 @@ done:
* Programmer: Jacob Smith
* 2017-07-12
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
struct tm *
@ -2192,8 +1998,6 @@ gmnow(void)
* Programmer: Jacob Smith
* 2017-10-04
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
herr_t
@ -2362,20 +2166,6 @@ done:
* Programmer: Jacob Smith
* 2017-07-12
*
* Changes:
*
* - Integrate into HDF.
* - Rename from hex() to H5FD_s3comms_bytes_to_hex.
* - Change return type from `void` to `herr_t`.
* --- Jacob Smtih 2017-09-14
*
* - Add bool parameter `lowercase` to configure upper/lowercase output
* of a-f hex characters.
* --- Jacob Smith 2017-09-19
*
* - Change bool type to `hbool_t`
* --- Jacob Smtih 2017-10-11
*
*----------------------------------------------------------------------------
*/
herr_t
@ -2438,8 +2228,6 @@ done:
* Programmer: Jacob Smith
* 2017-11-01
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
herr_t
@ -2494,22 +2282,8 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
* Programmer: Jacob Smith
* 2017-07-??
*
* Changes:
*
* - Integrate with HDF5.
* - Rename from `HMAC_SHA256` to `H5FD_s3comms_HMAC_SHA256`.
* - Rename output parameter from `md` to `dest`.
* - Return `herr_t` type instead of `void`.
* - Call `H5FD_s3comms_bytes_to_hex` to generate hex cleartext for output.
* --- Jacob Smith 2017-09-19
*
* - Use static char array instead of malloc'ing `md`
* --- Jacob Smith 2017-10-10
*
*----------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
herr_t
H5FD_s3comms_HMAC_SHA256(
const unsigned char *key,
@ -2556,23 +2330,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5FD_s3comms_HMAC_SHA256 */
#else /* H5_HAVE_ROS3_VFD not defined */
herr_t
H5FD_s3comms_HMAC_SHA256(
const unsigned char H5_ATTR_UNUSED *key,
size_t H5_ATTR_UNUSED key_len,
const char H5_ATTR_UNUSED *msg,
size_t H5_ATTR_UNUSED msg_len,
char H5_ATTR_UNUSED *dest)
{
herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_HMAC_SHA256() */
#endif /* H5_HAVE_ROS3_VFD */
/*-----------------------------------------------------------------------------
*
@ -2621,8 +2378,6 @@ H5FD_s3comms_HMAC_SHA256(
* Programmer: Jacob Smith
* 2018-02-27
*
* Changes: None
*
*-----------------------------------------------------------------------------
*/
static herr_t
@ -2781,8 +2536,6 @@ done:
* Programmer: Jacob Smith
* 2018-02-27
*
* Changes: None
*
*----------------------------------------------------------------------------
*/
herr_t
@ -2903,8 +2656,6 @@ done:
* Programmer: Jacob Smith
* 2017-09-18
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
herr_t
@ -2968,8 +2719,6 @@ done:
* Programmer: Jacob Smith
* 2017-10-30
*
* Changes: None.
*
*----------------------------------------------------------------------------
*/
herr_t
@ -3242,12 +2991,6 @@ done:
*
* Programmer: Jacob Smith
*
* Changes:
*
* - Integrate into HDF.
* - Rename from `hexutf8` to `H5FD_s3comms_percent_encode_char`.
* --- Jacob Smith 2017-09-15
*
*----------------------------------------------------------------------------
*/
herr_t
@ -3421,19 +3164,8 @@ done:
* Programmer: Jacob Smith
* 2017-07-13
*
* Changes:
*
* - Integrate into HDF5.
* - Return herr_t type.
* --- Jacob Smith 2017-09-18
*
* - NULL check and fail of input parameters.
* --- Jacob Smith 2017-10-10
*
*----------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
herr_t
H5FD_s3comms_signing_key(
unsigned char *md,
@ -3526,22 +3258,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_signing_key() */
#else /* H5_HAVE_ROS3_VFD not defined */
herr_t
H5FD_s3comms_signing_key(
unsigned char H5_ATTR_UNUSED *md,
const char H5_ATTR_UNUSED *secret,
const char H5_ATTR_UNUSED *region,
const char H5_ATTR_UNUSED *iso8601now)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT_NOERR;
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_signing_key() */
#endif /* H5_HAVE_ROS3_VFD */
/*----------------------------------------------------------------------------
*
@ -3577,20 +3293,8 @@ H5FD_s3comms_signing_key(
* Programmer: Jacob Smith
* 2017-07-??
*
* Changes:
*
* - Integrate with HDF5.
* - Rename from `tostringtosign` to `H5FD_s3comms_tostringtosign`.
* - Return `herr_t` instead of characters written.
* - Use HDF-friendly bytes-to-hex function (`H5FD_s3comms_bytes_to_hex`)
* instead of general-purpose, deprecated `hex()`.
* - Adjust casts to openssl's `SHA256`.
* - Input strings are now `const`.
* --- Jacob Smith 2017-09-19
*
*----------------------------------------------------------------------------
*/
#ifdef H5_HAVE_ROS3_VFD
herr_t
H5FD_s3comms_tostringtosign(
char *dest,
@ -3681,22 +3385,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ros3_tostringtosign() */
#else /* H5_HAVE_ROS3_VFD not defined */
herr_t
H5FD_s3comms_tostringtosign(
char H5_ATTR_UNUSED *dest,
const char H5_ATTR_UNUSED *req,
const char H5_ATTR_UNUSED *now,
const char H5_ATTR_UNUSED *region)
{
herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ros3_tostringtosign() */
#endif /* H5_HAVE_ROS3_VFD */
/*----------------------------------------------------------------------------
*
@ -3725,13 +3413,6 @@ H5FD_s3comms_tostringtosign(
* Programmer: Jacob Smith
* 2017-09-18
*
* Changes:
*
* - Rename from `trim()` to `H5FD_s3comms_trim()`.
* - Incorporate into HDF5.
* - Returns `herr_t` type.
* --- Jacob Smith 2017-??-??
*
*----------------------------------------------------------------------------
*/
herr_t
@ -3826,16 +3507,6 @@ done:
* Programmer: Jacob Smith
* 2017-07-??
*
* Changes:
*
* - Integrate to HDF environment.
* - Rename from `uriencode` to `H5FD_s3comms_uriencode`.
* - Change return from characters written to herr_t;
* move to i/o parameter `n_written`.
* - No longer append null-terminator to string;
* programmer may append or not as appropriate upon return.
* --- Jacob Smith 2017-09-15
*
*----------------------------------------------------------------------------
*/
herr_t
@ -3915,4 +3586,5 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_s3comms_uriencode */
#endif /* H5_HAVE_ROS3_VFD */

View File

@ -52,18 +52,15 @@
*
*****************************************************************************/
#include <ctype.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "H5private.h" /* Generic Functions */
#ifdef H5_HAVE_ROS3_VFD
/* Necessary S3 headers */
#include <curl/curl.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#endif /* ifdef H5_HAVE_ROS3_VFD */
/*****************
* PUBLIC MACROS *
@ -99,9 +96,6 @@
* It is left to the programmer to check return value of
* ISO8601NOW (should equal ISO8601_SIZE - 1).
*
* Programmer: Jacob Smith
* 2017-07-??
*
*---------------------------------------------------------------------------
*/
#define ISO8601NOW(dest, now_gm) \
@ -121,9 +115,6 @@ strftime((dest), ISO8601_SIZE, "%Y%m%dT%H%M%SZ", (now_gm))
* It is left to the programmer to check return value of
* RFC7231NOW (should equal RFC7231_SIZE - 1).
*
* Programmer: Jacob Smith
* 2017-07-??
*
*---------------------------------------------------------------------------
*/
#define RFC7231NOW(dest, now_gm) \
@ -169,11 +160,6 @@ strftime((dest), RFC7231_SIZE, "%a, %d %b %Y %H:%M:%S GMT", (now_gm))
* `region` should be relevant AWS region, i.e. "us-east-1".
* `service` should be "s3".
*
* Programmer: Jacob Smith
* 2017-09-19
*
* Changes: None.
*
*---------------------------------------------------------------------------
*/
#define S3COMMS_FORMAT_CREDENTIAL(dest, access, iso8601_date, region, service) \
@ -266,16 +252,6 @@ HDsnprintf((dest), S3COMMS_MAX_CREDENTIAL_SIZE,
* Pointers to next node in the list, or NULL sentinel as end of list.
* Next node must have a greater `lowername` as determined by strcmp().
*
*
*
* Programmer: Jacob Smith
* 2017-09-22
*
* Changes:
*
* - Change from twin doubly-linked lists to singly-linked list.
* --- Jake Smith 2017-01-17
*
*----------------------------------------------------------------------------
*/
typedef struct hrb_node_t {
@ -353,10 +329,6 @@ typedef struct hrb_node_t {
*
* Pointer to HTTP version string, e.g., "HTTP/1.1".
*
*
*
* Programmer: Jacob Smith
*
*----------------------------------------------------------------------------
*/
typedef struct {
@ -421,10 +393,6 @@ typedef struct {
* Single string of all query parameters in url (if any).
* "arg1=value1&arg2=value2"
*
*
*
* Programmer: Jacob Smith
*
*----------------------------------------------------------------------------
*/
typedef struct {
@ -514,15 +482,10 @@ typedef struct {
*
* Requred to authenticate.
*
*
*
* Programmer: Jacob Smith
*
*----------------------------------------------------------------------------
*/
typedef struct {
unsigned long magic;
#ifdef H5_HAVE_ROS3_VFD
CURL *curlhandle;
size_t filesize;
char *httpverb;
@ -530,15 +493,19 @@ typedef struct {
char *region;
char *secret_id;
unsigned char *signing_key;
#endif /* ifdef H5_HAVE_ROS3_VFD */
} s3r_t;
#define S3COMMS_S3R_MAGIC 0x44d8d79
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************
* DECLARATION OF HTTP FIELD LIST ROUTINES *
*******************************************/
herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L,
H5_DLL herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L,
const char *name,
const char *value);
@ -546,9 +513,9 @@ herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L,
* DECLARATION OF HTTP REQUEST BUFFER ROUTINES *
***********************************************/
herr_t H5FD_s3comms_hrb_destroy(hrb_t **buf);
H5_DLL herr_t H5FD_s3comms_hrb_destroy(hrb_t **buf);
hrb_t * H5FD_s3comms_hrb_init_request(const char *verb,
H5_DLL hrb_t * H5FD_s3comms_hrb_init_request(const char *verb,
const char *resource,
const char *host);
@ -576,7 +543,7 @@ H5_DLL herr_t H5FD_s3comms_s3r_read(s3r_t *handle,
H5_DLL struct tm * gmnow(void);
herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest,
H5_DLL herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest,
int cr_size,
char *signed_headers_dest,
int sh_size,
@ -587,27 +554,27 @@ H5_DLL herr_t H5FD_s3comms_bytes_to_hex(char *dest,
size_t msg_len,
hbool_t lowercase);
herr_t H5FD_s3comms_free_purl(parsed_url_t *purl);
H5_DLL herr_t H5FD_s3comms_free_purl(parsed_url_t *purl);
herr_t H5FD_s3comms_HMAC_SHA256(const unsigned char *key,
H5_DLL herr_t H5FD_s3comms_HMAC_SHA256(const unsigned char *key,
size_t key_len,
const char *msg,
size_t msg_len,
char *dest);
herr_t H5FD_s3comms_load_aws_profile(const char *name,
H5_DLL herr_t H5FD_s3comms_load_aws_profile(const char *name,
char *key_id_out,
char *secret_access_key_out,
char *aws_region_out);
herr_t H5FD_s3comms_nlowercase(char *dest,
H5_DLL herr_t H5FD_s3comms_nlowercase(char *dest,
const char *s,
size_t len);
herr_t H5FD_s3comms_parse_url(const char *str,
H5_DLL herr_t H5FD_s3comms_parse_url(const char *str,
parsed_url_t **purl);
herr_t H5FD_s3comms_percent_encode_char(char *repr,
H5_DLL herr_t H5FD_s3comms_percent_encode_char(char *repr,
const unsigned char c,
size_t *repr_len);
@ -616,7 +583,7 @@ H5_DLL herr_t H5FD_s3comms_signing_key(unsigned char *md,
const char *region,
const char *iso8601now);
herr_t H5FD_s3comms_tostringtosign(char *dest,
H5_DLL herr_t H5FD_s3comms_tostringtosign(char *dest,
const char *req_str,
const char *now,
const char *region);
@ -626,10 +593,12 @@ H5_DLL herr_t H5FD_s3comms_trim(char *dest,
size_t s_len,
size_t *n_written);
H5_DLL herr_t H5FD_s3comms_uriencode(char *dest,
const char *s,
size_t s_len,
hbool_t encode_slash,
size_t *n_written);
H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len,
hbool_t encode_slash, size_t *n_written);
#ifdef __cplusplus
}
#endif
#endif /* H5_HAVE_ROS3_VFD */

View File

@ -390,7 +390,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n"
cache_flags |= H5AC__DIRTIED_FLAG;
/* On file close or flushing, does not allow section info to shrink in size */
if(f->closing || flush_in_progress) {
if(f->shared->closing || flush_in_progress) {
if(fspace->sect_size > fspace->alloc_sect_size)
cache_flags |= H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG;
else
@ -441,7 +441,7 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC);
/* Set flag to release section info space in file */
/* On file close or flushing, only need to release section info with size
bigger than previous section */
if(f->closing || flush_in_progress) {
if(f->shared->closing || flush_in_progress) {
if(fspace->sect_size > fspace->alloc_sect_size)
release_sinfo_space = TRUE;
else

View File

@ -111,7 +111,7 @@ H5FL_BLK_DEFINE_STATIC(meta_accum);
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_read(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t size, void *buf/*out*/)
{
H5FD_t *file; /* File driver pointer */
@ -120,18 +120,18 @@ H5F__accum_read(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
FUNC_ENTER_PACKAGE
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
HDassert(buf);
/* Translate to file driver I/O info object */
file = f->shared->lf;
file = f_sh->lf;
/* Check if this information is in the metadata accumulator */
if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
/* Set up alias for file's metadata accumulator info */
accum = &f->shared->accum;
accum = &f_sh->accum;
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
@ -419,7 +419,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t size, const void *buf)
{
H5FD_t *file; /* File driver pointer */
@ -428,19 +428,19 @@ H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
HDassert(f_sh);
HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR);
HDassert(buf);
/* Translate to file driver pointer */
file = f->shared->lf;
file = f_sh->lf;
/* Check for accumulating metadata */
if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
/* Set up alias for file's metadata accumulator info */
accum = &f->shared->accum;
accum = &f_sh->accum;
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
@ -732,9 +732,9 @@ H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
} /* end if */
else {
/* Make certain that data in accumulator is visible before new write */
if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) > 0)
if((H5F_SHARED_INTENT(f_sh) & H5F_ACC_SWMR_WRITE) > 0)
/* Flush if dirty and reset accumulator */
if(H5F__accum_reset(f, TRUE) < 0)
if(H5F__accum_reset(f_sh, TRUE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
/* Write the data */
@ -783,7 +783,7 @@ H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr,
} /* end if */
else { /* Access covers whole accumulator */
/* Reset accumulator, but don't flush */
if(H5F__accum_reset(f, FALSE) < 0)
if(H5F__accum_reset(f_sh, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
} /* end else */
} /* end if */
@ -847,7 +847,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_free(H5F_t *f, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
hsize_t size)
{
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
@ -857,16 +857,16 @@ H5F__accum_free(H5F_t *f, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(f);
HDassert(f_sh);
/* Set up alias for file's metadata accumulator info */
accum = &f->shared->accum;
accum = &f_sh->accum;
/* Translate to file driver pointer */
file = f->shared->lf;
file = f_sh->lf;
/* Adjust the metadata accumulator to remove the freed block, if it overlaps */
if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA)
if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA)
&& H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
size_t overlap_size; /* Size of overlap with accumulator */
@ -1013,28 +1013,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_flush(H5F_t *f)
H5F__accum_flush(H5F_shared_t *f_sh)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
/* Check if we need to flush out the metadata accumulator */
if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f->shared->accum.dirty) {
if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f_sh->accum.dirty) {
H5FD_t *file; /* File driver pointer */
/* Translate to file driver pointer */
file = f->shared->lf;
file = f_sh->lf;
/* Flush the metadata contents */
if(H5FD_write(file, H5FD_MEM_DEFAULT, f->shared->accum.loc + f->shared->accum.dirty_off, f->shared->accum.dirty_len, f->shared->accum.buf + f->shared->accum.dirty_off) < 0)
if(H5FD_write(file, H5FD_MEM_DEFAULT, f_sh->accum.loc + f_sh->accum.dirty_off, f_sh->accum.dirty_len, f_sh->accum.buf + f_sh->accum.dirty_off) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Reset the dirty flag */
f->shared->accum.dirty = FALSE;
f_sh->accum.dirty = FALSE;
} /* end if */
done:
@ -1056,34 +1056,31 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_reset(H5F_t *f, hbool_t flush)
H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
/* Flush any dirty data in accumulator, if requested */
if(flush)
if(H5F__accum_flush(f) < 0)
if(H5F__accum_flush(f_sh) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "can't flush metadata accumulator")
/* Check if we need to reset the metadata accumulator information */
if(f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) {
/* Sanity check */
HDassert(!f->closing || FALSE == f->shared->accum.dirty);
if(f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) {
/* Free the buffer */
if(f->shared->accum.buf)
f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, f->shared->accum.buf);
if(f_sh->accum.buf)
f_sh->accum.buf = H5FL_BLK_FREE(meta_accum, f_sh->accum.buf);
/* Reset the buffer sizes & location */
f->shared->accum.alloc_size = f->shared->accum.size = 0;
f->shared->accum.loc = HADDR_UNDEF;
f->shared->accum.dirty = FALSE;
f->shared->accum.dirty_len = 0;
f_sh->accum.alloc_size = f_sh->accum.size = 0;
f_sh->accum.loc = HADDR_UNDEF;
f_sh->accum.dirty = FALSE;
f_sh->accum.dirty_len = 0;
} /* end if */
done:

View File

@ -299,7 +299,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F_cwfs_remove_heap(H5F_file_t *shared, H5HG_heap_t *heap)
H5F_cwfs_remove_heap(H5F_shared_t *shared, H5HG_heap_t *heap)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */

View File

@ -60,14 +60,14 @@ struct H5F_efc_t {
unsigned max_nfiles; /* Maximum size of the external file cache */
unsigned nrefs; /* Number of times this file appears in another file's EFC */
int tag; /* Temporary variable used by H5F__efc_try_close() */
H5F_file_t *tmp_next; /* Next file in temporary list used by H5F__efc_try_close() */
H5F_shared_t *tmp_next; /* Next file in temporary list used by H5F__efc_try_close() */
};
/* Private prototypes */
static herr_t H5F__efc_release_real(H5F_efc_t *efc);
static herr_t H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent);
static void H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail);
static void H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail);
static void H5F__efc_try_close_tag1(H5F_shared_t *sf, H5F_shared_t **tail);
static void H5F__efc_try_close_tag2(H5F_shared_t *sf, H5F_shared_t **tail);
/* Free lists */
H5FL_DEFINE_STATIC(H5F_efc_ent_t);
@ -644,10 +644,10 @@ done:
*-------------------------------------------------------------------------
*/
static void
H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail)
H5F__efc_try_close_tag1(H5F_shared_t *sf, H5F_shared_t **tail)
{
H5F_efc_ent_t *ent = NULL; /* EFC entry */
H5F_file_t *esf; /* Convenience pointer to ent->file->shared */
H5F_shared_t *esf; /* Convenience pointer to ent->file->shared */
FUNC_ENTER_STATIC_NOERR
@ -718,10 +718,10 @@ H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail)
*-------------------------------------------------------------------------
*/
static void
H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail)
H5F__efc_try_close_tag2(H5F_shared_t *sf, H5F_shared_t **tail)
{
H5F_efc_ent_t *ent = NULL; /* EFC entry */
H5F_file_t *esf; /* Convenience pointer to ent->file->shared */
H5F_shared_t *esf; /* Convenience pointer to ent->file->shared */
FUNC_ENTER_STATIC_NOERR
@ -827,11 +827,11 @@ H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail)
herr_t
H5F__efc_try_close(H5F_t *f)
{
H5F_file_t *tail; /* Tail of linked list of found files. Head will be f->shared. */
H5F_file_t *uncloseable_head = NULL; /* Head of linked list of files found to be uncloseable by the first pass */
H5F_file_t *uncloseable_tail = NULL; /* Tail of linked list of files found to be uncloseable by the first pass */
H5F_file_t *sf; /* Temporary file pointer */
H5F_file_t *next; /* Temporary file pointer */
H5F_shared_t *tail; /* Tail of linked list of found files. Head will be f->shared. */
H5F_shared_t *uncloseable_head = NULL; /* Head of linked list of files found to be uncloseable by the first pass */
H5F_shared_t *uncloseable_tail = NULL; /* Tail of linked list of files found to be uncloseable by the first pass */
H5F_shared_t *sf; /* Temporary file pointer */
H5F_shared_t *next; /* Temporary file pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE

View File

@ -50,7 +50,7 @@ H5F_fake_alloc(uint8_t sizeof_size)
/* Allocate faked file struct */
if(NULL == (f = H5FL_CALLOC(H5F_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate top file structure")
if(NULL == (f->shared = H5FL_CALLOC(H5F_file_t)))
if(NULL == (f->shared = H5FL_CALLOC(H5F_shared_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared file structure")
/* Only set fields necessary for clients */
@ -93,7 +93,7 @@ H5F_fake_free(H5F_t *f)
if(f) {
/* Destroy shared file struct */
if(f->shared)
f->shared = H5FL_FREE(H5F_file_t, f->shared);
f->shared = H5FL_FREE(H5F_shared_t, f->shared);
f = H5FL_FREE(H5F_t, f);
} /* end if */

View File

@ -58,7 +58,7 @@ typedef struct H5F_olist_t {
struct {
hbool_t local; /* Set flag for "local" file searches */
union {
H5F_file_t *shared; /* Pointer to shared file to look inside */
H5F_shared_t *shared; /* Pointer to shared file to look inside */
const H5F_t *file; /* Pointer to file to look inside */
} ptr;
} file_info;
@ -81,7 +81,7 @@ static herr_t H5F__get_objects(const H5F_t *f, unsigned types, size_t max_index,
static int H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key);
static herr_t H5F__build_name(const char *prefix, const char *file_name, char **full_name/*out*/);
static char *H5F__getenv_prefix_name(char **env_prefix/*in,out*/);
static H5F_t *H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf);
static H5F_t *H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf);
static herr_t H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name);
static herr_t H5F__flush_phase1(H5F_t *f);
static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing);
@ -104,8 +104,8 @@ static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing);
/* Declare a free list to manage the H5F_t struct */
H5FL_DEFINE(H5F_t);
/* Declare a free list to manage the H5F_file_t struct */
H5FL_DEFINE(H5F_file_t);
/* Declare a free list to manage the H5F_shared_t struct */
H5FL_DEFINE(H5F_shared_t);
@ -246,9 +246,9 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set minimum raw data fraction of page buffer")
} /* end if */
#ifdef H5_HAVE_PARALLEL
if(H5P_set(new_plist, H5_COLL_MD_READ_FLAG_NAME, &(f->coll_md_read)) < 0)
if(H5P_set(new_plist, H5_COLL_MD_READ_FLAG_NAME, &(f->shared->coll_md_read)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set collective metadata read flag")
if(H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0)
if(H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->shared->coll_md_write)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set collective metadata read flag")
#endif /* H5_HAVE_PARALLEL */
if(H5P_set(new_plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0)
@ -901,7 +901,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5F_t *
H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
{
H5F_t *f = NULL;
H5F_t *ret_value = NULL;
@ -922,7 +922,7 @@ H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_
size_t u; /* Local index variable */
HDassert(lf != NULL);
if(NULL == (f->shared = H5FL_CALLOC(H5F_file_t)))
if(NULL == (f->shared = H5FL_CALLOC(H5F_shared_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared file structure")
f->shared->flags = flags;
@ -1020,9 +1020,9 @@ H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_
if(NULL == (f->shared->efc = H5F__efc_create(efc_size)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't create external file cache")
#ifdef H5_HAVE_PARALLEL
if(H5P_get(plist, H5_COLL_MD_READ_FLAG_NAME, &(f->coll_md_read)) < 0)
if(H5P_get(plist, H5_COLL_MD_READ_FLAG_NAME, &(f->shared->coll_md_read)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get collective metadata read flag")
if(H5P_get(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0)
if(H5P_get(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->shared->coll_md_write)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get collective metadata write flag")
#endif /* H5_HAVE_PARALLEL */
if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0)
@ -1041,7 +1041,7 @@ H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_
if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get free space type mapping from VFD")
if(H5MF_init_merge_flags(f) < 0)
if(H5MF_init_merge_flags(f->shared) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "problem initializing free space merge flags")
f->shared->tmp_addr = f->shared->maxaddr;
/* Disable temp. space allocation for parallel I/O (for now) */
@ -1141,7 +1141,7 @@ done:
if(H5I_dec_ref(f->shared->fcpl_id) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, NULL, "can't close property list")
f->shared = H5FL_FREE(H5F_file_t, f->shared);
f->shared = H5FL_FREE(H5F_shared_t, f->shared);
}
f = H5FL_FREE(H5F_t, f);
}
@ -1175,6 +1175,9 @@ H5F__dest(H5F_t *f, hbool_t flush)
if(1 == f->shared->nrefs) {
int actype; /* metadata cache type (enum value) */
/* Mark this file as closing */
f->shared->closing = TRUE;
/* Flush at this point since the file will be closed (phase 1).
* Only try to flush the file if it was opened with write access, and if
* the caller requested a flush.
@ -1325,7 +1328,7 @@ H5F__dest(H5F_t *f, hbool_t flush)
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
/* Shutdown the page buffer cache */
if(H5PB_dest(f) < 0)
if(H5PB_dest(f->shared) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing page buffer cache")
@ -1346,7 +1349,7 @@ H5F__dest(H5F_t *f, hbool_t flush)
} /* end if */
/* Destroy other components of the file */
if(H5F__accum_reset(f, TRUE) < 0)
if(H5F__accum_reset(f->shared, TRUE) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
if(H5FO_dest(f) < 0)
@ -1384,13 +1387,16 @@ H5F__dest(H5F_t *f, hbool_t flush)
f->shared->mtab.child = (H5F_mount_t *)H5MM_xfree(f->shared->mtab.child);
f->shared->mtab.nalloc = 0;
/* Free the external link file */
f->shared->extpath = (char *)H5MM_xfree(f->shared->extpath);
/* Clean up the metadata retries array */
for(actype = 0; actype < (int)H5AC_NTYPES; actype++)
if(f->shared->retries[actype])
f->shared->retries[actype] = (uint32_t *)H5MM_xfree(f->shared->retries[actype]);
/* Destroy shared file struct */
f->shared = (H5F_file_t *)H5FL_FREE(H5F_file_t, f->shared);
f->shared = (H5F_shared_t *)H5FL_FREE(H5F_shared_t, f->shared);
}
else if(f->shared->nrefs > 0) {
@ -1404,7 +1410,6 @@ H5F__dest(H5F_t *f, hbool_t flush)
/* Free the non-shared part of the file */
f->open_name = (char *)H5MM_xfree(f->open_name);
f->actual_name = (char *)H5MM_xfree(f->actual_name);
f->extpath = (char *)H5MM_xfree(f->extpath);
if(H5FO_top_dest(f) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file")
f->shared = NULL;
@ -1491,7 +1496,7 @@ H5F_t *
H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
{
H5F_t *file = NULL; /*the success return value */
H5F_file_t *shared = NULL; /*shared part of `file' */
H5F_shared_t *shared = NULL; /*shared part of `file' */
H5FD_t *lf = NULL; /*file driver part of `shared' */
unsigned tent_flags; /*tentative flags */
H5FD_class_t *drvr; /*file driver class info */
@ -1650,7 +1655,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
if(page_buf_size) {
#ifdef H5_HAVE_PARALLEL
/* Collective metadata writes are not supported with page buffering */
if(file->coll_md_write)
if(file->shared->coll_md_write)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "collective metadata writes are not supported with page buffering")
/* Temporary: fail file create when page buffering feature is enabled for parallel */
@ -1675,7 +1680,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
/* Create the page buffer before initializing the superblock */
if(page_buf_size)
if(H5PB_create(file, page_buf_size, page_buf_min_meta_perc, page_buf_min_raw_perc) < 0)
if(H5PB_create(shared, page_buf_size, page_buf_min_meta_perc, page_buf_min_raw_perc) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create page buffer")
/* Initialize information about the superblock and allocate space for it */
@ -1697,7 +1702,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
/* Create the page buffer before initializing the superblock */
if(page_buf_size)
if(H5PB_create(file, page_buf_size, page_buf_min_meta_perc, page_buf_min_raw_perc) < 0)
if(H5PB_create(shared, page_buf_size, page_buf_min_meta_perc, page_buf_min_raw_perc) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create page buffer")
/* Open the root group */
@ -1750,8 +1755,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
} /* end if */
/* Formulate the absolute path for later search of target file for external links */
if(H5_build_extpath(name, &file->extpath) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to build extpath")
if(shared->nrefs == 1) {
if(H5_build_extpath(name, &file->shared->extpath) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to build extpath")
}
/* Formulate the actual file name, after following symlinks, etc. */
if(H5F__build_actual_name(file, a_plist, name, &file->actual_name) < 0)
@ -1905,12 +1912,12 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing)
#endif /* H5_HAVE_PARALLEL */
/* Flush out the metadata accumulator */
if(H5F__accum_flush(f) < 0)
if(H5F__accum_flush(f->shared) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator")
/* Flush the page buffer */
if(H5PB_flush(f) < 0)
if(H5PB_flush(f->shared) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "page buffer flush failed")
@ -2181,7 +2188,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/)
*/
/* Destroy the H5F_t struct and decrement the reference count for the
* shared H5F_file_t struct. If the reference count for the H5F_file_t
* shared H5F_shared_t struct. If the reference count for the H5F_shared_t
* struct reaches zero then destroy it also.
*/
if(H5F__dest(f, TRUE) < 0)
@ -2224,7 +2231,6 @@ H5F__reopen(H5F_t *f)
/* Duplicate old file's names */
ret_value->open_name = H5MM_xstrdup(f->open_name);
ret_value->actual_name = H5MM_xstrdup(f->actual_name);
ret_value->extpath = H5MM_xstrdup(f->extpath);
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -3152,31 +3158,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__get_max_eof_eoa() */
#ifdef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: H5F_set_coll_md_read
*
* Purpose: Set the coll_md_read field with a new value.
*
* Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
void
H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr)
{
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
HDassert(f);
f->coll_md_read = cmr;
FUNC_LEAVE_NOAPI_VOID
} /* H5F_set_coll_md_read() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
* Function: H5F_get_metadata_read_retry_info
@ -3416,7 +3397,7 @@ H5F__start_swmr_write(H5F_t *f)
} /* end if */
/* Flush and reset the accumulator */
if(H5F__accum_reset(f, TRUE) < 0)
if(H5F__accum_reset(f->shared, TRUE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
/* Turn on SWMR write in shared file open flags */

View File

@ -75,6 +75,50 @@
/*******************/
/*-------------------------------------------------------------------------
* Function: H5F_shared_block_read
*
* Purpose: Reads some data from a file/server/etc into a buffer.
* The data is contiguous. The address is relative to the base
* address for the file.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
*/
herr_t
H5F_shared_block_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/)
{
H5FD_mem_t map_type; /* Mapped memory type */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f_sh);
HDassert(buf);
HDassert(H5F_addr_defined(addr));
/* Check for attempting I/O on 'temporary' file address */
if(H5F_addr_le(f_sh->tmp_addr, (addr + size)))
HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space")
/* Treat global heap as raw data */
map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
/* Pass through page buffer layer */
if(H5PB_read(f_sh, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_shared_block_read() */
/*-------------------------------------------------------------------------
* Function: H5F_block_read
@ -113,13 +157,58 @@ H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*
map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
/* Pass through page buffer layer */
if(H5PB_read(f, map_type, addr, size, buf) < 0)
if(H5PB_read(f->shared, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_block_read() */
/*-------------------------------------------------------------------------
* Function: H5F_shared_block_write
*
* Purpose: Writes some data from memory to a file/server/etc. The
* data is contiguous. The address is relative to the base
* address.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
*/
herr_t
H5F_shared_block_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf)
{
H5FD_mem_t map_type; /* Mapped memory type */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f_sh);
HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR);
HDassert(buf);
HDassert(H5F_addr_defined(addr));
/* Check for attempting I/O on 'temporary' file address */
if(H5F_addr_le(f_sh->tmp_addr, (addr + size)))
HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space")
/* Treat global heap as raw data */
map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
/* Pass through page buffer layer */
if(H5PB_write(f_sh, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_shared_block_write() */
/*-------------------------------------------------------------------------
* Function: H5F_block_write
@ -159,7 +248,7 @@ H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void
map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
/* Pass through page buffer layer */
if(H5PB_write(f, map_type, addr, size, buf) < 0)
if(H5PB_write(f->shared, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed")
done:
@ -170,7 +259,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_flush_tagged_metadata
*
* Purpose: Flushes metadata with specified tag in the metadata cache
* Purpose: Flushes metadata with specified tag in the metadata cache
* to disk.
*
* Return: Non-negative on success/Negative on failure
@ -192,7 +281,7 @@ H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
/* Flush and reset the accumulator */
if(H5F__accum_reset(f, TRUE) < 0)
if(H5F__accum_reset(f->shared, TRUE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
/* Flush file buffers to disk. */

View File

@ -130,7 +130,7 @@ H5F_mpi_get_rank(const H5F_t *f)
/* Dispatch to driver */
if ((ret_value = H5FD_mpi_get_rank(f->shared->lf)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, (-1), "driver get_rank request failed")
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_rank request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -162,12 +162,44 @@ H5F_mpi_get_comm(const H5F_t *f)
/* Dispatch to driver */
if ((ret_value = H5FD_mpi_get_comm(f->shared->lf)) == MPI_COMM_NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed")
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mpi_get_comm() */
/*-------------------------------------------------------------------------
* Function: H5F_shared_mpi_get_size
*
* Purpose: Retrieves the size of an MPI process.
*
* Return: Success: The size (positive)
*
* Failure: Negative
*
* Programmer: John Mainzer
* Friday, May 6, 2005
*
*-------------------------------------------------------------------------
*/
int
H5F_shared_mpi_get_size(const H5F_shared_t *f_sh)
{
int ret_value = -1;
FUNC_ENTER_NOAPI((-1))
HDassert(f_sh);
/* Dispatch to driver */
if((ret_value = H5FD_mpi_get_size(f_sh->lf)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_size request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_shared_mpi_get_size() */
/*-------------------------------------------------------------------------
* Function: H5F_mpi_get_size
@ -194,7 +226,7 @@ H5F_mpi_get_size(const H5F_t *f)
/* Dispatch to driver */
if ((ret_value = H5FD_mpi_get_size(f->shared->lf)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, (-1), "driver get_size request failed")
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_size request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -336,14 +368,9 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm)
if(NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_FILE, 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_FILE, H5E_BADVALUE, FAIL, "bad VFL driver info")
*mpi_comm = fa->comm;
}
if(H5FD_MPIO == H5P_peek_driver(plist))
if(H5P_peek(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, mpi_comm) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator")
}
done:

View File

@ -217,7 +217,7 @@ typedef struct H5F_mtab_t {
} H5F_mtab_t;
/* Structure specifically to store superblock. This was originally
* maintained entirely within H5F_file_t, but is now extracted
* maintained entirely within H5F_shared_t, but is now extracted
* here because the superblock is now handled by the cache */
typedef struct H5F_super_t {
H5AC_info_t cache_info; /* Cache entry information structure */
@ -238,11 +238,11 @@ typedef struct H5F_super_t {
/*
* Define the structure to store the file information for HDF5 files. One of
* these structures is allocated per file, not per H5Fopen(). That is, set of
* H5F_t structs can all point to the same H5F_file_t struct. The `nrefs'
* H5F_t structs can all point to the same H5F_shared_t struct. The `nrefs'
* count in this struct indicates the number of H5F_t structs which are
* pointing to this struct.
*/
struct H5F_file_t {
struct H5F_shared_t {
H5FD_t *lf; /* Lower level file handle for I/O */
H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */
H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info
@ -309,6 +309,7 @@ struct H5F_file_t {
struct H5G_t *root_grp; /* Open root group */
H5FO_t *open_objs; /* Open objects in file */
H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */
hbool_t closing; /* File is in the process of being closed */
/* Cached VOL connector ID & info */
hid_t vol_id; /* ID of VOL connector for the container */
@ -357,28 +358,31 @@ struct H5F_file_t {
/* Object flush info */
H5F_object_flush_t object_flush; /* Information for object flush callback */
hbool_t crt_dset_min_ohdr_flag; /* flag to minimize created dataset object header */
char *extpath; /* Path for searching target external link file */
#ifdef H5_HAVE_PARALLEL
H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */
hbool_t coll_md_write; /* Do all metadata writes collectively */
#endif /* H5_HAVE_PARALLEL */
};
/*
* This is the top-level file descriptor. One of these structures is
* allocated every time H5Fopen() is called although they may contain pointers
* to shared H5F_file_t structs.
* to shared H5F_shared_t structs.
*/
struct H5F_t {
char *open_name; /* Name used to open file */
char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */
char *extpath; /* Path for searching target external link file */
H5F_file_t *shared; /* The shared file info */
unsigned nopen_objs; /* Number of open object headers */
char *open_name; /* Name used to open file */
char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */
H5F_shared_t *shared; /* The shared file info */
unsigned nopen_objs; /* Number of open object headers */
H5FO_t *obj_count; /* # of time each object is opened through top file structure */
hbool_t id_exists; /* Whether an ID for this struct exists */
hbool_t closing; /* File is in the process of being closed */
struct H5F_t *parent; /* Parent file that this file is mounted to */
unsigned nmounts; /* Number of children mounted to this file */
#ifdef H5_HAVE_PARALLEL
H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */
hbool_t coll_md_write; /* Do all metadata writes collectively */
#endif /* H5_HAVE_PARALLEL */
};
/*****************************/
@ -388,8 +392,8 @@ struct H5F_t {
/* Declare a free list to manage the H5F_t struct */
H5FL_EXTERN(H5F_t);
/* Declare a free list to manage the H5F_file_t struct */
H5FL_EXTERN(H5F_file_t);
/* Declare a free list to manage the H5F_shared_t struct */
H5FL_EXTERN(H5F_shared_t);
/******************************/
@ -429,16 +433,16 @@ H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id);
H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created);
/* Metadata accumulator routines */
H5_DLL herr_t H5F__accum_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf);
H5_DLL herr_t H5F__accum_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5F__accum_free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size);
H5_DLL herr_t H5F__accum_flush(H5F_t *f);
H5_DLL herr_t H5F__accum_reset(H5F_t *f, hbool_t flush);
H5_DLL herr_t H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf);
H5_DLL herr_t H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5F__accum_free(H5F_shared_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size);
H5_DLL herr_t H5F__accum_flush(H5F_shared_t *f_sh);
H5_DLL herr_t H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush);
/* Shared file list related routines */
H5_DLL herr_t H5F__sfile_add(H5F_file_t *shared);
H5_DLL H5F_file_t *H5F__sfile_search(H5FD_t *lf);
H5_DLL herr_t H5F__sfile_remove(H5F_file_t *shared);
H5_DLL herr_t H5F__sfile_add(H5F_shared_t *shared);
H5_DLL H5F_shared_t *H5F__sfile_search(H5FD_t *lf);
H5_DLL herr_t H5F__sfile_remove(H5F_shared_t *shared);
/* External file cache routines */
H5_DLL H5F_efc_t *H5F__efc_create(unsigned max_nfiles);

View File

@ -278,10 +278,11 @@ typedef struct H5F_t H5F_t;
#ifdef H5F_MODULE
#define H5F_LOW_BOUND(F) ((F)->shared->low_bound)
#define H5F_HIGH_BOUND(F) ((F)->shared->high_bound)
#define H5F_SHARED_INTENT(F_SH) ((F_SH)->flags)
#define H5F_INTENT(F) ((F)->shared->flags)
#define H5F_OPEN_NAME(F) ((F)->open_name)
#define H5F_ACTUAL_NAME(F) ((F)->actual_name)
#define H5F_EXTPATH(F) ((F)->extpath)
#define H5F_EXTPATH(F) ((F)->shared->extpath)
#define H5F_SHARED(F) ((F)->shared)
#define H5F_SAME_SHARED(F1, F2) ((F1)->shared == (F2)->shared)
#define H5F_NOPEN_OBJS(F) ((F)->nopen_objs)
@ -293,6 +294,7 @@ typedef struct H5F_t H5F_t;
#define H5F_GET_READ_ATTEMPTS(F) ((F)->shared->read_attempts)
#define H5F_DRIVER_ID(F) ((F)->shared->lf->driver_id)
#define H5F_GET_FILENO(F,FILENUM) ((FILENUM) = (F)->shared->lf->fileno)
#define H5F_SHARED_HAS_FEATURE(F_SH,FL) ((F_SH)->lf->feature_flags & (FL))
#define H5F_HAS_FEATURE(F,FL) ((F)->shared->lf->feature_flags & (FL))
#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr)
#define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k)
@ -321,7 +323,7 @@ typedef struct H5F_t H5F_t;
#define H5F_USE_TMP_SPACE(F) ((F)->shared->fs.use_tmp_space)
#define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->fs.tmp_addr, (ADDR)))
#ifdef H5_HAVE_PARALLEL
#define H5F_COLL_MD_READ(F) ((F)->coll_md_read)
#define H5F_COLL_MD_READ(F) ((F)->shared->coll_md_read)
#endif /* H5_HAVE_PARALLEL */
#define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging)
#define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access)
@ -336,6 +338,7 @@ typedef struct H5F_t H5F_t;
#else /* H5F_MODULE */
#define H5F_LOW_BOUND(F) (H5F_get_low_bound(F))
#define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F))
#define H5F_SHARED_INTENT(F_SH) (H5F_shared_get_intent(F_SH))
#define H5F_INTENT(F) (H5F_get_intent(F))
#define H5F_OPEN_NAME(F) (H5F_get_open_name(F))
#define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F))
@ -351,6 +354,7 @@ typedef struct H5F_t H5F_t;
#define H5F_GET_READ_ATTEMPTS(F) (H5F_get_read_attempts(F))
#define H5F_DRIVER_ID(F) (H5F_get_driver_id(F))
#define H5F_GET_FILENO(F,FILENUM) (H5F_get_fileno((F), &(FILENUM)))
#define H5F_SHARED_HAS_FEATURE(F_SH,FL) (H5F_shared_has_feature(F_SH,FL))
#define H5F_HAS_FEATURE(F,FL) (H5F_has_feature(F,FL))
#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F))
#define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F))
@ -509,6 +513,10 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_PAGE_BUFFER_SIZE_NAME "page_buffer_size" /* the maximum size for the page buffer cache */
#define H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME "page_buffer_min_meta_perc" /* the min metadata percentage for the page buffer cache */
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */
#ifdef H5_HAVE_PARALLEL
#define H5F_ACS_MPI_PARAMS_COMM_NAME "mpi_params_comm" /* the MPI communicator */
#define H5F_ACS_MPI_PARAMS_INFO_NAME "mpi_params_info" /* the MPI info struct */
#endif /* H5_HAVE_PARALLEL */
/* ======================== File Mount properties ====================*/
#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
@ -575,6 +583,7 @@ typedef struct H5F_t H5F_t;
#define H5F_SDATA_BLOCK_SIZE_DEF 2048
/* Check for file using paged aggregation */
#define H5F_SHARED_PAGED_AGGR(F_SH) ((F_SH)->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && (F_SH)->fs_page_size)
#define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size)
/* Metadata read attempt values */
@ -651,7 +660,7 @@ struct H5P_genplist_t;
/* Forward declarations for anonymous H5F objects */
/* Main file structures */
typedef struct H5F_file_t H5F_file_t;
typedef struct H5F_shared_t H5F_shared_t;
/* Block aggregation structure */
typedef struct H5F_blk_aggr_t H5F_blk_aggr_t;
@ -723,11 +732,12 @@ H5_DLL hid_t H5F_get_file_id(hid_t obj_id, H5I_type_t id_type, hbool_t app_ref);
/* Functions that retrieve values from the file struct */
H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f);
H5_DLL H5F_libver_t H5F_get_high_bound(const H5F_t *f);
H5_DLL unsigned H5F_shared_get_intent(const H5F_shared_t *f);
H5_DLL unsigned H5F_get_intent(const H5F_t *f);
H5_DLL char *H5F_get_open_name(const H5F_t *f);
H5_DLL char *H5F_get_actual_name(const H5F_t *f);
H5_DLL char *H5F_get_extpath(const H5F_t *f);
H5_DLL H5F_file_t *H5F_get_shared(const H5F_t *f);
H5_DLL H5F_shared_t *H5F_get_shared(const H5F_t *f);
H5_DLL hbool_t H5F_same_shared(const H5F_t *f1, const H5F_t *f2);
H5_DLL unsigned H5F_get_nopen_objs(const H5F_t *f);
H5_DLL unsigned H5F_incr_nopen_objs(H5F_t *f);
@ -786,7 +796,9 @@ H5_DLL char *H5F_mdc_log_location(const H5F_t *f);
/* Functions that retrieve values from VFD layer */
H5_DLL hid_t H5F_get_driver_id(const H5F_t *f);
H5_DLL herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum);
H5_DLL hbool_t H5F_shared_has_feature(const H5F_shared_t *f, unsigned feature);
H5_DLL hbool_t H5F_has_feature(const H5F_t *f, unsigned feature);
H5_DLL haddr_t H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type);
H5_DLL haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type);
H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle);
@ -797,7 +809,9 @@ H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/);
H5_DLL herr_t H5F_flush_mounts(H5F_t *f);
/* Functions that operate on blocks of bytes wrt super block */
H5_DLL herr_t H5F_shared_block_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/);
H5_DLL herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/);
H5_DLL herr_t H5F_shared_block_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
/* Functions that flush or evict */
@ -837,6 +851,7 @@ H5_DLL herr_t H5F_eoa_dirty(H5F_t *f);
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_shared_mpi_get_size(const H5F_shared_t *f_sh);
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);
H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info);
@ -853,7 +868,7 @@ H5_DLL H5F_t *H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix
H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap);
H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr);
H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, hbool_t add_heap);
H5_DLL herr_t H5F_cwfs_remove_heap(H5F_file_t *shared, struct H5HG_heap_t *heap);
H5_DLL herr_t H5F_cwfs_remove_heap(H5F_shared_t *shared, struct H5HG_heap_t *heap);
/* Debugging functions */
H5_DLL herr_t H5F_debug(H5F_t *f, FILE * stream, int indent, int fwidth);

View File

@ -73,6 +73,28 @@
/*******************/
/*-------------------------------------------------------------------------
* Function: H5F_shared_get_intent
*
* Purpose: Quick and dirty routine to retrieve the file's 'intent' flags
* (Mainly added to stop non-file routines from poking about in the
* H5F_shared_t data structure)
*
* Return: 'intent' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
H5F_shared_get_intent(const H5F_shared_t *f_sh)
{
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(f_sh);
FUNC_LEAVE_NOAPI(f_sh->flags)
} /* end H5F_shared_get_intent() */
/*-------------------------------------------------------------------------
* Function: H5F_get_intent
@ -207,9 +229,9 @@ H5F_get_extpath(const H5F_t *f)
FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(f);
HDassert(f->extpath);
HDassert(f->shared->extpath);
FUNC_LEAVE_NOAPI(f->extpath)
FUNC_LEAVE_NOAPI(f->shared->extpath)
} /* end H5F_get_extpath() */
@ -221,7 +243,7 @@ H5F_get_extpath(const H5F_t *f)
* Return: 'shared' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
H5F_file_t *
H5F_shared_t *
H5F_get_shared(const H5F_t *f)
{
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
@ -825,6 +847,27 @@ H5F_store_msg_crt_idx(const H5F_t *f)
FUNC_LEAVE_NOAPI(f->shared->store_msg_crt_idx)
} /* end H5F_store_msg_crt_idx() */
/*-------------------------------------------------------------------------
* Function: H5F_shared_has_feature
*
* Purpose: Check if a file has a particular feature enabled
*
* Return: Success: Non-negative - TRUE or FALSE
* Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
hbool_t
H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature)
{
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(f_sh);
FUNC_LEAVE_NOAPI((hbool_t)(f_sh->lf->feature_flags & feature))
} /* end H5F_shared_has_feature() */
/*-------------------------------------------------------------------------
* Function: H5F_has_feature
@ -902,6 +945,32 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_fileno() */
/*-------------------------------------------------------------------------
* Function: H5F_shared_get_eoa
*
* Purpose: Quick and dirty routine to retrieve the file's 'eoa' value
*
* Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
haddr_t
H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type)
{
haddr_t ret_value = HADDR_UNDEF; /* Return value */
FUNC_ENTER_NOAPI(HADDR_UNDEF)
HDassert(f_sh);
/* Dispatch to driver */
if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(f_sh->lf, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_shared_get_eoa() */
/*-------------------------------------------------------------------------
* Function: H5F_get_eoa
@ -1026,7 +1095,7 @@ H5F_coll_md_read(const H5F_t *f)
HDassert(f);
FUNC_LEAVE_NOAPI(f->coll_md_read)
FUNC_LEAVE_NOAPI(f->shared->coll_md_read)
} /* end H5F_coll_md_read() */
#endif /* H5_HAVE_PARALLEL */

View File

@ -24,7 +24,7 @@
/* Struct for tracking "shared" file structs */
typedef struct H5F_sfile_node_t {
H5F_file_t *shared; /* Pointer to "shared" file struct */
H5F_shared_t *shared; /* Pointer to "shared" file struct */
struct H5F_sfile_node_t *next; /* Pointer to next node */
} H5F_sfile_node_t;
@ -96,9 +96,9 @@ H5F_sfile_assert_num(unsigned n)
*-------------------------------------------------------------------------
*/
herr_t
H5F__sfile_add(H5F_file_t *shared)
H5F__sfile_add(H5F_shared_t *shared)
{
H5F_sfile_node_t *new_shared; /* New shared file node */
H5F_sfile_node_t *new_shared; /* New shared file node */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@ -135,11 +135,11 @@ done:
*
*-------------------------------------------------------------------------
*/
H5F_file_t *
H5F_shared_t *
H5F__sfile_search(H5FD_t *lf)
{
H5F_sfile_node_t *curr; /* Current shared file node */
H5F_file_t *ret_value = NULL; /* Return value */
H5F_shared_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE_NOERR
@ -175,7 +175,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__sfile_remove(H5F_file_t *shared)
H5F__sfile_remove(H5F_shared_t *shared)
{
H5F_sfile_node_t *curr; /* Current shared file node */
H5F_sfile_node_t *last; /* Last shared file node */

View File

@ -117,7 +117,7 @@ typedef struct H5HG_obj_t {
} H5HG_obj_t;
/* Forward declarations for fields */
struct H5F_file_t;
struct H5F_shared_t;
struct H5HG_heap_t {
H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
@ -130,7 +130,7 @@ struct H5HG_heap_t {
/* If this value is >65535 then all indices */
/* have been used at some time and the */
/* correct new index should be searched for */
struct H5F_file_t *shared; /* shared file */
struct H5F_shared_t *shared; /* shared file */
H5HG_obj_t *obj; /*array of object descriptions */
};

View File

@ -55,6 +55,11 @@
if(!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \
*CF = TRUE;
/* For non-paged aggregation: map allocation request type to tracked free-space type */
/* F_SH -- pointer to H5F_shared_t; T -- H5FD_mem_t */
#define H5MF_ALLOC_TO_FS_AGGR_TYPE(F_SH, T) \
((H5FD_MEM_DEFAULT == (F_SH)->fs_type_map[T]) ? (T) : (F_SH)->fs_type_map[T])
/******************/
/* Local Typedefs */
/******************/
@ -93,9 +98,9 @@ static herr_t H5MF__close_shrink_eoa(H5F_t *f);
/* General routines */
static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums);
static hbool_t H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type);
static hbool_t H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace);
static herr_t H5MF__continue_alloc_fsm(H5F_t *f, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace,
static hbool_t H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type);
static hbool_t H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace);
static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace,
H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm);
/* Free-space type manager routines */
@ -141,7 +146,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
*-------------------------------------------------------------------------
*/
herr_t
H5MF_init_merge_flags(H5F_t *f)
H5MF_init_merge_flags(H5F_shared_t *f_sh)
{
H5MF_aggr_merge_t mapping_type; /* Type of free list mapping */
H5FD_mem_t type; /* Memory type for iteration */
@ -151,9 +156,8 @@ H5MF_init_merge_flags(H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
/* check args */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->lf);
HDassert(f_sh);
HDassert(f_sh->lf);
/* Iterate over all the free space types to determine if sections of that type
* can merge with the metadata or small 'raw' data aggregator
@ -161,21 +165,21 @@ H5MF_init_merge_flags(H5F_t *f)
all_same = TRUE;
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type))
/* Check for any different type mappings */
if(f->shared->fs_type_map[type] != f->shared->fs_type_map[H5FD_MEM_DEFAULT]) {
if(f_sh->fs_type_map[type] != f_sh->fs_type_map[H5FD_MEM_DEFAULT]) {
all_same = FALSE;
break;
} /* end if */
/* Check for all allocation types mapping to the same free list type */
if(all_same) {
if(f->shared->fs_type_map[H5FD_MEM_DEFAULT] == H5FD_MEM_DEFAULT)
if(f_sh->fs_type_map[H5FD_MEM_DEFAULT] == H5FD_MEM_DEFAULT)
mapping_type = H5MF_AGGR_MERGE_SEPARATE;
else
mapping_type = H5MF_AGGR_MERGE_TOGETHER;
} /* end if */
else {
/* Check for raw data mapping into same list as metadata */
if(f->shared->fs_type_map[H5FD_MEM_DRAW] == f->shared->fs_type_map[H5FD_MEM_SUPER])
if(f_sh->fs_type_map[H5FD_MEM_DRAW] == f_sh->fs_type_map[H5FD_MEM_SUPER])
mapping_type = H5MF_AGGR_MERGE_SEPARATE;
else {
hbool_t all_metadata_same; /* Whether all metadata go in same free list */
@ -188,7 +192,7 @@ H5MF_init_merge_flags(H5F_t *f)
/* (global heap is treated as raw data) */
if(type != H5FD_MEM_DRAW && type != H5FD_MEM_GHEAP) {
/* Check for any different type mappings */
if(f->shared->fs_type_map[type] != f->shared->fs_type_map[H5FD_MEM_SUPER]) {
if(f_sh->fs_type_map[type] != f_sh->fs_type_map[H5FD_MEM_SUPER]) {
all_metadata_same = FALSE;
break;
} /* end if */
@ -206,30 +210,30 @@ H5MF_init_merge_flags(H5F_t *f)
switch(mapping_type) {
case H5MF_AGGR_MERGE_SEPARATE:
/* Don't merge any metadata together */
HDmemset(f->shared->fs_aggr_merge, 0, sizeof(f->shared->fs_aggr_merge));
HDmemset(f_sh->fs_aggr_merge, 0, sizeof(f_sh->fs_aggr_merge));
/* Check if merging raw data should be allowed */
/* (treat global heaps as raw data) */
if(H5FD_MEM_DRAW == f->shared->fs_type_map[H5FD_MEM_DRAW] ||
H5FD_MEM_DEFAULT == f->shared->fs_type_map[H5FD_MEM_DRAW]) {
f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
if(H5FD_MEM_DRAW == f_sh->fs_type_map[H5FD_MEM_DRAW] ||
H5FD_MEM_DEFAULT == f_sh->fs_type_map[H5FD_MEM_DRAW]) {
f_sh->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
f_sh->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
} /* end if */
break;
case H5MF_AGGR_MERGE_DICHOTOMY:
/* Merge all metadata together (but not raw data) */
HDmemset(f->shared->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f->shared->fs_aggr_merge));
HDmemset(f_sh->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f_sh->fs_aggr_merge));
/* Allow merging raw data allocations together */
/* (treat global heaps as raw data) */
f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
f_sh->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
f_sh->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
break;
case H5MF_AGGR_MERGE_TOGETHER:
/* Merge all allocation types together */
HDmemset(f->shared->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA), sizeof(f->shared->fs_aggr_merge));
HDmemset(f_sh->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA), sizeof(f_sh->fs_aggr_merge));
break;
default:
@ -254,31 +258,32 @@ done:
*-------------------------------------------------------------------------
*/
void
H5MF__alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type)
H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type)
{
FUNC_ENTER_PACKAGE_NOERR
HDassert(f);
/* Check arguments */
HDassert(f_sh);
HDassert(fs_type);
if(H5F_PAGED_AGGR(f)) { /* paged aggregation */
if(size >= f->shared->fs_page_size) {
if(H5F_HAS_FEATURE(f, H5FD_FEAT_PAGED_AGGR)) { /* multi or split driver */
if(H5F_SHARED_PAGED_AGGR(f_sh)) { /* paged aggregation */
if(size >= f_sh->fs_page_size) {
if(H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_PAGED_AGGR)) { /* multi or split driver */
/* For non-contiguous address space, map to large size free-space manager for each alloc_type */
if(H5FD_MEM_DEFAULT == f->shared->fs_type_map[alloc_type])
*fs_type = (H5F_mem_page_t) (alloc_type + (H5FD_MEM_NTYPES - 1));
if(H5FD_MEM_DEFAULT == f_sh->fs_type_map[alloc_type])
*fs_type = (H5F_mem_page_t)(alloc_type + (H5FD_MEM_NTYPES - 1));
else
*fs_type = (H5F_mem_page_t) (f->shared->fs_type_map[alloc_type] + (H5FD_MEM_NTYPES - 1));
*fs_type = (H5F_mem_page_t)(f_sh->fs_type_map[alloc_type] + (H5FD_MEM_NTYPES - 1));
} /* end if */
else
/* For contiguous address space, map to generic large size free-space manager */
*fs_type = H5F_MEM_PAGE_GENERIC; /* H5F_MEM_PAGE_SUPER */
} /* end if */
else
*fs_type = (H5F_mem_page_t)H5MF_ALLOC_TO_FS_AGGR_TYPE(f, alloc_type);
*fs_type = (H5F_mem_page_t)H5MF_ALLOC_TO_FS_AGGR_TYPE(f_sh, alloc_type);
} /* end if */
else /* non-paged aggregation */
*fs_type = (H5F_mem_page_t)H5MF_ALLOC_TO_FS_AGGR_TYPE(f, alloc_type);
*fs_type = (H5F_mem_page_t)H5MF_ALLOC_TO_FS_AGGR_TYPE(f_sh, alloc_type);
FUNC_LEAVE_NOAPI_VOID
} /* end H5MF__alloc_to_fs_type() */
@ -340,7 +345,7 @@ H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type)
} /* end else */
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, type))
if(H5MF__fsm_type_is_self_referential(f->shared, type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -428,7 +433,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type)
} /* end else */
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, type))
if(H5MF__fsm_type_is_self_referential(f->shared, type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -544,7 +549,7 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type)
f->shared->fs_state[type] = H5F_FS_STATE_DELETING;
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, type))
if(H5MF__fsm_type_is_self_referential(f->shared, type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -620,7 +625,6 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5MF__close_fstype() */
/*-------------------------------------------------------------------------
* Function: H5MF__add_sect
@ -649,7 +653,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio
HDassert(fspace);
HDassert(node);
H5MF__alloc_to_fs_type(f, alloc_type, node->sect_info.size, &fs_type);
H5MF__alloc_to_fs_type(f->shared, alloc_type, node->sect_info.size, &fs_type);
/* Construct user data for callbacks */
udata.f = f;
@ -658,7 +662,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio
udata.allow_eoa_shrink_only = FALSE;
/* Set the ring type in the API context */
if(H5MF__fsm_is_self_referential(f, fspace))
if(H5MF__fsm_is_self_referential(f->shared, fspace))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -708,7 +712,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace,
HDassert(fspace);
/* Set the ring type in the API context */
if(H5MF__fsm_is_self_referential(f, fspace))
if(H5MF__fsm_is_self_referential(f->shared, fspace))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -801,14 +805,14 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
HDassert(f->shared->lf);
HDassert(size > 0);
H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type);
#ifdef H5MF_ALLOC_DEBUG_MORE
HDfprintf(stderr, "%s: Check 1.0\n", FUNC);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fs_type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -907,15 +911,15 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size);
#endif /* H5MF_ALLOC_DEBUG */
H5MF__alloc_to_fs_type(f, alloc_type, size, &ptype);
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &ptype);
switch(ptype) {
case H5F_MEM_PAGE_GENERIC:
case H5F_MEM_PAGE_LARGE_BTREE:
case H5F_MEM_PAGE_LARGE_DRAW:
case H5F_MEM_PAGE_LARGE_GHEAP:
case H5F_MEM_PAGE_LARGE_LHEAP:
case H5F_MEM_PAGE_LARGE_OHDR:
case H5F_MEM_PAGE_GENERIC:
case H5F_MEM_PAGE_LARGE_BTREE:
case H5F_MEM_PAGE_LARGE_DRAW:
case H5F_MEM_PAGE_LARGE_GHEAP:
case H5F_MEM_PAGE_LARGE_LHEAP:
case H5F_MEM_PAGE_LARGE_OHDR:
{
haddr_t eoa; /* EOA for the file */
hsize_t frag_size = 0; /* Fragment size */
@ -952,7 +956,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
}
break;
case H5F_MEM_PAGE_META:
case H5F_MEM_PAGE_META:
case H5F_MEM_PAGE_DRAW:
case H5F_MEM_PAGE_BTREE:
case H5F_MEM_PAGE_GHEAP:
@ -980,13 +984,13 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
node = NULL;
/* Insert the new page into the Page Buffer list of new pages so
/* Insert the new page into the Page Buffer list of new pages so
we don't read an empty page from disk */
if(f->shared->page_buf != NULL && H5PB_add_new_page(f, alloc_type, new_page) < 0)
if(f->shared->page_buf != NULL && H5PB_add_new_page(f->shared, alloc_type, new_page) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't add new page to Page Buffer new page list")
ret_value = new_page;
}
}
break;
case H5F_MEM_PAGE_NTYPES:
@ -1108,10 +1112,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
HGOTO_DONE(SUCCEED)
HDassert(addr != 0); /* Can't deallocate the superblock :-) */
H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fs_type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -1133,11 +1137,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
/* If it's metadata, check if the space to free intersects with the file's
* metadata accumulator
*/
if(H5FD_MEM_DRAW != alloc_type) {
if(H5FD_MEM_DRAW != alloc_type)
/* Check if the space to free intersects with the file's metadata accumulator */
if(H5F__accum_free(f, alloc_type, addr, size) < 0)
if(H5F__accum_free(f->shared, alloc_type, addr, size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator")
} /* end if */
/* Check if the free space manager for the file has been initialized */
if(!f->shared->fs_man[fs_type]) {
@ -1326,10 +1329,10 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r
} /* end if */
/* Get free space type from allocation type */
H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fs_type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -1477,10 +1480,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
HDassert(sect_cls);
/* Get free space type from allocation type */
H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fs_type))
fsm_ring = H5AC_RING_MDFSM;
else
fsm_ring = H5AC_RING_RDFSM;
@ -1553,11 +1556,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
if(H5F_PAGED_AGGR(f)) {
if((ret_value = H5MF__close_pagefs(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'page' file space")
}
} /* end if */
else {
if((ret_value = H5MF__close_aggrfs(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'aggr' file space")
}
} /* end else */
done:
#ifdef H5MF_ALLOC_DEBUG
@ -1663,10 +1666,10 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
*
* The situation is further complicated if a cache image exists
* and had not yet been loaded into the metadata cache. In this
* case, call H5AC_force_cache_image_load() instead of
* case, call H5AC_force_cache_image_load() instead of
* H5MF_tidy_self_referential_fsm_hack(). H5AC_force_cache_image_load()
* will load the cache image, and then call
* H5MF_tidy_self_referential_fsm_hack() to discard the cache image
* will load the cache image, and then call
* H5MF_tidy_self_referential_fsm_hack() to discard the cache image
* block.
*/
@ -1680,12 +1683,12 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
if(H5F_PAGED_AGGR(f)) {
H5F_mem_page_t ptype; /* Memory type for iteration */
/* Iterate over all the free space types that have managers and
* get each free list's space
/* Iterate over all the free space types that have managers and
* get each free list's space
*/
for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, ptype))
if(H5MF__fsm_type_is_self_referential(f->shared, ptype))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -1702,12 +1705,12 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
else {
H5FD_mem_t type; /* Memory type for iteration */
/* Iterate over all the free space types that have managers and
* get each free list's space
/* Iterate over all the free space types that have managers and
* get each free list's space
*/
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type))
if(H5MF__fsm_type_is_self_referential(f->shared, (H5F_mem_page_t)type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -1824,9 +1827,9 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
if(f->shared->fs_man[type]) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type))
if(H5MF__fsm_type_is_self_referential(f->shared, (H5F_mem_page_t)type))
needed_ring = H5AC_RING_MDFSM;
else
else
needed_ring = H5AC_RING_RDFSM;
if(needed_ring != curr_ring) {
@ -1974,7 +1977,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
/* gather data for the free space manager superblock extension message.
* Only need addresses of FSMs and eoa prior to allocation of
* file space for the self referential free space managers. Other
* file space for the self referential free space managers. Other
* data was gathered above.
*/
for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype))
@ -1990,7 +1993,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) {
if(f->shared->fs_man[ptype]) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, ptype))
if(H5MF__fsm_type_is_self_referential(f->shared, ptype))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2125,7 +2128,7 @@ H5MF__close_shrink_eoa(H5F_t *f)
for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) {
if(f->shared->fs_man[ptype]) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, ptype))
if(H5MF__fsm_type_is_self_referential(f->shared, ptype))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2149,7 +2152,7 @@ H5MF__close_shrink_eoa(H5F_t *f)
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
if(f->shared->fs_man[type]) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type))
if(H5MF__fsm_type_is_self_referential(f->shared, (H5F_mem_page_t)type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2269,7 +2272,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
} /* end if */
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type))
if(H5MF__fsm_type_is_self_referential(f->shared, (H5F_mem_page_t)type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2299,7 +2302,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
/* Close the free-space managers if they were opened earlier in this routine */
for(type = start_type; type < end_type; H5_INC_ENUM(H5F_mem_page_t, type)) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type))
if(H5MF__fsm_type_is_self_referential(f->shared, (H5F_mem_page_t)type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2405,7 +2408,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
size_t nums = 0; /* The number of free-space sections */
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, ty))
if(H5MF__fsm_type_is_self_referential(f->shared, ty))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2731,7 +2734,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
break;
for(mem_type = H5FD_MEM_SUPER; mem_type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5F_mem_t, mem_type)) {
H5MF__alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type);
if(pass_count == 0) { /* this is the first pass */
HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT);
@ -2764,7 +2767,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
if(f->shared->fs_man[fsm_type]) {
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, fsm_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fsm_type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2876,7 +2879,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
break;
for(mem_type = H5FD_MEM_SUPER; mem_type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5F_mem_t, mem_type)) {
H5MF__alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type);
if(pass_count == 0) { /* this is the first pass */
HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT);
@ -2890,7 +2893,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
HDassert(FALSE);
/* Test to see if we need to switch rings -- do so if required */
if(H5MF__fsm_type_is_self_referential(f, fsm_type))
if(H5MF__fsm_type_is_self_referential(f->shared, fsm_type))
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
@ -2913,7 +2916,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
* that this is also the deciding factor as to whether a FSM
* in in the raw data FSM ring.
*/
if(!H5MF__fsm_type_is_self_referential(f, fsm_type)) {
if(!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) {
/* The current ring should be H5AC_RING_RDFSM */
HDassert(curr_ring == H5AC_RING_RDFSM);
@ -3120,8 +3123,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
/* should only be called if file is opened R/W */
HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT);
HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER);
@ -3137,8 +3140,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
sm_sinfo_fspace = f->shared->fs_man[sm_fssinfo_fs_type];
if(H5F_PAGED_AGGR(f)) {
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER);
HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES);
@ -3278,14 +3281,13 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
lg_sinfo_fspace = f->shared->fs_man[lg_fssinfo_fs_type];
}
if(H5MF__continue_alloc_fsm(f, sm_hdr_fspace, sm_sinfo_fspace, lg_hdr_fspace, lg_sinfo_fspace, &continue_alloc_fsm) < 0)
if(H5MF__continue_alloc_fsm(f->shared, sm_hdr_fspace, sm_sinfo_fspace, lg_hdr_fspace, lg_sinfo_fspace, &continue_alloc_fsm) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate lg sinfo FSM file space")
} while(continue_alloc_fsm);
/* All free space managers should have file space allocated for them
* now, and should see no further allocations / deallocations.
* now, and should see no further allocations / deallocations.
* For backward compatibility, store the eoa in f->shared->eoa_fsm_fsalloc
* which will be set to fsinfo.eoa_pre_fsm_fsalloc when we actually write
* the free-space info message to the superblock extension.
@ -3293,7 +3295,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
* the new solution.
*/
/* Get the eoa after allocation of file space for the self referential
* free space managers. Assuming no cache image, this should be the
* free space managers. Assuming no cache image, this should be the
* final EOA of the file.
*/
if(HADDR_UNDEF == (eoa_fsm_fsalloc = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))
@ -3328,42 +3330,39 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5MF__continue_alloc_fsm(H5F_t *f, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace,
H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace,
H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f_sh);
HDassert(continue_alloc_fsm);
/* Check sm_hdr_fspace */
if(sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) {
H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm);
}
} /* end if */
if(!(*continue_alloc_fsm)) {
if(!(*continue_alloc_fsm))
if(sm_sinfo_fspace && sm_sinfo_fspace != sm_hdr_fspace &&
sm_sinfo_fspace->serial_sect_count > 0 && sm_sinfo_fspace->sinfo) {
H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm);
}
}
} /* end if */
if(H5F_PAGED_AGGR(f) && !(*continue_alloc_fsm)) {
if(H5F_SHARED_PAGED_AGGR(f_sh) && !(*continue_alloc_fsm)) {
/* Check lg_hdr_fspace */
if(lg_hdr_fspace && lg_hdr_fspace->serial_sect_count > 0 && lg_hdr_fspace->sinfo) {
H5MF_CHECK_FSM(lg_hdr_fspace, continue_alloc_fsm);
}
} /* end if */
/* Check lg_sinfo_fspace */
if(!(*continue_alloc_fsm)) {
if(!(*continue_alloc_fsm))
if(lg_sinfo_fspace && lg_sinfo_fspace != lg_hdr_fspace &&
lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) {
lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) {
H5MF_CHECK_FSM(lg_sinfo_fspace, continue_alloc_fsm);
}
}
}
} /* end if */
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5MF__continue_alloc_fsm() */
@ -3382,8 +3381,8 @@ H5MF__continue_alloc_fsm(H5F_t *f, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspac
*
*-------------------------------------------------------------------------
*/
hbool_t
H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type)
static hbool_t
H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type)
{
H5F_mem_page_t sm_fshdr_fsm;
H5F_mem_page_t sm_fssinfo_fsm;
@ -3391,26 +3390,25 @@ H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type)
H5F_mem_page_t lg_fssinfo_fsm;
hbool_t result = FALSE;
FUNC_ENTER_PACKAGE_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
HDassert(f->shared);
HDassert(f_sh);
HDassert(fsm_type >= H5F_MEM_PAGE_DEFAULT);
HDassert(fsm_type < H5F_MEM_PAGE_NTYPES);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
if(H5F_PAGED_AGGR(f)) {
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
if(H5F_SHARED_PAGED_AGGR(f_sh)) {
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, f_sh->fs_page_size + 1, &lg_fshdr_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, f_sh->fs_page_size + 1, &lg_fssinfo_fsm);
result = (fsm_type == sm_fshdr_fsm) || (fsm_type == sm_fssinfo_fsm)
|| (fsm_type == lg_fshdr_fsm) || (fsm_type == lg_fssinfo_fsm);
} /* end if */
else {
/* In principle, fsm_type should always be less than
/* In principle, fsm_type should always be less than
* H5F_MEM_PAGE_LARGE_SUPER whenever paged aggregation
* is not enabled. However, since there is code that does
* not observe this principle, force the result to FALSE if
@ -3440,7 +3438,7 @@ H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type)
*-------------------------------------------------------------------------
*/
static hbool_t
H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace)
H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace)
{
H5F_mem_page_t sm_fshdr_fsm;
H5F_mem_page_t sm_fssinfo_fsm;
@ -3449,28 +3447,27 @@ H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace)
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
HDassert(f->shared);
HDassert(f_sh);
HDassert(fspace);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
if(H5F_PAGED_AGGR(f)) {
if(H5F_SHARED_PAGED_AGGR(f_sh)) {
H5F_mem_page_t lg_fshdr_fsm;
H5F_mem_page_t lg_fssinfo_fsm;
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, f_sh->fs_page_size + 1, &lg_fshdr_fsm);
H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, f_sh->fs_page_size + 1, &lg_fssinfo_fsm);
result = (fspace == f->shared->fs_man[sm_fshdr_fsm]) ||
(fspace == f->shared->fs_man[sm_fssinfo_fsm]) ||
(fspace == f->shared->fs_man[lg_fshdr_fsm]) ||
(fspace == f->shared->fs_man[lg_fssinfo_fsm]);
result = (fspace == f_sh->fs_man[sm_fshdr_fsm]) ||
(fspace == f_sh->fs_man[sm_fssinfo_fsm]) ||
(fspace == f_sh->fs_man[lg_fshdr_fsm]) ||
(fspace == f_sh->fs_man[lg_fssinfo_fsm]);
} /* end if */
else
result = (fspace == f->shared->fs_man[sm_fshdr_fsm]) ||
(fspace == f->shared->fs_man[sm_fssinfo_fsm]);
result = (fspace == f_sh->fs_man[sm_fshdr_fsm]) ||
(fspace == f_sh->fs_man[sm_fssinfo_fsm]);
FUNC_LEAVE_NOAPI(result)
} /* H5MF__fsm_is_self_referential() */

View File

@ -194,9 +194,9 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
* the cache eventually adjusts/evicts ageout entries and ends up flushing out the
* same entry that is being serialized (flush_in_progress).
*/
if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && (!f->closing || !f->shared->fs_persist)) {
if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && (!f->shared->closing || !f->shared->fs_persist)) {
#ifdef REPLACE
if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && !f->closing) {
if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && !f->shared->closing) {
#endif
haddr_t aggr_frag_addr = HADDR_UNDEF; /* Address of aggregrator fragment */
hsize_t aggr_frag_size = 0; /* Size of aggregator fragment */

View File

@ -55,11 +55,6 @@
#define H5MF_FSPACE_SECT_SMALL 1 /* For paged aggregation: "small" meta/raw data section which is < fsp_size) */
#define H5MF_FSPACE_SECT_LARGE 2 /* For paged aggregation: "large" Section which is >= fsp_size) */
/* For non-paged aggregation: map allocation request type to tracked free-space type */
/* F -- pointer to H5F_t; T -- H5FD_mem_t */
#define H5MF_ALLOC_TO_FS_AGGR_TYPE(F, T) \
((H5FD_MEM_DEFAULT == (F)->shared->fs_type_map[T]) ? (T) : (F)->shared->fs_type_map[T])
/* Get section class type based on size */
#define H5MF_SECT_CLASS_TYPE(F, S) \
((H5F_PAGED_AGGR(F)) ? \
@ -182,13 +177,10 @@ H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1];
/* Allocator routines */
H5_DLL herr_t H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type);
H5_DLL herr_t H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type);
H5_DLL htri_t H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, haddr_t *addr);
H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node);
H5_DLL herr_t H5MF__sects_dump(H5F_t *f, FILE *stream);
H5_DLL void H5MF__alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type);
H5_DLL void H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type,
hsize_t size, H5F_mem_page_t *fs_type);
/* 'simple/small/large' section routines */
H5_DLL H5MF_free_section_t *H5MF__sect_new(unsigned ctype, haddr_t sect_off,
@ -206,6 +198,11 @@ H5_DLL herr_t H5MF__aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr,
H5_DLL herr_t H5MF__aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr,
haddr_t *addr, hsize_t *size);
/* Debugging routines */
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5_DLL herr_t H5MF__sects_dump(H5F_t *f, FILE *stream);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
/* Testing routines */
#ifdef H5MF_TESTING
#endif /* H5MF_TESTING */

View File

@ -48,7 +48,7 @@
/***************************************/
/* File space manager routines */
H5_DLL herr_t H5MF_init_merge_flags(H5F_t *f);
H5_DLL herr_t H5MF_init_merge_flags(H5F_shared_t *f_sh);
H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size);
H5_DLL herr_t H5MF_close(H5F_t *f);
H5_DLL herr_t H5MF_try_close(H5F_t *f);

View File

@ -776,7 +776,7 @@ H5MF__sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2
/* Note: Large metadata page bypasses the PB cache */
/* Note: Update of raw data page (large or small sized) is handled by the PB cache */
if(udata->f->shared->page_buf != NULL && udata->alloc_type != H5FD_MEM_DRAW)
if(H5PB_remove_entry(udata->f, (*sect1)->sect_info.addr) < 0)
if(H5PB_remove_entry(udata->f->shared, (*sect1)->sect_info.addr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section")
if(H5MF__sect_free((H5FS_section_info_t *)(*sect1)) < 0)

View File

@ -325,7 +325,7 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
if(f->closing) {
if(f->shared->closing) {
/* Get the eoa, and verify that it has the expected value */
if(HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) )

View File

@ -331,7 +331,7 @@ H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx)
H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr)
/* check args */
HDassert(f);

View File

@ -124,8 +124,8 @@ typedef struct {
/* Local Prototypes */
/********************/
static herr_t H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry);
static htri_t H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type);
static herr_t H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry);
static htri_t H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type);
static herr_t H5PB__write_entry(H5F_shared_t *f_sh, H5PB_entry_t *page_entry);
/*********************/
@ -289,7 +289,7 @@ H5PB_print_stats(const H5PB_t *page_buf)
*-------------------------------------------------------------------------
*/
herr_t
H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc)
H5PB_create(H5F_shared_t *f_sh, size_t size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc)
{
H5PB_t *page_buf = NULL;
herr_t ret_value = SUCCEED; /* Return value */
@ -297,20 +297,19 @@ H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned pag
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f_sh);
/* Check args */
if(f->shared->fs_strategy != H5F_FSPACE_STRATEGY_PAGE)
if(f_sh->fs_strategy != H5F_FSPACE_STRATEGY_PAGE)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "Enabling Page Buffering requires PAGE file space strategy")
/* round down the size if it is larger than the page size */
else if(size > f->shared->fs_page_size) {
else if(size > f_sh->fs_page_size) {
hsize_t temp_size;
temp_size = (size / f->shared->fs_page_size) * f->shared->fs_page_size;
temp_size = (size / f_sh->fs_page_size) * f_sh->fs_page_size;
H5_CHECKED_ASSIGN(size, size_t, temp_size, hsize_t);
} /* end if */
else if(0 != size % f->shared->fs_page_size)
else if(0 != size % f_sh->fs_page_size)
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTINIT, FAIL, "Page Buffer size must be >= to the page size")
/* Allocate the new page buffering structure */
@ -318,15 +317,15 @@ H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned pag
HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "memory allocation failed")
page_buf->max_size = size;
H5_CHECKED_ASSIGN(page_buf->page_size, size_t, f->shared->fs_page_size, hsize_t);
H5_CHECKED_ASSIGN(page_buf->page_size, size_t, f_sh->fs_page_size, hsize_t);
page_buf->min_meta_perc = page_buf_min_meta_perc;
page_buf->min_raw_perc = page_buf_min_raw_perc;
/* Calculate the minimum page count for metadata and raw data
* based on the fractions provided
* based on the fractions provided
*/
page_buf->min_meta_count = (unsigned)((size * page_buf_min_meta_perc) / (f->shared->fs_page_size * 100));
page_buf->min_raw_count = (unsigned)((size * page_buf_min_raw_perc) / (f->shared->fs_page_size * 100));
page_buf->min_meta_count = (unsigned)((size * page_buf_min_meta_perc) / (f_sh->fs_page_size * 100));
page_buf->min_raw_count = (unsigned)((size * page_buf_min_raw_perc) / (f_sh->fs_page_size * 100));
if(NULL == (page_buf->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTCREATE, FAIL, "can't create skip list")
@ -336,7 +335,7 @@ H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned pag
if(NULL == (page_buf->page_fac = H5FL_fac_init(page_buf->page_size)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTINIT, FAIL, "can't create page factory")
f->shared->page_buf = page_buf;
f_sh->page_buf = page_buf;
done:
if(ret_value < 0) {
@ -370,18 +369,18 @@ static herr_t
H5PB__flush_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data)
{
H5PB_entry_t *page_entry = (H5PB_entry_t *)item; /* Pointer to page entry node */
H5F_t *f = (H5F_t *)_op_data;
H5F_shared_t *f_sh = (H5F_shared_t *)_op_data;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(page_entry);
HDassert(f);
HDassert(f_sh);
/* Flush the page if it's dirty */
if(page_entry->is_dirty)
if(H5PB__write_entry(f, page_entry) < 0)
if(H5PB__write_entry(f_sh, page_entry) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed")
done:
@ -401,21 +400,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5PB_flush(H5F_t *f)
H5PB_flush(H5F_shared_t *f_sh)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(f);
HDassert(f_sh);
/* Flush all the entries in the PB skiplist, if we have write access on the file */
if(f->shared->page_buf && (H5F_ACC_RDWR & H5F_INTENT(f))) {
H5PB_t *page_buf = f->shared->page_buf;
if(f_sh->page_buf && (H5F_ACC_RDWR & H5F_SHARED_INTENT(f_sh))) {
H5PB_t *page_buf = f_sh->page_buf;
/* Iterate over all entries in page buffer skip list */
if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, (void *)f))
if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, f_sh))
HGOTO_ERROR(H5E_PAGEBUF, H5E_BADITER, FAIL, "can't flush page buffer skip list")
} /* end if */
@ -473,21 +472,21 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data)
*-------------------------------------------------------------------------
*/
herr_t
H5PB_dest(H5F_t *f)
H5PB_dest(H5F_shared_t *f_sh)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
/* flush and destroy the page buffer, if it exists */
if(f->shared->page_buf) {
H5PB_t *page_buf = f->shared->page_buf;
if(f_sh->page_buf) {
H5PB_t *page_buf = f_sh->page_buf;
H5PB_ud1_t op_data; /* Iteration context */
if(H5PB_flush(f) < 0)
if(H5PB_flush(f_sh) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer")
/* Set up context info */
@ -507,7 +506,7 @@ H5PB_dest(H5F_t *f)
if(H5FL_fac_term(page_buf->page_fac) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTRELEASE, FAIL, "can't destroy page buffer page factory")
f->shared->page_buf = H5FL_FREE(H5PB_t, page_buf);
f_sh->page_buf = H5FL_FREE(H5PB_t, page_buf);
} /* end if */
done:
@ -529,16 +528,18 @@ done:
*
*-------------------------------------------------------------------------
*/
herr_t
H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr)
herr_t
H5PB_add_new_page(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t page_addr)
{
H5PB_t *page_buf = f->shared->page_buf;
H5PB_entry_t *page_entry = NULL; /* pointer to the corresponding page entry */
herr_t ret_value = SUCCEED; /* Return value */
H5PB_t *page_buf; /* Page buffer to operate on */
H5PB_entry_t *page_entry = NULL; /* Pointer to the corresponding page entry */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f_sh);
page_buf = f_sh->page_buf;
HDassert(page_buf);
/* If there is an existing page, this means that at some point the
@ -624,7 +625,7 @@ H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf)
* Function: H5PB_remove_entry
*
* Purpose: Remove possible metadata entry with ADDR from the PB cache.
* This is in response to the data corruption bug from fheap.c
* This is in response to the data corruption bug from fheap.c
* with page buffering + page strategy.
* Note: Large metadata page bypasses the PB cache.
* Note: Update of raw data page (large or small sized) is handled by the PB cache.
@ -636,15 +637,17 @@ H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf)
*-------------------------------------------------------------------------
*/
herr_t
H5PB_remove_entry(const H5F_t *f, haddr_t addr)
H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr)
{
H5PB_t *page_buf = f->shared->page_buf;
H5PB_entry_t *page_entry = NULL; /* pointer to the page entry being searched */
herr_t ret_value = SUCCEED; /* Return value */
H5PB_t *page_buf; /* Page buffer to operate on */
H5PB_entry_t *page_entry = NULL; /* Pointer to the page entry being searched */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f_sh);
page_buf = f_sh->page_buf;
HDassert(page_buf);
/* Search for address in the skip list */
@ -674,7 +677,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PB_read
*
* Purpose: Reads in the data from the page containing it if it exists
* Purpose: Reads in the data from the page containing it if it exists
* in the PB cache; otherwise reads in the page through the VFD.
*
* Return: Non-negative on success/Negative on failure
@ -684,7 +687,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/)
H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/)
{
H5PB_t *page_buf; /* Page buffering info for this file */
H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */
@ -701,21 +704,21 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
HDassert(type != H5FD_MEM_GHEAP);
/* Get pointer to page buffer info for this file */
page_buf = f->shared->page_buf;
page_buf = f_sh->page_buf;
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
if(H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI)) {
#if 1
bypass_pb = TRUE;
#else
/* MSC - why this stopped working ? */
int mpi_size;
if((mpi_size = H5F_mpi_get_size(f)) < 0)
if((mpi_size = H5F_shared_mpi_get_size(f_sh)) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size")
if(1 != mpi_size)
bypass_pb = TRUE;
@ -729,7 +732,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
*/
if(NULL == page_buf || size >= page_buf->page_size ||
(bypass_pb && H5FD_MEM_DRAW == type)) {
if(H5F__accum_read(f, type, addr, size, buf) < 0)
if(H5F__accum_read(f_sh, type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "read through metadata accumulator failed")
/* Update statistics */
@ -780,7 +783,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
} /* end else */
/* Translate to file driver I/O info object */
file = f->shared->lf;
file = f_sh->lf;
/* Copy raw data from dirty pages into the read buffer if the read
request spans pages in the page buffer*/
@ -884,7 +887,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
else
page_buf->hits[0]++;
} /* end if */
/* if not found */
/* if not found */
else {
void *new_page_buf = NULL;
size_t page_size = page_buf->page_size;
@ -895,7 +898,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
htri_t can_make_space;
/* check if we can make space in page buffer */
if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0)
if((can_make_space = H5PB__make_space(f_sh, page_buf, type)) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed")
/* if make_space returns 0, then we can't use the page
@ -920,7 +923,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
/* Read page through the VFD layer, but make sure we don't read past the EOA. */
/* Retrieve the 'eoa' for the file */
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
if(HADDR_UNDEF == (eoa = H5F_shared_get_eoa(f_sh, type)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed")
/* If the entire page falls outside the EOA, then fail */
@ -981,7 +984,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr,
size_t size, const void *buf)
{
H5PB_t *page_buf; /* Page buffering info for this file */
@ -999,20 +1002,20 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(f);
HDassert(f_sh);
/* Get pointer to page buffer info for this file */
page_buf = f->shared->page_buf;
page_buf = f_sh->page_buf;
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
if(H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI)) {
#if 1
bypass_pb = TRUE;
#else
/* MSC - why this stopped working ? */
int mpi_size;
if((mpi_size = H5F_mpi_get_size(f)) < 0)
if((mpi_size = H5F_shared_mpi_get_size(f_sh)) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size")
if(1 != mpi_size)
bypass_pb = TRUE;
@ -1025,7 +1028,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
* buffering.
*/
if(NULL == page_buf || size >= page_buf->page_size || bypass_pb) {
if(H5F__accum_write(f, type, addr, size, buf) < 0)
if(H5F__accum_write(f_sh, type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "write through metadata accumulator failed")
/* Update statistics */
@ -1084,7 +1087,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
} /* end else */
/* Translate to file driver I/O info object */
file = f->shared->lf;
file = f_sh->lf;
/* Check if existing pages for raw data need to be updated since raw data access is not atomic */
if(H5FD_MEM_DRAW == type && size >= page_buf->page_size) {
@ -1186,7 +1189,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
else
page_buf->hits[0]++;
} /* end if */
/* If not found */
/* If not found */
else {
void *new_page_buf;
size_t page_size = page_buf->page_size;
@ -1196,7 +1199,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
htri_t can_make_space;
/* Check if we can make space in page buffer */
if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0)
if((can_make_space = H5PB__make_space(f_sh, page_buf, type)) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed")
/* If make_space returns 0, then we can't use the page
@ -1208,14 +1211,14 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
/* Write to VFD and return */
if(H5FD_write(file, type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "driver write request failed")
/* Break out of loop */
break;
} /* end if */
} /* end if */
/* Don't bother searching if there is no write access */
if(H5F_ACC_RDWR & H5F_INTENT(f))
if(H5F_ACC_RDWR & H5F_SHARED_INTENT(f_sh))
/* Lookup & remove the page from the new skip list page if
* it exists to see if this is a new page from the MF layer
*/
@ -1258,7 +1261,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
page_entry->type = (H5F_mem_page_t)type;
/* Retrieve the 'eoa' for the file */
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
if(HADDR_UNDEF == (eoa = H5F_shared_get_eoa(f_sh, type)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed")
/* If the entire page falls outside the EOA, then fail */
@ -1269,8 +1272,8 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
* returned will most likely be HADDR_UNDEF, so skip
* that check.
*/
if(!H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI))
if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT)))
if(!H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI))
if(HADDR_UNDEF == (eof = H5FD_get_eof(f_sh->lf, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eof request failed")
/* Adjust the read size to not go beyond the EOA */
@ -1360,26 +1363,19 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PB__make_space()
*
* Purpose: ???
*
* This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
*
* If necessary and if possible, evict a page from the page
* buffer to make space for the supplied page. Depending on
* the page buffer configuration and contents, and the page
* Purpose: If necessary and if possible, evict a page from the page
* buffer to make space for the supplied page. Depending on
* the page buffer configuration and contents, and the page
* supplied this may or may not be possible.
*
* JRM -- 12/22/16
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
static htri_t
H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
static htri_t
H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type)
{
H5PB_entry_t *page_entry; /* Pointer to page eviction candidate */
htri_t ret_value = TRUE; /* Return value */
@ -1387,7 +1383,7 @@ H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
HDassert(f_sh);
HDassert(page_buf);
/* Get oldest entry */
@ -1444,7 +1440,7 @@ H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
/* Flush page if dirty */
if(page_entry->is_dirty)
if(H5PB__write_entry(f, page_entry) < 0)
if(H5PB__write_entry(f_sh, page_entry) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed")
/* Update statistics */
@ -1478,7 +1474,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry)
H5PB__write_entry(H5F_shared_t *f_sh, H5PB_entry_t *page_entry)
{
haddr_t eoa; /* Current EOA for the file */
herr_t ret_value = SUCCEED; /* Return value */
@ -1486,11 +1482,11 @@ H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry)
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
HDassert(f_sh);
HDassert(page_entry);
/* Retrieve the 'eoa' for the file */
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, (H5FD_mem_t)page_entry->type)))
if(HADDR_UNDEF == (eoa = H5F_shared_get_eoa(f_sh, (H5FD_mem_t)page_entry->type)))
HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed")
/* If the starting address of the page is larger than
@ -1498,14 +1494,14 @@ H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry)
*/
if(page_entry->addr <= eoa) {
H5FD_t *file; /* File driver I/O info */
size_t page_size = f->shared->page_buf->page_size;
size_t page_size = f_sh->page_buf->page_size;
/* Adjust the page length if it exceeds the EOA */
if((page_entry->addr + page_size) > eoa)
page_size = (size_t)(eoa - page_entry->addr);
/* Translate to file driver I/O info object */
file = f->shared->lf;
file = f_sh->lf;
if(H5FD_write(file, (H5FD_mem_t)page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed")

View File

@ -85,14 +85,14 @@ typedef struct H5PB_t {
/***************************************/
/* General routines */
H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc);
H5_DLL herr_t H5PB_flush(H5F_t *f);
H5_DLL herr_t H5PB_dest(H5F_t *f);
H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr);
H5_DLL herr_t H5PB_create(H5F_shared_t *f_sh, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc);
H5_DLL herr_t H5PB_flush(H5F_shared_t *f_sh);
H5_DLL herr_t H5PB_dest(H5F_shared_t *f_sh);
H5_DLL herr_t H5PB_add_new_page(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t page_addr);
H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr);
H5_DLL herr_t H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/);
H5_DLL herr_t H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr);
H5_DLL herr_t H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/);
H5_DLL herr_t H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
/* Statistics routines */
H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf);

View File

@ -30,22 +30,22 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory Management */
#include "H5Ppkg.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory Management */
#include "H5Ppkg.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h" /* Vector Functions */
/* Includes needed to set default file driver */
#include "H5FDsec2.h" /* POSIX unbuffered I/O */
#include "H5FDstdio.h" /* Standard C buffered I/O */
#include "H5FDsec2.h" /* POSIX unbuffered I/O */
#include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS
#include "H5FDwindows.h" /* Win32 I/O */
#include "H5FDwindows.h" /* Win32 I/O */
#endif
/* Includes needed to set default VOL connector */
@ -111,7 +111,7 @@
#define H5F_ACS_GARBG_COLCT_REF_DEF 0
#define H5F_ACS_GARBG_COLCT_REF_ENC H5P__encode_unsigned
#define H5F_ACS_GARBG_COLCT_REF_DEC H5P__decode_unsigned
/* Definition for file driver ID & info*/
/* Definition for file driver ID & info */
#define H5F_ACS_FILE_DRV_SIZE sizeof(H5FD_driver_prop_t)
#define H5F_ACS_FILE_DRV_DEF {H5_DEFAULT_VFD, NULL}
#define H5F_ACS_FILE_DRV_CRT H5P__facc_file_driver_create
@ -231,6 +231,24 @@
#define H5F_ACS_COLL_MD_WRITE_FLAG_DEF FALSE
#define H5F_ACS_COLL_MD_WRITE_FLAG_ENC H5P__encode_hbool_t
#define H5F_ACS_COLL_MD_WRITE_FLAG_DEC H5P__decode_hbool_t
/* Definition for the file's MPI communicator */
#define H5F_ACS_MPI_PARAMS_COMM_SIZE sizeof(MPI_Comm)
#define H5F_ACS_MPI_PARAMS_COMM_DEF MPI_COMM_NULL
#define H5F_ACS_MPI_PARAMS_COMM_SET H5P__facc_mpi_comm_set
#define H5F_ACS_MPI_PARAMS_COMM_GET H5P__facc_mpi_comm_get
#define H5F_ACS_MPI_PARAMS_COMM_DEL H5P__facc_mpi_comm_del
#define H5F_ACS_MPI_PARAMS_COMM_COPY H5P__facc_mpi_comm_copy
#define H5F_ACS_MPI_PARAMS_COMM_CMP H5P__facc_mpi_comm_cmp
#define H5F_ACS_MPI_PARAMS_COMM_CLOSE H5P__facc_mpi_comm_close
/* Definition for the file's MPI info */
#define H5F_ACS_MPI_PARAMS_INFO_SIZE sizeof(MPI_Info)
#define H5F_ACS_MPI_PARAMS_INFO_DEF MPI_INFO_NULL
#define H5F_ACS_MPI_PARAMS_INFO_SET H5P__facc_mpi_info_set
#define H5F_ACS_MPI_PARAMS_INFO_GET H5P__facc_mpi_info_get
#define H5F_ACS_MPI_PARAMS_INFO_DEL H5P__facc_mpi_info_del
#define H5F_ACS_MPI_PARAMS_INFO_COPY H5P__facc_mpi_info_copy
#define H5F_ACS_MPI_PARAMS_INFO_CMP H5P__facc_mpi_info_cmp
#define H5F_ACS_MPI_PARAMS_INFO_CLOSE H5P__facc_mpi_info_close
#endif /* H5_HAVE_PARALLEL */
/* Definitions for the initial metadata cache image configuration */
#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE sizeof(H5AC_cache_image_config_t)
@ -334,6 +352,24 @@ static herr_t H5P__facc_vol_copy(const char *name, size_t size, void *value);
static int H5P__facc_vol_cmp(const void *value1, const void *value2, size_t size);
static herr_t H5P__facc_vol_close(const char *name, size_t size, void *value);
#ifdef H5_HAVE_PARALLEL
/* MPI communicator callbacks */
static herr_t H5P__facc_mpi_comm_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_comm_get(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_comm_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_comm_copy(const char *name, size_t size, void *value);
static int H5P__facc_mpi_comm_cmp(const void *value1, const void *value2, size_t size);
static herr_t H5P__facc_mpi_comm_close(const char *name, size_t size, void *value);
/* MPI info callbacks */
static herr_t H5P__facc_mpi_info_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_info_get(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_info_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_mpi_info_copy(const char *name, size_t size, void *value);
static int H5P__facc_mpi_info_cmp(const void *value1, const void *value2, size_t size);
static herr_t H5P__facc_mpi_info_close(const char *name, size_t size, void *value);
#endif /* H5_HAVE_PARALLEL */
/*********************/
/* Package Variables */
@ -404,6 +440,8 @@ static const hbool_t H5F_def_evict_on_close_flag_g = H5F_ACS_EVICT_ON_CLOSE_FLAG
#ifdef H5_HAVE_PARALLEL
static const H5P_coll_md_read_flag_t H5F_def_coll_md_read_flag_g = H5F_ACS_COLL_MD_READ_FLAG_DEF; /* Default setting for the collective metedata read flag */
static const hbool_t H5F_def_coll_md_write_flag_g = H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */
static const MPI_Comm H5F_def_mpi_params_comm_g = H5F_ACS_MPI_PARAMS_COMM_DEF; /* Default MPI communicator */
static const MPI_Info H5F_def_mpi_params_info_g = H5F_ACS_MPI_PARAMS_INFO_DEF; /* Default MPI info struct */
#endif /* H5_HAVE_PARALLEL */
static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF; /* Default metadata cache image settings */
static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; /* Default page buffer size */
@ -621,6 +659,19 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the MPI communicator */
if(H5P__register_real(pclass, H5F_ACS_MPI_PARAMS_COMM_NAME, H5F_ACS_MPI_PARAMS_COMM_SIZE, &H5F_def_mpi_params_comm_g,
NULL, H5F_ACS_MPI_PARAMS_COMM_SET, H5F_ACS_MPI_PARAMS_COMM_GET, NULL, NULL,
H5F_ACS_MPI_PARAMS_COMM_DEL, H5F_ACS_MPI_PARAMS_COMM_COPY, H5F_ACS_MPI_PARAMS_COMM_CMP, H5F_ACS_MPI_PARAMS_COMM_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the MPI info struct */
if(H5P__register_real(pclass, H5F_ACS_MPI_PARAMS_INFO_NAME, H5F_ACS_MPI_PARAMS_INFO_SIZE, &H5F_def_mpi_params_info_g,
NULL, H5F_ACS_MPI_PARAMS_INFO_SET, H5F_ACS_MPI_PARAMS_INFO_GET, NULL, NULL,
H5F_ACS_MPI_PARAMS_INFO_DEL, H5F_ACS_MPI_PARAMS_INFO_COPY, H5F_ACS_MPI_PARAMS_INFO_CMP, H5F_ACS_MPI_PARAMS_INFO_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
#endif /* H5_HAVE_PARALLEL */
/* Register the initial metadata cache image configuration */
@ -634,11 +685,13 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the page buffer minimum metadata size */
if(H5P__register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g,
NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the page buffer minimum raw data size */
if(H5P__register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g,
NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC,
@ -4736,6 +4789,468 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_coll_metadata_write() */
/*-------------------------------------------------------------------------
* Function: H5Pget_mpi_params
*
* Purpose: Gets the MPI communicator and info stored in the fapl.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Dana Robinson
* August 2019
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm, MPI_Info *info)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "i*Mc*Mi", plist_id, comm, info);
/* Make sure that the property list is a fapl */
if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist")
/* Get the plist structure */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get the properties */
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI communicator from plist")
if(H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI info from plist")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_mpi_params() */
/*-------------------------------------------------------------------------
* Function: H5Pset_mpi_params
*
* Purpose: Set the MPI communicator and info
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Dana Robinson
* August 2019
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_mpi_params(hid_t plist_id, MPI_Comm comm, MPI_Info info)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iMcMi", plist_id, comm, info);
/* Make sure the MPI communicator is valid */
if(MPI_COMM_NULL == comm)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "not a valid argument")
/* Make sure that the property list is a fapl */
if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist")
/* Get the plist structure */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI communicator")
if(H5P_set(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI info object")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_mpi_params() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_set
*
* Purpose: Copies an MPI comminicator property when it's set for a property list
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_comm_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Comm *comm = (MPI_Comm *)value;
MPI_Comm comm_tmp = MPI_COMM_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI communicator */
if(H5_mpi_comm_dup(*comm, &comm_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI communicator")
done:
/* Copy the communicator to the in/out parameter */
if(ret_value != SUCCEED)
*comm = MPI_COMM_NULL;
else
*comm = comm_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_set() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_get
*
* Purpose: Copies an MPI comminicator property when it's retrieved from a property list
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_comm_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Comm *comm = (MPI_Comm *)value;
MPI_Comm comm_tmp = MPI_COMM_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI communicator */
if(H5_mpi_comm_dup(*comm, &comm_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI communicator")
done:
/* Copy the communicator to the out parameter */
if(ret_value != SUCCEED)
*comm = MPI_COMM_NULL;
else
*comm = comm_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_get() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_del
*
* Purpose: Frees an MPI communicator property
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_comm_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Comm *comm = (MPI_Comm *)value;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Free the MPI communicator */
if(H5_mpi_comm_free(comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI communicator")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_del() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_copy
*
* Purpose: Copy callback for the MPI communicator property.
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_comm_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Comm *comm = (MPI_Comm *)value;
MPI_Comm comm_tmp = MPI_COMM_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI communicator */
if(H5_mpi_comm_dup(*comm, &comm_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI communicator")
done:
/* Copy the communicator to the in/out parameter */
if(ret_value != SUCCEED)
*comm = MPI_COMM_NULL;
else
*comm = comm_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_copy() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_cmp
*
* Purpose: Callback routine which is called whenever the MPI
* communicator property in the file access property list
* is compared.
*
* Return: positive if VALUE1 is greater than VALUE2, negative if
* VALUE2 is greater than VALUE1 and zero if VALUE1 and
* VALUE2 are equal.
*
*-------------------------------------------------------------------------
*/
static int
H5P__facc_mpi_comm_cmp(const void *_comm1, const void *_comm2, size_t H5_ATTR_UNUSED size)
{
const MPI_Comm *comm1 = (const MPI_Comm *)_comm1;
const MPI_Comm *comm2 = (const MPI_Comm *)_comm2;
int ret_value = 0;
FUNC_ENTER_STATIC
/* Compare the MPI communicators */
if(H5_mpi_comm_cmp(*comm1, *comm2, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, 0, "unable to compare MPI communicator")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_cmp() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_comm_close
*
* Purpose: Close callback for the MPI communicator property.
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_comm_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Comm *comm = (MPI_Comm *)value;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Free the MPI communicator */
if(H5_mpi_comm_free(comm) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI communicator")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_comm_close() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_set
*
* Purpose: Copies an MPI info object property when it's set for a property list
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_info_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Info *info = (MPI_Info *)value;
MPI_Info info_tmp = MPI_INFO_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI info object */
if(H5_mpi_info_dup(*info, &info_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI info object")
done:
/* Copy the info object to the in/out parameter */
if(ret_value != SUCCEED)
*info = MPI_INFO_NULL;
else
*info = info_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_set() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_get
*
* Purpose: Copies an MPI comminicator property when it's retrieved from a property list
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_info_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Info *info = (MPI_Info *)value;
MPI_Info info_tmp = MPI_INFO_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI communicator */
if(H5_mpi_info_dup(*info, &info_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI info object")
done:
/* Copy the info object to the out parameter */
if(ret_value != SUCCEED)
*info = MPI_INFO_NULL;
else
*info = info_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_get() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_del
*
* Purpose: Frees an MPI info object property
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_info_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Info *info = (MPI_Info *)value;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Free the MPI info object */
if(H5_mpi_info_free(info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI info object")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_del() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_copy
*
* Purpose: Copy callback for the MPI info object property.
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_info_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Info *info = (MPI_Info *)value;
MPI_Info info_tmp = MPI_INFO_NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Make a copy of the MPI info object */
if(H5_mpi_info_dup(*info, &info_tmp) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to duplicate MPI info object")
done:
/* Copy the info object to the in/out parameter */
if(ret_value != SUCCEED)
*info = MPI_INFO_NULL;
else
*info = info_tmp;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_copy() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_cmp
*
* Purpose: Callback routine which is called whenever the MPI
* info object property in the file access property list
* is compared.
*
* Return: positive if VALUE1 is greater than VALUE2, negative if
* VALUE2 is greater than VALUE1 and zero if VALUE1 and
* VALUE2 are equal.
*
*-------------------------------------------------------------------------
*/
static int
H5P__facc_mpi_info_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED size)
{
const MPI_Info *info1 = (const MPI_Info *)_info1;
const MPI_Info *info2 = (const MPI_Info *)_info2;
int ret_value = 0;
FUNC_ENTER_STATIC
/* Compare the MPI info objects */
if(H5_mpi_info_cmp(*info1, *info2, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, 0, "unable to compare MPI info objects")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_cmp() */
/*-------------------------------------------------------------------------
* Function: H5P__facc_mpi_info_close
*
* Purpose: Close callback for the MPI info object property.
*
* Return: Success: Non-negative
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
static herr_t
H5P__facc_mpi_info_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
MPI_Info *info = (MPI_Info *)value;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Free the MPI info object */
if(H5_mpi_info_free(info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "unable to free MPI info object")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_mpi_info_close() */
/*-------------------------------------------------------------------------
* Function: H5Pget_coll_metadata_write
@ -5305,4 +5820,3 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__facc_vol_close() */

View File

@ -381,6 +381,8 @@ H5_DLL herr_t H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective
H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective);
H5_DLL herr_t H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective);
H5_DLL herr_t H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective);
H5_DLL herr_t H5Pget_mpi_params(hid_t fapl_id, MPI_Comm *comm, MPI_Info *info);
H5_DLL herr_t H5Pset_mpi_params(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
#endif /* H5_HAVE_PARALLEL */
H5_DLL herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr);
H5_DLL herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/);

View File

@ -36,8 +36,11 @@ typedef int H5VL_native_dataset_optional_t;
#define H5VL_NATIVE_DATASET_FORMAT_CONVERT 0 /* H5Dformat_convert (internal) */
#define H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE 1 /* H5Dget_chunk_index_type */
#define H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE 2 /* H5Dget_chunk_storage_size */
#define H5VL_NATIVE_DATASET_CHUNK_READ 3 /* H5Dchunk_read */
#define H5VL_NATIVE_DATASET_CHUNK_WRITE 4 /* H5Dchunk_write */
#define H5VL_NATIVE_DATASET_GET_NUM_CHUNKS 3 /* H5Dget_num_chunks */
#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX 4 /* H5Dget_chunk_info */
#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD 5 /* H5Dget_chunk_info_by_coord */
#define H5VL_NATIVE_DATASET_CHUNK_READ 6 /* H5Dchunk_read */
#define H5VL_NATIVE_DATASET_CHUNK_WRITE 7 /* H5Dchunk_write */
/* Typedef and values for native VOL connector file optional VOL operations */
typedef int H5VL_native_file_optional_t;

View File

@ -339,7 +339,7 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type,
switch(specific_type) {
/* H5Dspecific_space */
case H5VL_DATASET_SET_EXTENT:
{
{ /* H5Dset_extent (H5Dextend - deprecated) */
const hsize_t *size = HDva_arg(arguments, const hsize_t *);
if(H5D__set_extent(dset, size) < 0)
@ -348,7 +348,7 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type,
}
case H5VL_DATASET_FLUSH:
{
{ /* H5Dflush */
hid_t dset_id = HDva_arg(arguments, hid_t);
/* Flush the dataset */
@ -359,7 +359,7 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type,
}
case H5VL_DATASET_REFRESH:
{
{ /* H5Drefresh */
hid_t dset_id = HDva_arg(arguments, hid_t);
/* Refresh the dataset */
@ -399,7 +399,7 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
switch(optional_type) {
case H5VL_NATIVE_DATASET_FORMAT_CONVERT:
{
{ /* H5Dformat_convert */
dset = (H5D_t *)obj;
switch(dset->shared->layout.type) {
@ -434,7 +434,7 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
}
case H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE:
{
{ /* H5Dget_chunk_index_type */
H5D_chunk_index_t *idx_type = HDva_arg(arguments, H5D_chunk_index_t *);
dset = (H5D_t *)obj;
@ -450,7 +450,7 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
}
case H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE:
{
{ /* H5Dget_chunk_storage_size */
hsize_t *offset = HDva_arg(arguments, hsize_t *);
hsize_t *chunk_nbytes = HDva_arg(arguments, hsize_t *);
@ -467,8 +467,91 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
break;
}
case H5VL_NATIVE_DATASET_GET_NUM_CHUNKS:
{ /* H5Dget_num_chunks */
const H5S_t *space = NULL;
hid_t space_id = HDva_arg(arguments, hid_t);
hsize_t *nchunks = HDva_arg(arguments, hsize_t *);
dset = (H5D_t *)obj;
HDassert(dset);
HDassert(dset->shared);
HDassert(dset->shared->space);
/* When default dataspace is given, use the dataset's dataspace */
if(space_id == H5S_ALL)
space = dset->shared->space;
else /* otherwise, use the given space ID */
if(NULL == (space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace ID")
/* Make sure the dataset is chunked */
if(H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
if(H5D__get_num_chunks(dset, space, nchunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get number of chunks")
break;
}
case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX:
{ /* H5Dget_chunk_info */
const H5S_t *space = NULL;
hid_t space_id = HDva_arg(arguments, hid_t);
hsize_t chk_index = HDva_arg(arguments, hsize_t);
hsize_t *offset = HDva_arg(arguments, hsize_t *);
unsigned *filter_mask = HDva_arg(arguments, unsigned *);
haddr_t *addr = HDva_arg(arguments, haddr_t *);
hsize_t *size = HDva_arg(arguments, hsize_t *);
dset = (H5D_t *)obj;
HDassert(dset);
HDassert(dset->shared);
HDassert(dset->shared->space);
/* When default dataspace is given, use the dataset's dataspace */
if(space_id == H5S_ALL)
space = dset->shared->space;
else /* otherwise, use the given space ID */
if(NULL == (space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace ID")
/* Make sure the dataset is chunked */
if(H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
if(H5D__get_chunk_info(dset, space, chk_index, offset, filter_mask, addr, size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by index")
break;
}
case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD:
{ /* H5Dget_chunk_info_by_coord */
hsize_t *offset = HDva_arg(arguments, hsize_t *);
unsigned *filter_mask = HDva_arg(arguments, unsigned *);
haddr_t *addr = HDva_arg(arguments, haddr_t *);
hsize_t *size = HDva_arg(arguments, hsize_t *);
dset = (H5D_t *)obj;
HDassert(dset);
HDassert(dset->shared);
/* Make sure the dataset is chunked */
if(H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
if(H5D__get_chunk_info_by_coord(dset, offset, filter_mask, addr, size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by its logical coordinates")
break;
}
case H5VL_NATIVE_DATASET_CHUNK_READ:
{
{ /* H5Dread_chunk */
const hsize_t *offset = HDva_arg(arguments, hsize_t *);
uint32_t *filters = HDva_arg(arguments, uint32_t *);
void *buf = HDva_arg(arguments, void *);
@ -496,7 +579,7 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
}
case H5VL_NATIVE_DATASET_CHUNK_WRITE:
{
{ /* H5Dwrite_chunk */
uint32_t filters = HDva_arg(arguments, uint32_t);
const hsize_t *offset = HDva_arg(arguments, const hsize_t *);
uint32_t data_size_32 = HDva_arg(arguments, uint32_t);

View File

@ -16,14 +16,10 @@
*
*/
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
#include "H5FDmpi.h" /* Common MPI file driver */
#include "H5Pprivate.h" /* Property lists */
#include "H5MMprivate.h" /* Memory Management */
#ifdef H5_HAVE_PARALLEL
@ -32,6 +28,9 @@
*
* Purpose: Duplicate an MPI communicator.
*
* Does not duplicate MPI_COMM_NULL. Instead, comm_new will
* be set to MPI_COMM_NULL directly.
*
* The new communicator is returned via the comm_new pointer.
*
* Return: SUCCEED/FAIL
@ -50,19 +49,26 @@ H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new)
/* Check arguments */
if (!comm_new)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "comm_new cannot be NULL")
if (MPI_COMM_NULL == comm)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't duplicate MPI_COMM_NULL")
/* Duplicate the MPI communicator */
if (MPI_SUCCESS != (mpi_code = MPI_Comm_dup(comm, &comm_dup)))
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code)
/* Handle MPI_COMM_NULL separately */
if (MPI_COMM_NULL == comm) {
/* Don't duplicate MPI_COMM_NULL since that's an error in MPI */
comm_dup = MPI_COMM_NULL;
}
else {
/* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal,
* and return codes can be checked and handled.
*/
if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN)))
HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code)
/* Duplicate the MPI communicator */
if (MPI_SUCCESS != (mpi_code = MPI_Comm_dup(comm, &comm_dup)))
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code)
/* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal,
* and return codes can be checked and handled.
*/
if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN)))
HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code)
}
/* Copy the new communicator to the return argument */
*comm_new = comm_dup;
@ -108,7 +114,7 @@ H5_mpi_info_dup(MPI_Info info, MPI_Info *info_new)
/* Duplicate the MPI info */
if (info == MPI_INFO_NULL) {
/* Don't duplicate MPI_INFO_NULL. Just copy it. */
info_dup = info;
info_dup = MPI_INFO_NULL;
}
else {
/* Duplicate the info */
@ -194,5 +200,197 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* End H5_mpi_info_free() */
/*-------------------------------------------------------------------------
* Function: H5_mpi_comm_cmp
*
* Purpose: Compares two MPI communicators.
*
* Note that passing MPI_COMM_NULL to this function will not
* throw errors, unlike MPI_Comm_compare().
*
* We consider MPI communicators to be the "same" when the
* groups are identical. We don't care about the context
* since that will always be different as we call MPI_Comm_dup
* when we store the communicator in the fapl.
*
* The out parameter is a value like strcmp. The value is
* undefined when the return value is FAIL.
*
* Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5_mpi_comm_cmp(MPI_Comm comm1, MPI_Comm comm2, int *result)
{
int mpi_code;
int mpi_result = MPI_IDENT;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments */
if (!result)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "result cannot be NULL")
/* Set out parameter to something reasonable in case something goes wrong */
*result = 0;
/* Can't pass MPI_COMM_NULL to MPI_Comm_compare() so we have to handle
* it in special cases.
*
* MPI_Comm can either be an integer type or a pointer. We cast them
* to intptr_t so we can compare them with < and > when needed.
*/
if (MPI_COMM_NULL == comm1 && MPI_COMM_NULL == comm2) {
/* Special case of both communicators being MPI_COMM_NULL */
*result = 0;
}
else if (MPI_COMM_NULL == comm1 || MPI_COMM_NULL == comm2) {
/* Special case of one communicator being MPI_COMM_NULL */
*result = (intptr_t)comm1 < (intptr_t)comm2 ? -1 : 1;
}
else {
/* Normal communicator compare */
/* Compare the MPI communicators */
if (MPI_SUCCESS != (mpi_code = MPI_Comm_compare(comm1, comm2, &mpi_result)))
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_compare failed", mpi_code)
/* Set the result */
if (MPI_IDENT == mpi_result || MPI_CONGRUENT == mpi_result)
*result = 0;
else
*result = (intptr_t)comm1 < (intptr_t)comm2 ? -1 : 1;
}
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5_mpi_comm_cmp() */
/*-------------------------------------------------------------------------
* Function: H5_mpi_info_cmp
*
* Purpose: Compares two MPI info objects.
*
* For our purposes, two mpi info objects are the "same" if
* they contain the same key-value pairs or are both
* MPI_INFO_NULL.
*
* The out parameter is a value like strcmp. The value is
* undefined when the return value is FAIL.
*
* Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result)
{
hbool_t same = FALSE;
char *key = NULL;
char *value1 = NULL;
char *value2 = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments */
if (!result)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "result cannot be NULL")
/* Check for MPI_INFO_NULL */
if (MPI_INFO_NULL == info1 && MPI_INFO_NULL == info2) {
/* Special case of both info objects being MPI_INFO_NULL */
same = TRUE;
}
else if (MPI_INFO_NULL == info1 || MPI_INFO_NULL == info2) {
/* Special case of one info object being MPI_INFO_NULL */
same = FALSE;
}
else {
int mpi_code;
int nkeys_1;
int nkeys_2;
/* Check if the number of keys is the same */
if (MPI_SUCCESS != (mpi_code = MPI_Info_get_nkeys(info1, &nkeys_1)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_get_nkeys failed", mpi_code)
if (MPI_SUCCESS != (mpi_code = MPI_Info_get_nkeys(info2, &nkeys_2)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_get_nkeys failed", mpi_code)
if (nkeys_1 != nkeys_2)
same = FALSE;
else if (0 == nkeys_1 && 0 == nkeys_2)
same = TRUE;
else {
int i;
int flag1 = -1;
int flag2 = -1;
/* Allocate buffers for iteration */
if (NULL == (key = (char *)H5MM_malloc(MPI_MAX_INFO_KEY * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
if (NULL == (value1 = (char *)H5MM_malloc(MPI_MAX_INFO_VAL * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
if (NULL == (value2 = (char *)H5MM_malloc(MPI_MAX_INFO_VAL * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Iterate over the keys, comparing them */
for (i = 0; i < nkeys_1; i++) {
same = TRUE;
/* Memset the buffers to zero */
HDmemset(key, 0, MPI_MAX_INFO_KEY);
HDmemset(value1, 0, MPI_MAX_INFO_VAL);
HDmemset(value2, 0, MPI_MAX_INFO_VAL);
/* Get the nth key */
if (MPI_SUCCESS != (mpi_code = MPI_Info_get_nthkey(info1, i, key)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_get_nthkey failed", mpi_code)
/* Get the values */
if (MPI_SUCCESS != (mpi_code = MPI_Info_get(info1, key, MPI_MAX_INFO_VAL, value1, &flag1)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_get failed", mpi_code)
if (MPI_SUCCESS != (mpi_code = MPI_Info_get(info2, key, MPI_MAX_INFO_VAL, value2, &flag2)))
HMPI_GOTO_ERROR(FAIL, "MPI_Info_get failed", mpi_code)
/* Compare values and flags */
if (!flag1 || !flag2 || HDmemcmp(value1, value2, MPI_MAX_INFO_VAL)) {
same = FALSE;
break;
}
} /* end for */
} /* end else */
} /* end else */
/* Set the output value
*
* MPI_Info can either be an integer type or a pointer. We cast them
* to intptr_t so we can compare them with < and > when needed.
*/
if (same)
*result = 0;
else
*result = (intptr_t)info1 < (intptr_t)info2 ? -1 : 1;
done:
if (key)
H5MM_xfree(key);
if (value1)
H5MM_xfree(value1);
if (value2)
H5MM_xfree(value2);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5_mpi_info_cmp() */
#endif /* H5_HAVE_PARALLEL */

View File

@ -2674,6 +2674,8 @@ H5_DLL herr_t H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new);
H5_DLL herr_t H5_mpi_info_dup(MPI_Info info, MPI_Info *info_new);
H5_DLL herr_t H5_mpi_comm_free(MPI_Comm *comm);
H5_DLL herr_t H5_mpi_info_free(MPI_Info *info);
H5_DLL herr_t H5_mpi_comm_cmp(MPI_Comm comm1, MPI_Comm comm2, int *result);
H5_DLL herr_t H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result);
#endif /* H5_HAVE_PARALLEL */
/* Functions for debugging */

View File

@ -631,7 +631,7 @@ Pflock(int fd, int operation) {
flk.l_pid = 0; /* not used with set */
/* Lock or unlock */
if(HDfcntl(fd, F_SETLK, flk) < 0)
if(HDfcntl(fd, F_SETLK, &flk) < 0)
return -1;
return 0;

View File

@ -62,9 +62,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Fsfile.c H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \
H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \
H5FAint.c H5FAstat.c H5FAtest.c \
H5FD.c H5FDcore.c \
H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c H5FDs3comms.c \
H5FDmulti.c H5FDros3.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \
H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c \
H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \
H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \
H5FSstat.c H5FStest.c \
H5G.c H5Gbtree2.c H5Gcache.c \
@ -134,6 +133,11 @@ if DIRECT_VFD_CONDITIONAL
libhdf5_la_SOURCES += H5FDdirect.c
endif
# Only compile the read-only S3 VFD if necessary
if ROS3_VFD_CONDITIONAL
libhdf5_la_SOURCES += H5FDros3.c H5FDs3comms.c
endif
# Public headers
include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5version.h \
H5Apublic.h H5ACpublic.h \

View File

@ -242,6 +242,7 @@ set (H5_TESTS
page_buffer
dtypes
dsets
chunk_info # compression lib link
cmpd_dset
filter_fail
extend
@ -301,6 +302,7 @@ macro (ADD_H5_EXE file)
endmacro ()
set (H5_TESTS_MULTIPLE
chunk_info
direct_chunk
testhdf5
cache_image
@ -317,6 +319,18 @@ endforeach ()
### M U L T I P L E S O U R C E T E S T S ###
##############################################################################
######### Also special handling of link libs #############
#-- Adding test for chunk_info
add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c)
target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (chunk_info STATIC)
target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
else ()
TARGET_C_PROPERTIES (chunk_info SHARED)
target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS})
endif ()
set_target_properties (chunk_info PROPERTIES FOLDER test)
#-- Adding test for direct_chunk
add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")

View File

@ -58,9 +58,9 @@ TEST_PROG= testhdf5 \
cache cache_api cache_image cache_tagging lheap ohdr \
stab gheap evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \
objcopy links unlink twriteorder big mtime fillval mount flush1 \
flush2 app_ref enum set_extent ttsafe enc_dec_plist \
dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \
external efc objcopy links unlink twriteorder big mtime fillval mount \
flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \
dangle dtransform reserved cross_read freespace mf vds file_image \
unregister cache_logging cork swmr vol

View File

@ -66,9 +66,9 @@ void accum_printf(const H5F_t *f);
/* Private Test H5Faccum Function Wrappers */
#define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b))
#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b))
#define accum_free(f,a,s) H5F__accum_free(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s))
#define accum_flush(f) H5F__accum_flush(f)
#define accum_reset(f) H5F__accum_reset(f, TRUE)
#define accum_free(f,a,s) H5F__accum_free(f->shared, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s))
#define accum_flush(f) H5F__accum_flush(f->shared)
#define accum_reset(f) H5F__accum_reset(f->shared, TRUE)
/* ================= */
/* Main Test Routine */

View File

@ -55,7 +55,7 @@ int verify(int fd, unsigned int k);
void print_info(int *info, unsigned int lastr, unsigned iteration);
/*-------------------------------------------------------------------------
* Function: usage
*
@ -63,7 +63,7 @@ void print_info(int *info, unsigned int lastr, unsigned iteration);
*
* Parameters: None
*
* Return: void
* Return: void
*
*-------------------------------------------------------------------------
*/
@ -78,13 +78,13 @@ usage(void)
printf("\n");
} /* usage() */
/*-------------------------------------------------------------------------
* Function: verify
*
* Purpose: To verify that the data read is the pattern expected.
* Each integer read should be the same as the index.
* When a difference is encountered, the remaining integers
* When a difference is encountered, the remaining integers
* read should be the same as the previous index.
* For example, the pattern expected should be either:
* a) 01234567....n-1
@ -93,11 +93,11 @@ usage(void)
* the remaining integers should be all "3"s as:
* 012333333333333
*
* Parameters:
* Parameters:
* fd -- the file descriptor
* k -- the number of integers to read
*
* Return:
* Return:
* positive on success
* negative on failure
*
@ -106,9 +106,9 @@ usage(void)
int
verify(int fd, unsigned int k)
{
unsigned int i; /* local index variable */
ssize_t bytes_read; /* the number of bytes read */
unsigned int *buf = NULL; /* buffer to hold data read */
unsigned int i; /* local index variable */
ssize_t bytes_read; /* the number of bytes read */
unsigned int *buf = NULL; /* buffer to hold data read */
/* Allocate buffer for data read */
if((buf = (unsigned int *)malloc(k * sizeof(unsigned int))) == NULL) {
@ -165,13 +165,13 @@ error:
} /* end verify() */
/*-------------------------------------------------------------------------
* Function: print_info
*
* Purpose: To print the statistics gathered for re-reads
*
* Parameters:
* Parameters:
* info -- the array storing the statistics for re-reads
* lastr -- the last read completed
* iteration -- the current iteration
@ -183,7 +183,7 @@ error:
void
print_info(int *info, unsigned int lastr, unsigned iteration)
{
unsigned j; /* local index variable */
unsigned j; /* local index variable */
printf("--------statistics for %u reads (iteration %u)--------\n", lastr, iteration);
@ -193,13 +193,13 @@ print_info(int *info, unsigned int lastr, unsigned iteration)
printf("--------end statistics for %u reads (iteration %u)--------\n", lastr, iteration);
} /* print_info() */
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To verify that the data read is the pattern expected.
* (1) Make sure the file opens successfully and the # of bytes read is as expected
* (2) Iterate the reader with i iterations
* (1) Make sure the file opens successfully and the # of bytes read is as expected
* (2) Iterate the reader with i iterations
* (3) Read and verify n integers for each iteration
* (4) On verification error, re-read the data at most READ_TRIES
* times to see if correct data can be obtained

View File

@ -14,7 +14,7 @@
*
* Created: atomic_writer.c
*
* Purpose: This is the "writer" part of the standalone test to check
* Purpose: This is the "writer" part of the standalone test to check
* atomic read-write operation on a system.
* a) atomic_writer.c--the writer (this file)
* b) atomic_reader.c--the reader
@ -53,7 +53,7 @@
static void usage(void);
/*-------------------------------------------------------------------------
* Function: usage
*
@ -77,12 +77,12 @@ usage(void)
} /* usage() */
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To write a series of integers to a file for the reader to verify the data.
* A write is atomic if the whole amount written in one operation is not interleaved
* A write is atomic if the whole amount written in one operation is not interleaved
* with data from any other process.
* (1) Iterate with i iterations
* (2) Write a series of integers (0 to n-1) to the file with this pattern:
@ -196,7 +196,7 @@ main(int argc, char *argv[])
printf("WRITER: error from lseek\n");
goto error;
} /* end if */
/* Write the data */
if((bytes_wrote = write(fd, buf, ((num-n) * sizeof(unsigned int)))) < 0) {
printf("WRITER: error from write\n");

View File

@ -895,13 +895,11 @@ test_clear (void)
/*-------------------------------------------------------------------------
* Function: main
* Function: main
*
* Purpose:
*
* Return: Success:
*
* Failure:
* Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, June 16, 1998
@ -911,7 +909,7 @@ test_clear (void)
int
main(void)
{
int nerrors = 0;
int nerrors = 0;
/*
* Open the library explicitly.
@ -930,12 +928,12 @@ main(void)
if(nerrors) {
HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1 == nerrors ? "" : "S");
exit(EXIT_FAILURE);
HDexit(EXIT_FAILURE);
}
HDprintf("All bit tests passed.\n");
H5close();
return 0;
}
HDexit(EXIT_SUCCESS);
} /* end main() */

File diff suppressed because it is too large Load Diff

14816
test/cache.c

File diff suppressed because it is too large Load Diff

View File

@ -14,8 +14,8 @@
/* Programmer: John Mainzer
* 11/10/05
*
* This file contains tests for the API calls associated
* with the cache implemented in H5C.c
* This file contains tests for the API calls associated
* with the cache implemented in H5C.c
*/
#include "cache_common.h"
@ -36,7 +36,7 @@ static hbool_t check_fapl_mdc_api_errs(void);
static hbool_t check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id);
/**************************************************************************/
/**************************************************************************/
/********************************* tests: *********************************/
@ -104,8 +104,8 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t scratch;
H5C_auto_size_ctl_t default_auto_size_ctl;
@ -495,7 +495,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
} /* check_fapl_mdc_api_calls() */
/*-------------------------------------------------------------------------
* Function: check_file_mdc_api_calls()
*
@ -560,8 +560,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_2 =
{
@ -595,8 +595,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_3 =
{
@ -630,8 +630,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ FALSE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_4 =
{
@ -666,8 +666,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.1f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
if(paged)
@ -813,9 +813,9 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
else {
HDfprintf(stdout, "H5Fget_mdc_size() reports:\n");
HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n",
HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n",
(long)max_size, (long)min_clean_size);
HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n",
HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n",
(long)cur_size, cur_num_entries);
}
#endif
@ -846,7 +846,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
}
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
}
@ -854,14 +854,14 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
} /* check_file_mdc_api_calls() */
/*-------------------------------------------------------------------------
* Function: mdc_api_call_smoke_check()
* Function: mdc_api_call_smoke_check()
*
* Purpose: Initial basic functional test to see if there are problems
* with the cache API calls.
*
* NOTE: This test takes some time to run and checks the
* NOTE: This test takes some time to run and checks the
* HDF5TestExpress environment variable.
*
* Return: Test pass status (TRUE/FALSE)
@ -933,8 +933,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_2 =
{
@ -968,8 +968,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_3 =
{
@ -1003,8 +1003,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
if(paged)
@ -1117,9 +1117,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* create the dataset */
if ( pass ) {
sprintf(dset_name, "/dset%03d", i);
HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@ -1327,7 +1327,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "slab validation failed.";
#else /* as above */
fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
#endif
}
@ -1448,7 +1448,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "slab validation failed.";
#if 0 /* as above */
fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
#endif
}
@ -1523,9 +1523,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
}
if ( pass ) {
PASSED();
} else {
H5_FAILED();
@ -1561,7 +1561,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
*-------------------------------------------------------------------------
*/
#define NUM_INVALID_CONFIGS 36
#define NUM_INVALID_CONFIGS 36
static H5AC_cache_config_t * invalid_configs = NULL;
static H5AC_cache_config_t *
@ -1737,7 +1737,7 @@ init_invalid_configs(void) {
} /* initialize_invalid_configs() */
/*-------------------------------------------------------------------------
* Function: check_fapl_mdc_api_errs()
*
@ -1913,7 +1913,7 @@ check_fapl_mdc_api_errs(void)
} /* check_fapl_mdc_api_errs() */
/*-------------------------------------------------------------------------
* Function: check_file_mdc_api_errs()
*
@ -2259,7 +2259,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
} /* check_file_mdc_api_errs() */
/*-------------------------------------------------------------------------
* Function: main
*
@ -2285,10 +2285,10 @@ main(void)
express_test = GetTestExpress();
printf("===================================\n");
printf("Cache API tests\n");
printf(" express_test = %d\n", express_test);
printf("===================================\n");
HDprintf("===================================\n");
HDprintf("Cache API tests\n");
HDprintf(" express_test = %d\n", express_test);
HDprintf("===================================\n");
/* Initialize invalid configurations.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
*
* This file contains tests for metadata tagging.
*/
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
@ -47,7 +47,7 @@
#define TEST_DEFAULT 0
#define TEST_SHMESG 1
#define NUM_TEST_TYPES 2
/* ===================== */
/* Function Declarations */
/* ===================== */
@ -98,7 +98,7 @@ static unsigned check_invalid_tag_application(void);
#ifndef NDEBUG
/*-------------------------------------------------------------------------
* Function: dump_cache()
*
@ -127,19 +127,19 @@ static int dump_cache(hid_t fid)
TEST_ERROR;
return 0;
error:
return -1;
} /* dump_cache */
#endif /* NDEBUG */ /* end debugging functions */
/*-------------------------------------------------------------------------
* Function: verify_no_unknown_tags()
*
* Purpose: Verifies that all tags in the provided cache have the
* 'dirtied' flag set. Other verification functions in this
* test file set this flag after checking them, so
* 'dirtied' flag set. Other verification functions in this
* test file set this flag after checking them, so
* this is handy to verify that tests have checked all entries
* in the cache.
*
@ -181,7 +181,7 @@ error:
return -1;
} /* verify_no_unknown_tags */
/*-------------------------------------------------------------------------
* Function: mark_all_entries_investigated()
*
@ -229,7 +229,7 @@ error:
return -1;
} /* mark_all_entries_investigated */
/*-------------------------------------------------------------------------
* Function: reset_all_entries_investigated()
*
@ -275,15 +275,15 @@ error:
return -1;
} /* reset_all_entries_investigated */
/*-------------------------------------------------------------------------
* Function: verify_tag()
*
* Purpose: Asserts that there is an entry in the specified cache with
* the provided entry id and provided tag. The function will
* fail if this is not the case. If found, this function will
* set the entry's flush_marker flag, so future verification
* attempts can skip over this entry, knowing it has already been
* fail if this is not the case. If found, this function will
* set the entry's flush_marker flag, so future verification
* attempts can skip over this entry, knowing it has already been
* checked.
*
* Return: 0 on Success, -1 on Failure
@ -327,7 +327,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
/* Didn't find the tagged entry, throw an error */
TEST_ERROR;
done:
return 0;
@ -358,7 +358,7 @@ error:
return -1;
} /* evict entries */
/*-------------------------------------------------------------------------
* Function: get_object_header_tag()
*
@ -389,7 +389,7 @@ error:
return -1;
} /* get_object_header_tag */
/*-------------------------------------------------------------------------
* Function: get_sbe_tag()
*
@ -420,7 +420,7 @@ error:
/* Test Functions */
/* ============== */
/*-------------------------------------------------------------------------
* Function: check_file_creation_tags
*
@ -434,7 +434,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_file_creation_tags(hid_t fcpl_id, int type)
{
/* Variable Declarations */
@ -507,7 +507,7 @@ error:
return 1;
} /* check_file_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_file_open_tags
*
@ -521,7 +521,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_file_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -551,12 +551,12 @@ check_file_open_tags(hid_t fcpl, int type)
/* Retrieve various tags */
if ( type == TEST_SHMESG ) {
/* determine tag value of superblock extension object header */
if ( get_sbe_tag(fid, &sbe_tag) < 0 ) TEST_ERROR;
} /* end if */
/* Close the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
@ -619,7 +619,7 @@ error:
return 1;
} /* check_file_open_tags */
/*-------------------------------------------------------------------------
* Function: check_group_creation_tags
*
@ -633,7 +633,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_group_creation_tags(void)
{
/* Variable Declarations */
@ -646,7 +646,7 @@ check_group_creation_tags(void)
/* Testing Macro */
TESTING("tag application during group creation");
/* ===== */
/* Setup */
/* ===== */
@ -683,7 +683,7 @@ check_group_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SNODE_ID, root_tag) < 0 ) TEST_ERROR;
@ -720,7 +720,7 @@ error:
return 1;
} /* check_group_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_multi_group_creation_tags
*
@ -734,7 +734,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_multi_group_creation_tags(void)
{
/* Variable Declarations */
@ -774,7 +774,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
sprintf(gname, "%d", i);
HDsprintf(gname, "%d", i);
if ( (gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
@ -793,7 +793,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
/* Re-open the group */
sprintf(gname, "%d", i);
HDsprintf(gname, "%d", i);
if ( (gid = H5Gopen2(fid, gname, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* Verify object header for root group */
@ -848,7 +848,7 @@ error:
return 1;
} /* check_multi_group_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_link_iteration_tags
*
@ -862,7 +862,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_link_iteration_tags(void)
{
/* Variable Declarations */
@ -899,7 +899,7 @@ check_link_iteration_tags(void)
/* Create many datasets in root group */
for (i=0;i<500;i++) {
sprintf(dsetname, "Dset %d", i);
HDsprintf(dsetname, "Dset %d", i);
if ( (did = H5Dcreate2(fid, dsetname, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Dclose(did) < 0 ) TEST_ERROR;
}
@ -966,7 +966,7 @@ error:
return 1;
} /* check_link_iteration_tags */
/*-------------------------------------------------------------------------
* Function: check_dense_attribute_tags
*
@ -980,7 +980,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dense_attribute_tags(void)
{
/* Variable Declarations */
@ -994,7 +994,7 @@ check_dense_attribute_tags(void)
hid_t fapl = -1; /* File access property list */
haddr_t d_tag = 0; /* Dataset tag value */
haddr_t root_tag = 0; /* Root group tag value */
char attrname[500]; /* Name of attribute */
char attrname[500]; /* Name of attribute */
/* Testing Macro */
TESTING("tag application during dense attribute manipulation");
@ -1022,10 +1022,10 @@ check_dense_attribute_tags(void)
/* Create dataset */
if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Pclose(dcpl) < 0 ) TEST_ERROR;
/* get dataset object header */
if ( get_object_header_tag(did, &d_tag) < 0 ) TEST_ERROR;
/* Clear Metadata Tags (don't care about them for this test */
mark_all_entries_investigated(fid);
@ -1035,7 +1035,7 @@ check_dense_attribute_tags(void)
for (i=0;i<50;i++) {
sprintf(attrname, "attr %d", i);
HDsprintf(attrname, "attr %d", i);
if ( (aid = H5Acreate2(did, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0 ) TEST_ERROR;
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
@ -1151,7 +1151,7 @@ error:
return 1;
} /* check_dense_attribute_tags */
/*-------------------------------------------------------------------------
* Function: check_group_open_tags
*
@ -1165,7 +1165,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_group_open_tags(void)
{
/* Variable Declarations */
@ -1178,7 +1178,7 @@ check_group_open_tags(void)
/* Testing Macro */
TESTING("tag application during group open");
/* ===== */
/* Setup */
/* ===== */
@ -1258,7 +1258,7 @@ error:
return 1;
} /* check_group_open_tags */
/*-------------------------------------------------------------------------
* Function: check_attribute_creation_tags
*
@ -1272,7 +1272,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_attribute_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -1349,7 +1349,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify shared message index tagged with sohm */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/* verify fractal heap header belonging to group */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@ -1368,7 +1368,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
/* Reset the changes we've made to the cache's data structures */
if(reset_all_entries_investigated(fid) < 0) TEST_ERROR;
@ -1392,7 +1392,7 @@ error:
return 1;
} /* check_attribute_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_attribute_open_tags
*
@ -1406,7 +1406,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_attribute_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -1483,7 +1483,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* verify object header chunk belonging to group */
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, g_tag) < 0 ) TEST_ERROR;
if ( type == TEST_SHMESG ) {
/* verify (another) object header chunk belonging to group */
@ -1529,7 +1529,7 @@ error:
return 1;
} /* check_attribute_open_tags */
/*-------------------------------------------------------------------------
* Function: check_attribute_rename_tags
*
@ -1543,7 +1543,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_attribute_rename_tags(hid_t fcpl, int type)
{
/* Variable declarations */
@ -1597,7 +1597,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* fill out data buffer */
for(i = 0; i < DIMS; i++)
for(j = 0; j < DIMS; j++)
@ -1663,9 +1663,9 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* verify shared header message stored as a list */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/*
* one freespace header tag for H5FD_MEM_DRAW manager,
* one freespace header tag for H5FD_MEM_SUPER manager
/*
* one freespace header tag for H5FD_MEM_DRAW manager,
* one freespace header tag for H5FD_MEM_SUPER manager
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
@ -1704,7 +1704,7 @@ error:
return 1;
} /* check_attribute_rename_tags */
/*-------------------------------------------------------------------------
* Function: check_attribute_delete_tags
*
@ -1718,7 +1718,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_attribute_delete_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -1772,7 +1772,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* fill out data buffer */
for(i = 0;i < DIMS; i++)
for(j = 0;j < DIMS; j++)
@ -1810,33 +1810,33 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
if ( type == TEST_SHMESG ) {
/* verify shared header message master table */
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/*
* 2 calls to verify_tag() for verifying free space:
/*
* 2 calls to verify_tag() for verifying free space:
* one freespace header tag for free-space header raw data
* one freespace header tag for free-space section info raw data
* one freespace header tag for free-space header metadata
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
#if 0
/* If the free space managers are persistent, the
/* If the free space managers are persistent, the
* H5MF_tidy_self_referential_fsm_hack() must have been run.
* Since this function floats all self referential free space
* managers, the H5FD_MEM_SUPER FSM will not be in the metadata
* Since this function floats all self referential free space
* managers, the H5FD_MEM_SUPER FSM will not be in the metadata
* cache.
*/
if ( ( ! persistent_fsms ) &&
if ( ( ! persistent_fsms ) &&
( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) )
TEST_ERROR;
#endif
@ -1871,7 +1871,7 @@ error:
return 1;
} /* check_attribute_delete_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_tags
*
@ -1885,7 +1885,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -1929,10 +1929,10 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* ============================ */
/* Create Dataset in Root Group */
/* ============================ */
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -1974,7 +1974,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@ -2004,7 +2004,7 @@ error:
return 1;
} /* check_dataset_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_earlyalloc_tags
*
@ -2018,7 +2018,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -2107,7 +2107,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@ -2141,7 +2141,7 @@ error:
return 1;
} /* check_dataset_creation_earlyalloc_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_open_tags
*
@ -2155,7 +2155,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_open_tags(void)
{
/* Variable Declarations */
@ -2192,7 +2192,7 @@ check_dataset_open_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -2222,7 +2222,7 @@ check_dataset_open_tags(void)
/* ========================== */
/* Open Dataset in Root Group */
/* ========================== */
if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* =================================== */
@ -2267,7 +2267,7 @@ error:
return 1;
} /* check_dataset_open_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_write_tags
*
@ -2281,7 +2281,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_write_tags(void)
{
/* Variable Declarations */
@ -2323,7 +2323,7 @@ check_dataset_write_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -2372,7 +2372,7 @@ check_dataset_write_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify 10 b-tree nodes belonging to dataset */
for (i=0; i<10; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@ -2408,7 +2408,7 @@ error:
return 1;
} /* check_dataset_write_tags */
/*-------------------------------------------------------------------------
* Function: check_attribute_write_tags
*
@ -2422,7 +2422,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_attribute_write_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -2503,7 +2503,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify object header of group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@ -2562,7 +2562,7 @@ error:
return 1;
} /* check_attribute_write_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_read_tags
*
@ -2576,7 +2576,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_read_tags(void)
{
/* Variable Declarations */
@ -2618,7 +2618,7 @@ check_dataset_read_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -2666,7 +2666,7 @@ check_dataset_read_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify 19 b-tree nodes belonging to dataset */
for (i=0; i<19; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@ -2699,7 +2699,7 @@ error:
return 1;
} /* check_dataset_read_tags */
/*-------------------------------------------------------------------------
* Function: check_dataset_size_retrieval
*
@ -2713,7 +2713,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_size_retrieval(void)
{
/* Variable Declarations */
@ -2756,7 +2756,7 @@ check_dataset_size_retrieval(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -2837,7 +2837,7 @@ error:
return 1;
} /* check_dataset_size_retrieval */
/*-------------------------------------------------------------------------
* Function: check_dataset_extend_tags
*
@ -2851,7 +2851,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_dataset_extend_tags(void)
{
@ -2895,7 +2895,7 @@ check_dataset_extend_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -2976,7 +2976,7 @@ error:
return 1;
} /* check_dataset_extend_tags */
/*-------------------------------------------------------------------------
* Function: check_object_info_tags
*
@ -2990,7 +2990,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_object_info_tags(void)
{
/* Variable Declarations */
@ -3000,7 +3000,7 @@ check_object_info_tags(void)
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
H5O_info_t oinfo; /* Object info struct */
H5O_info_t oinfo; /* Object info struct */
/* Testing Macro */
TESTING("tag application during object info retrieval");
@ -3085,7 +3085,7 @@ error:
return 1;
} /* check_object_info_tags */
/*-------------------------------------------------------------------------
* Function: check_object_copy_tags
*
@ -3099,7 +3099,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_object_copy_tags(void)
{
/* Variable Declarations */
@ -3155,7 +3155,7 @@ check_object_copy_tags(void)
if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( get_object_header_tag(gid, &copy_tag) < 0 ) TEST_ERROR;
if (H5Gclose(gid) < 0) TEST_ERROR;
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@ -3204,7 +3204,7 @@ error:
return 1;
} /* check_object_copy_tags */
/*-------------------------------------------------------------------------
* Function: check_link_removal_tags
*
@ -3218,7 +3218,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_link_removal_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@ -3271,7 +3271,7 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -3334,7 +3334,7 @@ check_link_removal_tags(hid_t fcpl, int type)
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
} /* end if */
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
@ -3362,7 +3362,7 @@ error:
return 1;
} /* check_link_removal_tags */
/*-------------------------------------------------------------------------
* Function: check_link_getname_tags
*
@ -3376,7 +3376,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_link_getname_tags(void)
{
/* Variable Declarations */
@ -3430,7 +3430,7 @@ check_link_getname_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@ -3513,7 +3513,7 @@ error:
return 1;
} /* check_link_getname_tags */
/*-------------------------------------------------------------------------
* Function: check_external_link_creation_tags
*
@ -3527,7 +3527,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_external_link_creation_tags(void)
{
/* Variable Declarations */
@ -3576,7 +3576,7 @@ check_external_link_creation_tags(void)
/* ==================== */
/* Create External Link */
/* ==================== */
if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR;
/* =================================== */
@ -3587,7 +3587,7 @@ check_external_link_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, root_tag) < 0 ) TEST_ERROR;
@ -3617,7 +3617,7 @@ error:
return 1;
} /* check_external_link_creation_tags */
/*-------------------------------------------------------------------------
* Function: check_external_link_open_tags
*
@ -3631,7 +3631,7 @@ error:
*
*-------------------------------------------------------------------------
*/
static unsigned
static unsigned
check_external_link_open_tags(void)
{
/* Variable Declarations */
@ -3689,11 +3689,11 @@ check_external_link_open_tags(void)
/* ================== */
/* Open External Link */
/* ================== */
if ( (xid = H5Gopen2(fid, LINKNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( (fid2 = H5Iget_file_id(xid)) < 0) TEST_ERROR;
if ( get_object_header_tag(xid, &link_tag) < 0 ) TEST_ERROR;
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@ -3747,12 +3747,12 @@ error:
return 1;
} /* check_external_link_open_tags */
/*-------------------------------------------------------------------------
* Function: check_invalid_tag_application
*
* Purpose: This function verifies that an error occurs if a tag
* has not been set up during a protect or set of
* has not been set up during a protect or set of
* a new piece of metadata.
*
* Return: 0 on Success, 1 on Failure
@ -3777,7 +3777,7 @@ check_invalid_tag_application(void)
/* Testing Macro */
TESTING("failure on invalid tag application");
#if H5C_DO_TAGGING_SANITY_CHECKS
/* Create Fapl */
if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
@ -3844,7 +3844,7 @@ error:
return 1;
} /* check_invalid_tag_application */
/*-------------------------------------------------------------------------
* Function: main
*
@ -3857,8 +3857,8 @@ error:
*
*-------------------------------------------------------------------------
*/
int
main(void)
int
main(void)
{
/* Variable Declarations */
hid_t fcpl_default = -1; /* file creation prop list */
@ -3866,13 +3866,13 @@ main(void)
hid_t fcpl = -1; /* file creation prop list */
unsigned nerrs = 0; /* Error Encountered */
int test_type = 0; /* test type iterator */
/* Open the HDF5 Library */
H5open();
/* ========== */
/* ========== */
/* Test Setup */
/* ========== */
/* ========== */
/* Create a standard file creation property list */
fcpl_default = H5Pcreate(H5P_FILE_CREATE);
@ -3888,13 +3888,13 @@ main(void)
/* ========= */
for (test_type=0; test_type<NUM_TEST_TYPES; test_type++) {
/* Run tests on each fcpl set up above. */
if (test_type == TEST_DEFAULT) {
if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n");
fcpl = fcpl_default;
} else if (test_type == TEST_SHMESG) {
if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n");
@ -3931,7 +3931,7 @@ main(void)
if (!nerrs) nerrs += check_link_getname_tags();
if (!nerrs) nerrs += check_external_link_creation_tags();
if (!nerrs) nerrs += check_external_link_open_tags();
if (!nerrs) nerrs += check_dense_attribute_tags();
if (!nerrs) nerrs += check_link_iteration_tags();
if (!nerrs) nerrs += check_invalid_tag_application();

1986
test/chunk_info.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,9 +24,9 @@
* This file needs to access private information from the H5C package.
* This file also needs to access the metadata cache testing code.
*/
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#define H5C_TESTING /*suppress warning about H5C testing funcs*/
#include "H5Cpkg.h" /* Cache */
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#define H5C_TESTING /*suppress warning about H5C testing funcs*/
#include "H5Cpkg.h" /* Cache */
/* ============ */
@ -74,7 +74,7 @@ static unsigned verify_group_cork(hbool_t swmr);
static unsigned verify_named_cork(hbool_t swmr);
static unsigned verify_multiple_cork(hbool_t swmr);
/*-------------------------------------------------------------------------
* Function: verify_old_dset_cork
*
@ -120,15 +120,15 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
/* Create chunked dataset with v1-btree indexing: DSET_BT1 */
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did = H5Dcreate2(fid, DSET_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Get dataset object header address: DSET_BT1 */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_BT1 */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
@ -159,13 +159,13 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
FAIL_STACK_ERROR
if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object address */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_COMPACT */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
@ -212,7 +212,7 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
if(H5Pset_layout(dcpl3, H5D_CONTIGUOUS) < 0)
FAIL_STACK_ERROR
if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0)
if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object address: DSET_CONTIG */
@ -224,11 +224,11 @@ verify_old_dset_cork(void)
TEST_ERROR
/* Verify the cork status for DSET_CONTIG */
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Verify the cork status for DSET_BT1 */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
/* Un-cork the dataset: DSET_CONTIG */
@ -236,7 +236,7 @@ verify_old_dset_cork(void)
TEST_ERROR
/* Verify the cork status for DSET_CONTIG */
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@ -268,7 +268,7 @@ error:
return 1;
} /* verify_old_dset_cork */
/*-------------------------------------------------------------------------
* Function: verify_obj_dset_cork
*
@ -325,23 +325,23 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Create dataset: DSET */
if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Get dataset object header address */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
/* Cork the dataset: DSET */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
/* Attach and write to an attribute to the dataset: DSET */
if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
@ -349,24 +349,24 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Close the attribute */
if(H5Aclose(aid) < 0)
if(H5Aclose(aid) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
/* Create dcpl */
if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
/* Set to early allocation for dataset space */
if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
TEST_ERROR
/* Create chunked dataset with implicit indexing: DSET_NONE */
if(H5Pset_chunk(dcpl2, 1, chunk_dim) < 0)
FAIL_STACK_ERROR
if((sid2 = H5Screate_simple(1, dim, NULL)) < 0)
if((sid2 = H5Screate_simple(1, dim, NULL)) < 0)
TEST_ERROR
if((did2 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
TEST_ERROR
@ -391,7 +391,7 @@ verify_obj_dset_cork(hbool_t swmr)
} /* end for */
/* Verify cork status of the dataset: DSET_NONE */
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Closing */
@ -412,11 +412,11 @@ verify_obj_dset_cork(hbool_t swmr)
flags = H5F_ACC_RDWR;
if(swmr)
flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
TEST_ERROR
/* Open the dataset object: DSET_NONE */
if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0)
if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
@ -469,7 +469,7 @@ error:
return 1;
} /* verify_obj_dset_cork */
/*-------------------------------------------------------------------------
* Function: verify_dset_cork
*
@ -540,15 +540,15 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
FAIL_STACK_ERROR
/* Create chunked dataset with extensive array indexing: DSET_EA */
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Get dataset object header address: DSET_EA */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_EA */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
@ -558,7 +558,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Create chunked dataset with fixed array indexing: DSET_FA */
if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
if((did2 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
@ -566,7 +566,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Get dataset object header address: DSET_FA */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_FA */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
@ -585,7 +585,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Create chunked dataset with v2-Btree indexing */
max_dims[0] = H5S_UNLIMITED;
if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0)
if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did3 = H5Dcreate2(fid, DSET_BT2, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
@ -708,7 +708,7 @@ error:
} /* verify_dset_cork */
/*-------------------------------------------------------------------------
* Function: verify_group_cork
*
@ -758,11 +758,11 @@ verify_group_cork(hbool_t swmr)
TEST_ERROR
/* Create 3 groups */
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Cork the second group: GRP2 */
@ -778,23 +778,23 @@ verify_group_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the groups */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Close the second group: GRP2 */
if(H5Gclose(gid2) < 0)
TEST_ERROR
/* Re-open the second group: GRP2 */
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Verify cork status of the second group: GRP2 */
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@ -813,11 +813,11 @@ verify_group_cork(hbool_t swmr)
flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0)
if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Create dataspace */
@ -826,7 +826,7 @@ verify_group_cork(hbool_t swmr)
/* Attach 8 attributes to the third group: GRP3 */
for(i = 0;i < 8; i++) {
sprintf(attrname, "attr %d", i);
HDsprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(gid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
@ -835,7 +835,7 @@ verify_group_cork(hbool_t swmr)
if(i == 3) {
if(H5Odisable_mdc_flushes(gid3) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@ -843,7 +843,7 @@ verify_group_cork(hbool_t swmr)
} /* end for */
/* Verify cork status of the third group: GRP3 */
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Closing */
@ -875,7 +875,7 @@ error:
return 1;
} /* verify_group_cork */
/*-------------------------------------------------------------------------
* Function: verify_named_cork
*
@ -935,21 +935,21 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Commit datatype /DT */
if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Create /GRP */
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Commit datatype /GRP/DT2 */
if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Create /GRP/GRP2 */
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Commit datatype /GRP/GRP2/DT3 */
if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Cork 2 named datatypes: /DT and /GRP/GRP2/DT3 */
@ -967,11 +967,11 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the named datatypes */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Close the datatypes */
@ -983,19 +983,19 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Re-open the named datatypes */
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Verify cork status of the named datatypes */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@ -1019,17 +1019,17 @@ verify_named_cork(hbool_t swmr)
flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Re-open the named datatypes */
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Cork the datatype: DT2 */
@ -1042,7 +1042,7 @@ verify_named_cork(hbool_t swmr)
/* Attach 8 attributes to datatype: DT3 */
for(i = 0;i < 8; i++) {
sprintf(attrname, "attr %d", i);
HDsprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(tid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
@ -1051,7 +1051,7 @@ verify_named_cork(hbool_t swmr)
if(i == 3) {
if(H5Odisable_mdc_flushes(tid3) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@ -1059,7 +1059,7 @@ verify_named_cork(hbool_t swmr)
} /* end for */
/* Create a dataset with named datatype: DT */
if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object header address */
@ -1071,20 +1071,20 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT2 */
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT3 */
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Un-cork the datatype: DT3 */
if(H5Oenable_mdc_flushes(tid3) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT3 */
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Cork the datatype: DT */
@ -1092,14 +1092,14 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT2 */
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0)
TEST_ERROR
/* Close the dataset */
@ -1107,11 +1107,11 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@ -1149,7 +1149,7 @@ error:
return 1;
} /* verify_named_cork */
/*-------------------------------------------------------------------------
* Function: verify_multiple_cork
*
@ -1279,7 +1279,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the group: gid2 */
if(H5Oget_info2(gid2, &oinfo1, H5O_INFO_BASIC) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the group: gid1 */
@ -1307,7 +1307,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the dataset: did1 */
if(H5Oget_info2(did1, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did2 */
@ -1335,7 +1335,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the datatype: tid2 */
if(H5Oget_info2(tid2, &oinfo3, H5O_INFO_BASIC) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0)
if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the datatype: tid1 */
@ -1351,7 +1351,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the group: gid1 */
if(H5Oget_info2(gid1, &oinfo1, H5O_INFO_BASIC) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
TEST_ERROR
/* Check cork status of the group: gid2 */
@ -1371,7 +1371,7 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the group: gid1 */
if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
TEST_ERROR
/* Close the group: gid1 */
@ -1385,7 +1385,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the dataset: did2 */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did1 */
@ -1405,7 +1405,7 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the dataset: did1 */
if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0)
if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Close the dataset: did1 */
@ -1517,7 +1517,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_objs_cork
*
* Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public
* Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public
* routines are working as specified.
*
* Return: 0 on Success, 1 on Failure
@ -1723,7 +1723,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
/* Cork the named datatype */
if(H5Odisable_mdc_flushes(tid) < 0)
TEST_ERROR
@ -1796,7 +1796,7 @@ error:
return 1;
} /* test_objs_cork() */
/*-------------------------------------------------------------------------
* Function: test_dset_cork
*
@ -1847,7 +1847,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
} /* end if */
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR
/* Set to use latest format */
@ -1880,7 +1880,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
/* Set up dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
/* Enable chunking */
if(H5Pset_chunk(dcpl, RANK, cdims) < 0)
TEST_ERROR
@ -2003,7 +2003,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
if(!corked)
TEST_ERROR
/* Close the dataset */
if(H5Dclose(did1) < 0)
TEST_ERROR
@ -2053,7 +2053,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Second open of the named datatype */
if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0)
if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0)
TEST_ERROR
/* Check cork status of the second opened named datatype */
@ -2124,7 +2124,7 @@ error:
} /* test_dset_cork() */
/*-------------------------------------------------------------------------
* Function: main
*
@ -2138,12 +2138,12 @@ error:
*
*-------------------------------------------------------------------------
*/
int
main(void)
int
main(void)
{
unsigned swmr; /* Loop over SWMR/non-SWMR */
unsigned nerrs = 0; /* Error Encountered */
/* Test for dataset created with old library format */
nerrs += verify_old_dset_cork();
@ -2158,10 +2158,10 @@ main(void)
/* Tests with/without SWMR access */
nerrs += verify_obj_dset_cork(swmr);
nerrs += verify_dset_cork(swmr, TRUE);
nerrs += verify_dset_cork(swmr, FALSE);
nerrs += verify_group_cork(swmr);
nerrs += verify_named_cork(swmr);
nerrs += verify_dset_cork(swmr, TRUE);
nerrs += verify_dset_cork(swmr, FALSE);
nerrs += verify_group_cork(swmr);
nerrs += verify_named_cork(swmr);
nerrs += verify_multiple_cork(swmr);
} /* end for */

Some files were not shown because too many files have changed in this diff Show More