From 1280f90f8128a72f1b2cfe45d3a5a24334c222e0 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Sat, 2 Jun 2007 13:19:36 -0500 Subject: [PATCH] [svn-r13829] Some systems (only SGI Altix ProPack 4 discovered so far) doesn't return correct file size from MPI_File_get_size. Bypass this problem by replacing it with stat. Add an option --disable-mpi-size in configure to indicate this function doesn't work properly. Add a test in testpar/t_mpi.c, too. If it returns wrong file size, print out a warning. Tested on kagiso (parallel) because already tested the same change to v1.6 on several platforms (kagiso, cobalt, copper, and sol). --- Makefile.in | 1 + c++/Makefile.in | 1 + c++/examples/Makefile.in | 1 + c++/src/Makefile.in | 1 + c++/test/Makefile.in | 1 + configure | 83 +++++++++++++++++++++++---------- configure.in | 31 ++++++++++++ examples/Makefile.in | 1 + fortran/Makefile.in | 1 + fortran/examples/Makefile.in | 1 + fortran/src/Makefile.in | 1 + fortran/test/Makefile.in | 1 + fortran/testpar/Makefile.in | 1 + hl/Makefile.in | 1 + hl/c++/Makefile.in | 1 + hl/c++/examples/Makefile.in | 1 + hl/c++/src/Makefile.in | 1 + hl/c++/test/Makefile.in | 1 + hl/examples/Makefile.in | 1 + hl/fortran/Makefile.in | 1 + hl/fortran/examples/Makefile.in | 1 + hl/fortran/src/Makefile.in | 1 + hl/fortran/test/Makefile.in | 1 + hl/src/H5TB.c | 6 +-- hl/src/Makefile.in | 1 + hl/test/Makefile.in | 1 + hl/test/test_table.c | 3 -- hl/tools/Makefile.in | 1 + hl/tools/gif2h5/Makefile.in | 1 + perform/Makefile.in | 1 + src/H5FDmpio.c | 16 ++++++- src/H5config.h.in | 3 ++ src/Makefile.in | 1 + test/Makefile.in | 1 + testpar/Makefile.in | 1 + testpar/t_chunk_alloc.c | 14 ++++++ testpar/t_mpi.c | 40 ++++++++++++++++ tools/Makefile.in | 1 + tools/h5copy/Makefile.in | 1 + tools/h5diff/Makefile.in | 1 + tools/h5dump/Makefile.in | 1 + tools/h5import/Makefile.in | 1 + tools/h5jam/Makefile.in | 1 + tools/h5ls/Makefile.in | 1 + tools/h5repack/Makefile.in | 1 + tools/lib/Makefile.in | 1 + tools/misc/Makefile.in | 1 + 47 files changed, 203 insertions(+), 32 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1e363e1c60..d43766f4eb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -189,6 +189,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/c++/Makefile.in b/c++/Makefile.in index 3249c02e41..9a8cc718ba 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -160,6 +160,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index ce1d760899..edf1ee6a45 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index fd821fb794..b7392eb39d 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -190,6 +190,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 6ad8b2b7a9..1cfe7e6b9e 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -176,6 +176,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/configure b/configure index b1e7ded00c..ca9564c3df 100755 --- a/configure +++ b/configure @@ -922,6 +922,7 @@ CLEARFILEBUF USINGMEMCHECKER ADD_PARALLEL_FILES MPE +MPI_GET_SIZE FILTERS USE_FILTER_SHUFFLE USE_FILTER_FLETCHER32 @@ -1600,6 +1601,11 @@ Optional Features: picky about it's memory operations and also disables the library's free space manager code. Default=no. --enable-parallel Search for MPI-IO and MPI support files + --enable-mpi-size Some systems (only SGI Altix Propack 4 so far) + return wrong value from MPI_File_get_size. By + disabling this function, the library will replace it + with stat to get the correct file size. + [default=yes] --enable-filters=all Turn on all internal I/O filters. One may also specify a comma-separated list of filters or the word no. The default is all internal I/O filters. @@ -7840,7 +7846,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7843 "configure"' > conftest.$ac_ext + echo '#line 7849 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10114,11 +10120,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10117: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10123: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10121: \$? = $ac_status" >&5 + echo "$as_me:10127: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -10382,11 +10388,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10385: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10391: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10389: \$? = $ac_status" >&5 + echo "$as_me:10395: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -10486,11 +10492,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10489: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10495: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10493: \$? = $ac_status" >&5 + echo "$as_me:10499: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12866,7 +12872,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:15327: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15325: \$? = $ac_status" >&5 + echo "$as_me:15331: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15422,11 +15428,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15425: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15431: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15429: \$? = $ac_status" >&5 + echo "$as_me:15435: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16992,11 +16998,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16995: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17001: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16999: \$? = $ac_status" >&5 + echo "$as_me:17005: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17096,11 +17102,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17099: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17105: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17103: \$? = $ac_status" >&5 + echo "$as_me:17109: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19294,11 +19300,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19297: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19303: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19301: \$? = $ac_status" >&5 + echo "$as_me:19307: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19562,11 +19568,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19565: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19571: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19569: \$? = $ac_status" >&5 + echo "$as_me:19575: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19666,11 +19672,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19669: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19675: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19673: \$? = $ac_status" >&5 + echo "$as_me:19679: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -50292,6 +50298,34 @@ echo "${ECHO_T}yes" >&6; } echo "${ECHO_T}no" >&6; } fi +# Check whether --enable-mpi-size was given. +if test "${enable_mpi_size+set}" = set; then + enableval=$enable_mpi_size; MPI_GET_SIZE=$enableval +fi + + +{ echo "$as_me:$LINENO: checking if MPI_File_get_size is enabled" >&5 +echo $ECHO_N "checking if MPI_File_get_size is enabled... $ECHO_C" >&6; } + + +case "X-$MPI_GET_SIZE" in + X-no) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + MPI_GET_SIZE=no + ;; + X-yes|*) + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + MPI_GET_SIZE=yes + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MPI_GET_SIZE 1 +_ACEOF + + ;; +esac + { echo "$as_me:$LINENO: checking if irregular hyperslab optimization code works inside MPI-IO" >&5 echo $ECHO_N "checking if irregular hyperslab optimization code works inside MPI-IO... $ECHO_C" >&6; } @@ -53392,6 +53426,7 @@ CLEARFILEBUF!$CLEARFILEBUF$ac_delim USINGMEMCHECKER!$USINGMEMCHECKER$ac_delim ADD_PARALLEL_FILES!$ADD_PARALLEL_FILES$ac_delim MPE!$MPE$ac_delim +MPI_GET_SIZE!$MPI_GET_SIZE$ac_delim FILTERS!$FILTERS$ac_delim USE_FILTER_SHUFFLE!$USE_FILTER_SHUFFLE$ac_delim USE_FILTER_FLETCHER32!$USE_FILTER_FLETCHER32$ac_delim @@ -53426,7 +53461,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 87; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index 43cd698954..994e739a45 100644 --- a/configure.in +++ b/configure.in @@ -2510,6 +2510,37 @@ if test -n "$PARALLEL"; then AC_MSG_RESULT([no]) fi +dnl ---------------------------------------------------------------------- +dnl Set the flag to indicate that the MPI_File_get_size() function +dnl works. The default is enabled unless the user knows the function +dnl doesn't work on the system and disables it. (This flag should be set +dnl for all machines except for SGI Altix Propack 4 where the function +dnl doesn't return correct file size.) +dnl +AC_ARG_ENABLE([mpi-size], + [AC_HELP_STRING([--enable-mpi-size], + [Some systems (only SGI Altix Propack 4 so far) return wrong value + from MPI_File_get_size. By disabling this function, the library + will replace it with stat to get the correct file size. + [default=yes]])], + [MPI_GET_SIZE=$enableval]) + +AC_MSG_CHECKING([if MPI_File_get_size is enabled]) + +AC_SUBST(MPI_GET_SIZE) +case "X-$MPI_GET_SIZE" in + X-no) + AC_MSG_RESULT([no]) + MPI_GET_SIZE=no + ;; + X-yes|*) + AC_MSG_RESULT([yes]) + MPI_GET_SIZE=yes + AC_DEFINE([HAVE_MPI_GET_SIZE], [1], + [Define if MPI_File_get_size works correctly]) + ;; +esac + dnl ---------------------------------------------------------------------- dnl Check to see whether the complicate MPI derived datatype works. dnl In Dec. 20th, 2004, we found that IBM's MPIO implemention didn't diff --git a/examples/Makefile.in b/examples/Makefile.in index 099ce90f75..ef6acf1566 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 6178080e6f..5a0fef80c3 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -164,6 +164,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index a28fc32fec..ae32620cd1 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 92e9ecfc60..e2428e5954 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -217,6 +217,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 4a85da0297..2f6ee47e62 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -210,6 +210,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index defb5c7681..338a1a8bba 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -167,6 +167,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/Makefile.in b/hl/Makefile.in index af961c12b9..32c02b3694 100755 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -164,6 +164,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 4695fb8081..81cb283271 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -160,6 +160,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 74a128f39d..fe344d9c58 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index cf455de512..35f1148578 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -179,6 +179,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 44cab07ba0..d619d7b2b7 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -170,6 +170,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 0f191b3579..64fda225f7 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 5b0bd7227b..db9c4c637d 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -164,6 +164,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 86cd9414df..693357feac 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -154,6 +154,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 8dbe8d44c5..bf9ac00bf4 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -184,6 +184,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 74d93fbf1a..3233adeb41 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -174,6 +174,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 7e1de59baf..666c6f4a6e 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -113,7 +113,7 @@ herr_t H5TBmake_table( const char *table_title, } /* Create a simple data space with unlimited size */ - if ( (sid = H5Screate_simple( 1, dims, maxdims )) < 0 ) + if ( (sid = H5Screate_simple( 1, dims, maxdims )) < 0 ) return -1; /* Modify dataset creation properties, i.e. enable chunking */ @@ -249,7 +249,6 @@ herr_t H5TBmake_table( const char *table_title, if ( H5Tclose( mem_type_id ) < 0 ) return -1; - return 0; /* error zone, gracefully close */ @@ -3281,7 +3280,8 @@ herr_t H5TBget_table_info ( hid_t loc_id, if ( H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0) return -1; - *nrecords = *n; + /**nrecords = *n;*/ + *nrecords = n[0]; } else { diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2c3e05e8d7..670932fbbf 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -180,6 +180,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 1e580c689b..08276d4564 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -190,6 +190,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/test/test_table.c b/hl/test/test_table.c index f5b73f9622..16172c4e8b 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -354,7 +354,6 @@ int test_table(hid_t fid, int write) PASSED(); } - TESTING2("reading table"); /*------------------------------------------------------------------------- @@ -1355,7 +1354,6 @@ int test_table(hid_t fid, int write) PASSED(); } - /*------------------------------------------------------------------------- * * Functions tested: @@ -1374,7 +1372,6 @@ int test_table(hid_t fid, int write) chunk_size,fill,compress,wbuf)<0) goto out; - /* delete the field */ if ( H5TBdelete_field(fid, "table14", "Pressure" ) < 0 ) goto out; diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 243f496002..aa08313289 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -161,6 +161,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 46ccc98ad6..f8befa4720 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -182,6 +182,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/perform/Makefile.in b/perform/Makefile.in index 7039f5a667..496d2ee6b4 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -205,6 +205,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 65939699dc..5d5f092383 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -942,7 +942,10 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, MPI_Comm comm_dup=MPI_COMM_NULL; MPI_Info info_dup=MPI_INFO_NULL; H5FD_t *ret_value; /* Return value */ - +#ifndef H5_HAVE_MPI_GET_SIZE + struct stat stat_buf; +#endif + FUNC_ENTER_NOAPI(H5FD_mpio_open, NULL) #ifdef H5FDmpio_DEBUG @@ -1016,9 +1019,18 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, /* Only processor p0 will get the filesize and broadcast it. */ if (mpi_rank == 0) { - /* Get current file size */ + /* Get current file size. If MPI_File_get_size is disabled in configuration + * because it doesn't return correct value (SGI Altix Propack 4), + * use stat to get the file size. */ +#ifdef H5_HAVE_MPI_GET_SIZE if (MPI_SUCCESS != (mpi_code=MPI_File_get_size(fh, &size))) HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mpi_code) +#else + if((mpi_code=HDstat(name, &stat_buf))<0) + HMPI_GOTO_ERROR(NULL, "stat failed", mpi_code) + /* Hopefully this casting is safe */ + size = (MPI_Offset)(stat_buf.st_size); +#endif } /* end if */ /* Broadcast file size */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 6b966f556f..3817ea8ae0 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -210,6 +210,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MPE_H +/* Define if MPI_File_get_size works correctly */ +#undef HAVE_MPI_GET_SIZE + /* Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists */ #undef HAVE_MPI_MULTI_LANG_Comm diff --git a/src/Makefile.in b/src/Makefile.in index cf7257c9aa..c985af0b49 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -235,6 +235,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/test/Makefile.in b/test/Makefile.in index 5839184d4f..ecdd1dfb05 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -444,6 +444,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index c0ae51dd56..49adf767d3 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -197,6 +197,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index 770a1fcdc1..5b60c0ec6f 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -36,7 +36,11 @@ get_filesize(const char *filename) int mpierr; MPI_File fd; MPI_Offset filesize; +#ifndef H5_HAVE_MPI_GET_SIZE + struct stat stat_buf; +#endif +#ifdef H5_HAVE_MPI_GET_SIZE mpierr = MPI_File_open(MPI_COMM_SELF, (char*)filename, MPI_MODE_RDONLY, MPI_INFO_NULL, &fd); VRFY((mpierr == MPI_SUCCESS), ""); @@ -46,6 +50,16 @@ get_filesize(const char *filename) mpierr = MPI_File_close(&fd); VRFY((mpierr == MPI_SUCCESS), ""); +#else + /* Some systems (only SGI Altix Propack 4 so far) doesn't return correct + * file size for MPI_File_get_size. Use stat instead. + */ + if((mpierr=stat(filename, &stat_buf))<0) + VRFY((mpierr == MPI_SUCCESS), ""); + + /* Hopefully this casting is safe */ + filesize = (MPI_Offset)(stat_buf.st_size); +#endif return(filesize); } diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 6465a94042..f68c92b04c 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -202,9 +202,11 @@ test_mpio_gb_file(char *filename) int ntimes; /* how many times */ char *buf = NULL; char expected; + MPI_Offset size; MPI_Offset mpi_off; MPI_Offset mpi_off_old; MPI_Status mpi_stat; + struct stat stat_buf; int is_signed, sizeof_mpi_offset; nerrs = 0; @@ -376,6 +378,44 @@ test_mpio_gb_file(char *filename) */ mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync before leaving test"); + + /* + * Check if MPI_File_get_size works correctly. Some systems (only SGI Altix + * Propack 4 so far) return wrong file size. It can be avoided by reconfiguring + * with "--disable-mpi-size". + */ +#ifdef H5_HAVE_MPI_GET_SIZE + printf("Test if MPI_File_get_size works correctly with %s\n", filename); + + mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info, &fh); + VRFY((mrc==MPI_SUCCESS), ""); + + if (MAINPROCESS){ /* only process 0 needs to check it*/ + mrc = MPI_File_get_size(fh, &size); + VRFY((mrc==MPI_SUCCESS), ""); + + mrc=stat(filename, &stat_buf); + VRFY((mrc==0), ""); + + /* Hopefully this casting is safe */ + if(size != (MPI_Offset)(stat_buf.st_size)) { + printf("Warning: MPI_File_get_size doesn't return correct file size. To avoid using it in the library, reconfigure and rebuild the library with --disable-mpi-size.\n"); + } + } + + /* close file and free the communicator */ + mrc = MPI_File_close(&fh); + VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE"); + + /* + * one more sync to ensure all processes have done reading + * before ending this test. + */ + mrc = MPI_Barrier(MPI_COMM_WORLD); + VRFY((mrc==MPI_SUCCESS), "Sync before leaving test"); +#else + printf("Skipped testing MPI_File_get_size because it's disabled\n"); +#endif } finish: diff --git a/tools/Makefile.in b/tools/Makefile.in index e33c893d41..9c97e0c45d 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -161,6 +161,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 8e7d6139b7..5262cc9cb0 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -178,6 +178,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 62f956b5fd..0b68c4272c 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -185,6 +185,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 079704e820..51dcc4ee43 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -183,6 +183,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 670bbf3fe2..097075abee 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -178,6 +178,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index a541d2e8e6..a4b7142ccb 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -189,6 +189,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index fc1c28d9ef..50a2f6d63e 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -172,6 +172,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index c5f1d34d8d..b9028b567b 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -192,6 +192,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index afedeea1a1..2d09465a31 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -177,6 +177,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index a3ff1b5173..17e124eb2c 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -201,6 +201,7 @@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@