Compare commits
16 Commits
vms_last_s
...
inactive/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f77ae95dd7 | ||
|
|
e7d8baf0c3 | ||
|
|
cca4beb3a9 | ||
|
|
88a4994eb4 | ||
|
|
adaf2fd9de | ||
|
|
16746f815d | ||
|
|
92b272cf1f | ||
|
|
9bb32f6494 | ||
|
|
848b2e7158 | ||
|
|
8657fa19db | ||
|
|
e1e75b3031 | ||
|
|
de34897eb4 | ||
|
|
bf877c025f | ||
|
|
c4f3b2fbd6 | ||
|
|
e6b9094a32 | ||
|
|
b617e21552 |
2
MANIFEST
2
MANIFEST
@@ -968,6 +968,8 @@
|
||||
./test/filter_fail.c
|
||||
./test/flush1.c
|
||||
./test/flush2.c
|
||||
./test/fsync_tests.c
|
||||
./test/fsync_tests.sh.in
|
||||
./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_bogus.c _DO_NOT_DISTRIBUTE_
|
||||
|
||||
@@ -110,15 +110,22 @@ static void test_file_create()
|
||||
|
||||
// try to create the same file with H5F_ACC_TRUNC. This should fail
|
||||
// because file1 is the same file and is currently open.
|
||||
|
||||
/* These three are failing with new/PGI compiler, HDFFV-8067
|
||||
The line "H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E"
|
||||
Results in this message:
|
||||
"terminate called without an active exception
|
||||
Command terminated by signal 6"
|
||||
Commenting it out until it's fixed LK 20120626.
|
||||
#ifndef H5_HAVE_FILE_VERSIONS
|
||||
try {
|
||||
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
|
||||
|
||||
// Should FAIL but didn't, so throw an invalid action exception
|
||||
throw InvalidActionException("H5File constructor", "Attempted to create an existing file.");
|
||||
}
|
||||
catch( FileIException E ) // catch truncating existing file
|
||||
{} // do nothing, FAIL expected
|
||||
|
||||
#endif
|
||||
// Close file1
|
||||
delete file1;
|
||||
@@ -152,13 +159,15 @@ static void test_file_create()
|
||||
// Try with H5F_ACC_EXCL. This should fail too because the file already
|
||||
// exists.
|
||||
try {
|
||||
H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
|
||||
// H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
|
||||
|
||||
// Should FAIL but didn't, so throw an invalid action exception
|
||||
throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file.");
|
||||
}
|
||||
catch( FileIException E ) // catching H5F_ACC_EXCL on existing file
|
||||
{} // do nothing, FAIL expected
|
||||
*/
|
||||
std::cerr << "SKIPPED for HDFFV-8067" << std::endl;
|
||||
|
||||
// Get the file-creation template
|
||||
FileCreatPropList tmpl1 = file1->getCreatePlist();
|
||||
|
||||
@@ -58,8 +58,6 @@ if test "X-" = "X-$cc_flags_set"; then
|
||||
&& PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS"
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
if test "X-" = "X-$FC"; then
|
||||
|
||||
242
configure
vendored
242
configure
vendored
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# From configure.in Id: configure.in 21898 2012-01-29 15:51:06Z hdftest .
|
||||
# From configure.in Id: configure.in 21945 2012-02-16 01:06:58Z mainzer .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.68 for HDF5 1.9.109.
|
||||
#
|
||||
@@ -887,6 +887,9 @@ enable_gpfs
|
||||
enable_debug
|
||||
enable_codestack
|
||||
enable_metadata_trace_file
|
||||
enable_aio
|
||||
enable_64_bit_posix_aio
|
||||
enable_posix_aio_error_recovery
|
||||
enable_trace
|
||||
enable_instrument
|
||||
enable_clear_file_buffers
|
||||
@@ -1575,6 +1578,11 @@ Optional Features:
|
||||
debugging).
|
||||
--enable-metadata-trace-file
|
||||
Enable metadata trace file collection.
|
||||
--enable-aio force AIO support on or off
|
||||
--enable-64-bit-posix-aio
|
||||
force use of 64 bit posix AIO calls
|
||||
--enable-posix-aio-error-recovery
|
||||
Enable POSIX AIO error recovery.
|
||||
--enable-trace Enable API tracing capability. Default=no if debug
|
||||
is disabled.
|
||||
--enable-instrument Enable library instrumentation of optimization
|
||||
@@ -26965,6 +26973,84 @@ $as_echo "no" >&6; }
|
||||
;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if AIO support should be forced" >&5
|
||||
$as_echo_n "checking if AIO support should be forced... " >&6; }
|
||||
# Check whether --enable-aio was given.
|
||||
if test "${enable_aio+set}" = set; then :
|
||||
enableval=$enable_aio; FORCE_AIO=$enableval
|
||||
else
|
||||
FORCE_AIO="use-default"
|
||||
fi
|
||||
|
||||
|
||||
case "X-$FORCE_AIO" in
|
||||
X-|X-no)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
X-yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
;;
|
||||
X-use-default)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: use-default" >&5
|
||||
$as_echo "use-default" >&6; }
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if AIO 64 bit calls should be forced" >&5
|
||||
$as_echo_n "checking if AIO 64 bit calls should be forced... " >&6; }
|
||||
# Check whether --enable-64-bit-posix-aio was given.
|
||||
if test "${enable_64_bit_posix_aio+set}" = set; then :
|
||||
enableval=$enable_64_bit_posix_aio; FORCE_64_BIT_POSIX_AIO=$enableval
|
||||
else
|
||||
FORCE_64_BIT_POSIX_AIO="use-default"
|
||||
fi
|
||||
|
||||
|
||||
case "X-$FORCE_64_BIT_POSIX_AIO" in
|
||||
X-|X-no)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
X-yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
;;
|
||||
X-use-default)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: use-default" >&5
|
||||
$as_echo "use-default" >&6; }
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable POSIX AIO error recovery" >&5
|
||||
$as_echo_n "checking whether to enable POSIX AIO error recovery... " >&6; }
|
||||
# Check whether --enable-posix-aio-error-recovery was given.
|
||||
if test "${enable_posix_aio_error_recovery+set}" = set; then :
|
||||
enableval=$enable_posix_aio_error_recovery; POSIXAIOERRORRECOVERY=$enableval
|
||||
fi
|
||||
|
||||
|
||||
case "X-$POSIXAIOERRORRECOVERY" in
|
||||
X-yes)
|
||||
POSIXAIOERRORRECOVERY=yes
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
$as_echo "#define ENABLE_POSIX_AIO_ERROR_RECOVERY 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
*)
|
||||
POSIXAIOERRORRECOVERY=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for API tracing" >&5
|
||||
$as_echo_n "checking for API tracing... " >&6; };
|
||||
@@ -29940,6 +30026,157 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if AIO is supported" >&5
|
||||
$as_echo_n "checking if AIO is supported... " >&6; }
|
||||
|
||||
case $host_os in
|
||||
linux* )
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
REQUIRE_64_BIT_POSIX_AIO=yes
|
||||
;;
|
||||
freebsd* )
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
saved_libs="$LIBS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
case "X-$POSIX_AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
LIBS="$LIBS -lrt"
|
||||
if test "X$STATIC_EXEC" = "Xyes"; then
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
fi
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <aio.h>
|
||||
#ifdef FC_DUMMY_MAIN
|
||||
#ifndef FC_DUMMY_MAIN_EQ_F77
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int FC_DUMMY_MAIN() { return 1; }
|
||||
#endif
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct aiocb cb; aio_fsync(O_SYNC, &cb)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
|
||||
else
|
||||
AIO_SUPPORTED=no
|
||||
POSIX_AIO_SUPPORTED=no
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
;;
|
||||
X-no|*)
|
||||
;;
|
||||
esac
|
||||
|
||||
LIBS="$saved_libs"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
|
||||
|
||||
if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null ; then
|
||||
AIO_SUPPORTED=no
|
||||
fi
|
||||
|
||||
|
||||
case "X-$FORCE_AIO" in
|
||||
X-|X-no)
|
||||
AIO_SUPPORTED=no
|
||||
POSIX_AIO_SUPPORTED=no
|
||||
;;
|
||||
X-yes)
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "X-$FORCE_64_BIT_POSIX_AIO" in
|
||||
X-|X-no)
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
;;
|
||||
X-yes)
|
||||
REQUIRE_64_BIT_POSIX_AIO=yes
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
case "X-$AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
$as_echo "#define HAVE_AIO 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
X-no|*)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if POSIX AIO is supported" >&5
|
||||
$as_echo_n "checking if POSIX AIO is supported... " >&6; }
|
||||
case "X-$POSIX_AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
$as_echo "#define HAVE_POSIX_AIO 1" >>confdefs.h
|
||||
|
||||
case $host_os in
|
||||
linux* )
|
||||
H5_CFLAGS="$H5_CFLAGS -D_POSIX_C_SOURCE=199309L"
|
||||
;;
|
||||
esac
|
||||
LIBS="$LIBS -lrt"
|
||||
;;
|
||||
X-no|*)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64 POSIX AIO CALLS should be used" >&5
|
||||
$as_echo_n "checking if 64 POSIX AIO CALLS should be used... " >&6; }
|
||||
case "X-$REQUIRE_64_BIT_POSIX_AIO" in
|
||||
X-yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
$as_echo "#define USE_64_BIT_POSIX_AIO 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
X-no|*)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
CFLAGS="$saved_user_CFLAGS"
|
||||
FCFLAGS="$saved_user_FCFLAGS"
|
||||
@@ -30017,7 +30254,7 @@ if test -n "$TESTPARALLEL"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh"
|
||||
ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/fsync_tests.sh test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh"
|
||||
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
@@ -31282,6 +31519,7 @@ do
|
||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
|
||||
"test/fsync_tests.sh") CONFIG_FILES="$CONFIG_FILES test/fsync_tests.sh" ;;
|
||||
"test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;;
|
||||
"test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;;
|
||||
"test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;;
|
||||
|
||||
199
configure.in
199
configure.in
@@ -2460,6 +2460,76 @@ case "X-$METADATATRACEFILE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------------
|
||||
dnl Allow user to over-ride configure's decision as to whether AIO is
|
||||
dnl supported
|
||||
AC_MSG_CHECKING([if AIO support should be forced])
|
||||
AC_ARG_ENABLE([aio],
|
||||
[AC_HELP_STRING([--enable-aio],
|
||||
[force AIO support on or off])],
|
||||
[FORCE_AIO=$enableval],
|
||||
[FORCE_AIO="use-default"])
|
||||
|
||||
case "X-$FORCE_AIO" in
|
||||
X-|X-no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
X-use-default)
|
||||
AC_MSG_RESULT([use-default])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------------
|
||||
dnl Allow user to over-ride configure's decision as to whether to force use of
|
||||
dnl 64 bit POSIX AIO calls.
|
||||
AC_MSG_CHECKING([if AIO 64 bit calls should be forced])
|
||||
AC_ARG_ENABLE([64-bit-posix-aio],
|
||||
[AC_HELP_STRING([--enable-64-bit-posix-aio],
|
||||
[force use of 64 bit posix AIO calls])],
|
||||
[FORCE_64_BIT_POSIX_AIO=$enableval],
|
||||
[FORCE_64_BIT_POSIX_AIO="use-default"])
|
||||
|
||||
case "X-$FORCE_64_BIT_POSIX_AIO" in
|
||||
X-|X-no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
X-use-default)
|
||||
AC_MSG_RESULT([use-default])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check if they would like POSIX aio error recovery enabled
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable POSIX AIO error recovery])
|
||||
AC_ARG_ENABLE([posix-aio-error-recovery],
|
||||
[AC_HELP_STRING([--enable-posix-aio-error-recovery],
|
||||
[Enable POSIX AIO error recovery.])],
|
||||
[POSIXAIOERRORRECOVERY=$enableval])
|
||||
|
||||
case "X-$POSIXAIOERRORRECOVERY" in
|
||||
X-yes)
|
||||
POSIXAIOERRORRECOVERY=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([ENABLE_POSIX_AIO_ERROR_RECOVERY], [1],
|
||||
[Define if POSIX AIO error recovery is to be enabled])
|
||||
;;
|
||||
*)
|
||||
POSIXAIOERRORRECOVERY=no
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Enable tracing of the API
|
||||
dnl This must come after the enable-debug since it depends on debug.
|
||||
@@ -4326,6 +4396,134 @@ AC_RUN_IFELSE([
|
||||
AC_MSG_RESULT([unknown, assuming yes])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for AIO support. In addition to setting H5_HAVE_AIO, also define
|
||||
dnl flags indicating whether POSIX AIO is available, and if so, whether
|
||||
dnl we should use the 64 bit versions.
|
||||
dnl
|
||||
AC_MSG_CHECKING([if AIO is supported])
|
||||
|
||||
case $host_os in
|
||||
linux* )
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
REQUIRE_64_BIT_POSIX_AIO=yes
|
||||
;;
|
||||
freebsd* )
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl If we think posix aio is supported, verify that we can link with it.
|
||||
|
||||
saved_libs="$LIBS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
case "X-$POSIX_AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
LIBS="$LIBS -lrt"
|
||||
if test "X$STATIC_EXEC" = "Xyes"; then
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
fi
|
||||
AC_TRY_LINK([#include <aio.h>],
|
||||
[struct aiocb cb; aio_fsync(O_SYNC, &cb)],
|
||||
,
|
||||
AIO_SUPPORTED=no
|
||||
POSIX_AIO_SUPPORTED=no
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
)
|
||||
;;
|
||||
X-no|*)
|
||||
;;
|
||||
esac
|
||||
|
||||
LIBS="$saved_libs"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
|
||||
dnl As of last check, aio didn't get along with portland group compilers.
|
||||
dnl Disable aio if we are using same.
|
||||
|
||||
if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null ; then
|
||||
AIO_SUPPORTED=no
|
||||
fi
|
||||
|
||||
dnl Over-ride decision on aio support if the user has requested same.
|
||||
|
||||
case "X-$FORCE_AIO" in
|
||||
X-|X-no)
|
||||
AIO_SUPPORTED=no
|
||||
POSIX_AIO_SUPPORTED=no
|
||||
;;
|
||||
X-yes)
|
||||
AIO_SUPPORTED=yes
|
||||
POSIX_AIO_SUPPORTED=yes
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Over-ride decision on whether to require 64 bit POSIX AIO calls
|
||||
|
||||
case "X-$FORCE_64_BIT_POSIX_AIO" in
|
||||
X-|X-no)
|
||||
REQUIRE_64_BIT_POSIX_AIO=no
|
||||
;;
|
||||
X-yes)
|
||||
REQUIRE_64_BIT_POSIX_AIO=yes
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
case "X-$AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_AIO], [1], [Define if AIO is supported])
|
||||
;;
|
||||
X-no|*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([if POSIX AIO is supported])
|
||||
case "X-$POSIX_AIO_SUPPORTED" in
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_POSIX_AIO], [1], [Define if POSIX AIO is supported])
|
||||
case $host_os in
|
||||
linux* )
|
||||
H5_CFLAGS="$H5_CFLAGS -D_POSIX_C_SOURCE=199309L"
|
||||
;;
|
||||
esac
|
||||
LIBS="$LIBS -lrt"
|
||||
;;
|
||||
X-no|*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([if 64 POSIX AIO CALLS should be used])
|
||||
case "X-$REQUIRE_64_BIT_POSIX_AIO" in
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([USE_64_BIT_POSIX_AIO], [1], [Define if 64 bit POSIX AIO must be specified])
|
||||
;;
|
||||
X-no|*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Restore user's CFLAGS.
|
||||
@@ -4395,6 +4593,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
|
||||
Makefile
|
||||
src/Makefile
|
||||
test/Makefile
|
||||
test/fsync_tests.sh
|
||||
test/testcheck_version.sh
|
||||
test/testerror.sh
|
||||
test/H5srcdir_str.h
|
||||
|
||||
@@ -159,6 +159,28 @@ CONTENTS
|
||||
provided by MPI and MPI-IO. If these libraries are not available
|
||||
when HDF5 is configured, only a serial version of HDF5 can be built.
|
||||
|
||||
3.4. AIO
|
||||
Modification of the HDF5 library to support AIO for metadata writes,
|
||||
and possibly raw data reads and writes is in progress. To date,
|
||||
only the VFD modifications needed to support AIO have been included
|
||||
in the library. This code is tested as part of the build process,
|
||||
but is not yet used under normal operating circumstances.
|
||||
|
||||
However, it does depend on a working POSIX AIO implementation on
|
||||
the host system. At present, AIO support is configured by default
|
||||
on Linux and BSD systems, and omitted on all other systems, and on
|
||||
Linux and BSD systems when the PGI compilers are used.
|
||||
|
||||
This default can be over-ridden with the --enable-aio / --disable-aio
|
||||
configuration flags. The --enable-64-bit-posix-aio /
|
||||
--disable-64-bit-posix-aio configuration flags allow an over-ride
|
||||
of the configure script's decision on whether the use of the 64
|
||||
bit aio calls should be forced.
|
||||
|
||||
The --enable-posix-aio-error-recovery enables code that attempts
|
||||
to recover from aio read/write failures by converting the operation
|
||||
to SIO.
|
||||
|
||||
|
||||
4. Full installation instructions for source distributions
|
||||
|
||||
|
||||
@@ -91,6 +91,17 @@ New Features
|
||||
|
||||
Library:
|
||||
--------
|
||||
- Extended VFD calls to support AIO. At present, the new AIO calls are
|
||||
NOT used during normal library operations -- modifications to the library
|
||||
to use the new VFD calls will be added as time and funding permit.
|
||||
User provided file drivers need not support AIO, but must be modified to
|
||||
set the AIO related fields in their instance of H5FD_class_t to NULL in
|
||||
this case. The top level of the VFD interface will fake AIO if the
|
||||
underlying driver does not support it. (JRM - 2011/04/20)
|
||||
- Added fsync call to the VFD interface. At present, this call is NOT
|
||||
used by the library under normal circumstances. However, it will be
|
||||
used in the future, and user supplied file drivers should move towards
|
||||
supporting it if it is applicable to the driver. (JRM - 2011/04/20)
|
||||
- I added a new parameter of object access property list to the function
|
||||
H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former
|
||||
H5Rdereference function has been deprecated to H5Rdereference1. (SLU -
|
||||
|
||||
@@ -63,6 +63,14 @@ hid_t H5E_WRITEERROR_g = FAIL; /* Write failed */
|
||||
hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */
|
||||
hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */
|
||||
hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */
|
||||
hid_t H5E_SYNCFAIL_g = FAIL; /* File sync failed */
|
||||
hid_t H5E_AIOREADERROR_g = FAIL; /* File sync failed */
|
||||
hid_t H5E_AIOWRITEERROR_g = FAIL; /* File sync failed */
|
||||
hid_t H5E_AIOSYNCFAIL_g = FAIL; /* File sync failed */
|
||||
hid_t H5E_AIOCANCELFAIL_g = FAIL; /* AIO File op cancel failed */
|
||||
hid_t H5E_AIOTESTFAIL_g = FAIL; /* AIO File op test failed */
|
||||
hid_t H5E_AIOWAITFAIL_g = FAIL; /* AIO File op wait failed */
|
||||
hid_t H5E_AIOFINISHFAIL_g = FAIL; /* AIO File op finish failed */
|
||||
|
||||
/* Resource errors */
|
||||
hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */
|
||||
|
||||
@@ -221,6 +221,46 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_SYNCFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "File sync failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_SYNCFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOREADERROR_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "File sync failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOREADERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOWRITEERROR_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "File sync failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOWRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOSYNCFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "File sync failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOSYNCFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOCANCELFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "AIO File op cancel failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOCANCELFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOTESTFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "AIO File op test failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOTESTFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOWAITFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "AIO File op wait failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOWAITFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
assert(H5E_AIOFINISHFAIL_g==(-1));
|
||||
if((msg = H5E_create_msg(cls, H5E_MINOR, "AIO File op finish failed"))==NULL)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
|
||||
if((H5E_AIOFINISHFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
|
||||
|
||||
/* Resource errors */
|
||||
assert(H5E_NOSPACE_g==(-1));
|
||||
|
||||
@@ -100,12 +100,28 @@ H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */
|
||||
#define H5E_CLOSEERROR (H5OPEN H5E_CLOSEERROR_g)
|
||||
#define H5E_OVERFLOW (H5OPEN H5E_OVERFLOW_g)
|
||||
#define H5E_FCNTL (H5OPEN H5E_FCNTL_g)
|
||||
#define H5E_SYNCFAIL (H5OPEN H5E_SYNCFAIL_g)
|
||||
#define H5E_AIOREADERROR (H5OPEN H5E_AIOREADERROR_g)
|
||||
#define H5E_AIOWRITEERROR (H5OPEN H5E_AIOWRITEERROR_g)
|
||||
#define H5E_AIOSYNCFAIL (H5OPEN H5E_AIOSYNCFAIL_g)
|
||||
#define H5E_AIOCANCELFAIL (H5OPEN H5E_AIOCANCELFAIL_g)
|
||||
#define H5E_AIOTESTFAIL (H5OPEN H5E_AIOTESTFAIL_g)
|
||||
#define H5E_AIOWAITFAIL (H5OPEN H5E_AIOWAITFAIL_g)
|
||||
#define H5E_AIOFINISHFAIL (H5OPEN H5E_AIOFINISHFAIL_g)
|
||||
H5_DLLVAR hid_t H5E_SEEKERROR_g; /* Seek failed */
|
||||
H5_DLLVAR hid_t H5E_READERROR_g; /* Read failed */
|
||||
H5_DLLVAR hid_t H5E_WRITEERROR_g; /* Write failed */
|
||||
H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */
|
||||
H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */
|
||||
H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */
|
||||
H5_DLLVAR hid_t H5E_SYNCFAIL_g; /* File sync failed */
|
||||
H5_DLLVAR hid_t H5E_AIOREADERROR_g; /* File sync failed */
|
||||
H5_DLLVAR hid_t H5E_AIOWRITEERROR_g; /* File sync failed */
|
||||
H5_DLLVAR hid_t H5E_AIOSYNCFAIL_g; /* File sync failed */
|
||||
H5_DLLVAR hid_t H5E_AIOCANCELFAIL_g; /* AIO File op cancel failed */
|
||||
H5_DLLVAR hid_t H5E_AIOTESTFAIL_g; /* AIO File op test failed */
|
||||
H5_DLLVAR hid_t H5E_AIOWAITFAIL_g; /* AIO File op wait failed */
|
||||
H5_DLLVAR hid_t H5E_AIOFINISHFAIL_g; /* AIO File op finish failed */
|
||||
|
||||
/* Resource errors */
|
||||
#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g)
|
||||
|
||||
@@ -64,7 +64,15 @@ H5E_READERROR_g=
|
||||
H5E_WRITEERROR_g=
|
||||
H5E_CLOSEERROR_g=
|
||||
H5E_OVERFLOW_g=
|
||||
H5E_FCNTL_g=
|
||||
H5E_FCNTL_g=
|
||||
H5E_SYNCFAIL_g=
|
||||
H5E_AIOREADERROR_g=
|
||||
H5E_AIOWRITEERROR_g=
|
||||
H5E_AIOSYNCFAIL_g=
|
||||
H5E_AIOCANCELFAIL_g=
|
||||
H5E_AIOTESTFAIL_g=
|
||||
H5E_AIOWAITFAIL_g=
|
||||
H5E_AIOFINISHFAIL_g=
|
||||
|
||||
/* Resource errors */
|
||||
H5E_NOSPACE_g=
|
||||
|
||||
436
src/H5FD.c
436
src/H5FD.c
@@ -2096,3 +2096,439 @@ H5FD_get_base_addr(const H5FD_t *file)
|
||||
FUNC_LEAVE_NOAPI(file->base_addr)
|
||||
} /* end H5FD_get_base_addr() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_read
|
||||
*
|
||||
* Purpose: Initiate an asynchronous read from the indicated file of
|
||||
* the specified number of bytes starting at the specified
|
||||
* offset and loading the data into the provided buffer.
|
||||
*
|
||||
* The buffer must be large enough to contain the requested
|
||||
* data, and is undefined and must not be read or modified
|
||||
* until the read completes successfully. Completion is
|
||||
* determined via either a call to H5FDaio_test() or a
|
||||
* call to H5FDaio_wait(), and success via a call to
|
||||
* H5FDaio_finish().
|
||||
*
|
||||
* If successful, the H5FDaio_read routine will return a
|
||||
* pointer to an internal control block in *ctlblk_ptr_ptr.
|
||||
* This pointer must be used in all subsequent
|
||||
* H5FDaio_test() / H5FDaio_wait() / H5FDaio_finish()
|
||||
* calls referring to this request.
|
||||
*
|
||||
* Note that a successful return from this function does not
|
||||
* imply a successful read -- simply that no errors were
|
||||
* immediately evident.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FDaio_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
size_t size, void *buffer, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE7("e", "*xMtiaz*x**x", file, type, dxpl_id, addr, size, buffer,
|
||||
ctlblk_ptr_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if((type < H5FD_MEM_DEFAULT) || (type >= H5FD_MEM_NTYPES))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mem type out of range");
|
||||
|
||||
/* Get the default dataset transfer property list if the user
|
||||
* didn't provide one
|
||||
*/
|
||||
if(H5P_DEFAULT == dxpl_id)
|
||||
dxpl_id= H5P_DATASET_XFER_DEFAULT;
|
||||
else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
|
||||
|
||||
if(buffer == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer")
|
||||
|
||||
if((ctlblk_ptr_ptr == NULL) || (*ctlblk_ptr_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad ctlblk_ptr_ptr")
|
||||
|
||||
/* do the real work */
|
||||
if(H5FD_aio_read(file, type, dxpl_id, addr, size, buffer, ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOREADERROR, FAIL, "aio read request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_read() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_write
|
||||
*
|
||||
* Purpose: Initiate an asynchronous write to the indicated file of
|
||||
* the specified number of bytes from the supplied buffer
|
||||
* to the indicated location.
|
||||
*
|
||||
* The buffer must not be discarded or modified until the
|
||||
* write completes successfully. Completion is determined
|
||||
* via either H5FDaio_test() or H5FDaio_wait(), and
|
||||
* success via H5FDaio_finish().
|
||||
*
|
||||
* If successful, the H5FDaio_write routine will return a
|
||||
* pointer to an internal control block in *ctlblk_ptr_ptr.
|
||||
* This pointer must be used in all subsequent H5FDaio_test()
|
||||
* / H5FDaio_wait() / H5FDaio_finish() calls referring to
|
||||
* this request.
|
||||
*
|
||||
* Note that a successful return from this function does not
|
||||
* imply a successful write -- simply that no errors were
|
||||
* immediately evident.
|
||||
*
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FDaio_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
size_t size, void *buffer, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE7("e", "*xMtiaz*x**x", file, type, dxpl_id, addr, size, buffer,
|
||||
ctlblk_ptr_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if((type < H5FD_MEM_DEFAULT) || (type >= H5FD_MEM_NTYPES))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mem type out of range");
|
||||
|
||||
/* Get the default dataset transfer property list if the user
|
||||
* didn't provide one
|
||||
*/
|
||||
if(H5P_DEFAULT == dxpl_id)
|
||||
dxpl_id= H5P_DATASET_XFER_DEFAULT;
|
||||
else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
|
||||
|
||||
if(buffer == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer")
|
||||
|
||||
if((ctlblk_ptr_ptr == NULL) || ((void *)(*ctlblk_ptr_ptr) != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad ctlblk_ptr_ptr")
|
||||
|
||||
/* do the real work */
|
||||
if(H5FD_aio_write(file, type, dxpl_id, addr, size, buffer, ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOWRITEERROR, FAIL, "aio write request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_write() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_test
|
||||
*
|
||||
* Purpose: This function is used to determine if the asynchronous
|
||||
* operation associated with the supplied control block
|
||||
* pointer is complete. If it is, *done_ptr should be set
|
||||
* to TRUE, if it isn't, *done_ptr should be set to FALSE.
|
||||
* In all cases, there function should return immediately.
|
||||
*
|
||||
* Note that the return value only reflects errors in the
|
||||
* process of testing whether the operation is complete.
|
||||
*
|
||||
* After the operation is complete, a call to
|
||||
* H5FDaio_finish() must be made to determine whether
|
||||
* the operation completed successfully and to allow the
|
||||
* driver to tidy its data structures.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
* Changes: None.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FDaio_test(H5FD_t *file, hbool_t *done_ptr, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE3("e", "*x*b*x", file, done_ptr, ctlblk_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if(done_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL done pointer")
|
||||
|
||||
if(ctlblk_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL control block pointer")
|
||||
|
||||
if(H5FD_aio_test(file, done_ptr, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOTESTFAIL, FAIL, "aio test request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_test() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_wait
|
||||
*
|
||||
* Purpose: Wait until the asynchronous read, write, or fsync operation
|
||||
* indicated by *ctlblk_ptr has completed (successfully or
|
||||
* otherwise).
|
||||
*
|
||||
* Note that the error code returned refers only to the
|
||||
* operation of waiting until read/write/fsync is
|
||||
* complete -- Success does not imply that the read, write,
|
||||
* or fsync operation completed successfully, only that
|
||||
* no error was encountered while waiting for the operation
|
||||
* to finish.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FDaio_wait(H5FD_t *file,
|
||||
void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "*x*x", file, ctlblk_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if(ctlblk_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL control block pointer")
|
||||
|
||||
if(H5FD_aio_wait(file, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOWAITFAIL, FAIL, "aio wait request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_wait() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_finish
|
||||
*
|
||||
* Purpose: Determine whether the read, write, or fsync operation
|
||||
* indicated by *ctlblk_ptr completed successfully. If it
|
||||
* did, set *errno_ptr to 0. If if didn't, set *errno_ptr
|
||||
* to the appropriate error code.
|
||||
*
|
||||
* Return SUCCEED if successful, and the appropriate error
|
||||
* code if not.
|
||||
*
|
||||
* Note that the returned error code only refers to the
|
||||
* success or failure of the finish operation. The caller
|
||||
* must examine *errno_ptr to determine if the underlying
|
||||
* asynchronous operation succeeded.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FDaio_finish(H5FD_t *file,
|
||||
int *errno_ptr,
|
||||
void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE3("e", "*x*Is*x", file, errno_ptr, ctlblk_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if(errno_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL errno pointer")
|
||||
|
||||
if(ctlblk_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL control block pointer")
|
||||
|
||||
if(H5FD_aio_finish(file, errno_ptr, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOFINISHFAIL, FAIL, "aio finish request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_finish() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_fsync
|
||||
*
|
||||
* Purpose: Queue a sync of all asynchronous writes outstanding as of
|
||||
* the time this function is called. Return SUCCEED if no
|
||||
* errors are encountered, but note that a good error return
|
||||
* from H5FD_aio_fsync() does not imply a successful
|
||||
* operation, only that no immediate errors were detected.
|
||||
*
|
||||
* The sync is not known to be successful until reported
|
||||
* complete by either H5FDaio_test or H5FDaio_wait,
|
||||
* and reported successful by H5FDaio_finish.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FDaio_fsync(H5FD_t *file, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "*x**x", file, ctlblk_ptr_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if((ctlblk_ptr_ptr == NULL) || (*ctlblk_ptr_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
|
||||
"NULL ctlblk_ptr_ptr or *ctlblk_ptr_ptr != NULL")
|
||||
|
||||
if(H5FD_aio_fsync(file, ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOSYNCFAIL, FAIL, "aio fsync request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_fsync() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDaio_cancel
|
||||
*
|
||||
* Purpose: Attempt to cancel the asynchronous operation associated
|
||||
* with the control block pointed to by ctlblk_ptr.
|
||||
*
|
||||
* Note that this operation may have completed, but it is
|
||||
* an error if H5FDaio_finish() has been called on it.
|
||||
*
|
||||
* As part of the cancel, free the associated control blocks.
|
||||
*
|
||||
* Return SUCCEED if successful, and the appropriate error
|
||||
* code otherwise.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FDaio_cancel(H5FD_t *file, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "*x*x", file, ctlblk_ptr);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
if(ctlblk_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "ctlblk_ptr NULL on entry")
|
||||
|
||||
if(H5FD_aio_cancel(file, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOCANCELFAIL, FAIL, "aio cancel request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDaio_cancel() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDfsync
|
||||
*
|
||||
* Purpose: fsync the target file. The file should be synced to disk
|
||||
* upon return.
|
||||
*
|
||||
* Return: Success: Non-negative.
|
||||
*
|
||||
* Failure: Negative.
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/7/10
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FDfsync(H5FD_t *file, hid_t dxpl_id)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "*xi", file, dxpl_id);
|
||||
|
||||
/* Check args */
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
|
||||
/* Get the default dataset transfer property list if the user didn't
|
||||
* provide one
|
||||
*/
|
||||
if(H5P_DEFAULT == dxpl_id)
|
||||
dxpl_id= H5P_DATASET_XFER_DEFAULT;
|
||||
else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
|
||||
|
||||
/* Do the real work */
|
||||
if(H5FD_fsync(file, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, "file sync request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5FDfsync() */
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@ static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, had
|
||||
size_t size, const void *buf);
|
||||
static herr_t H5FD_core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
|
||||
static herr_t H5FD_core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
|
||||
static herr_t H5FD_core_fsync(H5FD_t *file, hid_t dxpl_id);
|
||||
|
||||
static const H5FD_class_t H5FD_core_g = {
|
||||
"core", /*name */
|
||||
@@ -161,6 +162,14 @@ static const H5FD_class_t H5FD_core_g = {
|
||||
H5FD_core_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
H5FD_core_fsync, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
};
|
||||
|
||||
@@ -1113,3 +1122,65 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_core_truncate() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_core_fsync
|
||||
*
|
||||
* Purpose: Flush and fsync the backing store file if there is one.
|
||||
*
|
||||
* This is a somewhat novel interpretation of fsync -- but
|
||||
* one that gives the results that one would expect. If it
|
||||
* has been written to the core file driver, it winds up on
|
||||
* disk after the fsync (assuming there is a backing file).
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/12/10
|
||||
*
|
||||
* Modifications:
|
||||
* None
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static herr_t
|
||||
H5FD_core_fsync(H5FD_t *file,
|
||||
hid_t UNUSED dxpl_id)
|
||||
{
|
||||
H5FD_core_t * core_file = (H5FD_core_t*)file;
|
||||
herr_t ret_value=SUCCEED; /* Return value */
|
||||
int result;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
HDassert( file != NULL );
|
||||
|
||||
core_file = (H5FD_core_t *)file;
|
||||
|
||||
/* sync the backing store file -- if it exists */
|
||||
if ( ( core_file->fd >= 0 ) &&
|
||||
( core_file->backing_store ) ) {
|
||||
|
||||
/* Flush any changed buffers */
|
||||
if(H5FD_core_flush(file, (hid_t)-1, TRUE) < 0)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file")
|
||||
|
||||
|
||||
result = HDfsync(core_file->fd);
|
||||
|
||||
if ( result != 0 ) {
|
||||
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, \
|
||||
"core file fsync request failed")
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_core_fsync() */
|
||||
|
||||
|
||||
@@ -205,7 +205,15 @@ static const H5FD_class_t H5FD_direct_g = {
|
||||
H5FD_direct_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
NULL, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
};
|
||||
|
||||
/* Declare a free list to manage the H5FD_direct_t struct */
|
||||
|
||||
1515
src/H5FDfamily.c
1515
src/H5FDfamily.c
File diff suppressed because it is too large
Load Diff
951
src/H5FDint.c
951
src/H5FDint.c
@@ -79,6 +79,8 @@
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
char * dummy_aio_ctlblk = "Dummy AIO Control Block";
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
@@ -276,7 +278,6 @@ done:
|
||||
* block.
|
||||
*
|
||||
* Return: Success: The EOF address.
|
||||
*
|
||||
* Failure: HADDR_UNDEF
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
@@ -310,3 +311,951 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_get_eof() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_read
|
||||
*
|
||||
* Purpose: Initiate an asynchronous read from the indicated file of
|
||||
* the specified number of bytes starting at the specified
|
||||
* offset and loading the data into the provided buffer.
|
||||
*
|
||||
* The buffer must be large enough to contain the requested
|
||||
* data, and is undefined and must not be read or modified
|
||||
* until the read completes successfully. Completion is
|
||||
* determined via either a call to H5FD_aio_test() or a
|
||||
* call to H5FD_aio_wait(), and success via a call to
|
||||
* H5FD_aio_finish().
|
||||
*
|
||||
* If successful, the H5FD_aio_read routine will return a
|
||||
* pointer to an internal control block in *ctlblk_ptr_ptr.
|
||||
* This pointer must be used in all subsequent
|
||||
* H5FD_aio_test() / H5FD_aio_wait() / H5FD_aio_finish()
|
||||
* calls referring to this request.
|
||||
*
|
||||
* Note that a successful return from this function does not
|
||||
* imply a successful read -- simply that no errors were
|
||||
* immediately evident.
|
||||
*
|
||||
* If AIO is supported by the underlying file driver,
|
||||
* simply pass the call on, and report the results.
|
||||
*
|
||||
* If AIO is not supported by the underlying driver, set
|
||||
* *ctlblk_ptr_ptr the address of a shared dummy control
|
||||
* block, and do a synchronous read instead. Return
|
||||
* SUCCEED or FAIL depending on the success of the
|
||||
* read.
|
||||
*
|
||||
* The pointer to the shared dummy control block
|
||||
* many be used in subsequent calls to H5FD_aio_test(),
|
||||
* H5FD_aio_wait(), and H5FD_aio_finish(), which calls will
|
||||
* report completion without error as appropriate as long
|
||||
* as the underlying file driver does not support AIO.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_aio_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr,
|
||||
size_t size, void *buffer, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(!H5F_addr_defined(addr)) ||
|
||||
(size <= 0) ||
|
||||
(buffer == NULL) ||
|
||||
(ctlblk_ptr_ptr == NULL) ||
|
||||
(*ctlblk_ptr_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
if(file->cls->aio_read != NULL) { /* aio_read supported */
|
||||
/* if we have aio_read, verify that we also have aio_test,
|
||||
* aio_wait, and aio_finish as well.
|
||||
*/
|
||||
HDassert( file->cls->aio_test != NULL );
|
||||
HDassert( file->cls->aio_wait != NULL );
|
||||
HDassert( file->cls->aio_finish != NULL );
|
||||
|
||||
if((file->cls->aio_read)(file, type, dxpl, addr + file->base_addr, size, buffer,
|
||||
ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOREADERROR, FAIL, "driver aio read request failed")
|
||||
} else { /* aio_read not supported -- do synchronous read instead */
|
||||
HDassert( file->cls->read != NULL );
|
||||
|
||||
if((file->cls->read)(file, type, dxpl, addr + file->base_addr, size, buffer) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver fallback sio read request failed")
|
||||
else /* setup the dummy control block pointer */
|
||||
*ctlblk_ptr_ptr = (void *)dummy_aio_ctlblk;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_read() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_write
|
||||
*
|
||||
* Purpose: Initiate an asynchronous write to the indicated file of
|
||||
* the specified number of bytes from the supplied buffer
|
||||
* to the indicated location.
|
||||
*
|
||||
* The buffer must not be discarded or modified until the
|
||||
* write completes successfully. Completion is determined
|
||||
* via either H5FD_aio_test() or H5FD_aio_wait(), and
|
||||
* success via H5FD_aio_finish().
|
||||
*
|
||||
* If successful, the H5FD_aio_write routine will return a
|
||||
* pointer to an internal control block in *ctlblk_ptr_ptr.
|
||||
* This pointer must be used in all subsequent H5FD_aio_test()
|
||||
* / H5FD_aio_wait() / H5FD_aio_finish() calls referring to
|
||||
* this request.
|
||||
*
|
||||
* Note that a successful return from this function does not
|
||||
* imply a successful write -- simply that no errors were
|
||||
* immediately evident.
|
||||
*
|
||||
* If AIO is supported by the underlying file driver,
|
||||
* simply pass the call on and report the results.
|
||||
*
|
||||
* If AIO is not supported by the underlying driver, set
|
||||
* *ctlblk_ptr_ptr the address of a shared dummy control
|
||||
* block, and do a synchronous write instead. Return
|
||||
* SUCCEED or FAIL depending on the success of the
|
||||
* write.
|
||||
*
|
||||
* The pointer to the shared dummy control block
|
||||
* pointer many be used in subsequent calls to H5FD_aio_test(),
|
||||
* H5FD_aio_wait(), and H5FD_aio_finish(), which calls will
|
||||
* report completion without error as appropriate as long
|
||||
* as the underlying file driver does not support AIO.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FD_aio_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr,
|
||||
size_t size, void *buffer, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(!H5F_addr_defined(addr)) ||
|
||||
(size <= 0) ||
|
||||
(buffer == NULL) ||
|
||||
(ctlblk_ptr_ptr == NULL) ||
|
||||
(*ctlblk_ptr_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
if ( file->cls->aio_write != NULL ) { /* aio_write supported */
|
||||
/* if we have aio_write, verify that we also have aio_test,
|
||||
* aio_wait, and aio_finish as well.
|
||||
*/
|
||||
HDassert( file->cls->aio_test != NULL );
|
||||
HDassert( file->cls->aio_wait != NULL );
|
||||
HDassert( file->cls->aio_finish != NULL );
|
||||
|
||||
if((file->cls->aio_write)(file, type, dxpl, addr + file->base_addr, size,
|
||||
buffer, ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOWRITEERROR, FAIL, "driver aio write request failed")
|
||||
} else { /* aio_write not supported -- do synchronous write instead */
|
||||
HDassert( file->cls->write != NULL );
|
||||
|
||||
if((file->cls->write)(file, type, dxpl, addr + file->base_addr, size, buffer) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL,
|
||||
"driver fallback sio write request failed")
|
||||
else /* setup the dummy control block pointer */
|
||||
*ctlblk_ptr_ptr = (void *)dummy_aio_ctlblk;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_write() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_test
|
||||
*
|
||||
* Purpose: This function is used to determine if the asynchronous
|
||||
* operation associated with the supplied control block
|
||||
* pointer is complete. If it is, *done_ptr should be set
|
||||
* to TRUE, if it isn't, *done_ptr should be set to FALSE.
|
||||
* In all cases, there function should return immediately.
|
||||
*
|
||||
* Note that the return value only reflects errors in the
|
||||
* process of testing whether the operation is complete.
|
||||
*
|
||||
* After the operation is complete, a call to
|
||||
* H5FD_aio_finish() must be made to determine whether
|
||||
* the operation completed successfully and to allow the
|
||||
* driver to tidy its data structures.
|
||||
*
|
||||
* If the underlying file driver supports AIO, pass the
|
||||
* call on to the underlying file driver, and relay the
|
||||
* results back.
|
||||
*
|
||||
* If the underlying file driver doesn't support AIO,
|
||||
* the operation being tested for was run synchronously,
|
||||
* and is already complete. Verify that the supplied
|
||||
* control block pointer points to the shared dummy
|
||||
* control block, set *done_ptr to TRUE and return.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_aio_test(H5FD_t *file, hbool_t *done_ptr, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(done_ptr == NULL) ||
|
||||
(ctlblk_ptr == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
if(file->cls->aio_test != NULL) { /* aio_test supported */
|
||||
if((file->cls->aio_test)(done_ptr, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOTESTFAIL, FAIL, "driver aio test request failed")
|
||||
} else { /* aio_test not supported -- just fake it */
|
||||
if(ctlblk_ptr != (void *)dummy_aio_ctlblk)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "unexpected control block pointer.")
|
||||
|
||||
*done_ptr = TRUE;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_test() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_wait
|
||||
*
|
||||
* Purpose: Wait until the asynchronous read, write, or fsync operation
|
||||
* indicated by *ctlblk_ptr has completed (successfully or
|
||||
* otherwise).
|
||||
*
|
||||
* Note that the error code returned refers only to the
|
||||
* operation of waiting until read/write/fsync is
|
||||
* complete -- Success does not imply that the read, write,
|
||||
* or fsync operation completed successfully, only that
|
||||
* no error was encountered while waiting for the operation
|
||||
* to finish.
|
||||
*
|
||||
* If the underlying file driver supports AIO, pass the
|
||||
* call on to the underlying file driver, and relay the
|
||||
* results back.
|
||||
*
|
||||
* If the underlying file driver doesn't support AIO,
|
||||
* the operation being tested for was run synchronously,
|
||||
* and is already complete. Verify that the supplied
|
||||
* control block pointer points to the shared dummy
|
||||
* control block, and return.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_aio_wait(H5FD_t *file, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(ctlblk_ptr == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "NULL ctlblk ptr on entry.")
|
||||
|
||||
if(ctlblk_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
if(file->cls->aio_wait != NULL) { /* aio_wait supported */
|
||||
if((file->cls->aio_wait)(ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOWAITFAIL, FAIL, "driver aio wait request failed")
|
||||
} else /* aio_wait not supported -- just fake it */
|
||||
if(ctlblk_ptr != (void *)dummy_aio_ctlblk)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "unexpected control block pointer.")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_aio_wait() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_finish
|
||||
*
|
||||
* Purpose: Determine whether the read, write, or fsync operation
|
||||
* indicated by *ctlblk_ptr completed successfully. If it
|
||||
* did, set *errno_ptr to 0. If if didn't, set *errno_ptr
|
||||
* to the appropriate error code.
|
||||
*
|
||||
* Return SUCCEED if successful, and the appropriate error
|
||||
* code if not.
|
||||
*
|
||||
* Note that the returned error code only refers to the
|
||||
* success or failure of the finish operation. The caller
|
||||
* must examine *errno_ptr to determine if the underlying
|
||||
* asynchronous operation succeeded.
|
||||
*
|
||||
* If the underlying file driver supports AIO, pass the
|
||||
* call on to the underlying file driver, and relay the
|
||||
* results back.
|
||||
*
|
||||
* If the underlying file driver doesn't support AIO,
|
||||
* the operation being tested for was run synchronously,
|
||||
* and has already completed successfully. Verify that
|
||||
* the supplied control block pointer points to the
|
||||
* shared dummy control block, set *errno_ptr to zero,
|
||||
* and return.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_aio_finish(H5FD_t *file, int *errno_ptr, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(errno_ptr == NULL) ||
|
||||
(ctlblk_ptr == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "NULL param(s) on entry.")
|
||||
|
||||
if(file->cls->aio_finish != NULL) { /* aio_finish supported */
|
||||
if((file->cls->aio_finish)(errno_ptr, ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOFINISHFAIL, FAIL, "driver aio finish request failed")
|
||||
} else { /* aio_finish not supported -- just fake it */
|
||||
if(ctlblk_ptr != (void *)dummy_aio_ctlblk)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "unexpected control block pointer.")
|
||||
|
||||
*errno_ptr = 0;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_finish() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_fsync
|
||||
*
|
||||
* Purpose: Queue a sync of all asynchronous writes outstanding as of
|
||||
* the time this function is called. Return SUCCEED if no
|
||||
* errors are encountered, but note that a good error return
|
||||
* from H5FD_aio_fsync() does not imply a successful
|
||||
* operation, only that no immediate errors were detected.
|
||||
*
|
||||
* The sync is not known to be successful until reported
|
||||
* complete by either H5FD_aio_test or H5FD_aio_wait,
|
||||
* and reported successful by H5FD_aio_finish.
|
||||
*
|
||||
* If the underlying file driver supports AIO, pass the the
|
||||
* call on to the underlying file driver, and relay the
|
||||
* results back.
|
||||
*
|
||||
* If the underlying file driver doesn't support AIO,
|
||||
* call H5FD_fsync() do do a synchronous fsync,
|
||||
* set *ctlblk_ptr_ptr to point to the shared dummy
|
||||
* control block, and return.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_aio_fsync(H5FD_t *file, void **ctlblk_ptr_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(ctlblk_ptr_ptr == NULL) ||
|
||||
(*ctlblk_ptr_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "NULL param(s) on entry.")
|
||||
|
||||
if(file->cls->aio_fsync != NULL) { /* aio_fsync supported */
|
||||
/* if we have aio_fsync, verify that we also have aio_test,
|
||||
* aio_wait, and aio_finish as well.
|
||||
*/
|
||||
HDassert( file->cls->aio_test != NULL );
|
||||
HDassert( file->cls->aio_wait != NULL );
|
||||
HDassert( file->cls->aio_finish != NULL );
|
||||
|
||||
if((file->cls->aio_fsync)(file, ctlblk_ptr_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOSYNCFAIL, FAIL, "driver aio fsync request failed")
|
||||
} else { /* aio_fsync not supported -- do synchronous fsync instead */
|
||||
if(H5FD_fsync(file, H5P_DATASET_XFER_DEFAULT) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, "driver fallback sio fsync request failed")
|
||||
else /* setup the dummy control block pointer */
|
||||
*ctlblk_ptr_ptr = (void *)dummy_aio_ctlblk;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_fsync() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aio_cancel
|
||||
*
|
||||
* Purpose: Attempt to cancel the asynchronous operation associated
|
||||
* with the control block pointed to by ctlblk_ptr.
|
||||
*
|
||||
* Note that this operation may have completed, but it is
|
||||
* an error if H5FD_aio_finish() has been called on it.
|
||||
*
|
||||
* As part of the cancel, free the associated control blocks.
|
||||
*
|
||||
* Return SUCCEED if successful, and the appropriate error
|
||||
* code otherwise.
|
||||
*
|
||||
* If the underlying file driver supports AIO, pass the
|
||||
* call on to the underlying file driver, and relay the
|
||||
* results back.
|
||||
*
|
||||
* If the underlying file driver doesn't support AIO,
|
||||
* the operation being tested for was run synchronously,
|
||||
* and has already completed successfully. Verify that
|
||||
* the supplied control block pointer points to the
|
||||
* shared dummy control block, and return.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 6/12/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FD_aio_cancel(H5FD_t *file, void *ctlblk_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) || (file->cls == NULL) || (ctlblk_ptr == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "NULL ctlblk_ptr on entry.")
|
||||
|
||||
if(file->cls->aio_cancel != NULL) { /* aio_cancel supported */
|
||||
if((file->cls->aio_cancel)(ctlblk_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_AIOCANCELFAIL, FAIL, "driver aio cancel request failed")
|
||||
} else { /* aio_cancel not supported -- just fake it */
|
||||
if(ctlblk_ptr != (void *)dummy_aio_ctlblk)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "unexpected control block pointer.")
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aio_cancel() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_fsync
|
||||
*
|
||||
* Purpose: Do an fsync on the indicated file.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/7/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_fsync(H5FD_t *file, hid_t dxpl)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) || (file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad file param on entry.")
|
||||
|
||||
if(file->cls->fsync != NULL) { /* fsync supported */
|
||||
if((file->cls->fsync)(file, dxpl) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, "sio fsync request failed")
|
||||
} else { /* fsync not supported */
|
||||
|
||||
/* Quincey:
|
||||
*
|
||||
* We need to make a decision here, and its a bit above my pay
|
||||
* grade.
|
||||
*
|
||||
* On the one hand, there will be file drivers such as the core,
|
||||
* and direct file drivers for which fsync makes no sense.
|
||||
*
|
||||
* On the other hand, in general I would think we want fsync
|
||||
* supported for the vast majority of cases.
|
||||
*
|
||||
* Thus the question is, do we want to require that the fsync
|
||||
* call be supported in all cases -- albeit by an empty function
|
||||
* in cases like the core file driver.
|
||||
*
|
||||
* If so, we should throw an error at this point.
|
||||
*
|
||||
* If not, we should just do nothing quietly.
|
||||
*
|
||||
* Let me know what you think.
|
||||
*
|
||||
* JRM -- 7/7/10
|
||||
*/
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_fsync() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_aggregate_stats
|
||||
*
|
||||
* Purpose: Aggregate the contents of *new_stats_ptr into
|
||||
* *base_stats_ptr.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/30/11
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FD_aggregate_stats(H5FD_stats_t *base_stats_ptr, H5FD_stats_t *new_stats_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
if((base_stats_ptr == NULL) ||
|
||||
(base_stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC) ||
|
||||
(new_stats_ptr == NULL) ||
|
||||
(new_stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
if(new_stats_ptr->defined){
|
||||
base_stats_ptr->defined = TRUE;
|
||||
base_stats_ptr->complete = (hbool_t)
|
||||
(base_stats_ptr->complete && new_stats_ptr->complete);
|
||||
base_stats_ptr->aio_reads_attempted += new_stats_ptr->aio_reads_attempted;
|
||||
base_stats_ptr->aio_reads_completed_successfully +=
|
||||
new_stats_ptr->aio_reads_completed_successfully;
|
||||
base_stats_ptr->aio_reads_canceled += new_stats_ptr->aio_reads_canceled;
|
||||
base_stats_ptr->aio_read_queue_attempts += new_stats_ptr->aio_read_queue_attempts;
|
||||
base_stats_ptr->aio_read_queue_attempt_failures +=
|
||||
new_stats_ptr->aio_read_queue_attempt_failures;
|
||||
base_stats_ptr->aio_reads_converted_to_sio += new_stats_ptr->aio_reads_converted_to_sio;
|
||||
base_stats_ptr->aio_read_failures += new_stats_ptr->aio_read_failures;
|
||||
base_stats_ptr->aio_read_failures_recovered_via_sio +=
|
||||
new_stats_ptr->aio_read_failures_recovered_via_sio;
|
||||
base_stats_ptr->aio_partial_reads += new_stats_ptr->aio_partial_reads;
|
||||
base_stats_ptr->aio_partial_reads_recovered_via_sio +=
|
||||
new_stats_ptr->aio_partial_reads_recovered_via_sio;
|
||||
base_stats_ptr->aio_writes_attempted += new_stats_ptr->aio_writes_attempted;
|
||||
base_stats_ptr->aio_writes_completed_successfully +=
|
||||
new_stats_ptr->aio_writes_completed_successfully;
|
||||
base_stats_ptr->aio_writes_canceled += new_stats_ptr->aio_writes_canceled;
|
||||
base_stats_ptr->aio_write_queue_attempts += new_stats_ptr->aio_write_queue_attempts;
|
||||
base_stats_ptr->aio_write_queue_attempt_failures +=
|
||||
new_stats_ptr->aio_write_queue_attempt_failures;
|
||||
base_stats_ptr->aio_writes_converted_to_sio +=
|
||||
new_stats_ptr->aio_writes_converted_to_sio;
|
||||
base_stats_ptr->aio_write_failures += new_stats_ptr->aio_write_failures;
|
||||
base_stats_ptr->aio_write_failures_recovered_via_sio +=
|
||||
new_stats_ptr->aio_write_failures_recovered_via_sio;
|
||||
base_stats_ptr->aio_partial_writes += new_stats_ptr->aio_partial_writes;
|
||||
base_stats_ptr->aio_partial_writes_recovered_via_sio +=
|
||||
new_stats_ptr->aio_partial_writes_recovered_via_sio;
|
||||
base_stats_ptr->aio_fsyncs_attempted += new_stats_ptr->aio_fsyncs_attempted;
|
||||
base_stats_ptr->aio_fsyncs_completed_successfully +=
|
||||
new_stats_ptr->aio_fsyncs_completed_successfully;
|
||||
base_stats_ptr->aio_fsyncs_canceled += new_stats_ptr->aio_fsyncs_canceled;
|
||||
base_stats_ptr->aio_fsync_queue_attempts += new_stats_ptr->aio_fsync_queue_attempts;
|
||||
base_stats_ptr->aio_fsync_queue_attempt_failures +=
|
||||
new_stats_ptr->aio_fsync_queue_attempt_failures;
|
||||
base_stats_ptr->aio_fsyncs_converted_to_sio +=
|
||||
new_stats_ptr->aio_fsyncs_converted_to_sio;
|
||||
base_stats_ptr->aio_fsync_failures += new_stats_ptr->aio_fsync_failures;
|
||||
base_stats_ptr->aio_fsync_failures_recovered_via_sio +=
|
||||
new_stats_ptr->aio_fsync_failures_recovered_via_sio;
|
||||
} else
|
||||
base_stats_ptr->complete=FALSE;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_aggregate_stats() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_copy_stats
|
||||
*
|
||||
* Purpose: copy the contents of *src_stats_ptr into *dest_stats_ptr.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/30/11
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_copy_stats(H5FD_stats_t *dest_stats_ptr, H5FD_stats_t *src_stats_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
if((dest_stats_ptr == NULL) ||
|
||||
(dest_stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC) ||
|
||||
(src_stats_ptr == NULL) ||
|
||||
(src_stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
dest_stats_ptr->defined = src_stats_ptr->defined;
|
||||
|
||||
if(src_stats_ptr->defined) {
|
||||
dest_stats_ptr->complete = src_stats_ptr->complete;
|
||||
dest_stats_ptr->aio_reads_attempted = src_stats_ptr->aio_reads_attempted;
|
||||
dest_stats_ptr->aio_reads_completed_successfully =
|
||||
src_stats_ptr->aio_reads_completed_successfully;
|
||||
dest_stats_ptr->aio_reads_canceled = src_stats_ptr->aio_reads_canceled;
|
||||
dest_stats_ptr->aio_read_queue_attempts = src_stats_ptr->aio_read_queue_attempts;
|
||||
dest_stats_ptr->aio_read_queue_attempt_failures =
|
||||
src_stats_ptr->aio_read_queue_attempt_failures;
|
||||
dest_stats_ptr->aio_reads_converted_to_sio = src_stats_ptr->aio_reads_converted_to_sio;
|
||||
dest_stats_ptr->aio_read_failures = src_stats_ptr->aio_read_failures;
|
||||
dest_stats_ptr->aio_read_failures_recovered_via_sio =
|
||||
src_stats_ptr->aio_read_failures_recovered_via_sio;
|
||||
dest_stats_ptr->aio_partial_reads = src_stats_ptr->aio_partial_reads;
|
||||
dest_stats_ptr->aio_partial_reads_recovered_via_sio =
|
||||
src_stats_ptr->aio_partial_reads_recovered_via_sio;
|
||||
dest_stats_ptr->aio_writes_attempted = src_stats_ptr->aio_writes_attempted;
|
||||
dest_stats_ptr->aio_writes_completed_successfully =
|
||||
src_stats_ptr->aio_writes_completed_successfully;
|
||||
dest_stats_ptr->aio_writes_canceled = src_stats_ptr->aio_writes_canceled;
|
||||
dest_stats_ptr->aio_write_queue_attempts = src_stats_ptr->aio_write_queue_attempts;
|
||||
dest_stats_ptr->aio_write_queue_attempt_failures =
|
||||
src_stats_ptr->aio_write_queue_attempt_failures;
|
||||
dest_stats_ptr->aio_writes_converted_to_sio =
|
||||
src_stats_ptr->aio_writes_converted_to_sio;
|
||||
dest_stats_ptr->aio_write_failures = src_stats_ptr->aio_write_failures;
|
||||
dest_stats_ptr->aio_write_failures_recovered_via_sio =
|
||||
src_stats_ptr->aio_write_failures_recovered_via_sio;
|
||||
dest_stats_ptr->aio_partial_writes = src_stats_ptr->aio_partial_writes;
|
||||
dest_stats_ptr->aio_partial_writes_recovered_via_sio =
|
||||
src_stats_ptr->aio_partial_writes_recovered_via_sio;
|
||||
dest_stats_ptr->aio_fsyncs_attempted = src_stats_ptr->aio_fsyncs_attempted;
|
||||
dest_stats_ptr->aio_fsyncs_completed_successfully =
|
||||
src_stats_ptr->aio_fsyncs_completed_successfully;
|
||||
dest_stats_ptr->aio_fsyncs_canceled = src_stats_ptr->aio_fsyncs_canceled;
|
||||
dest_stats_ptr->aio_fsync_queue_attempts = src_stats_ptr->aio_fsync_queue_attempts;
|
||||
dest_stats_ptr->aio_fsync_queue_attempt_failures =
|
||||
src_stats_ptr->aio_fsync_queue_attempt_failures;
|
||||
dest_stats_ptr->aio_fsyncs_converted_to_sio =
|
||||
src_stats_ptr->aio_fsyncs_converted_to_sio;
|
||||
dest_stats_ptr->aio_fsync_failures = src_stats_ptr->aio_fsync_failures;
|
||||
dest_stats_ptr->aio_fsync_failures_recovered_via_sio =
|
||||
src_stats_ptr->aio_fsync_failures_recovered_via_sio;
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_copy_stats() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_dump_stats
|
||||
*
|
||||
* Purpose: Dump the contents of the supplied instance of H5FD_stats_t
|
||||
* to the indicated stream.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 4/4/11
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_dump_stats(FILE * out_stream,H5FD_stats_t *stats_ptr,const char *label_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
if((out_stream == NULL) ||
|
||||
(stats_ptr == NULL) ||
|
||||
(stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC) ||
|
||||
(label_ptr==NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
HDfprintf(out_stream, "\n%s\n", label_ptr);
|
||||
if(!(stats_ptr->defined))
|
||||
HDfprintf(out_stream," Stats are undefined.\n\n");
|
||||
else{
|
||||
HDfprintf(out_stream, "\nstats defined/complete = %d/%d.\n\n",
|
||||
(int)(stats_ptr->defined), (int)(stats_ptr->complete));
|
||||
HDfprintf(out_stream,
|
||||
" aio_read aio_write aio_fsync\n");
|
||||
HDfprintf(out_stream,
|
||||
"=========================================================================\n");
|
||||
HDfprintf(out_stream,
|
||||
"attempted %5lld %5lld %5lld\n",
|
||||
(long long)(stats_ptr->aio_reads_attempted),
|
||||
(long long)(stats_ptr->aio_writes_attempted),
|
||||
(long long)(stats_ptr->aio_fsyncs_attempted));
|
||||
HDfprintf(out_stream,
|
||||
"completed successfuly %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_reads_completed_successfully,
|
||||
stats_ptr->aio_writes_completed_successfully,
|
||||
stats_ptr->aio_fsyncs_completed_successfully);
|
||||
HDfprintf(out_stream,
|
||||
"canceled %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_reads_canceled,
|
||||
stats_ptr->aio_writes_canceled,
|
||||
stats_ptr->aio_fsyncs_canceled);
|
||||
HDfprintf(out_stream,
|
||||
"queue attempts %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_read_queue_attempts,
|
||||
stats_ptr->aio_write_queue_attempts,
|
||||
stats_ptr->aio_fsync_queue_attempts);
|
||||
HDfprintf(out_stream,
|
||||
"queue attempt failures %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_read_queue_attempt_failures,
|
||||
stats_ptr->aio_write_queue_attempt_failures,
|
||||
stats_ptr->aio_fsync_queue_attempt_failures);
|
||||
HDfprintf(out_stream,
|
||||
"converted to sio %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_reads_converted_to_sio,
|
||||
stats_ptr->aio_writes_converted_to_sio,
|
||||
stats_ptr->aio_fsyncs_converted_to_sio);
|
||||
HDfprintf(out_stream,
|
||||
"failures %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_read_failures,
|
||||
stats_ptr->aio_write_failures,
|
||||
stats_ptr->aio_fsync_failures);
|
||||
HDfprintf(out_stream,
|
||||
"failures recovered via sio %5lld %5lld %5lld\n",
|
||||
stats_ptr->aio_read_failures_recovered_via_sio,
|
||||
stats_ptr->aio_write_failures_recovered_via_sio,
|
||||
stats_ptr->aio_fsync_failures_recovered_via_sio);
|
||||
HDfprintf(out_stream,
|
||||
"partial %5lld %5lld n/a\n",
|
||||
stats_ptr->aio_partial_reads, stats_ptr->aio_partial_writes);
|
||||
HDfprintf(out_stream,
|
||||
"partial complete via sio %5lld %5lld n/a\n",
|
||||
stats_ptr->aio_partial_reads_recovered_via_sio,
|
||||
stats_ptr->aio_partial_writes_recovered_via_sio);
|
||||
HDfprintf(out_stream,
|
||||
"=========================================================================\n\n");
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_dump_stats() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_get_stats
|
||||
*
|
||||
* Purpose: Request stats from the specified file, returning them
|
||||
* in *stats_ptr.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/30/11
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_get_stats(H5FD_t *file, H5FD_stats_t *stats_ptr)
|
||||
{
|
||||
const H5FD_private_class_t * private_class_ptr;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL) ||
|
||||
(file->cls == NULL) ||
|
||||
(stats_ptr==NULL) ||
|
||||
(stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad param(s) on entry.")
|
||||
|
||||
if((file->feature_flags&H5FD_FEAT_EXTENDED_CLASS) != 0) {
|
||||
private_class_ptr = (const H5FD_private_class_t *)(file->cls);
|
||||
if(private_class_ptr->magic!=H5FD__H5FD_PRIVATE_CLASS_T__MAGIC)
|
||||
HGOTO_ERROR(H5E_INTERNAL, H5E_SYSTEM, FAIL, "bad extended class magic.")
|
||||
if(private_class_ptr->get_stats!=NULL){
|
||||
if((private_class_ptr->get_stats)(file,stats_ptr)<0)
|
||||
HGOTO_ERROR(H5E_INTERNAL, H5E_SYSTEM, FAIL, "target get_stats() call failed.")
|
||||
}else
|
||||
stats_ptr->defined = FALSE;
|
||||
}else
|
||||
stats_ptr->defined = FALSE;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_get_stats() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_initialize_stats
|
||||
*
|
||||
* Purpose: Set the fields of the supplied instance of H5FD_stats_t
|
||||
* to standard initial values.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/30/11
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5FD_initialize_stats(H5FD_stats_t *stats_ptr)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
if(( stats_ptr == NULL) || (stats_ptr->magic != H5FD__H5FD_STATS_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
stats_ptr->magic = H5FD__H5FD_STATS_T_MAGIC;
|
||||
stats_ptr->defined = TRUE;
|
||||
stats_ptr->complete = TRUE;
|
||||
stats_ptr->aio_reads_attempted = 0;
|
||||
stats_ptr->aio_reads_completed_successfully = 0;
|
||||
stats_ptr->aio_reads_canceled = 0;
|
||||
stats_ptr->aio_read_queue_attempts = 0;
|
||||
stats_ptr->aio_read_queue_attempt_failures = 0;
|
||||
stats_ptr->aio_reads_converted_to_sio = 0;
|
||||
stats_ptr->aio_read_failures = 0;
|
||||
stats_ptr->aio_read_failures_recovered_via_sio = 0;
|
||||
stats_ptr->aio_partial_reads = 0;
|
||||
stats_ptr->aio_partial_reads_recovered_via_sio = 0;
|
||||
stats_ptr->aio_writes_attempted = 0;
|
||||
stats_ptr->aio_writes_completed_successfully = 0;
|
||||
stats_ptr->aio_writes_canceled = 0;
|
||||
stats_ptr->aio_write_queue_attempts = 0;
|
||||
stats_ptr->aio_write_queue_attempt_failures = 0;
|
||||
stats_ptr->aio_writes_converted_to_sio = 0;
|
||||
stats_ptr->aio_write_failures = 0;
|
||||
stats_ptr->aio_write_failures_recovered_via_sio = 0;
|
||||
stats_ptr->aio_partial_writes = 0;
|
||||
stats_ptr->aio_partial_writes_recovered_via_sio = 0;
|
||||
stats_ptr->aio_fsyncs_attempted = 0;
|
||||
stats_ptr->aio_fsyncs_completed_successfully = 0;
|
||||
stats_ptr->aio_fsyncs_canceled = 0;
|
||||
stats_ptr->aio_fsync_queue_attempts = 0;
|
||||
stats_ptr->aio_fsync_queue_attempt_failures = 0;
|
||||
stats_ptr->aio_fsyncs_converted_to_sio = 0;
|
||||
stats_ptr->aio_fsync_failures = 0;
|
||||
stats_ptr->aio_fsync_failures_recovered_via_sio = 0;
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_initialize_stats() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_reset_stats
|
||||
*
|
||||
* Purpose: Reset stats for the specified file.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/30/11
|
||||
*
|
||||
* Changes: None.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5FD_reset_stats(H5FD_t *file)
|
||||
{
|
||||
const H5FD_private_class_t * private_class_ptr;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((file == NULL)||(file->cls == NULL))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad file param on entry.")
|
||||
|
||||
if((file->feature_flags&H5FD_FEAT_EXTENDED_CLASS)==0){
|
||||
private_class_ptr = (const H5FD_private_class_t *)(file->cls);
|
||||
if(private_class_ptr->magic!=H5FD__H5FD_PRIVATE_CLASS_T__MAGIC)
|
||||
HGOTO_ERROR(H5E_INTERNAL, H5E_SYSTEM, FAIL, "bad extended class magic.")
|
||||
if(private_class_ptr->reset_stats!=NULL)
|
||||
if((private_class_ptr->reset_stats)(file)<0)
|
||||
HGOTO_ERROR(H5E_INTERNAL, H5E_SYSTEM, FAIL,
|
||||
"target reset_stats() call failed.")
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_reset_stats() */
|
||||
|
||||
|
||||
|
||||
101
src/H5FDlog.c
101
src/H5FDlog.c
@@ -199,7 +199,9 @@ static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr
|
||||
size_t size, void *buf);
|
||||
static herr_t H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
|
||||
size_t size, const void *buf);
|
||||
static herr_t H5FD_log_flush(H5FD_t *file, hid_t UNUSED dxpl, unsigned closing);
|
||||
static herr_t H5FD_log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
|
||||
static herr_t H5FD_log_fsync(H5FD_t *file, hid_t UNUSED dxpl);
|
||||
|
||||
static const H5FD_class_t H5FD_log_g = {
|
||||
"log", /*name */
|
||||
@@ -229,10 +231,18 @@ static const H5FD_class_t H5FD_log_g = {
|
||||
H5FD_log_get_handle, /*get_handle */
|
||||
H5FD_log_read, /*read */
|
||||
H5FD_log_write, /*write */
|
||||
NULL, /*flush */
|
||||
H5FD_log_flush, /*flush */
|
||||
H5FD_log_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
H5FD_log_fsync, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
};
|
||||
|
||||
@@ -1499,6 +1509,44 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_log_write() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_log_flush
|
||||
*
|
||||
* Purpose: Flush the log file. Since the data file is written
|
||||
* without buffering, there is no need to flush it as well.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/14/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_log_flush(H5FD_t *file, hid_t UNUSED dxpl, unsigned closing)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
H5FD_log_t * log_file_ptr = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(file == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
log_file_ptr = (H5FD_log_t *)file;
|
||||
|
||||
if((!closing) && (log_file_ptr->logfp != NULL))
|
||||
if(HDfflush(log_file_ptr->logfp) != 0)
|
||||
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
|
||||
"log file fflush request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_log_flush() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_log_truncate
|
||||
@@ -1581,3 +1629,54 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5FD_log_truncate() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_log_fsync
|
||||
*
|
||||
* Purpose: Sync the data and log files.
|
||||
*
|
||||
* Note that a sycn and a flush are two different things,
|
||||
* and that since the log file may be buffered, a flush may
|
||||
* be necessary before the sync to obtain the desired result.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/8/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_log_fsync(H5FD_t *file, hid_t UNUSED dxpl)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
int filenum;
|
||||
H5FD_log_t * log_file_ptr = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(file == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
log_file_ptr = (H5FD_log_t *)file;
|
||||
|
||||
if(HDfsync(log_file_ptr->fd) != 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL,
|
||||
"unix file fsync request failed")
|
||||
|
||||
if(log_file_ptr->logfp != NULL) {
|
||||
if(-1 == (filenum = HDfileno(log_file_ptr->logfp)))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL,
|
||||
"fileno() request on log file failed")
|
||||
|
||||
if(0 != HDfsync(filenum))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL,
|
||||
"log file fsync request failed")
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_log_fsync() */
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ static herr_t H5FD_mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
|
||||
static int H5FD_mpio_mpi_rank(const H5FD_t *_file);
|
||||
static int H5FD_mpio_mpi_size(const H5FD_t *_file);
|
||||
static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file);
|
||||
static herr_t H5FD_mpio_fsync(H5FD_t *file, hid_t UNUSED dxpl);
|
||||
|
||||
/* MPIO-specific file access properties */
|
||||
typedef struct H5FD_mpio_fapl_t {
|
||||
@@ -127,6 +128,14 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
|
||||
H5FD_mpio_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
H5FD_mpio_fsync, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
}, /* End of superclass information */
|
||||
H5FD_mpio_mpi_rank, /*get_rank */
|
||||
@@ -1141,15 +1150,6 @@ done:
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, August 25, 2000
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
* John Mainzer -- 9/21/05
|
||||
* Modified code to turn off the
|
||||
* H5FD_FEAT_ACCUMULATE_METADATA_WRITE flag.
|
||||
* With the movement of
|
||||
* all cache writes to process 0, this flag has become
|
||||
* problematic in PHDF5.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
@@ -2064,5 +2064,42 @@ H5FD_mpio_communicator(const H5FD_t *_file)
|
||||
FUNC_LEAVE_NOAPI(file->comm)
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_mpio_fsync
|
||||
*
|
||||
* Purpose: Sync the file to disk.
|
||||
*
|
||||
* Note that the MPI_file_sync() operation is collective
|
||||
* and must involve all members of the file comunicator.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/14/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_mpio_fsync(H5FD_t *file, hid_t UNUSED dxpl)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
H5FD_mpio_t * mpio_file = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(file == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
mpio_file = (H5FD_mpio_t *)file;
|
||||
|
||||
if(MPI_SUCCESS != MPI_File_sync(mpio_file->f))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, "MPI_File_sync() request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_mpio_fsync() */
|
||||
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
|
||||
@@ -195,6 +195,7 @@ static herr_t H5FD_mpiposix_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closi
|
||||
static int H5FD_mpiposix_mpi_rank(const H5FD_t *_file);
|
||||
static int H5FD_mpiposix_mpi_size(const H5FD_t *_file);
|
||||
static MPI_Comm H5FD_mpiposix_communicator(const H5FD_t *_file);
|
||||
static herr_t H5FD_mpiposix_fsync(H5FD_t *file, hid_t UNUSED dxpl);
|
||||
|
||||
/* MPIPOSIX-specific file access properties */
|
||||
typedef struct H5FD_mpiposix_fapl_t {
|
||||
@@ -236,7 +237,15 @@ static const H5FD_class_mpi_t H5FD_mpiposix_g = {
|
||||
H5FD_mpiposix_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
H5FD_mpiposix_fsync, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
}, /* End of superclass information */
|
||||
H5FD_mpiposix_mpi_rank, /*get_rank */
|
||||
H5FD_mpiposix_mpi_size, /*get_size */
|
||||
@@ -1516,5 +1525,49 @@ H5FD_mpiposix_communicator(const H5FD_t *_file)
|
||||
FUNC_LEAVE_NOAPI(file->comm)
|
||||
} /* end H5FD_mpi_posix_communicator() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_mpiposix_fsync
|
||||
*
|
||||
* Purpose: Sync the file to disk.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/14/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_mpiposix_fsync(H5FD_t *file, hid_t UNUSED dxpl)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
H5FD_mpiposix_t * mpiposix_file = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(file == NULL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_SYSTEM, FAIL, "bad arg(s) on entry.")
|
||||
|
||||
/* Question: Do we really want every process doing the fsync()?
|
||||
* Or would it be better to have just one? This is a
|
||||
* moot issue right now, as the fsync call is only used
|
||||
* for journaling, and we don't support journaling in
|
||||
* parallel right now. However we will have to address
|
||||
* it eventually.
|
||||
*/
|
||||
|
||||
mpiposix_file = (H5FD_mpiposix_t *)file;
|
||||
|
||||
if(0 != HDfsync(mpiposix_file->fd))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_SYNCFAIL, FAIL, "fsync request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* end H5FD_mpiposix_fsync() */
|
||||
|
||||
|
||||
#endif /*H5_HAVE_PARALLEL*/
|
||||
|
||||
|
||||
1021
src/H5FDmulti.c
1021
src/H5FDmulti.c
File diff suppressed because it is too large
Load Diff
@@ -39,11 +39,178 @@
|
||||
/* Length of filename buffer */
|
||||
#define H5FD_MAX_FILENAME_LEN 1024
|
||||
|
||||
#define H5FD_AIO_OP__UNDEFINED 0
|
||||
#define H5FD_AIO_OP__READ 1
|
||||
#define H5FD_AIO_OP__WRITE 2
|
||||
#define H5FD_AIO_OP__FSYNC 3
|
||||
#define H5FD_AIO_OP__MAX_OP 3
|
||||
|
||||
#define H5FD__H5FD_STATS_T_MAGIC 0x0FD05354
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_ATTEMPTED(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_reads_attempted)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_writes_attempted)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsyncs_attempted)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_COMPLETED_SUCCESSFULLY(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_reads_completed_successfully)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_writes_completed_successfully)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsyncs_completed_successfully)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_CANCELED(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_reads_canceled)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_writes_canceled)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsyncs_canceled)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_QUEUE_ATTEMPTED(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_read_queue_attempts)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_write_queue_attempts)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsync_queue_attempts)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_QUEUE_ATTEMPT_FAILURES(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_read_queue_attempt_failures)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_write_queue_attempt_failures)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsync_queue_attempt_failures)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_CONVERTED_TO_SIO(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_reads_converted_to_sio)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_writes_converted_to_sio)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsyncs_converted_to_sio)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_FAILURES(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_read_failures)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_write_failures)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsync_failures)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_FAILURES_RECOVERED_VIA_SIO(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_read_failures_recovered_via_sio)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_write_failures_recovered_via_sio)++; \
|
||||
else if((op)==H5FD_AIO_OP__FSYNC) \
|
||||
((stats_ptr)->aio_fsync_failures_recovered_via_sio)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_PARTIAL(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_partial_reads)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_partial_writes)++; }
|
||||
|
||||
#define H5FD_UPDATE_STATS__AIO_OP_PARTIAL_RECOVERED_VIA_SIO(stats_ptr, op) { \
|
||||
if((op)==H5FD_AIO_OP__READ) \
|
||||
((stats_ptr)->aio_partial_reads_recovered_via_sio)++; \
|
||||
else if((op)==H5FD_AIO_OP__WRITE) \
|
||||
((stats_ptr)->aio_partial_reads_recovered_via_sio)++; }
|
||||
|
||||
|
||||
|
||||
/****************************/
|
||||
/* Library Private Typedefs */
|
||||
/****************************/
|
||||
|
||||
typedef struct H5FD_stats_t {
|
||||
int32_t magic;
|
||||
hbool_t defined;
|
||||
hbool_t complete;
|
||||
uint64_t aio_reads_attempted; /* number of aio reads requested */
|
||||
uint64_t aio_reads_completed_successfully; /* number of aio reads requested, */
|
||||
/* queued, and completed via aio */
|
||||
/* with all desired data read. */
|
||||
uint64_t aio_reads_canceled; /* number of aio reads canceled */
|
||||
uint64_t aio_read_queue_attempts; /* number of times we have tried */
|
||||
/* to queue an aio read. */
|
||||
uint64_t aio_read_queue_attempt_failures; /* number of times an attempt to */
|
||||
/* queue an aio read has failed */
|
||||
uint64_t aio_reads_converted_to_sio; /* number of aio read requests */
|
||||
/* that have been converted to */
|
||||
/* sio due to the inability to */
|
||||
/* queue the aio request. */
|
||||
uint64_t aio_read_failures; /* number of aio reads that have */
|
||||
/* failed beyond recovery. */
|
||||
uint64_t aio_read_failures_recovered_via_sio; /* number of aio read failures */
|
||||
/* recovered by converting the */
|
||||
/* read to sio. */
|
||||
uint64_t aio_partial_reads; /* number of aio read requests */
|
||||
/* that were successful, but */
|
||||
/* returned less than the */
|
||||
/* requested amount of data. */
|
||||
uint64_t aio_partial_reads_recovered_via_sio; /* number of aio read requests */
|
||||
/* that returned less than the */
|
||||
/* requested amount of data, and */
|
||||
/* that were completed by */
|
||||
/* converting the unfulfilled */
|
||||
/* part of the read to sio. */
|
||||
|
||||
uint64_t aio_writes_attempted; /* number of aio writes requested */
|
||||
uint64_t aio_writes_completed_successfully; /* number of aio writes requested,*/
|
||||
/* queued, and completed with all */
|
||||
/* desired data read. */
|
||||
uint64_t aio_writes_canceled; /* number of aio writes canceled */
|
||||
uint64_t aio_write_queue_attempts; /* number of times we have tried */
|
||||
/* to queue an aio write. */
|
||||
uint64_t aio_write_queue_attempt_failures; /* number of times an attempt to */
|
||||
/* queue an aio write has failed */
|
||||
uint64_t aio_writes_converted_to_sio; /* number of aio write requests */
|
||||
/* that have been converted to */
|
||||
/* sio due to the inability to */
|
||||
/* queue the aio request. */
|
||||
uint64_t aio_write_failures; /* number of aio writes that have */
|
||||
/* failed beyond recovery. */
|
||||
uint64_t aio_write_failures_recovered_via_sio; /* number of aio write failures */
|
||||
/* recovered by converting the */
|
||||
/* read to sio. */
|
||||
uint64_t aio_partial_writes; /* number of aio write requests */
|
||||
/* that were successful, but */
|
||||
/* wrote less than the requested */
|
||||
/* amount of data. */
|
||||
uint64_t aio_partial_writes_recovered_via_sio; /* number of aio write requests */
|
||||
/* that wrote less than the */
|
||||
/* requested amount of data, and */
|
||||
/* that were completed by */
|
||||
/* converting the unfulfilled */
|
||||
/* part of the write to sio. */
|
||||
|
||||
uint64_t aio_fsyncs_attempted; /* number of aio fsyncs requested */
|
||||
uint64_t aio_fsyncs_completed_successfully; /* number of aio fsyncs requested,*/
|
||||
/* queued, and completed with out */
|
||||
/* error. */
|
||||
uint64_t aio_fsyncs_canceled; /* number of aio writes canceled */
|
||||
uint64_t aio_fsync_queue_attempts; /* number of times we have tried */
|
||||
/* to queue an aio fsync. */
|
||||
uint64_t aio_fsync_queue_attempt_failures; /* number of times an attempt to */
|
||||
/* queue an aio fsync has failed */
|
||||
uint64_t aio_fsyncs_converted_to_sio; /* number of aio fsync requests */
|
||||
/* that have been converted to */
|
||||
/* sio due to the inability to */
|
||||
/* queue the aio request. */
|
||||
uint64_t aio_fsync_failures; /* number of aio fsyncs that have */
|
||||
/* failed beyond recovery. */
|
||||
uint64_t aio_fsync_failures_recovered_via_sio; /* number of aio fsync failures */
|
||||
/* recovered by converting the */
|
||||
/* read to sio. */
|
||||
} H5FD_stats_t;
|
||||
|
||||
/* File operations */
|
||||
typedef enum {
|
||||
OP_UNKNOWN = 0, /* Unknown last file operation */
|
||||
@@ -51,6 +218,16 @@ typedef enum {
|
||||
OP_WRITE = 2 /* Last file I/O operation was a write */
|
||||
} H5FD_file_op_t;
|
||||
|
||||
/* private extended verion of H5FD_class_t */
|
||||
#define H5FD__H5FD_PRIVATE_CLASS_T__MAGIC 0x48357063 /* 'H5pc' */
|
||||
typedef struct H5FD_private_class_t {
|
||||
struct H5FD_class_t pub;
|
||||
int32_t magic; /* Must be set to */
|
||||
/* H5FD__H5FD_PRIVATE_CLASS_T__MAGIC */
|
||||
herr_t (*get_stats)(H5FD_t *file, H5FD_stats_t *stats_ptr);
|
||||
herr_t (*reset_stats)(H5FD_t *file);
|
||||
} H5FD_private_class_t;
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
@@ -105,6 +282,20 @@ H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum);
|
||||
H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle);
|
||||
H5_DLL herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr);
|
||||
H5_DLL haddr_t H5FD_get_base_addr(const H5FD_t *file);
|
||||
H5_DLL herr_t H5FD_aio_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer, void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FD_aio_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer, void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FD_aio_test(H5FD_t *file, hbool_t *done_ptr, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FD_aio_wait(H5FD_t *file, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FD_aio_finish(H5FD_t *file, int *errno_ptr, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FD_aio_fsync(H5FD_t *file, void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FD_aio_cancel(H5FD_t *file, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FD_fsync(H5FD_t *file, hid_t dxpl);
|
||||
H5_DLL herr_t H5FD_aggregate_stats(H5FD_stats_t *base_stats_ptr, H5FD_stats_t *new_stats_ptr);
|
||||
H5_DLL herr_t H5FD_copy_stats(H5FD_stats_t *dest_stats_ptr, H5FD_stats_t *src_stats_ptr);
|
||||
H5_DLL herr_t H5FD_dump_stats(FILE * out_stream,H5FD_stats_t *stats_ptr,const char *label_ptr);
|
||||
H5_DLL herr_t H5FD_get_stats(H5FD_t *file, H5FD_stats_t *stats_ptr);
|
||||
H5_DLL herr_t H5FD_initialize_stats(H5FD_stats_t *stats_ptr);
|
||||
H5_DLL herr_t H5FD_reset_stats(H5FD_t *file);
|
||||
|
||||
#endif /* !_H5FDprivate_H */
|
||||
|
||||
|
||||
@@ -222,6 +222,13 @@ typedef enum H5F_mem_t H5FD_mem_t;
|
||||
* instead of the default H5D_ALLOC_TIME_LATE
|
||||
*/
|
||||
#define H5FD_FEAT_ALLOCATE_EARLY 0x00000200
|
||||
/*
|
||||
* Defining the H5FD_FEAT_EXTENDED_CLASS for a VFD driver means that the
|
||||
* driver supports some or all of the extended VFD calls used for
|
||||
* test and debug of file drivers by the HDF5 library. External file
|
||||
* drivers should never set this flag.
|
||||
*/
|
||||
#define H5FD_FEAT_EXTENDED_CLASS 0x80000000
|
||||
|
||||
/* Forward declaration */
|
||||
typedef struct H5FD_t H5FD_t;
|
||||
@@ -264,6 +271,18 @@ typedef struct H5FD_class_t {
|
||||
herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
|
||||
herr_t (*lock)(H5FD_t *file, unsigned char *oid, unsigned lock_type, hbool_t last);
|
||||
herr_t (*unlock)(H5FD_t *file, unsigned char *oid, hbool_t last);
|
||||
herr_t (*aio_read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
|
||||
haddr_t addr, size_t size, void *buffer,
|
||||
void **ctlblk_ptr_ptr);
|
||||
herr_t (*aio_write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
|
||||
haddr_t addr, size_t size, void *buffer,
|
||||
void **ctlblk_ptr_ptr);
|
||||
herr_t (*aio_test)(hbool_t *done_ptr, void *ctlblk_ptr);
|
||||
herr_t (*aio_wait)(void *ctlblk_ptr);
|
||||
herr_t (*aio_finish)(int *errno_ptr, void *ctlblk_ptr);
|
||||
herr_t (*aio_fsync)(H5FD_t *file, void **ctlblk_ptr_ptr);
|
||||
herr_t (*aio_cancel)(void *ctlblk_ptr);
|
||||
herr_t (*fsync)(H5FD_t *file, hid_t dxpl_id);
|
||||
H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
|
||||
} H5FD_class_t;
|
||||
|
||||
@@ -317,6 +336,18 @@ H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
|
||||
H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing);
|
||||
H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
|
||||
|
||||
H5_DLL herr_t H5FDaio_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
|
||||
haddr_t addr, size_t size, void *buffer,
|
||||
void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FDaio_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
|
||||
haddr_t addr, size_t size, void *buffer,
|
||||
void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FDaio_test(H5FD_t *file, hbool_t *done_ptr, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FDaio_wait(H5FD_t *file, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FDaio_finish(H5FD_t *file, int *errno_ptr, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FDaio_fsync(H5FD_t *file, void **ctlblk_ptr_ptr);
|
||||
H5_DLL herr_t H5FDaio_cancel(H5FD_t *file, void *ctlblk_ptr);
|
||||
H5_DLL herr_t H5FDfsync(H5FD_t *file, hid_t dxpl_id);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
2486
src/H5FDsec2.c
2486
src/H5FDsec2.c
File diff suppressed because it is too large
Load Diff
@@ -180,6 +180,7 @@ static herr_t H5FD_stdio_write(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr
|
||||
size_t size, const void *buf);
|
||||
static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
|
||||
static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
|
||||
static herr_t H5FD_stdio_fsync(H5FD_t *file, hid_t dxpl_id);
|
||||
|
||||
static const H5FD_class_t H5FD_stdio_g = {
|
||||
"stdio", /*name */
|
||||
@@ -213,7 +214,15 @@ static const H5FD_class_t H5FD_stdio_g = {
|
||||
H5FD_stdio_truncate, /*truncate */
|
||||
NULL, /*lock */
|
||||
NULL, /*unlock */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
NULL, /*aio_read */
|
||||
NULL, /*aio_write */
|
||||
NULL, /*aio_test */
|
||||
NULL, /*aio_wait */
|
||||
NULL, /*aio_finish */
|
||||
NULL, /*aio_fsync */
|
||||
NULL, /*aio_cancel */
|
||||
H5FD_stdio_fsync, /*fsync */
|
||||
H5FD_FLMAP_SINGLE /*fl_map */
|
||||
};
|
||||
|
||||
|
||||
@@ -929,6 +938,16 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
*
|
||||
* Purpose: Makes sure that all data is on disk.
|
||||
*
|
||||
* Note: actually, this routine only ensures that all
|
||||
* application buffers have been flushed -- the
|
||||
* data may still be in the operating systems
|
||||
* buffers on return.
|
||||
*
|
||||
* To ensure that the data is actually on disk
|
||||
* call H5FD_stdio_fsync() after the flush.
|
||||
*
|
||||
* JRM -- 7/14/10
|
||||
*
|
||||
* Errors:
|
||||
* IO SEEKERROR fseek failed.
|
||||
* IO WRITEERROR fflush or fwrite failed.
|
||||
@@ -1050,6 +1069,48 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
|
||||
return(0);
|
||||
} /* end H5FD_stdio_truncate() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_stdio_fsync
|
||||
*
|
||||
* Purpose: Sync out the file. If we restricted ourselves to stdio,
|
||||
* we really couldn't do this, as fflush only writes all
|
||||
* buffers in the application -- it doesn't sync.
|
||||
*
|
||||
* For now, get around this by looking the the file's file
|
||||
* descriptor, and calling HDfsync().
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 7/8/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_stdio_fsync(H5FD_t *file, hid_t dxpl_id)
|
||||
{
|
||||
static const char * func = "H5FD_stdio_fsync";
|
||||
int filenum;
|
||||
H5FD_stdio_t * stdio_file = (H5FD_stdio_t*)file;
|
||||
|
||||
/* Clear the error stack */
|
||||
H5Eclear2(H5E_DEFAULT);
|
||||
|
||||
dxpl_id = dxpl_id; /* to shut up the compiler */
|
||||
|
||||
stdio_file = (H5FD_stdio_t *)file;
|
||||
|
||||
if(-1 == (filenum = fileno(stdio_file->fp)))
|
||||
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_SYNCFAIL, "fileno() request failed", -1)
|
||||
|
||||
if(0 != fsync(filenum))
|
||||
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_SYNCFAIL, "fsync() request failed", -1)
|
||||
|
||||
return(0);
|
||||
|
||||
} /* end H5FD_stdio_fsync() */
|
||||
|
||||
|
||||
#ifdef _H5private_H
|
||||
/*
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
/* Define if `dev_t' is a scalar */
|
||||
#undef DEV_T_IS_SCALAR
|
||||
|
||||
/* Define if POSIX AIO error recovery is to be enabled */
|
||||
#undef ENABLE_POSIX_AIO_ERROR_RECOVERY
|
||||
|
||||
/* Define to dummy `main' function (if any) required to link to the Fortran
|
||||
libraries. */
|
||||
#undef FC_DUMMY_MAIN
|
||||
@@ -52,6 +55,9 @@
|
||||
/* Define if gettimeofday() populates the tz pointer passed in */
|
||||
#undef GETTIMEOFDAY_GIVES_TZ
|
||||
|
||||
/* Define if AIO is supported */
|
||||
#undef HAVE_AIO
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
#undef HAVE_ALARM
|
||||
|
||||
@@ -253,6 +259,9 @@
|
||||
/* Define if we have parallel support */
|
||||
#undef HAVE_PARALLEL
|
||||
|
||||
/* Define if POSIX AIO is supported */
|
||||
#undef HAVE_POSIX_AIO
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
@@ -656,6 +665,9 @@
|
||||
/* Define using v1.6 public API symbols by default */
|
||||
#undef USE_16_API_DEFAULT
|
||||
|
||||
/* Define if 64 bit POSIX AIO must be specified */
|
||||
#undef USE_64_BIT_POSIX_AIO
|
||||
|
||||
/* Define if a memory checking tool will be used on the library, to cause
|
||||
library to be very picky about memory operations and also disable the
|
||||
internal free list manager code. */
|
||||
|
||||
@@ -139,6 +139,14 @@ MINOR, FILE, H5E_WRITEERROR, Write failed
|
||||
MINOR, FILE, H5E_CLOSEERROR, Close failed
|
||||
MINOR, FILE, H5E_OVERFLOW, Address overflowed
|
||||
MINOR, FILE, H5E_FCNTL, File control (fcntl) failed
|
||||
MINOR, FILE, H5E_SYNCFAIL, File sync failed
|
||||
MINOR, FILE, H5E_AIOREADERROR, File sync failed
|
||||
MINOR, FILE, H5E_AIOWRITEERROR, File sync failed
|
||||
MINOR, FILE, H5E_AIOSYNCFAIL, File sync failed
|
||||
MINOR, FILE, H5E_AIOCANCELFAIL, AIO File op cancel failed
|
||||
MINOR, FILE, H5E_AIOTESTFAIL, AIO File op test failed
|
||||
MINOR, FILE, H5E_AIOWAITFAIL, AIO File op wait failed
|
||||
MINOR, FILE, H5E_AIOFINISHFAIL, AIO File op finish failed
|
||||
|
||||
# Function entry/exit interface errors
|
||||
MINOR, FUNC, H5E_CANTINIT, Unable to initialize object
|
||||
|
||||
@@ -495,6 +495,81 @@ typedef struct {
|
||||
#ifndef HDacos
|
||||
#define HDacos(X) acos(X)
|
||||
#endif /* HDacos */
|
||||
|
||||
#ifdef H5_HAVE_AIO
|
||||
#ifdef H5_HAVE_POSIX_AIO
|
||||
#ifdef H5_USE_64_BIT_POSIX_AIO
|
||||
|
||||
#ifndef HDaiocb
|
||||
#define HDaiocb aiocb64
|
||||
#endif /* HDaiocb */
|
||||
|
||||
#ifndef HDaio_cancel
|
||||
#define HDaio_cancel(F,A) aio_cancel64(F, A)
|
||||
#endif /* HDaio_cancel */
|
||||
|
||||
#ifndef HDaio_error
|
||||
#define HDaio_error(A) aio_error64(A)
|
||||
#endif /* HDaio_error */
|
||||
|
||||
#ifndef HDaio_fsync
|
||||
#define HDaio_fsync(O,A) aio_fsync64(O, A)
|
||||
#endif /* HDaio_fsync */
|
||||
|
||||
#ifndef HDaio_read
|
||||
#define HDaio_read(A) aio_read64(A)
|
||||
#endif /* HDaio_read */
|
||||
|
||||
#ifndef HDaio_return
|
||||
#define HDaio_return(A) aio_return64(A)
|
||||
#endif /* HDaio_return */
|
||||
|
||||
#ifndef HDaio_suspend
|
||||
#define HDaio_suspend(L,N,T) aio_suspend64(L, N, T)
|
||||
#endif /* HDaio_suspend */
|
||||
|
||||
#ifndef HDaio_write
|
||||
#define HDaio_write(A) aio_write64(A)
|
||||
#endif /* HDaio_write */
|
||||
|
||||
#else /* H5_USE_64_BIT_POSIX_AIO */
|
||||
|
||||
#ifndef HDaiocb
|
||||
#define HDaiocb aiocb
|
||||
#endif /* HDaiocb */
|
||||
|
||||
#ifndef HDaio_cancel
|
||||
#define HDaio_cancel(F,A) aio_cancel(F, A)
|
||||
#endif /* HDaio_cancel */
|
||||
|
||||
#ifndef HDaio_error
|
||||
#define HDaio_error(A) aio_error(A)
|
||||
#endif /* HDaio_error */
|
||||
|
||||
#ifndef HDaio_fsync
|
||||
#define HDaio_fsync(O,A) aio_fsync(O, A)
|
||||
#endif /* HDaio_fsync */
|
||||
|
||||
#ifndef HDaio_read
|
||||
#define HDaio_read(A) aio_read(A)
|
||||
#endif /* HDaio_read */
|
||||
|
||||
#ifndef HDaio_return
|
||||
#define HDaio_return(A) aio_return(A)
|
||||
#endif /* HDaio_return */
|
||||
|
||||
#ifndef HDaio_suspend
|
||||
#define HDaio_suspend(L,N,T) aio_suspend(L, N, T)
|
||||
#endif /* HDaio_suspend */
|
||||
|
||||
#ifndef HDaio_write
|
||||
#define HDaio_write(A) aio_write(A)
|
||||
#endif /* HDaio_write */
|
||||
|
||||
#endif /* H5_USE_64_BIT_POSIX_AIO */
|
||||
#endif /* H5_HAVE_POSIX_AIO */
|
||||
#endif /* H5_HAVE_AIO */
|
||||
|
||||
#ifndef HDalarm
|
||||
#ifdef H5_HAVE_ALARM
|
||||
#define HDalarm(N) alarm(N)
|
||||
@@ -763,7 +838,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
|
||||
#define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T
|
||||
#endif /* H5_SIZEOF_OFF_T!=8 && ... */
|
||||
#endif /* !defined(HDfstat) || !defined(HDstat) */
|
||||
|
||||
#ifndef HDfsync
|
||||
#define HDfsync(F) fsync(F)
|
||||
#endif /* HDfsync */
|
||||
#ifndef HDftell
|
||||
#define HDftell(F) ftell(F)
|
||||
#endif /* HDftell */
|
||||
|
||||
@@ -24,9 +24,9 @@ include $(top_srcdir)/config/commence.am
|
||||
INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src
|
||||
|
||||
# Test script for error_test and err_compat
|
||||
TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh
|
||||
TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh fsync_tests.sh
|
||||
check_SCRIPTS = $(TEST_SCRIPT)
|
||||
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT)
|
||||
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) fsync_tests.c$(EXEEXT)
|
||||
|
||||
|
||||
# These are our main targets. They should be listed in the order to be
|
||||
@@ -50,7 +50,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
|
||||
# 'make check' doesn't run them directly, so they are not included in TEST_PROG.
|
||||
# Also build testmeta, which is used for timings test. It builds quickly,
|
||||
# and this lets automake keep all its test programs in one place.
|
||||
check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env
|
||||
check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env fsync_tests
|
||||
|
||||
|
||||
# These programs generate test files for the tests. They don't need to be
|
||||
@@ -135,6 +135,6 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
|
||||
tvlstr.c tvltypes.c
|
||||
|
||||
# Temporary files.
|
||||
DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh
|
||||
DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh fsync_tests.sh
|
||||
|
||||
include $(top_srcdir)/config/conclude.am
|
||||
|
||||
@@ -53,13 +53,14 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/testcheck_version.sh.in \
|
||||
$(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \
|
||||
$(srcdir)/testlinks_env.sh.in $(top_srcdir)/config/commence.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/fsync_tests.sh.in \
|
||||
$(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \
|
||||
$(srcdir)/testlibinfo.sh.in $(srcdir)/testlinks_env.sh.in \
|
||||
$(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/config/conclude.am COPYING
|
||||
check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \
|
||||
err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \
|
||||
links_env$(EXEEXT)
|
||||
links_env$(EXEEXT) fsync_tests$(EXEEXT)
|
||||
@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2)
|
||||
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
|
||||
subdir = test
|
||||
@@ -69,8 +70,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/src/H5config.h
|
||||
CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \
|
||||
testlibinfo.sh testlinks_env.sh
|
||||
CONFIG_CLEAN_FILES = fsync_tests.sh testcheck_version.sh testerror.sh \
|
||||
H5srcdir_str.h testlibinfo.sh testlinks_env.sh
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libh5test_la_LIBADD =
|
||||
@@ -218,6 +219,10 @@ freespace_SOURCES = freespace.c
|
||||
freespace_OBJECTS = freespace.$(OBJEXT)
|
||||
freespace_LDADD = $(LDADD)
|
||||
freespace_DEPENDENCIES = libh5test.la $(LIBHDF5)
|
||||
fsync_tests_SOURCES = fsync_tests.c
|
||||
fsync_tests_OBJECTS = fsync_tests.$(OBJEXT)
|
||||
fsync_tests_LDADD = $(LDADD)
|
||||
fsync_tests_DEPENDENCIES = libh5test.la $(LIBHDF5)
|
||||
gen_bad_ohdr_SOURCES = gen_bad_ohdr.c
|
||||
gen_bad_ohdr_OBJECTS = gen_bad_ohdr.$(OBJEXT)
|
||||
gen_bad_ohdr_LDADD = $(LDADD)
|
||||
@@ -419,30 +424,31 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \
|
||||
cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \
|
||||
earray.c efc.c enum.c err_compat.c error_test.c extend.c \
|
||||
external.c farray.c fheap.c fillval.c filter_fail.c flush1.c \
|
||||
flush2.c freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \
|
||||
gen_deflate.c gen_filespace.c gen_filters.c gen_new_array.c \
|
||||
gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \
|
||||
flush2.c freespace.c fsync_tests.c gen_bad_ohdr.c gen_bogus.c \
|
||||
gen_cross.c gen_deflate.c gen_filespace.c gen_filters.c \
|
||||
gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \
|
||||
gen_new_super.c gen_noencoder.c gen_nullspace.c \
|
||||
gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \
|
||||
gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \
|
||||
mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \
|
||||
set_extent.c space_overflow.c stab.c tcheck_version.c \
|
||||
$(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
|
||||
vfd.c
|
||||
DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \
|
||||
bittests.c btree2.c cache.c cache_api.c cache_tagging.c \
|
||||
cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \
|
||||
dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \
|
||||
error_test.c extend.c external.c farray.c fheap.c fillval.c \
|
||||
filter_fail.c flush1.c flush2.c freespace.c fsync_tests.c \
|
||||
gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
|
||||
gen_filespace.c gen_filters.c gen_new_array.c gen_new_fill.c \
|
||||
gen_new_group.c gen_new_mtime.c gen_new_super.c \
|
||||
gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \
|
||||
gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \
|
||||
istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \
|
||||
ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \
|
||||
space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \
|
||||
testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c
|
||||
DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \
|
||||
bittests.c btree2.c cache.c cache_api.c cache_tagging.c \
|
||||
cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \
|
||||
dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \
|
||||
error_test.c extend.c external.c farray.c fheap.c fillval.c \
|
||||
filter_fail.c flush1.c flush2.c freespace.c gen_bad_ohdr.c \
|
||||
gen_bogus.c gen_cross.c gen_deflate.c gen_filespace.c \
|
||||
gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
|
||||
gen_new_mtime.c gen_new_super.c gen_noencoder.c \
|
||||
gen_nullspace.c gen_sizes_lheap.c gen_specmetaread.c \
|
||||
gen_udlinks.c getname.c gheap.c hyperslab.c istore.c lheap.c \
|
||||
links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \
|
||||
ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \
|
||||
tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
|
||||
$(ttsafe_SOURCES) unlink.c vfd.c
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__tty_colors = \
|
||||
@@ -761,9 +767,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \
|
||||
INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
|
||||
|
||||
# Test script for error_test and err_compat
|
||||
TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh
|
||||
TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh fsync_tests.sh
|
||||
check_SCRIPTS = $(TEST_SCRIPT)
|
||||
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT)
|
||||
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) fsync_tests.c$(EXEEXT)
|
||||
|
||||
# These are our main targets. They should be listed in the order to be
|
||||
# executed, generally most specific tests to least specific tests.
|
||||
@@ -816,7 +822,7 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
|
||||
|
||||
|
||||
# Temporary files.
|
||||
DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh
|
||||
DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh fsync_tests.sh
|
||||
|
||||
# Automake needs to be taught how to build lib, progs, and tests targets.
|
||||
# These will be filled in automatically for the most part (e.g.,
|
||||
@@ -867,6 +873,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
fsync_tests.sh: $(top_builddir)/config.status $(srcdir)/fsync_tests.sh.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
testcheck_version.sh: $(top_builddir)/config.status $(srcdir)/testcheck_version.sh.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in
|
||||
@@ -993,6 +1001,9 @@ flush2$(EXEEXT): $(flush2_OBJECTS) $(flush2_DEPENDENCIES)
|
||||
freespace$(EXEEXT): $(freespace_OBJECTS) $(freespace_DEPENDENCIES)
|
||||
@rm -f freespace$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(freespace_OBJECTS) $(freespace_LDADD) $(LIBS)
|
||||
fsync_tests$(EXEEXT): $(fsync_tests_OBJECTS) $(fsync_tests_DEPENDENCIES)
|
||||
@rm -f fsync_tests$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(fsync_tests_OBJECTS) $(fsync_tests_LDADD) $(LIBS)
|
||||
gen_bad_ohdr$(EXEEXT): $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_DEPENDENCIES)
|
||||
@rm -f gen_bad_ohdr$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_LDADD) $(LIBS)
|
||||
@@ -1150,6 +1161,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freespace.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync_tests.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bad_ohdr.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bogus.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_cross.Po@am__quote@
|
||||
|
||||
2828
test/fsync_tests.c
Normal file
2828
test/fsync_tests.c
Normal file
File diff suppressed because it is too large
Load Diff
294
test/fsync_tests.sh.in
Normal file
294
test/fsync_tests.sh.in
Normal file
@@ -0,0 +1,294 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# Copyright by the Board of Trustees of the University of Illinois.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the files COPYING and Copyright.html. COPYING can be found at the root
|
||||
# of the source code distribution tree; Copyright.html can be found at the
|
||||
# root level of an installed copy of the electronic HDF5 document set and
|
||||
# is linked from the top-level documents page. It can also be found at
|
||||
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
|
||||
# access to either file, you may request a copy from help@hdfgroup.org.
|
||||
#
|
||||
# Tests for journaling related marking and unmarking of HDF5 files.
|
||||
#
|
||||
# These tests used to be in cache_journal.c, but had to be moved
|
||||
# out as the tests require simulated crashes, and it is difficult to
|
||||
# do this in a C program without using fork().
|
||||
|
||||
nerrors=0
|
||||
|
||||
# The build (current) directory might be different than the source directory.
|
||||
if test -z "$srcdir"; then
|
||||
srcdir=.
|
||||
fi
|
||||
|
||||
test -d ./testfiles || mkdir ./testfiles
|
||||
|
||||
# Print a line-line message left justified in a field of 70 characters
|
||||
# beginning with the word "Testing".
|
||||
#
|
||||
TESTING() {
|
||||
SPACES=" "
|
||||
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
|
||||
}
|
||||
|
||||
# Run a test and print PASS or *FAIL*. If a test fails then increment
|
||||
# the `nerrors' global variable.
|
||||
#
|
||||
TEST() {
|
||||
TEST_ERR=$1 # The test name
|
||||
TEST_ERR_BIN=`pwd`/$TEST_ERR # The path of the test binary
|
||||
TEST_DESC=$2
|
||||
TEST_SIZE=$3
|
||||
TEST_STDERR=fsync_test.stderr
|
||||
|
||||
#Run the test:
|
||||
trap "" 6
|
||||
$RUNSERIAL $TEST_ERR_BIN $TEST_DESC setup $TEST_SIZE
|
||||
trap 6
|
||||
TESTING $TEST_DESC $TEST_SIZE bytes
|
||||
$RUNSERIAL $TEST_ERR_BIN $TEST_DESC check $TEST_SIZE > $TEST_STDERR
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
|
||||
# it is possible that we are running on a machine that discards
|
||||
# our return code -- such as red storm.
|
||||
#
|
||||
# Thus check the contents of the stderr file before declaring a
|
||||
# pass.
|
||||
|
||||
if [ `wc -c < $TEST_STDERR` = '0' ]
|
||||
then
|
||||
|
||||
echo " PASSED"
|
||||
|
||||
else
|
||||
|
||||
echo "*FAILED*"
|
||||
nerrors="`expr $nerrors + 1`"
|
||||
|
||||
fi
|
||||
else
|
||||
echo "*FAILED*"
|
||||
nerrors="`expr $nerrors + 1`"
|
||||
fi
|
||||
|
||||
# delete the stderr file before we quit
|
||||
rm $TEST_STDERR
|
||||
}
|
||||
|
||||
# Print a "SKIP" message
|
||||
SKIP() {
|
||||
TESTING $@
|
||||
echo " -SKIP-"
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
### T H E T E S T S ###
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
|
||||
echo "Tests to verify correct operation of the fsync and aio fsync calls"
|
||||
echo "under various HDF5 file drivers. Most tests involve abnormal exits."
|
||||
echo "Thus the \"Aborted\" messages between tests are expected."
|
||||
|
||||
|
||||
# sec2 SIO fsync tests:
|
||||
|
||||
TEST fsync_tests "generic_fsync_test sec2" "56"
|
||||
TEST fsync_tests "generic_fsync_test sec2" "1048576"
|
||||
TEST fsync_tests "generic_fsync_test sec2" "20000000"
|
||||
|
||||
|
||||
# core SIO fsync tests:
|
||||
|
||||
TEST fsync_tests "generic_fsync_test core" "62"
|
||||
TEST fsync_tests "generic_fsync_test core" "1048576"
|
||||
TEST fsync_tests "generic_fsync_test core" "3000000"
|
||||
|
||||
|
||||
# stdio SIO fsync tests:
|
||||
|
||||
TEST fsync_tests "generic_fsync_test stdio" "88"
|
||||
TEST fsync_tests "generic_fsync_test stdio" "1048576"
|
||||
TEST fsync_tests "generic_fsync_test stdio" "4000000"
|
||||
|
||||
|
||||
# family SIO fsync tests:
|
||||
#
|
||||
# Note that the family file driver SIO fsync tests don't use file
|
||||
# sizes below 32 MB. We do this as the fsync test code sets the
|
||||
# family member size to 32 MB, and the family file driver open
|
||||
# call sets the member size to the size of the first file in
|
||||
# the family.
|
||||
#
|
||||
# Under normal circumstances, this value is overwritten when the
|
||||
# super block is decoded (HDF 1.8 and up), but since these tests
|
||||
# are working at the file driver level, this adjustment is not
|
||||
# made. Rather than fiddle with the family file driver internal
|
||||
# data structures, we go with the flow and do our tests file
|
||||
# total file sizes greater than 32 MB.
|
||||
# JRM -- 1/27/11
|
||||
|
||||
TEST fsync_tests "generic_fsync_test family" "33554432"
|
||||
TEST fsync_tests "generic_fsync_test family" "33554433"
|
||||
TEST fsync_tests "generic_fsync_test family" "40000000"
|
||||
TEST fsync_tests "generic_fsync_test family" "67108863"
|
||||
TEST fsync_tests "generic_fsync_test family" "67108864"
|
||||
TEST fsync_tests "generic_fsync_test family" "100000000"
|
||||
|
||||
|
||||
# multi SIO fsync tests
|
||||
#
|
||||
# The generic SIO fsync test doesn't exercise the fsync multi
|
||||
# file driver call fully -- but it is a good first smoke check.
|
||||
|
||||
TEST fsync_tests "generic_fsync_test multi" "99"
|
||||
TEST fsync_tests "generic_fsync_test multi" "1048576"
|
||||
TEST fsync_tests "generic_fsync_test multi" "5000000"
|
||||
|
||||
# Now do multi file driver specific fsync tests. This should
|
||||
# exercise the multi file driver a bit more fully.
|
||||
|
||||
TEST fsync_tests "multi_fd_fsync_test multi" "99"
|
||||
TEST fsync_tests "multi_fd_fsync_test multi" "1048576"
|
||||
TEST fsync_tests "multi_fd_fsync_test multi" "5000000"
|
||||
|
||||
|
||||
|
||||
# sec2 AIO fsync poll tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test sec2" "56"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test sec2" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test sec2" "20000000"
|
||||
|
||||
|
||||
# core AIO fsync poll tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test core" "62"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test core" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test core" "3000000"
|
||||
|
||||
|
||||
# stdio AIO fsync poll tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test stdio" "88"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test stdio" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test stdio" "4000000"
|
||||
|
||||
|
||||
# family AIO fsync poll tests:
|
||||
#
|
||||
# Note that the family file driver AIO fsync tests don't use file
|
||||
# sizes below 32 MB. We do this as the fsync test code sets the
|
||||
# family member size to 32 MB, and the family file driver open
|
||||
# call sets the member size to the size of the first file in
|
||||
# the family.
|
||||
#
|
||||
# Under normal circumstances, this value is overwritten when the
|
||||
# super block is decoded (HDF 1.8 and up), but since these tests
|
||||
# are working at the file driver level, this adjustment is not
|
||||
# made. Rather than fiddle with the family file driver internal
|
||||
# data structures, we go with the flow and do our tests file
|
||||
# total file sizes greater than 32 MB.
|
||||
# JRM -- 1/27/11
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "33554432"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "33554433"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "40000000"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "67108863"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "67108864"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test family" "100000000"
|
||||
|
||||
|
||||
# multi AIO fsync poll tests
|
||||
#
|
||||
# The generic AIO fsync test doesn't exercise the fsync multi
|
||||
# file driver call fully -- but it is a good first smoke check.
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test multi" "99"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test multi" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_poll_test multi" "5000000"
|
||||
|
||||
|
||||
# Now do multi file driver specific fsync tests. This should
|
||||
# exercise the multi file driver a bit more fully.
|
||||
|
||||
TEST fsync_tests "multi_fd_aio_fsync_poll_test multi" "111"
|
||||
TEST fsync_tests "multi_fd_aio_fsync_poll_test multi" "1048576"
|
||||
TEST fsync_tests "multi_fd_aio_fsync_poll_test multi" "5800000"
|
||||
|
||||
|
||||
# sec2 AIO fsync wait tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test sec2" "56"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test sec2" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test sec2" "20000000"
|
||||
|
||||
|
||||
# core AIO fsync poll tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test core" "62"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test core" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test core" "3000000"
|
||||
|
||||
|
||||
# stdio AIO fsync poll tests:
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test stdio" "88"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test stdio" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test stdio" "4000000"
|
||||
|
||||
|
||||
# family AIO fsync poll tests:
|
||||
#
|
||||
# Note that the family file driver AIO fsync tests don't use file
|
||||
# sizes below 32 MB. We do this as the fsync test code sets the
|
||||
# family member size to 32 MB, and the family file driver open
|
||||
# call sets the member size to the size of the first file in
|
||||
# the family.
|
||||
#
|
||||
# Under normal circumstances, this value is overwritten when the
|
||||
# super block is decoded (HDF 1.8 and up), but since these tests
|
||||
# are working at the file driver level, this adjustment is not
|
||||
# made. Rather than fiddle with the family file driver internal
|
||||
# data structures, we go with the flow and do our tests file
|
||||
# total file sizes greater than 32 MB.
|
||||
# JRM -- 1/27/11
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "33554432"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "33554433"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "40000000"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "67108863"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "67108864"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test family" "100000000"
|
||||
|
||||
|
||||
# multi AIO fsync poll tests
|
||||
#
|
||||
# The generic AIO fsync test doesn't exercise the fsync multi
|
||||
# file driver call fully -- but it is a good first smoke check.
|
||||
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test multi" "66"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test multi" "1048576"
|
||||
TEST fsync_tests "generic_aio_fsync_wait_test multi" "5200000"
|
||||
|
||||
|
||||
# Now do multi file driver specific fsync tests. This should
|
||||
# exercise the multi file driver a bit more fully.
|
||||
|
||||
TEST fsync_tests "multi_fd_aio_fsync_wait_test multi" "88"
|
||||
TEST fsync_tests "multi_fd_aio_fsync_wait_test multi" "1048576"
|
||||
TEST fsync_tests "multi_fd_aio_fsync_wait_test multi" "5400000"
|
||||
|
||||
|
||||
if test $nerrors -eq 0 ; then
|
||||
echo "All fsync tests passed."
|
||||
fi
|
||||
|
||||
exit $nerrors
|
||||
3478
test/vfd.c
3478
test/vfd.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user