Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d140c6cb6 | |||
| 8d760dc264 | |||
| 4546846f06 | |||
| 62c46dc8bf | |||
| 9516e493bc | |||
| 9df1d56714 | |||
| 98e1055b7b | |||
| 436cce16c7 | |||
| ec6f30bbd8 | |||
| d356142bc4 | |||
| 00c9b0804b | |||
| 172ceff05a | |||
| 030985c9a4 | |||
| 359b699464 | |||
| 6e1ce25417 | |||
| 4144c2b696 | |||
| bad33a75d2 | |||
| 7240f26378 | |||
| b9d82c2fda | |||
| 1bdd5268ed | |||
| 92e057e4cf | |||
| aa72af797b | |||
| 9974b6b44c | |||
| 82c594c17d | |||
| c96b859f88 | |||
| d580292235 | |||
| 4dd379ff2f | |||
| e13c4e8d8d | |||
| 4d0ffd58df | |||
| b105b19d4d | |||
| f0d51def4e | |||
| 5325a7a24f | |||
| 9c6d4e48a3 | |||
| 150f623c03 | |||
| 14536c6d84 | |||
| 94779f185f | |||
| 07ff9e52ef | |||
| 4de6c55220 |
@@ -28,6 +28,7 @@ doc/H5PartVisIt/cloud_visit_2D.png -text
|
|||||||
doc/H5PartVisIt/cloud_visit_2D.s.png -text
|
doc/H5PartVisIt/cloud_visit_2D.s.png -text
|
||||||
doc/H5PartVisIt/visit_query1.png -text
|
doc/H5PartVisIt/visit_query1.png -text
|
||||||
doc/H5PartVisIt/visit_query1.s.png -text
|
doc/H5PartVisIt/visit_query1.s.png -text
|
||||||
|
doc/H5X_File_Format.txt -text
|
||||||
doc/H5tools/H5tools.html -text
|
doc/H5tools/H5tools.html -text
|
||||||
doc/H5tools/H5tools_files/snapshot1.jpg -text
|
doc/H5tools/H5tools_files/snapshot1.jpg -text
|
||||||
doc/InternalLayout.html -text
|
doc/InternalLayout.html -text
|
||||||
|
|||||||
+151
-165
@@ -1,6 +1,6 @@
|
|||||||
# Every configure script must call AC_INIT before doing anything else.
|
# Every configure script must call AC_INIT before doing anything else.
|
||||||
# AC_INIT (package, version, [bug-report], [tarname])
|
# AC_INIT (package, version, [bug-report], [tarname])
|
||||||
AC_INIT([H5Part], [1.3.1], [vis@hpcrdm.lbl.gov])
|
AC_INIT([H5Part], [1.3.3], [h5part@lists.psi.ch], H5Part)
|
||||||
|
|
||||||
|
|
||||||
# Ensure that a recent enough version of Autoconf is being used.
|
# Ensure that a recent enough version of Autoconf is being used.
|
||||||
@@ -14,6 +14,45 @@ AC_INIT([H5Part], [1.3.1], [vis@hpcrdm.lbl.gov])
|
|||||||
# The AC_CONFIG_HEADERS macro selects this kind of output.
|
# The AC_CONFIG_HEADERS macro selects this kind of output.
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
################# --enable-xxx and --with-xxx Argument ########################
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(
|
||||||
|
[64],
|
||||||
|
[AC_HELP_STRING([--enable-64],
|
||||||
|
[Compile using 64-bit flags [default=no]])],
|
||||||
|
[USE_64=$enableval])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(
|
||||||
|
[fortran],
|
||||||
|
[AC_HELP_STRING([--enable-fortran],
|
||||||
|
[Compile the Fortran interface [default=no]])],
|
||||||
|
[USE_FORTRAN=$enableval])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(
|
||||||
|
[parallel],
|
||||||
|
[AC_HELP_STRING([--enable-parallel],
|
||||||
|
[Compile the MPI/IO interface [default=no]])],
|
||||||
|
[USE_PARALLEL=$enableval])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(
|
||||||
|
[tools],
|
||||||
|
[AC_HELP_STRING([--enable-tools],
|
||||||
|
[Compile h5part tools [default=no]])],
|
||||||
|
[USE_TOOLS=$enableval])
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
[mpipath],
|
||||||
|
[AC_HELP_STRING([--with-mpipath],
|
||||||
|
[path to MPI installation [default=""]])],
|
||||||
|
[MPIPATH=$withval], [MPIPATH=""])
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
[hdf5path],
|
||||||
|
[AC_HELP_STRING([--with-hdf5path],
|
||||||
|
[path to HDF5 installation [default=""]])],
|
||||||
|
[HDF5PATH=$withval], [HDF5PATH=""])
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
||||||
@@ -56,18 +95,18 @@ PATH_Search()
|
|||||||
fi
|
fi
|
||||||
for h5part_place in $2
|
for h5part_place in $2
|
||||||
do
|
do
|
||||||
echo -n "Looking in $h5part_place ... $ac_c" #1>&6
|
echo -n "looking in $h5part_place ... $ac_c" #1>&6
|
||||||
if test -r "$h5part_basedir$h5part_place/$3" ; then
|
if test -r "$h5part_basedir$h5part_place/$3" ; then
|
||||||
echo "$ac_t"" Found" #1>&6
|
echo "$ac_t"" found" #1>&6
|
||||||
eval $1="$h5part_place"
|
eval $1="$h5part_place"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if test -d "$h5part_basedir$h5part_place/$3" ; then
|
if test -d "$h5part_basedir$h5part_place/$3" ; then
|
||||||
echo "$ac_t"" Found" #1>&6
|
echo "$ac_t"" found" #1>&6
|
||||||
eval $1="$h5part_place"
|
eval $1="$h5part_place"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "$ac_t"" No" #1>&6
|
echo "$ac_t"" no" #1>&6
|
||||||
done
|
done
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -176,85 +215,63 @@ AC_DEFINE_UNQUOTED(MY_UNAME, "$uname", "")
|
|||||||
###################### 64-bit compilation enabled #############################
|
###################### 64-bit compilation enabled #############################
|
||||||
AC_MSG_CHECKING([if 64-bit compilation is enabled])
|
AC_MSG_CHECKING([if 64-bit compilation is enabled])
|
||||||
|
|
||||||
AC_ARG_ENABLE([64],
|
|
||||||
[AC_HELP_STRING([--enable-64],
|
|
||||||
[Compile using 64-bit flags [default=no]])],
|
|
||||||
[USE_64=$enableval])
|
|
||||||
|
|
||||||
|
|
||||||
# If --enable-64 is set in the configure line
|
# If --enable-64 is set in the configure line
|
||||||
if test "X$USE_64" = "Xyes"; then
|
if test "X$USE_64" = "Xyes"; then
|
||||||
echo "YES, 64-BIT ENABLED"
|
AC_MSG_RESULT([yes])
|
||||||
if test $uname = "AIX"; then
|
if test $uname = "AIX"; then
|
||||||
CFLAGS="$CFLAGS -q64"
|
CFLAGS="$CFLAGS -q64"
|
||||||
FFLAGS="$FFLAGS -q64"
|
FFLAGS="$FFLAGS -q64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $uname = "IRIX64"; then
|
if test $uname = "IRIX64"; then
|
||||||
CFLAGS="$CFLAGS -64"
|
CFLAGS="$CFLAGS -64"
|
||||||
FFLAGS="$FFLAGS -64 -fPIC -fno-second-underscore"
|
FFLAGS="$FFLAGS -64 -fPIC -fno-second-underscore"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "NO, 64-BIT NOT ENABLED"
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
############################ fortran enabled ##################################
|
############################ fortran enabled ##################################
|
||||||
AC_MSG_CHECKING([if fortran interface enabled])
|
AC_MSG_CHECKING([if fortran interface enabled])
|
||||||
AC_MSG_RESULT([])
|
|
||||||
AC_ARG_ENABLE([fortran],
|
|
||||||
[AC_HELP_STRING([--enable-fortran],
|
|
||||||
[Compile the Fortran interface [default=no]])],
|
|
||||||
[USE_FORTRAN=$enableval])
|
|
||||||
|
|
||||||
|
|
||||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||||
echo "YES, FORTRAN ENABLED"
|
AC_MSG_RESULT([yes])
|
||||||
|
|
||||||
# Start looking for ifort first
|
AC_PROG_FC(ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
||||||
AC_PROG_FC(ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
if test -z "$FC" ; then
|
||||||
|
AC_MSG_ERROR([Cannot find a fortran compiler!!!])
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if test -n "$FC" ; then
|
if test ! $uname = "AIX"; then
|
||||||
if test "X$FC" = "Xg95"; then
|
FFLAGS="${FFLAGS} -fPIC -fno-second-underscore"
|
||||||
FFLAGS="${FFLAGS} -fno-second-underscore"
|
fi
|
||||||
fi
|
|
||||||
AC_MSG_CHECKING([Test Number of FC Underscores])
|
|
||||||
AC_MSG_RESULT([OK])
|
|
||||||
`cd src && rm -f TestUnderscore.o TestUnderscoreC.o TestUnderscore`
|
|
||||||
`cd src && ${FC} ${FFLAGS} -c TestUnderscore.f`
|
|
||||||
`cd src && ${CC} ${CFLAGS} -c TestUnderscoreC.c`
|
|
||||||
`cd src && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o -lc`
|
|
||||||
|
|
||||||
if test -f src/TestUnderscore ; then
|
AC_MSG_CHECKING([symbol convention in object files])
|
||||||
UNDERSCORE_H=Underscore.h
|
`cd src && rm -f TestUnderscore.o TestUnderscoreC.o TestUnderscore`
|
||||||
`cd src && cat COPYRIGHT > Underscore.h`
|
`cd src && ${FC} ${FFLAGS} -c TestUnderscore.f`
|
||||||
`cd src && ./TestUnderscore >> Underscore.h`
|
`cd src && ${CC} ${CFLAGS} -c TestUnderscoreC.c`
|
||||||
echo "==== Underscore.h contains ============="
|
`cd src && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o -lc`
|
||||||
cat src/Underscore.h
|
|
||||||
echo "========================================"
|
if test -f src/TestUnderscore ; then
|
||||||
else
|
UNDERSCORE_H=Underscore.h
|
||||||
AC_MSG_ERROR(could not build fortran executable)
|
`cd src && ./TestUnderscore > Underscore.h`
|
||||||
USE_FORTRAN = "no"
|
AC_MSG_RESULT([ok])
|
||||||
fi
|
else
|
||||||
else
|
AC_MSG_RESULT([nok])
|
||||||
AC_MSG_ERROR(could not find a fortran compiler)
|
AC_MSG_ERROR([Cannot build fortran executables!!!])
|
||||||
USE_FORTRAN = "no"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "NO, FORTRAN NOT ENABLED"
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
######################## parallel interface enabled ###########################
|
######################## parallel interface enabled ###########################
|
||||||
AC_MSG_CHECKING([if parallel interface enabled])
|
AC_MSG_CHECKING([if parallel interface enabled])
|
||||||
AC_ARG_ENABLE([parallel],
|
|
||||||
[AC_HELP_STRING([--enable-parallel],
|
|
||||||
[Compile the MPI/IO interface [default=no]])],
|
|
||||||
[USE_PARALLEL=$enableval])
|
|
||||||
|
|
||||||
if test "X$USE_PARALLEL" = "Xyes"; then
|
if test "X$USE_PARALLEL" = "Xyes"; then
|
||||||
AC_MSG_RESULT([YES, PARALLEL ENABLED])
|
AC_MSG_RESULT([yes])
|
||||||
|
|
||||||
CFLAGS="${CFLAGS} -DPARALLEL_IO -DH5_HAVE_PARALLEL -DMPICH_IGNORE_CXX_SEEK"
|
CFLAGS="${CFLAGS} -DPARALLEL_IO -DH5_HAVE_PARALLEL -DMPICH_IGNORE_CXX_SEEK"
|
||||||
|
|
||||||
@@ -269,13 +286,15 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
AC_PATH_PROGS([MPICC], [mpicc mpcc_r], [], [$PATH])
|
AC_PATH_PROGS([MPICC], [mpicc mpcc_r], [], [$PATH])
|
||||||
AC_PATH_PROGS([MPICXX], [mpicxx mpcc_r], [], [$PATH])
|
AC_PATH_PROGS([MPICXX], [mpicxx mpcc_r], [], [$PATH])
|
||||||
if test -z "$MPICC" -o -z "$MPICXX"; then
|
if test -z "$MPICC" -o -z "$MPICXX"; then
|
||||||
AC_ARG_WITH([mpipath],
|
AC_MSG_CHECKING([for MPI root ])
|
||||||
[AC_HELP_STRING([--with-mpipath],
|
AC_MSG_RESULT([])
|
||||||
[path to MPI installation [default=""]])],
|
if test -n "$MPIROOT"; then
|
||||||
[MPIROOT=$withval], [MPIROOT=""])
|
P=${MPIROOT}
|
||||||
if test -z "$MPIROOT"; then
|
elif test -n "$MPIHOME"; then
|
||||||
AC_MSG_CHECKING([for MPI root ])
|
P=${MPIHOME}
|
||||||
echo
|
elif test -n "$MPIPATH"; then
|
||||||
|
P=${MPIPATH}
|
||||||
|
else
|
||||||
P=''
|
P=''
|
||||||
P="$P /usr"
|
P="$P /usr"
|
||||||
P="$P /usr/local"
|
P="$P /usr/local"
|
||||||
@@ -284,10 +303,10 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
P="$P /usr/local/mpich2"
|
P="$P /usr/local/mpich2"
|
||||||
P="$P /usr/local/mpich"
|
P="$P /usr/local/mpich"
|
||||||
P="$P /opt/xt-mpt/default/mpich2-64/P2"
|
P="$P /opt/xt-mpt/default/mpich2-64/P2"
|
||||||
PATH_Search MPIROOT "$P" include/mpi.h
|
|
||||||
fi
|
fi
|
||||||
|
PATH_Search MPIROOT "$P" include/mpi.h
|
||||||
if test ! -n "$MPIROOT"; then
|
if test ! -n "$MPIROOT"; then
|
||||||
AC_MSG_RESULT([Cannot determine MPIROOT])
|
AC_MSG_ERROR([Cannot determine MPI root!!!])
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -335,8 +354,6 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
|
|
||||||
# parallel + fortran
|
# parallel + fortran
|
||||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||||
echo "PARALLEL ENABLED WITH FORTRAN"
|
|
||||||
|
|
||||||
AC_PATH_PROGS([MPIFC], [mpxlf_r mpif90], [], [$PATH])
|
AC_PATH_PROGS([MPIFC], [mpxlf_r mpif90], [], [$PATH])
|
||||||
|
|
||||||
if test -z "${MPIFC}" ; then
|
if test -z "${MPIFC}" ; then
|
||||||
@@ -359,97 +376,78 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
MTARGET="${MTARGET} libpH5PartF.a"
|
MTARGET="${MTARGET} libpH5PartF.a"
|
||||||
TTARGET="${TTARGET} H5testFpar"
|
TTARGET="${TTARGET} H5testFpar"
|
||||||
TTARGET="${TTARGET} H5BlockParTestScalarFieldF"
|
TTARGET="${TTARGET} H5BlockParTestScalarFieldF"
|
||||||
else
|
|
||||||
echo "PARALLEL ENABLED WITHOUT FORTRAN"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else # --enable-parallel=no
|
||||||
echo "NO, PARALLEL NOT ENABLED"
|
AC_MSG_RESULT([no])
|
||||||
|
|
||||||
MTARGET="libH5Part.a"
|
MTARGET="libH5Part.a"
|
||||||
TTARGET="H5PartTest H5test"
|
TTARGET="H5PartTest H5test"
|
||||||
TTARGET="${TTARGET} H5BlockTestAttributes"
|
TTARGET="${TTARGET} H5BlockTestAttributes"
|
||||||
|
|
||||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||||
echo "PARALLEL NOT ENABLED WITH FORTRAN ENABLED"
|
|
||||||
|
|
||||||
MTARGET="${MTARGET} libH5PartF.a"
|
MTARGET="${MTARGET} libH5PartF.a"
|
||||||
TTARGET="${TTARGET} H5testF"
|
TTARGET="${TTARGET} H5testF"
|
||||||
TTARGET="${TTARGET} H5BlockTestAttributesF"
|
TTARGET="${TTARGET} H5BlockTestAttributesF"
|
||||||
else
|
|
||||||
echo "BOTH PARALLEL & FORTRAN NOT ENABLED"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([for h5pTools file: ])
|
AC_MSG_CHECKING([wheter tools are enabled])
|
||||||
AC_MSG_RESULT([OK])
|
|
||||||
AC_ARG_ENABLE([tools],
|
|
||||||
[AC_HELP_STRING([--enable-tools], [Compile h5part tools [default=no]])],
|
|
||||||
[USE_TOOLS=$enableval])
|
|
||||||
|
|
||||||
|
|
||||||
if test "X$USE_TOOLS" = "Xyes"; then
|
if test "X$USE_TOOLS" = "Xyes"; then
|
||||||
BUILD_TOOLS="h5pAttrib h5pToGNUplot homdynToH5p"
|
AC_MSG_RESULT([yes])
|
||||||
|
BUILD_TOOLS="h5pAttrib h5pToGNUplot # homdynToH5p"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
######################### PATH CHECKING & SETTING #############################
|
######################### PATH CHECKING & SETTING #############################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
AC_ARG_WITH([hdf5path],
|
AC_MSG_CHECKING([for HDF5 root ])
|
||||||
[AC_HELP_STRING([--with-hdf5path],
|
AC_MSG_RESULT([])
|
||||||
[path to HDF5 installation [default=""]])],
|
if test -n "${HDF5ROOT}"; then
|
||||||
[XROOT=$withval], [XROOT=""])
|
P=${HDF5ROOT}
|
||||||
|
elif test -n "${HDF5HOME}" ; then
|
||||||
|
P=${HDF5HOME}
|
||||||
|
elif test -n "${HDF5PATH}" ; then
|
||||||
|
P=${HDF5PATH}
|
||||||
|
else
|
||||||
|
P=''
|
||||||
|
P="$P /usr"
|
||||||
|
P="$P /usr/local"
|
||||||
|
P="$P /usr/local/hdf5"
|
||||||
|
P="$P /usr/local/packages/hdf5"
|
||||||
|
P="$P /apps/hdf5"
|
||||||
|
|
||||||
HDF5ROOT=$XROOT
|
if test "X$USE_PARALLEL" = "Xyes"; then
|
||||||
|
|
||||||
if test "X$USE_PARALLEL" = "Xyes"; then
|
|
||||||
if test -z "$HDF5ROOT"; then
|
|
||||||
AC_MSG_CHECKING([for Parallel HDF5 root ])
|
|
||||||
AC_MSG_RESULT([])
|
|
||||||
P=''
|
|
||||||
P="$P /usr"
|
|
||||||
P="$P /usr/local"
|
|
||||||
P="$P /usr/local/phdf5"
|
P="$P /usr/local/phdf5"
|
||||||
P="$P /usr/local/hdf5"
|
|
||||||
P="$P /usr/local/packages/hdf5"
|
|
||||||
P="$P /usr/local/hdf5/hdf5_par"
|
P="$P /usr/local/hdf5/hdf5_par"
|
||||||
P="$P /apps/hdf5"
|
|
||||||
|
|
||||||
if test "X$USE_64" = "Xyes"; then
|
if test "X$USE_64" = "Xyes"; then
|
||||||
P="$P /usr/common/usg/hdf5/64/default/parallel"
|
P="$P /usr/common/usg/hdf5/64/default/parallel"
|
||||||
else
|
else
|
||||||
P="$P /usr/common/usg/hdf5/32/default/parallel"
|
P="$P /usr/common/usg/hdf5/32/default/parallel"
|
||||||
fi
|
fi
|
||||||
PATH_Search HDF5ROOT "$P" include/hdf5.h
|
else
|
||||||
XROOT=$HDF5ROOT
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if test -z "$HDF5ROOT"; then
|
|
||||||
AC_MSG_CHECKING([for HDF5 library location ])
|
|
||||||
AC_MSG_RESULT([])
|
|
||||||
P=''
|
|
||||||
P="$P /usr"
|
|
||||||
P="$P /usr/local"
|
|
||||||
P="$P /usr/local/hdf5"
|
|
||||||
P="$P /usr/local/packages/hdf5"
|
|
||||||
P="$P /usr/local/hdf5/hdf5_serial"
|
P="$P /usr/local/hdf5/hdf5_serial"
|
||||||
P="$P /apps/hdf5"
|
|
||||||
if test "X$USE_64" = "Xyes"; then
|
if test "X$USE_64" = "Xyes"; then
|
||||||
P="$P /usr/common/usg/hdf5/64/default/serial"
|
P="$P /usr/common/usg/hdf5/64/default/serial"
|
||||||
else
|
else
|
||||||
P="$P /usr/common/usg/hdf5/32/default/serial"
|
P="$P /usr/common/usg/hdf5/32/default/serial"
|
||||||
fi
|
fi
|
||||||
PATH_Search HDF5ROOT "$P" include/hdf5.h
|
|
||||||
XROOT=$HDF5ROOT
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
PATH_Search HDF5ROOT "$P" include/hdf5.h
|
||||||
|
if test -z "$HDF5ROOT"; then
|
||||||
|
AC_MSG_ERROR([Cannot determine HDF5 root!!!])
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([if we need to link to libsz ])
|
AC_MSG_CHECKING([if we need to link to libsz ])
|
||||||
if test -n "$XROOT"; then
|
if test -n "$HDF5ROOT"; then
|
||||||
if test -f $XROOT/lib/libsz.a; then
|
if test -f $HDF5ROOT/lib/libsz.a; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
SZLIB="-L$XROOT/lib/ -lsz"
|
SZLIB="-L$HDF5ROOT/lib/ -lsz"
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
SZLIB=""
|
SZLIB=""
|
||||||
@@ -468,14 +466,6 @@ fi
|
|||||||
#################### MISC SETTINGS - path, flags, etc #########################
|
#################### MISC SETTINGS - path, flags, etc #########################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# if not AIX
|
|
||||||
if test ! $uname = "AIX"; then
|
|
||||||
# Additional flags
|
|
||||||
echo "SETTING ADDITIONAL FLAGS"
|
|
||||||
ADDFLAGS="-fPIC -fno-second-underscore"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
H5P_LIB_LOC=`pwd`/src
|
H5P_LIB_LOC=`pwd`/src
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -545,36 +535,6 @@ TOOLS_H5PART_LIB="-lH5Part"
|
|||||||
TOOLS_HDFLIB="-L$HDF5ROOT/lib -lhdf5"
|
TOOLS_HDFLIB="-L$HDF5ROOT/lib -lhdf5"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
########################## PRINTING SUMMARY ###################################
|
|
||||||
###############################################################################
|
|
||||||
echo "+++++++++++++++++++++++++++++++"
|
|
||||||
echo "+++++++++ SUMMARY for `(hostname || uname -n) 2>/dev/null | sed 1q` +++++++++"
|
|
||||||
echo "CC = $CC"
|
|
||||||
echo "CXX = $CXX"
|
|
||||||
echo "FC = $FC"
|
|
||||||
echo "MPICC = $MPICC"
|
|
||||||
echo "MPICXX = $MPICXX"
|
|
||||||
echo "MPIFC = $MPIFC"
|
|
||||||
echo "CFLAGS = $CFLAGS"
|
|
||||||
echo "FFLAGS = $FFLAGS"
|
|
||||||
echo "MPILIB = $MPILIB"
|
|
||||||
echo "MPIINC = $MPIINC"
|
|
||||||
echo "MPIROOT = $MPIROOT"
|
|
||||||
echo "HDF5ROOT = $HDF5ROOT"
|
|
||||||
echo "LDFLAGS = $LDFLAGS"
|
|
||||||
echo "host_os = $host_os"
|
|
||||||
echo "host_cpu = $host_cpu"
|
|
||||||
echo "host_vendor = $host_vendor"
|
|
||||||
echo "Will Be Building Libraries ... : $MTARGET"
|
|
||||||
echo "Will Be Building Test Programs ... : $TTARGET"
|
|
||||||
echo "TOOLS_CXX = $TOOLS_CXX"
|
|
||||||
echo "TOOLS_H5PART_LIB = $TOOLS_H5PART_LIB"
|
|
||||||
echo "TOOLS_HDFLIB = $TOOLS_HDFLIB"
|
|
||||||
echo "BUILD_TOOLS = $BUILD_TOOLS"
|
|
||||||
echo "+++++++++++++++++++++++++++++++"
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
|
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -597,7 +557,6 @@ AC_SUBST(TTARGET)
|
|||||||
AC_SUBST(SZLIB)
|
AC_SUBST(SZLIB)
|
||||||
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
AC_SUBST(FFLAGS)
|
AC_SUBST(FFLAGS)
|
||||||
AC_SUBST(ADDFLAGS)
|
|
||||||
AC_SUBST(STDCXX)
|
AC_SUBST(STDCXX)
|
||||||
AC_SUBST(H5P_LIB_LOC)
|
AC_SUBST(H5P_LIB_LOC)
|
||||||
AC_SUBST(UNDERSCORE_H)
|
AC_SUBST(UNDERSCORE_H)
|
||||||
@@ -617,5 +576,32 @@ test/Makefile
|
|||||||
tools/Makefile
|
tools/Makefile
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
########################## PRINTING SUMMARY ###################################
|
||||||
|
###############################################################################
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo "Summary for `(hostname || uname -n) 2>/dev/null | sed 1q`:"
|
||||||
|
echo
|
||||||
|
echo "Host OS: $host_os"
|
||||||
|
echo "Host CPU: $host_cpu"
|
||||||
|
echo "Host vendor: $host_vendor"
|
||||||
|
echo "Build libraries: $MTARGET"
|
||||||
|
echo "Build test programs: $TTARGET"
|
||||||
|
echo "Build tools: $BUILD_TOOLS"
|
||||||
|
echo "CC = $CC"
|
||||||
|
echo "CXX = $CXX"
|
||||||
|
echo "FC = $FC"
|
||||||
|
echo "MPICC = $MPICC"
|
||||||
|
echo "MPICXX = $MPICXX"
|
||||||
|
echo "MPIFC = $MPIFC"
|
||||||
|
echo "CFLAGS = $CFLAGS"
|
||||||
|
echo "FFLAGS = $FFLAGS"
|
||||||
|
echo "MPILIB = $MPILIB"
|
||||||
|
echo "MPIINC = $MPIINC"
|
||||||
|
echo "MPIROOT = $MPIROOT"
|
||||||
|
echo "HDF5ROOT = $HDF5ROOT"
|
||||||
|
echo "LDFLAGS = $LDFLAGS"
|
||||||
|
echo
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
<meta name="keywords" content="scientific visualization">
|
<meta name="keywords" content="scientific visualization">
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +13,7 @@
|
|||||||
<title>Building HDF5</title>
|
<title>Building HDF5</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body bgcolor="#F0F0F0">
|
<body>
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
|
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><a href="#ConfigOptions">Configure Options</a>
|
<LI><a href="#ConfigOptions">Configure Options</a>
|
||||||
@@ -64,5 +62,3 @@ source .tcshr (.cshrc, .bashrc) in the one that you are using.
|
|||||||
|
|
||||||
You can <a href="http://vis.lbl.gov/Research/AcceleratorSAPP/Downloading.html">continue <a/>downloading and installing H5Part.
|
You can <a href="http://vis.lbl.gov/Research/AcceleratorSAPP/Downloading.html">continue <a/>downloading and installing H5Part.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|||||||
+12
-25
@@ -6,14 +6,12 @@
|
|||||||
<meta name="keywords" content="scientific visualization">
|
<meta name="keywords" content="scientific visualization">
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
<head>
|
<head>
|
||||||
<title>Downloading HDF5 and H5Part</title>
|
<title>Downloading HDF5 and H5Part</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="#F0F0F0">
|
<body>
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>Downloading H5Part</h2></font>
|
<font face="arial,helvetica" size="+2" color="#555588"><h2>Downloading H5Part</h2></font>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><a href="#hdf5">Downloading HDF5</a>
|
<LI><a href="#hdf5">Downloading HDF5</a>
|
||||||
@@ -23,28 +21,17 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<a name="hdf5">
|
<a name="hdf5">
|
||||||
<h2>Downloading HDF5</h2></a>
|
<h2>Downloading HDF5</h2></a>
|
||||||
You will need to download and install the hdf5 library and link H5Part with it.
|
You will need to download and install the HDF5 library and link H5Part with it.
|
||||||
<pre>
|
<UL>
|
||||||
ftp ftp.ncsa.uiuc.edu
|
<LI><a href="ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-1.6.5.tar.gz">ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-1.6.5.tar.gz</a></LI>
|
||||||
username: anonymous
|
<LI><a href="http://www.zlib.net/zlib-1.2.3.tar.gz">http://www.zlib.net/zlib-1.2.3.tar.gz</a></LI>
|
||||||
password: your email
|
<LI><a href="ftp://ftp.hdfgroup.org/lib-external/szip/2.0/src/szip-2.0.tar.gz">ftp://ftp.hdfgroup.org/lib-external/szip/2.0/src/szib-2.0.tar.gz</a></LI>
|
||||||
cd HDF/HDF5/current/src
|
</UL>
|
||||||
ls
|
<P>
|
||||||
get hdf5-1.6.5.tar.gz (get the current version, this as the one on April 20th, 2006)
|
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
|
||||||
cd szip/src
|
</P>
|
||||||
ls
|
|
||||||
get szip-2.0.tar.gz (get the current version, this as the one on April 20th, 2006)
|
|
||||||
cd ../../
|
|
||||||
cd zlib/1.2/src
|
|
||||||
ls
|
|
||||||
get zlib-1.2.1.tar.gz (get the current version, this as the one on April 20th, 2006)
|
|
||||||
</pre>
|
|
||||||
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
|
|
||||||
|
|
||||||
<a name="hpart">
|
<h2 id="h5part">Downloading H5Part</h2>
|
||||||
<h2>Downloading H5Part</h2></a>
|
H5Part is available for download from Berkeley Labs Codeforge system <a href="https://codeforge.lbl.gov/projects/h5part/">https://codeforge.lbl.gov/projects/h5part</a>.
|
||||||
Please contact <address><a href="mailto:andreas.adelmann@psi.ch">Andreas Adelmann</a></address>.
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
PROJECT_NAME = H5Part
|
PROJECT_NAME = H5Part
|
||||||
PROJECT_NUMBER = 1.3.1
|
PROJECT_NUMBER = 1.3.3
|
||||||
OUTPUT_DIRECTORY = ./ReferencePages
|
OUTPUT_DIRECTORY = ./ReferencePages
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
<meta name="keywords" content="scientific visualization">
|
<meta name="keywords" content="scientific visualization">
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +13,7 @@
|
|||||||
<title>H5Part Utility Tools</title>
|
<title>H5Part Utility Tools</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body bgcolor="#F0F0F0">
|
<body>
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>H5Part Utility Tools</h2></font>
|
<font face="arial,helvetica" size="+2" color="#555588"><h2>H5Part Utility Tools</h2></font>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><a href="h5pAttrib">h5pAttrib</a>
|
<LI><a href="h5pAttrib">h5pAttrib</a>
|
||||||
@@ -94,6 +92,3 @@ usage: h5pToGNUplot -t TIMESTEP -1 VARIABLE#1 -2 VARIABLE#2 -i INPUTFILE [OPTION
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
Proposal for a more general file format used by H5Part/H5Block
|
||||||
|
|
||||||
|
Authors: Achim Gsell
|
||||||
|
Status: Draft
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
H5X is the file format used by H5Part and H5Block. H5X is designed on
|
||||||
|
top of HDF5: A H5X file is a very special HDF5 file.
|
||||||
|
|
||||||
|
+--------------------+
|
||||||
|
| Application |
|
||||||
|
+--------------------+
|
||||||
|
| H5Part/H5Block API |
|
||||||
|
+--------------------+
|
||||||
|
| H5X API |
|
||||||
|
+--------------------+
|
||||||
|
| HDF5 API |
|
||||||
|
+--------------------+
|
||||||
|
| Filesystem of OS |
|
||||||
|
+--------------------+
|
||||||
|
|
||||||
|
|
||||||
|
2. H5X file format specification
|
||||||
|
|
||||||
|
2.1 The root group
|
||||||
|
|
||||||
|
2.1.1 File attributes
|
||||||
|
|
||||||
|
Attributes of the HDF5 root group are called "file attributes". There
|
||||||
|
are no restrictions on file attribute names. Supported values are
|
||||||
|
scalars and arrays of 64bit integer and 64bit floating point number as
|
||||||
|
well as string values, but not arrays of strings.
|
||||||
|
|
||||||
|
2.1.1.1 Predefined file attributes
|
||||||
|
|
||||||
|
__stepname__ (optional)
|
||||||
|
See below.
|
||||||
|
|
||||||
|
__stepnumwidth__ (optional)
|
||||||
|
See below.
|
||||||
|
|
||||||
|
2.1.2 Members of the root group
|
||||||
|
|
||||||
|
Members of the root group are special formated HDF5 groups called
|
||||||
|
"step groups". The name of a step group is "<name>#<number>".
|
||||||
|
Whereby <name> is either defined by the optional file attribute
|
||||||
|
__stepname__ or set to "Step" by default. <number> is an
|
||||||
|
unsigned integer less than 2^63.
|
||||||
|
|
||||||
|
/
|
||||||
|
+- Step#0
|
||||||
|
+- Step#1
|
||||||
|
...
|
||||||
|
+- Step#n
|
||||||
|
+- StepProperties [NEW]
|
||||||
|
+- Mesh [NEW]
|
||||||
|
|
||||||
|
The optional file attribute __stepnumwidth__ defines the minimum width
|
||||||
|
of <number> in the name of the step group. The number is padded with
|
||||||
|
'0'. The minimum width defaults to zero, so that no paddings occurs.
|
||||||
|
Example: With __stepnumwidth__ := 5 the name of the step group with
|
||||||
|
number 42 is "Step#00042", with __stepnumwidth__ := 0 the name is
|
||||||
|
"Step#42".
|
||||||
|
|
||||||
|
Step groups may be unsorted in the HDF5 file und may not be number
|
||||||
|
consecutively.
|
||||||
|
|
||||||
|
|
||||||
|
2.2 Format of a step group
|
||||||
|
|
||||||
|
2.2.1 Step attributes
|
||||||
|
|
||||||
|
Step attributes are HDF5 attributes asigned to a step group. There
|
||||||
|
are no restrictions on file attribute names. Supported values are
|
||||||
|
scalars and arrays of 64bit integer and 64bit floating point number as
|
||||||
|
well as string values, but not arrays of strings.
|
||||||
|
|
||||||
|
2.2.2 Predefined step attributes
|
||||||
|
|
||||||
|
No predefined step attributes exists.
|
||||||
|
|
||||||
|
|
||||||
|
2.2.3 Members of a step group
|
||||||
|
|
||||||
|
Members of a step group are HDF5 datasets and optional one HDF5 group
|
||||||
|
with the name "Block". HDF5 datasets in a step group are called "step
|
||||||
|
datasets". The optional block group is called "block data".
|
||||||
|
|
||||||
|
Mesh?!
|
||||||
|
|
||||||
|
2.2.4 Step datasets
|
||||||
|
|
||||||
|
Step datasets are arrays of rank 1. The dataset size must be the same
|
||||||
|
for all datasets inside a step. The size of the dataset may vary
|
||||||
|
from step to step. Array values are 64bit integer or 64bit floating
|
||||||
|
point numbers. No limitations (other than given by HDF5) are given on
|
||||||
|
step dataset names.
|
||||||
|
|
||||||
|
|
||||||
|
2.2.5 Block Data
|
||||||
|
|
||||||
|
The block data group is a container for an arbitrary number of field
|
||||||
|
data. A field is a data structure to store arrays of rank m with
|
||||||
|
n-dimensional vector values. Fields are represented within HDF5
|
||||||
|
groups. The HDF5 group name is the unique identifier for a field in
|
||||||
|
the current step.
|
||||||
|
|
||||||
|
2.2.5.1 m-rank fields with n-dimensional-vector values
|
||||||
|
|
||||||
|
Values are stored per dimension in separate datasets. Thus we have n
|
||||||
|
datasets for a field with n-dimensional vector values. Each dataset
|
||||||
|
corresponse to one dimension. The datasets are numbered from '0' to
|
||||||
|
'n-1'. Arrays are stored in column major order (Fortran indexing
|
||||||
|
scheme).
|
||||||
|
|
||||||
|
/ # HDF5 root group
|
||||||
|
...
|
||||||
|
+- Step#<i> # HDF5 group
|
||||||
|
|
|
||||||
|
+- Block # HDF5 group
|
||||||
|
|
|
||||||
|
+- <field name> # HDF5 group
|
||||||
|
|
|
||||||
|
+- 0 # HDF5 dataset, first dim of vector
|
||||||
|
+- 1 # HDF5 dataset, second dim of vector
|
||||||
|
...
|
||||||
|
+- n-1 # HDF5 dataset, last dim of vector
|
||||||
|
...
|
||||||
|
|
||||||
|
2.2.5.2 m-rank fields with scalar values
|
||||||
|
|
||||||
|
Fields with scalar values are stored as special case of fields with
|
||||||
|
n-dimensional vector values with n := 1.
|
||||||
|
|
||||||
|
/ # HDF5 root group
|
||||||
|
...
|
||||||
|
+- Step#<i> # HDF5 group
|
||||||
|
|
|
||||||
|
+- Block # HDF5 group
|
||||||
|
|
|
||||||
|
+- <field name> # HDF5 group
|
||||||
|
|
|
||||||
|
+- 0 # HDF5 dataset, scalar value
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
2.3 Step properties [NEW]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
<meta name="keywords" content="scientific visualization">
|
<meta name="keywords" content="scientific visualization">
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
|
|
||||||
<h1>The C/C++ Application Programming Interface (API)</h1>
|
<h1>The C/C++ Application Programming Interface (API)</h1>
|
||||||
@@ -603,4 +601,3 @@ if (H5PartReadStepAttrib(file, "filename", &name[0]) == 1){
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
<meta name="keywords" content="scientific visualization">
|
<meta name="keywords" content="scientific visualization">
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
|
|
||||||
|
|
||||||
@@ -500,5 +498,3 @@ err=h5pt_readstepattrib(file,"RealTime",data)
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|||||||
+6
-6
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<div id="maincenter">
|
<div id="maincenter">
|
||||||
<font face="arial,helvetica"><h1>H5Part: a Portable High Performance Parallel Data Interface to HDF5</h1></font>
|
<font face="arial,helvetica"><h1>H5Part: a Portable High Performance Parallel Data Interface to HDF5</h1></font>
|
||||||
<h2><font color="red"> THESE PAGES ARE UNDER CONSTRUCTION, September 2006</h2></font>
|
<!--<h2><font color="red"> THESE PAGES ARE UNDER CONSTRUCTION, September 2006</h2></font>-->
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Motivation</h2></font>
|
<font face="arial,helvetica" color="#555588"><h2>Motivation</h2></font>
|
||||||
<P>
|
<P>
|
||||||
<TABLE>
|
<TABLE>
|
||||||
@@ -105,17 +105,17 @@ of datasets that contain multiple fields.
|
|||||||
<LI><a href="UsingF.html">Using the F77/F90 interface</a>
|
<LI><a href="UsingF.html">Using the F77/F90 interface</a>
|
||||||
<LI><a href="InternalLayout.html">Logical Internal HDF5 File</a>
|
<LI><a href="InternalLayout.html">Logical Internal HDF5 File</a>
|
||||||
<LI><a href="H5PartTools.html">H5Part Utility Tools</a>
|
<LI><a href="H5PartTools.html">H5Part Utility Tools</a>
|
||||||
<LI><a href="ReferencePages/index.html">Reference Manual</a>
|
<LI><a href="ReferencePages/index.html">Reference Manual</a> (Note: Requires doxygen
|
||||||
|
to be run in the directory /doc)
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>H5Part Visualization Tools</h2></font>
|
<font face="arial,helvetica" color="#555588"><h2>H5Part Visualization Tools</h2></font>
|
||||||
<UL>
|
<UL>
|
||||||
<LI><a href="H5PartExpress.html">H5Part Express Reader</a>
|
<!--<LI><a href="H5PartExpress.html">H5Part Express Reader</a>-->
|
||||||
<LI><a href="H5PartVisIt.html">H5Part VisIt Reader</a>
|
<LI><a href="H5PartVisIt.html">H5Part VisIt Reader</a>
|
||||||
<LI><a href="H5PartIDL.html">H5Part IDL Reader</a>
|
<!--<LI><a href="H5PartIDL.html">H5Part IDL Reader</a>-->
|
||||||
<LI><a href="http://www.cscs.ch/a-display.php?id=170">H5Part sparticles Reader: developed at CSCS, Switzerland</a>
|
<LI><a href="http://www.cscs.ch/a-display.php?id=170">H5Part sparticles Reader: developed at CSCS, Switzerland</a>
|
||||||
|
<LI><a href="http://vis.lbl.gov/Vignettes/PartView/index.html">PartView Visualization Application</a>
|
||||||
<LI><a href="H5PartPartView.html">PartView Visualization Application</a>
|
|
||||||
</UL>
|
</UL>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+198
-190
@@ -7,19 +7,40 @@ analysis needs to be preserved, reading and writing such enormous
|
|||||||
restart files on massively parallel supercomputing systems remains
|
restart files on massively parallel supercomputing systems remains
|
||||||
challenging.
|
challenging.
|
||||||
|
|
||||||
H5Part consists of Particles, Block structured Fields and unstructured
|
H5Part consists of Particles and Block structured Fields.
|
||||||
data (Topo).
|
|
||||||
|
|
||||||
Developed by .
|
Developed by:
|
||||||
|
|
||||||
For further information contact: <a href="mailto:xxxxx">xxxxxx</a> -
|
<UL>
|
||||||
xxxx xxxxx, (xxx) xxx.
|
<LI> Andreas Adelmann (PSI) </LI>
|
||||||
|
<LI> Achim Gsell (PSI) </LI>
|
||||||
|
<LI> Benedikt Oswald (PSI) </LI>
|
||||||
|
|
||||||
|
<LI> Wes Bethel (NERSC/LBNL)</LI>
|
||||||
|
<LI> John Shalf (NERSC/LBNL)</LI>
|
||||||
|
<LI> Cristina Siegerist (NERSC/LBNL)</LI>
|
||||||
|
</UL>
|
||||||
|
|
||||||
Last modified on xxx xx, 2006.
|
|
||||||
|
|
||||||
Papers:
|
Papers:
|
||||||
|
|
||||||
<a href="http://www-vis.lbl.gov/Research/AcceleratorSAPP/index.html">LBNL Vis Group </a><br>
|
<UL>
|
||||||
|
<LI> A. Adelmann, R.D. Ryne, C. Siegerist, J. Shalf,"From Visualization to Data Mining with Large Data Sets," <i>
|
||||||
|
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005. (LBNL-57603)
|
||||||
|
<a href="http://vis.lbl.gov/Publications/2005/FPAT082.pdf">FPAT082.pdf</a>
|
||||||
|
</LI>
|
||||||
|
|
||||||
|
|
||||||
|
<LI> A. Adelmann, R.D. Ryne, J. Shalf, C. Siegerist,"H5Part: A Portable High Performance Parallel Data Interface for Particle Simulations," <i>
|
||||||
|
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005.
|
||||||
|
<a href="http://vis.lbl.gov/Publications/2005/FPAT083.pdf">FPAT083.pdf</a>
|
||||||
|
</LI>
|
||||||
|
</UL>
|
||||||
|
|
||||||
|
For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
|
||||||
|
|
||||||
|
Last modified on April 19, 2007.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -93,36 +114,13 @@ _h5_error_handler (
|
|||||||
|
|
||||||
/*========== File Opening/Closing ===============*/
|
/*========== File Opening/Closing ===============*/
|
||||||
|
|
||||||
/*!
|
static H5PartFile*
|
||||||
\ingroup h5part_openclose
|
_H5Part_open_file (
|
||||||
|
|
||||||
Opens file with specified filename.
|
|
||||||
|
|
||||||
If you open with flag \c H5PART_WRITE, it will truncate any
|
|
||||||
file with the specified filename and start writing to it. If
|
|
||||||
you open with \c H5PART_APPEND, then you can append new timesteps.
|
|
||||||
If you open with \c H5PART_READ, then it will open the file
|
|
||||||
readonly.
|
|
||||||
|
|
||||||
The typical extension for these files is \c .h5.
|
|
||||||
|
|
||||||
H5PartFile should be treated as an essentially opaque
|
|
||||||
datastructure. It acts as the file handle, but internally
|
|
||||||
it maintains several key state variables associated with
|
|
||||||
the file.
|
|
||||||
|
|
||||||
\return File handle or \c NULL
|
|
||||||
*/
|
|
||||||
H5PartFile*
|
|
||||||
H5PartOpenFileParallel (
|
|
||||||
const char *filename, /*!< [in] The name of the data file to open. */
|
const char *filename, /*!< [in] The name of the data file to open. */
|
||||||
unsigned flags /*!< [in] The access mode for the file. */
|
unsigned flags, /*!< [in] The access mode for the file. */
|
||||||
#ifdef PARALLEL_IO
|
MPI_Comm comm, /*!< [in] MPI communicator */
|
||||||
,MPI_Comm comm /*!< [in] MPI communicator */
|
int f_parallel /*!< [in] 0 for serial io otherwise parallel */
|
||||||
#endif
|
) {
|
||||||
) {
|
|
||||||
SET_FNAME ( "H5PartOpenFileParallel" );
|
|
||||||
|
|
||||||
if ( _init() < 0 ) {
|
if ( _init() < 0 ) {
|
||||||
HANDLE_H5PART_INIT_ERR;
|
HANDLE_H5PART_INIT_ERR;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -136,57 +134,71 @@ H5PartOpenFileParallel (
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
memset (f, 0, sizeof (H5PartFile));
|
memset (f, 0, sizeof (H5PartFile));
|
||||||
f->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
f->groupname_step = strdup ( H5PART_GROUPNAME_STEP );
|
||||||
/* for the SP2... perhaps different for linux */
|
if( f->groupname_step == NULL ) {
|
||||||
MPI_Info info = MPI_INFO_NULL;
|
|
||||||
|
|
||||||
if (MPI_Comm_size (comm, &f->nprocs) != MPI_SUCCESS) {
|
|
||||||
HANDLE_MPI_COMM_SIZE_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
if (MPI_Comm_rank (comm, &f->myproc) != MPI_SUCCESS) {
|
|
||||||
HANDLE_MPI_COMM_RANK_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
f->pnparticles = malloc (f->nprocs * sizeof (h5part_int64_t));
|
|
||||||
if (f->pnparticles == NULL) {
|
|
||||||
HANDLE_H5PART_NOMEM_ERR;
|
HANDLE_H5PART_NOMEM_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
f->stepno_width = 0;
|
||||||
|
|
||||||
f->access_prop = H5Pcreate (H5P_FILE_ACCESS);
|
f->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
||||||
if (f->access_prop < 0) {
|
|
||||||
HANDLE_H5P_CREATE_ERR;
|
#ifdef PARALLEL_IO
|
||||||
goto error_cleanup;
|
if ( f_parallel ) {
|
||||||
|
/* for the SP2... perhaps different for linux */
|
||||||
|
MPI_Info info = MPI_INFO_NULL;
|
||||||
|
|
||||||
|
if (MPI_Comm_size (comm, &f->nprocs) != MPI_SUCCESS) {
|
||||||
|
HANDLE_MPI_COMM_SIZE_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
if (MPI_Comm_rank (comm, &f->myproc) != MPI_SUCCESS) {
|
||||||
|
HANDLE_MPI_COMM_RANK_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
f->pnparticles = malloc (f->nprocs * sizeof (h5part_int64_t));
|
||||||
|
if (f->pnparticles == NULL) {
|
||||||
|
HANDLE_H5PART_NOMEM_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
f->access_prop = H5Pcreate (H5P_FILE_ACCESS);
|
||||||
|
if (f->access_prop < 0) {
|
||||||
|
HANDLE_H5P_CREATE_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
||||||
|
HANDLE_H5P_SET_FAPL_MPIO_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* f->create_prop = H5Pcreate(H5P_FILE_CREATE); */
|
||||||
|
f->create_prop = H5P_DEFAULT;
|
||||||
|
|
||||||
|
/* currently create_prop is empty */
|
||||||
|
/* xfer_prop: also used for parallel I/O, during actual writes
|
||||||
|
rather than the access_prop which is for file creation. */
|
||||||
|
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
||||||
|
if (f->xfer_prop < 0) {
|
||||||
|
HANDLE_H5P_CREATE_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (H5Pset_dxpl_mpio (f->xfer_prop,H5FD_MPIO_COLLECTIVE) < 0) {
|
||||||
|
HANDLE_H5P_SET_DXPL_MPIO_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
f->comm = comm;
|
||||||
|
} else {
|
||||||
|
f->pnparticles = 0;
|
||||||
|
f->comm = MPI_COMM_WORLD;
|
||||||
|
f->nprocs = 1;
|
||||||
|
f->myproc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
|
||||||
HANDLE_H5P_SET_FAPL_MPIO_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create_prop: tunable parameters like blocksize and btree sizes */
|
|
||||||
/* f->create_prop = H5Pcreate(H5P_FILE_CREATE); */
|
|
||||||
f->create_prop = H5P_DEFAULT;
|
|
||||||
|
|
||||||
/* currently create_prop is empty */
|
|
||||||
/* xfer_prop: also used for parallel I/O, during actual writes
|
|
||||||
rather than the access_prop which is for file creation. */
|
|
||||||
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
|
||||||
if (f->xfer_prop < 0) {
|
|
||||||
HANDLE_H5P_CREATE_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (H5Pset_dxpl_mpio (f->xfer_prop, H5FD_MPIO_COLLECTIVE) < 0) {
|
|
||||||
HANDLE_H5P_SET_DXPL_MPIO_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
f->comm = comm;
|
|
||||||
#endif
|
#endif
|
||||||
if ( flags == H5PART_READ ) {
|
if ( flags == H5PART_READ ) {
|
||||||
f->file = H5Fopen (filename, H5F_ACC_RDONLY, f->access_prop);
|
f->file = H5Fopen (filename, H5F_ACC_RDONLY, f->access_prop);
|
||||||
@@ -194,12 +206,14 @@ H5PartOpenFileParallel (
|
|||||||
else if ( flags == H5PART_WRITE ){
|
else if ( flags == H5PART_WRITE ){
|
||||||
f->file = H5Fcreate (filename, H5F_ACC_TRUNC, f->create_prop,
|
f->file = H5Fcreate (filename, H5F_ACC_TRUNC, f->create_prop,
|
||||||
f->access_prop);
|
f->access_prop);
|
||||||
|
f->empty = 1;
|
||||||
}
|
}
|
||||||
else if ( flags == H5PART_APPEND ) {
|
else if ( flags == H5PART_APPEND ) {
|
||||||
int fd = open (filename, O_RDONLY, 0);
|
int fd = open (filename, O_RDONLY, 0);
|
||||||
if ( (fd == -1) && (errno == ENOENT) ) {
|
if ( (fd == -1) && (errno == ENOENT) ) {
|
||||||
f->file = H5Fcreate(filename, H5F_ACC_TRUNC,
|
f->file = H5Fcreate(filename, H5F_ACC_TRUNC,
|
||||||
f->create_prop, f->access_prop);
|
f->create_prop, f->access_prop);
|
||||||
|
f->empty = 1;
|
||||||
}
|
}
|
||||||
else if (fd != -1) {
|
else if (fd != -1) {
|
||||||
close (fd);
|
close (fd);
|
||||||
@@ -210,7 +224,7 @@ H5PartOpenFileParallel (
|
|||||||
if f->file < 0. But we can safely ignore this.
|
if f->file < 0. But we can safely ignore this.
|
||||||
*/
|
*/
|
||||||
f->timestep = _H5Part_get_num_objects_matching_pattern(
|
f->timestep = _H5Part_get_num_objects_matching_pattern(
|
||||||
f->file, "/", H5G_GROUP, H5PART_GROUPNAME_STEP );
|
f->file, "/", H5G_GROUP, f->groupname_step );
|
||||||
if ( f->timestep < 0 ) goto error_cleanup;
|
if ( f->timestep < 0 ) goto error_cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,6 +255,9 @@ H5PartOpenFileParallel (
|
|||||||
|
|
||||||
error_cleanup:
|
error_cleanup:
|
||||||
if (f != NULL ) {
|
if (f != NULL ) {
|
||||||
|
if (f->groupname_step) {
|
||||||
|
free (f->groupname_step);
|
||||||
|
}
|
||||||
if (f->pnparticles != NULL) {
|
if (f->pnparticles != NULL) {
|
||||||
free (f->pnparticles);
|
free (f->pnparticles);
|
||||||
}
|
}
|
||||||
@@ -249,6 +266,39 @@ H5PartOpenFileParallel (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_openclose
|
||||||
|
|
||||||
|
Opens file with specified filename.
|
||||||
|
|
||||||
|
If you open with flag \c H5PART_WRITE, it will truncate any
|
||||||
|
file with the specified filename and start writing to it. If
|
||||||
|
you open with \c H5PART_APPEND, then you can append new timesteps.
|
||||||
|
If you open with \c H5PART_READ, then it will open the file
|
||||||
|
readonly.
|
||||||
|
|
||||||
|
The typical extension for these files is \c .h5.
|
||||||
|
|
||||||
|
H5PartFile should be treated as an essentially opaque
|
||||||
|
datastructure. It acts as the file handle, but internally
|
||||||
|
it maintains several key state variables associated with
|
||||||
|
the file.
|
||||||
|
|
||||||
|
\return File handle or \c NULL
|
||||||
|
*/
|
||||||
|
H5PartFile*
|
||||||
|
H5PartOpenFileParallel (
|
||||||
|
const char *filename, /*!< [in] The name of the data file to open. */
|
||||||
|
unsigned flags, /*!< [in] The access mode for the file. */
|
||||||
|
MPI_Comm comm /*!< [in] MPI communicator */
|
||||||
|
) {
|
||||||
|
int f_parallel = 1; /* parallel i/o */
|
||||||
|
|
||||||
|
return _H5Part_open_file ( filename, flags, comm, f_parallel );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5part_openclose
|
\ingroup h5part_openclose
|
||||||
|
|
||||||
@@ -277,87 +327,11 @@ H5PartOpenFile (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
SET_FNAME ( "H5PartOpenFile" );
|
SET_FNAME ( "H5PartOpenFile" );
|
||||||
if ( _init() < 0 ) {
|
|
||||||
HANDLE_H5PART_INIT_ERR;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_errno = H5PART_SUCCESS;
|
MPI_Comm comm = 0; /* dummy */
|
||||||
H5PartFile *f = NULL;
|
int f_parallel = 0; /* serial open */
|
||||||
|
|
||||||
f = (H5PartFile*) malloc( sizeof (H5PartFile) );
|
return _H5Part_open_file ( filename, flags, comm, f_parallel );
|
||||||
if( f == NULL ) {
|
|
||||||
HANDLE_H5PART_NOMEM_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
memset (f, 0, sizeof (H5PartFile));
|
|
||||||
f->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
|
||||||
f->pnparticles = 0;
|
|
||||||
f->comm = MPI_COMM_WORLD;
|
|
||||||
f->nprocs = 1;
|
|
||||||
f->myproc = 0;
|
|
||||||
#endif
|
|
||||||
if (flags == H5PART_READ) {
|
|
||||||
f->file = H5Fopen (filename, H5F_ACC_RDONLY, f->access_prop);
|
|
||||||
}
|
|
||||||
else if (flags == H5PART_WRITE){
|
|
||||||
f->file = H5Fcreate (filename, H5F_ACC_TRUNC, f->create_prop,
|
|
||||||
f->access_prop);
|
|
||||||
}
|
|
||||||
else if (flags == H5PART_APPEND) {
|
|
||||||
int fd = open (filename, O_RDONLY, 0);
|
|
||||||
if ( (fd == -1) && (errno == ENOENT) ) {
|
|
||||||
f->file = H5Fcreate(filename, H5F_ACC_TRUNC,
|
|
||||||
f->create_prop, f->access_prop);
|
|
||||||
}
|
|
||||||
else if (fd != -1) {
|
|
||||||
close (fd);
|
|
||||||
f->file = H5Fopen (filename, H5F_ACC_RDWR,
|
|
||||||
f->access_prop);
|
|
||||||
/*
|
|
||||||
The following function call returns an error,
|
|
||||||
if f->file < 0. But we can safely ignore it
|
|
||||||
*/
|
|
||||||
f->timestep = _H5Part_get_num_objects_matching_pattern(
|
|
||||||
f->file, "/", H5G_GROUP, H5PART_GROUPNAME_STEP );
|
|
||||||
if ( f->timestep < 0 ) goto error_cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
HANDLE_H5PART_FILE_ACCESS_TYPE_ERR ( flags );
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f->file < 0) {
|
|
||||||
HANDLE_H5F_OPEN_ERR ( filename, flags );
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
f->mode = flags;
|
|
||||||
f->timegroup = -1;
|
|
||||||
f->shape = 0;
|
|
||||||
f->diskshape = H5S_ALL;
|
|
||||||
f->memshape = H5S_ALL;
|
|
||||||
f->viewstart = -1;
|
|
||||||
f->viewend = -1;
|
|
||||||
|
|
||||||
_H5Part_print_debug (
|
|
||||||
"Opened file \"%s\" val=%lld",
|
|
||||||
filename,
|
|
||||||
(long long)(size_t)f );
|
|
||||||
|
|
||||||
return f;
|
|
||||||
|
|
||||||
error_cleanup:
|
|
||||||
if (f != NULL ) {
|
|
||||||
if (f->pnparticles != NULL) {
|
|
||||||
free (f->pnparticles);
|
|
||||||
}
|
|
||||||
free (f);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -437,6 +411,9 @@ H5PartCloseFile (
|
|||||||
if ( r < 0 ) HANDLE_H5F_CLOSE_ERR;
|
if ( r < 0 ) HANDLE_H5F_CLOSE_ERR;
|
||||||
f->file = 0;
|
f->file = 0;
|
||||||
}
|
}
|
||||||
|
if (f->groupname_step) {
|
||||||
|
free (f->groupname_step);
|
||||||
|
}
|
||||||
if( f->pnparticles ) {
|
if( f->pnparticles ) {
|
||||||
free( f->pnparticles );
|
free( f->pnparticles );
|
||||||
}
|
}
|
||||||
@@ -447,6 +424,21 @@ H5PartCloseFile (
|
|||||||
|
|
||||||
/*============== File Writing Functions ==================== */
|
/*============== File Writing Functions ==================== */
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartDefineStepName (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_int64_t width
|
||||||
|
) {
|
||||||
|
f->groupname_step = strdup ( name );
|
||||||
|
if( f->groupname_step == NULL ) {
|
||||||
|
return HANDLE_H5PART_NOMEM_ERR;
|
||||||
|
}
|
||||||
|
f->stepno_width = width;
|
||||||
|
|
||||||
|
return H5PART_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5part_write
|
\ingroup h5part_write
|
||||||
|
|
||||||
@@ -629,6 +621,8 @@ _write_data (
|
|||||||
herr = H5Dclose ( dataset_id );
|
herr = H5Dclose ( dataset_id );
|
||||||
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
||||||
|
|
||||||
|
f->empty = 0;
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,16 +855,16 @@ _H5Part_get_attrib_info (
|
|||||||
attrib_id = H5Aopen_idx ( id, attrib_idx );
|
attrib_id = H5Aopen_idx ( id, attrib_idx );
|
||||||
if ( attrib_id < 0 ) return HANDLE_H5A_OPEN_IDX_ERR ( attrib_idx );
|
if ( attrib_id < 0 ) return HANDLE_H5A_OPEN_IDX_ERR ( attrib_idx );
|
||||||
|
|
||||||
mytype = H5Aget_type ( attrib_id );
|
|
||||||
if ( attrib_id < 0 ) return HANDLE_H5A_GET_TYPE_ERR;
|
|
||||||
|
|
||||||
space_id = H5Aget_space ( attrib_id );
|
|
||||||
if ( attrib_id < 0 ) return HANDLE_H5A_GET_SPACE_ERR;
|
|
||||||
|
|
||||||
if ( attrib_nelem ) {
|
if ( attrib_nelem ) {
|
||||||
|
space_id = H5Aget_space ( attrib_id );
|
||||||
|
if ( space_id < 0 ) return HANDLE_H5A_GET_SPACE_ERR;
|
||||||
|
|
||||||
*attrib_nelem = H5Sget_simple_extent_npoints ( space_id );
|
*attrib_nelem = H5Sget_simple_extent_npoints ( space_id );
|
||||||
if ( *attrib_nelem < 0 )
|
if ( *attrib_nelem < 0 )
|
||||||
return HANDLE_H5S_GET_SIMPLE_EXTENT_NPOINTS_ERR;
|
return HANDLE_H5S_GET_SIMPLE_EXTENT_NPOINTS_ERR;
|
||||||
|
|
||||||
|
herr = H5Sclose ( space_id );
|
||||||
|
if ( herr < 0 ) return HANDLE_H5S_CLOSE_ERR;
|
||||||
}
|
}
|
||||||
if ( attrib_name ) {
|
if ( attrib_name ) {
|
||||||
herr = H5Aget_name (
|
herr = H5Aget_name (
|
||||||
@@ -880,14 +874,14 @@ _H5Part_get_attrib_info (
|
|||||||
if ( herr < 0 ) return HANDLE_H5A_GET_NAME_ERR;
|
if ( herr < 0 ) return HANDLE_H5A_GET_NAME_ERR;
|
||||||
}
|
}
|
||||||
if ( attrib_type ) {
|
if ( attrib_type ) {
|
||||||
|
mytype = H5Aget_type ( attrib_id );
|
||||||
|
if ( mytype < 0 ) return HANDLE_H5A_GET_TYPE_ERR;
|
||||||
|
|
||||||
*attrib_type = _H5Part_normalize_h5_type ( mytype );
|
*attrib_type = _H5Part_normalize_h5_type ( mytype );
|
||||||
|
|
||||||
|
herr = H5Tclose ( mytype );
|
||||||
|
if ( herr < 0 ) return HANDLE_H5T_CLOSE_ERR;
|
||||||
}
|
}
|
||||||
herr = H5Sclose ( space_id );
|
|
||||||
if ( herr < 0 ) return HANDLE_H5S_CLOSE_ERR;
|
|
||||||
|
|
||||||
herr = H5Tclose ( mytype );
|
|
||||||
if ( herr < 0 ) return HANDLE_H5T_CLOSE_ERR;
|
|
||||||
|
|
||||||
herr = H5Aclose ( attrib_id);
|
herr = H5Aclose ( attrib_id);
|
||||||
if ( herr < 0 ) return HANDLE_H5A_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5A_CLOSE_ERR;
|
||||||
|
|
||||||
@@ -1303,7 +1297,10 @@ _H5Part_set_step (
|
|||||||
|
|
||||||
char name[128];
|
char name[128];
|
||||||
|
|
||||||
sprintf ( name, "%s#%lld", H5PART_GROUPNAME_STEP, (long long) step );
|
sprintf (
|
||||||
|
name,
|
||||||
|
"%s#%0*lld",
|
||||||
|
f->groupname_step, f->stepno_width, (long long) step );
|
||||||
herr_t herr = H5Gget_objinfo( f->file, name, 1, NULL );
|
herr_t herr = H5Gget_objinfo( f->file, name, 1, NULL );
|
||||||
if ( (f->mode != H5PART_READ) && ( herr >= 0 ) ) {
|
if ( (f->mode != H5PART_READ) && ( herr >= 0 ) ) {
|
||||||
return HANDLE_H5PART_STEP_EXISTS_ERR ( step );
|
return HANDLE_H5PART_STEP_EXISTS_ERR ( step );
|
||||||
@@ -1387,11 +1384,13 @@ _H5Part_iteration_operator (
|
|||||||
herr_t herr;
|
herr_t herr;
|
||||||
H5G_stat_t objinfo;
|
H5G_stat_t objinfo;
|
||||||
|
|
||||||
herr = H5Gget_objinfo ( group_id, member_name, 1, &objinfo );
|
if ( data->type != H5G_UNKNOWN ) {
|
||||||
if ( herr < 0 ) return HANDLE_H5G_GET_OBJINFO_ERR ( member_name );
|
herr = H5Gget_objinfo ( group_id, member_name, 1, &objinfo );
|
||||||
|
if ( herr < 0 ) return HANDLE_H5G_GET_OBJINFO_ERR ( member_name );
|
||||||
|
|
||||||
if ( objinfo.type != data->type )
|
if ( objinfo.type != data->type )
|
||||||
return 0; /* don't count, continue iteration */
|
return 0;/* don't count, continue iteration */
|
||||||
|
}
|
||||||
|
|
||||||
if ( data->name && (data->stop_idx == data->count) ) {
|
if ( data->name && (data->stop_idx == data->count) ) {
|
||||||
memset ( data->name, 0, data->len );
|
memset ( data->name, 0, data->len );
|
||||||
@@ -1516,8 +1515,8 @@ H5PartGetNumSteps (
|
|||||||
return _H5Part_get_num_objects_matching_pattern (
|
return _H5Part_get_num_objects_matching_pattern (
|
||||||
f->file,
|
f->file,
|
||||||
"/",
|
"/",
|
||||||
H5G_GROUP,
|
H5G_UNKNOWN,
|
||||||
H5PART_GROUPNAME_STEP );
|
f->groupname_step );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -1539,8 +1538,10 @@ H5PartGetNumDatasets (
|
|||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
sprintf ( stepname, "%s#%lld",
|
sprintf (
|
||||||
H5PART_GROUPNAME_STEP, (long long) f->timestep );
|
stepname,
|
||||||
|
"%s#%0*lld",
|
||||||
|
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
||||||
|
|
||||||
return _H5Part_get_num_objects ( f->file, stepname, H5G_DATASET );
|
return _H5Part_get_num_objects ( f->file, stepname, H5G_DATASET );
|
||||||
}
|
}
|
||||||
@@ -1570,8 +1571,10 @@ H5PartGetDatasetName (
|
|||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_TIMEGROUP ( f );
|
CHECK_TIMEGROUP ( f );
|
||||||
|
|
||||||
sprintf ( stepname, "%s#%lld",
|
sprintf (
|
||||||
H5PART_GROUPNAME_STEP, (long long)f->timestep);
|
stepname,
|
||||||
|
"%s#%0*lld",
|
||||||
|
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
||||||
|
|
||||||
return _H5Part_get_object_name (
|
return _H5Part_get_object_name (
|
||||||
f->file,
|
f->file,
|
||||||
@@ -1613,11 +1616,14 @@ H5PartGetDatasetInfo (
|
|||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_TIMEGROUP ( f );
|
CHECK_TIMEGROUP ( f );
|
||||||
|
|
||||||
sprintf ( step_name, "%s#%lld",
|
sprintf (
|
||||||
H5PART_GROUPNAME_STEP, (long long)f->timestep);
|
step_name,
|
||||||
|
"%s#%0*lld",
|
||||||
|
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
||||||
|
|
||||||
herr = _H5Part_get_object_name (
|
herr = _H5Part_get_object_name (
|
||||||
f->timegroup,
|
//f->timegroup,
|
||||||
|
f->file,
|
||||||
step_name,
|
step_name,
|
||||||
H5G_DATASET,
|
H5G_DATASET,
|
||||||
idx,
|
idx,
|
||||||
@@ -1734,8 +1740,10 @@ _H5Part_get_num_particles (
|
|||||||
|
|
||||||
/* Get first dataset in current time-step */
|
/* Get first dataset in current time-step */
|
||||||
sprintf (
|
sprintf (
|
||||||
step_name, "%s#%lld",
|
step_name,
|
||||||
H5PART_GROUPNAME_STEP, (long long) f->timestep );
|
"%s#%0*lld",
|
||||||
|
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
||||||
|
|
||||||
herr = _H5Part_get_object_name (
|
herr = _H5Part_get_object_name (
|
||||||
f->file,
|
f->file,
|
||||||
step_name,
|
step_name,
|
||||||
@@ -1903,7 +1911,7 @@ _set_view (
|
|||||||
/* setting up the new view */
|
/* setting up the new view */
|
||||||
f->viewstart = start;
|
f->viewstart = start;
|
||||||
f->viewend = end;
|
f->viewend = end;
|
||||||
f->nparticles = end - start;
|
f->nparticles = end - start + 1;
|
||||||
|
|
||||||
/* declare overall datasize */
|
/* declare overall datasize */
|
||||||
f->shape = H5Screate_simple ( 1, &total, &total );
|
f->shape = H5Screate_simple ( 1, &total, &total );
|
||||||
|
|||||||
@@ -61,6 +61,13 @@ H5PartCloseFile (
|
|||||||
|
|
||||||
|
|
||||||
/*============== File Writing Functions ==================== */
|
/*============== File Writing Functions ==================== */
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartDefineStepName (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_int64_t width
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5PartSetNumParticles (
|
H5PartSetNumParticles (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
|
|||||||
+11
-3
@@ -14,6 +14,10 @@ __attribute__ ((format (printf, 3, 4)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
#ifndef PARALLEL_IO
|
||||||
|
typedef unsigned long MPI_Comm;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct H5BlockFile;
|
struct H5BlockFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +29,11 @@ struct H5BlockFile;
|
|||||||
H5PartCloseFile().
|
H5PartCloseFile().
|
||||||
*/
|
*/
|
||||||
struct H5PartFile {
|
struct H5PartFile {
|
||||||
hid_t file;
|
hid_t file;
|
||||||
|
char *groupname_step;
|
||||||
|
int stepno_width;
|
||||||
|
int empty;
|
||||||
|
|
||||||
h5part_int64_t timestep;
|
h5part_int64_t timestep;
|
||||||
hsize_t nparticles;
|
hsize_t nparticles;
|
||||||
|
|
||||||
@@ -60,12 +68,12 @@ struct H5PartFile {
|
|||||||
The index of the processor this process is running on.
|
The index of the processor this process is running on.
|
||||||
*/
|
*/
|
||||||
int myproc;
|
int myproc;
|
||||||
#ifdef PARALLEL_IO
|
|
||||||
/**
|
/**
|
||||||
MPI comnunicator
|
MPI comnunicator
|
||||||
*/
|
*/
|
||||||
MPI_Comm comm;
|
MPI_Comm comm;
|
||||||
#endif
|
|
||||||
struct H5BlockStruct *block;
|
struct H5BlockStruct *block;
|
||||||
h5part_int64_t (*close_block)(struct H5PartFile *f);
|
h5part_int64_t (*close_block)(struct H5PartFile *f);
|
||||||
};
|
};
|
||||||
|
|||||||
+139
-128
@@ -22,13 +22,14 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
bench <nParticles>
|
bench <nParticles>
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int main(int argc,char *argv[]){
|
int main(int argc,char *argv[]){
|
||||||
|
printf("Start benchmarks...\n");
|
||||||
MPI_Info info;
|
MPI_Info info;
|
||||||
int nprocs,rank;
|
int nprocs,rank;
|
||||||
int trial;
|
int trial;
|
||||||
@@ -48,6 +49,7 @@ int main(int argc,char *argv[]){
|
|||||||
H5PartFile *f;
|
H5PartFile *f;
|
||||||
#endif
|
#endif
|
||||||
char newfilename[128];
|
char newfilename[128];
|
||||||
|
char lastfilename[128];
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
MPI_File file;
|
MPI_File file;
|
||||||
MPI_Offset foffset;
|
MPI_Offset foffset;
|
||||||
@@ -74,7 +76,7 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
|
|
||||||
/* printf("about to call create subarray with nparticles=%u localnp=%u offset=%u\n",
|
/* printf("about to call create subarray with nparticles=%u localnp=%u offset=%u\n",
|
||||||
nparticles,localnp,offset); */
|
nparticles,localnp,offset); */
|
||||||
MPI_Type_create_subarray(1, /* rank */
|
MPI_Type_create_subarray(1, /* rank */
|
||||||
&nparticles, /* size of the global array */
|
&nparticles, /* size of the global array */
|
||||||
&localnp, /* size of my local chunk */
|
&localnp, /* size of my local chunk */
|
||||||
@@ -86,148 +88,157 @@ int main(int argc,char *argv[]){
|
|||||||
MPI_Info_create(&info);
|
MPI_Info_create(&info);
|
||||||
|
|
||||||
if(rank==0) printf("Nprocs=%u Particles=%u*6attribs*sizeof(double) Particles/proc=%u Nsteps=%u Ntrials=%u\n",
|
if(rank==0) printf("Nprocs=%u Particles=%u*6attribs*sizeof(double) Particles/proc=%u Nsteps=%u Ntrials=%u\n",
|
||||||
nprocs,nparticles,localnp,NSTEPS,NTRIALS);
|
nprocs,nparticles,localnp,NSTEPS,NTRIALS);
|
||||||
|
|
||||||
|
|
||||||
for(trial=0;trial<NTRIALS;trial++){
|
for(trial=0;trial<NTRIALS;trial++){
|
||||||
if(rank==0) printf("---------------------- Trial %u of %u ---------------------\n",trial+1,NTRIALS);
|
if(rank==0) printf("---------------------- Trial %u of %u ---------------------\n",trial+1,NTRIALS);
|
||||||
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
sprintf(filename,"%s.%u.mpio.dat",FILENAME,nprocs);
|
sprintf(filename,"%s.%u.mpio.dat",FILENAME,nprocs);
|
||||||
|
sprintf(lastfilename,"%s.%u.mpio.dat",FILENAME,nprocs);
|
||||||
|
|
||||||
if(rank==0) unlink(filename);
|
if(rank==0) unlink(filename);
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
|
|
||||||
MPI_File_open(MPI_COMM_WORLD,filename,
|
MPI_File_open(MPI_COMM_WORLD,filename,
|
||||||
MPI_MODE_CREATE | MPI_MODE_RDWR,
|
MPI_MODE_CREATE | MPI_MODE_RDWR,
|
||||||
info,&file);
|
info,&file);
|
||||||
|
|
||||||
MPI_File_set_view(file,0,MPI_DOUBLE,chunktype,"native",info);
|
MPI_File_set_view(file,0,MPI_DOUBLE,chunktype,"native",info);
|
||||||
/* now a barrier to get the start timers roughly synced*/
|
/* now a barrier to get the start timers roughly synced*/
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
curtime = starttime = MPI_Wtime();
|
curtime = starttime = MPI_Wtime();
|
||||||
endtime = starttime+5.0*60.0; /* end in 5 minutes */
|
endtime = starttime+5.0*60.0; /* end in 5 minutes */
|
||||||
MPI_Bcast(&endtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
MPI_Bcast(&endtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||||
/* must touch the entire array after each write */
|
/* must touch the entire array after each write */
|
||||||
/* ensures cache-invalidation */
|
/* ensures cache-invalidation */
|
||||||
foffset=0;
|
foffset=0;
|
||||||
i=0;
|
i=0;
|
||||||
curtime=starttime;
|
curtime=starttime;
|
||||||
for(i=0;i<NSTEPS;i++){
|
for(i=0;i<NSTEPS;i++){
|
||||||
int n;
|
int n;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
for(j=0;j<6;j++){
|
for(j=0;j<6;j++){
|
||||||
/* touch data */
|
/* touch data */
|
||||||
for(n=0;n<localnp;n++)
|
for(n=0;n<localnp;n++)
|
||||||
(data[j])[n]=(double)rank;
|
(data[j])[n]=(double)rank;
|
||||||
/* write to that file */
|
/* write to that file */
|
||||||
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
|
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
|
||||||
MPI_File_write_at_all(file,
|
MPI_File_write_at_all(file,
|
||||||
foffset,
|
foffset,
|
||||||
data[j],
|
data[j],
|
||||||
localnp,
|
localnp,
|
||||||
MPI_DOUBLE,&status);
|
MPI_DOUBLE,&status);
|
||||||
foffset+=nparticles/nprocs;
|
foffset+=nparticles/nprocs;
|
||||||
|
}
|
||||||
|
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
||||||
|
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||||
}
|
}
|
||||||
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
MPI_File_close(&file);
|
||||||
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
}
|
endtime=MPI_Wtime();
|
||||||
MPI_File_close(&file);
|
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
/* foffset*=nprocs; if we want total megabytes written */
|
||||||
endtime=MPI_Wtime();
|
if(rank==0){
|
||||||
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
|
puts("*");
|
||||||
/* foffset*=nprocs; if we want total megabytes written */
|
unlink(filename);
|
||||||
if(rank==0){
|
puts("======================================================");
|
||||||
puts("*");
|
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
|
||||||
unlink(filename);
|
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
puts("======================================================");
|
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
|
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
|
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
puts("======================================================");
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
}
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
|
||||||
puts("======================================================");
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
}
|
/* OK, now we do this using H5Part */
|
||||||
|
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
unlink(newfilename);
|
||||||
/* OK, now we do this using H5Part */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
|
fd = fopen(newfilename,"w");
|
||||||
unlink(newfilename);
|
/* start the timer */
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
starttime=endtime=MPI_Wtime();
|
||||||
fd = fopen(newfilename,"w");
|
for(i=0;i<NSTEPS;i++){
|
||||||
/* start the timer */
|
for(j=0;j<6;j++){
|
||||||
starttime=endtime=MPI_Wtime();
|
/* touch data */
|
||||||
for(i=0;i<NSTEPS;i++){
|
for(n=0;n<localnp;n++)
|
||||||
for(j=0;j<6;j++){
|
(data[j])[n]=(double)rank;
|
||||||
/* touch data */
|
fwrite(data[j],sizeof(double),localnp,fd);
|
||||||
for(n=0;n<localnp;n++)
|
}
|
||||||
(data[j])[n]=(double)rank;
|
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
||||||
fwrite(data[j],sizeof(double),localnp,fd);
|
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||||
|
}
|
||||||
|
fclose(fd);
|
||||||
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
|
endtime=MPI_Wtime();
|
||||||
|
if(rank==0) puts("*");
|
||||||
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
|
unlink(newfilename);
|
||||||
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
|
if(rank==0){
|
||||||
|
puts("======================================================");
|
||||||
|
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
||||||
|
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
|
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
|
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
|
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
|
puts("======================================================");
|
||||||
}
|
}
|
||||||
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
|
||||||
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
|
||||||
}
|
|
||||||
fclose(fd);
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
endtime=MPI_Wtime();
|
|
||||||
if(rank==0) puts("*");
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
|
||||||
unlink(newfilename);
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
if(rank==0){
|
|
||||||
puts("======================================================");
|
|
||||||
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
|
||||||
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
|
||||||
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
|
||||||
puts("======================================================");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef DISABLE_H5PART
|
#ifndef DISABLE_H5PART
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
//printf("H5Part benchmark...");
|
||||||
/* OK, now we do this using H5Part */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
|
/* OK, now we do this using H5Part */
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
|
||||||
/* start the timer */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
starttime=endtime=MPI_Wtime();
|
/* start the timer */
|
||||||
H5PartSetNumParticles(f,localnp);
|
starttime=endtime=MPI_Wtime();
|
||||||
for(i=0;i<NSTEPS;i++){
|
H5PartSetNumParticles(f,localnp);
|
||||||
for(j=0;j<6;j++){
|
for(i=0;i<NSTEPS;i++){
|
||||||
/* touch data */
|
for(j=0;j<6;j++){
|
||||||
for(n=0;n<localnp;n++)
|
/* touch data */
|
||||||
(data[j])[n]=(double)rank;
|
for(n=0;n<localnp;n++)
|
||||||
}
|
(data[j])[n]=(double)rank;
|
||||||
H5PartSetStep(f,i);
|
}
|
||||||
H5PartWriteDataFloat64(f,"x",x);
|
H5PartSetStep(f,i);
|
||||||
H5PartWriteDataFloat64(f,"y",y);
|
H5PartWriteDataFloat64(f,"x",x);
|
||||||
H5PartWriteDataFloat64(f,"z",z);
|
H5PartWriteDataFloat64(f,"y",y);
|
||||||
H5PartWriteDataFloat64(f,"px",px);
|
H5PartWriteDataFloat64(f,"z",z);
|
||||||
H5PartWriteDataFloat64(f,"py",py);
|
H5PartWriteDataFloat64(f,"px",px);
|
||||||
H5PartWriteDataFloat64(f,"pz",pz);
|
H5PartWriteDataFloat64(f,"py",py);
|
||||||
|
H5PartWriteDataFloat64(f,"pz",pz);
|
||||||
|
|
||||||
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
||||||
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||||
}
|
}
|
||||||
H5PartCloseFile(f);
|
H5PartCloseFile(f);
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
endtime=MPI_Wtime();
|
endtime=MPI_Wtime();
|
||||||
if(rank==0){
|
if(rank==0){
|
||||||
puts("*");
|
puts("*");
|
||||||
unlink(filename);
|
unlink(filename);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
||||||
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
}
|
}
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
#endif
|
#endif
|
||||||
} /* trials */
|
} /* trials */
|
||||||
|
|
||||||
|
if (rank==0) {
|
||||||
|
printf("lastfilename: %s \n", lastfilename);
|
||||||
|
unlink(lastfilename);
|
||||||
|
}
|
||||||
|
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -12,8 +12,7 @@ MPICC = @MPICC@
|
|||||||
|
|
||||||
# COMPILER FLAG SETTING
|
# COMPILER FLAG SETTING
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
ADDFLAGS = @ADDFLAGS@
|
FFLAGS = @FFLAGS@ @MPIINC@
|
||||||
FFLAGS = @FFLAGS@ @MPIINC@ $(ADDFLAGS)
|
|
||||||
|
|
||||||
# LIBRARIES
|
# LIBRARIES
|
||||||
SZLIB = @SZLIB@
|
SZLIB = @SZLIB@
|
||||||
|
|||||||
+2
-2
@@ -33,7 +33,7 @@ H5PINC = -I@H5P_LIB_LOC@
|
|||||||
bin_PROGRAMS = @BUILD_TOOLS@
|
bin_PROGRAMS = @BUILD_TOOLS@
|
||||||
|
|
||||||
# Listing of all programs that maybe built. (Has to know statically...)
|
# Listing of all programs that maybe built. (Has to know statically...)
|
||||||
EXTRA_PROGRAMS = h5pAttrib h5pToGNUplot homdynToH5p
|
EXTRA_PROGRAMS = h5pAttrib h5pToGNUplot # homdynToH5p
|
||||||
|
|
||||||
# Extra files that I wish to include in the dist tar ball.
|
# Extra files that I wish to include in the dist tar ball.
|
||||||
EXTRA_DIST = h5pAttrib.cc h5pToGNUplot.cc## TO BE TAILORED LATER...
|
EXTRA_DIST = h5pAttrib.cc h5pToGNUplot.cc## TO BE TAILORED LATER...
|
||||||
@@ -43,7 +43,7 @@ h5pAttrib_SOURCES = h5pAttrib.cc
|
|||||||
|
|
||||||
h5pToGNUplot_SOURCES = h5pToGNUplot.cc
|
h5pToGNUplot_SOURCES = h5pToGNUplot.cc
|
||||||
|
|
||||||
homdynToH5p_SOURCES = homdynToH5p.cc
|
#homdynToH5p_SOURCES = homdynToH5p.cc
|
||||||
|
|
||||||
# Specific building instruction (What compilers to use...)
|
# Specific building instruction (What compilers to use...)
|
||||||
# ------------ Build Tools ------------
|
# ------------ Build Tools ------------
|
||||||
|
|||||||
+89
-6
@@ -31,6 +31,7 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
double data[nCol][10000];
|
double data[nCol][10000];
|
||||||
string headers[nCol];
|
string headers[nCol];
|
||||||
|
string units[nCol];
|
||||||
|
|
||||||
string fnStr("HBUNCH.OUT");
|
string fnStr("HBUNCH.OUT");
|
||||||
|
|
||||||
@@ -76,14 +77,96 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
H5PartWriteFileAttribString(file,"File Description", "This file contains HOMDYN HBUNCH.OUT data");
|
H5PartWriteFileAttribString(file,"File Description", "This file contains HOMDYN HBUNCH.OUT data");
|
||||||
|
|
||||||
for (int c=0;c<nCol;c++)
|
H5PartWriteFileAttribString(file,"tUnit","s");
|
||||||
int rc = H5PartWriteFileAttribString(file,(headers[c]+string("Unit")).c_str(), " "); ;
|
H5PartWriteFileAttribString(file,"xUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"yUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"zUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"pxUnit","#beta#gamma");
|
||||||
|
H5PartWriteFileAttribString(file,"pyUnit","#beta#gamma");
|
||||||
|
H5PartWriteFileAttribString(file,"pzUnit","#beta#gamma");
|
||||||
|
H5PartWriteFileAttribString(file,"idUnit","1");
|
||||||
|
H5PartWriteFileAttribString(file,"SPOSUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"TIMEUnit","s");
|
||||||
|
H5PartWriteFileAttribString(file,"#gammaUnit","1");
|
||||||
|
H5PartWriteFileAttribString(file,"ENERGYUnit","MeV");
|
||||||
|
H5PartWriteFileAttribString(file,"#varepsilonUnit","m rad");
|
||||||
|
H5PartWriteFileAttribString(file,"#varepsilonrUnit","m rad");
|
||||||
|
|
||||||
|
H5PartWriteFileAttribString(file,"#varepsilonr-geomUnit","m rad");
|
||||||
|
H5PartWriteFileAttribString(file,"RMSXUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"RMSRUnit","m");
|
||||||
|
H5PartWriteFileAttribString(file,"RMSPUnit","#beta#gamma");
|
||||||
|
|
||||||
|
H5PartWriteFileAttribString(file,"maxdEUnit","MeV");
|
||||||
|
H5PartWriteFileAttribString(file,"max#phiUnit","deg");
|
||||||
|
|
||||||
|
H5PartWriteFileAttribString(file,"phizUnit","deg");
|
||||||
|
H5PartWriteFileAttribString(file,"enezUnit","keV");
|
||||||
|
|
||||||
|
/*
|
||||||
|
1 Z_[m]
|
||||||
|
2 sigma_r_[mm]
|
||||||
|
3 sigma_z_[mm]
|
||||||
|
4 I_[A]
|
||||||
|
5 sigma_x_[mm]
|
||||||
|
6 enx_[um]
|
||||||
|
7 sigma_y_[mm]
|
||||||
|
8 eny_[um]
|
||||||
|
9 T_[MeV]
|
||||||
|
10 dg/g_[%]
|
||||||
|
11 DE_[MeV]
|
||||||
|
12 elz_[KeVmm]
|
||||||
|
13 Ez_[MV/m]
|
||||||
|
14 Bz_[T] Bx_[G] By_[G]
|
||||||
|
15 Qgrad_[T/m]
|
||||||
|
16 ByWig
|
||||||
|
17 BHOR_[T]
|
||||||
|
18 Time_[nsec]
|
||||||
|
19 beta
|
||||||
|
20 R/gL
|
||||||
|
21 Lplas_[m]
|
||||||
|
22 Zeq_[m]
|
||||||
|
23 EWsteady
|
||||||
|
*/
|
||||||
|
|
||||||
for (int t=0;t<nLines;t++) {
|
for (int t=0;t<nLines;t++) {
|
||||||
H5PartSetStep(file,t); /* must set the current timestep in file */
|
H5PartSetStep(file,t); /* must set the current timestep in file */
|
||||||
for (int c=0;c<nCol;c++) {
|
|
||||||
int rc = H5PartWriteStepAttrib(file,headers[c].c_str(), H5T_NATIVE_DOUBLE,&data[c][t],1);
|
double d3[3];
|
||||||
}
|
double dummy = 0.0;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = H5PartWriteStepAttrib(file,"SPOS", H5T_NATIVE_DOUBLE,&data[0][t],1);
|
||||||
|
|
||||||
|
dummy = data[1][t]/1000.0;
|
||||||
|
rc = H5PartWriteStepAttrib(file,"RMSR", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"TIME", H5T_NATIVE_DOUBLE,&data[17][t],1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"ENERGY", H5T_NATIVE_DOUBLE,&data[8][t],1);
|
||||||
|
|
||||||
|
d3[0] = data[4][t]/1000.0;
|
||||||
|
d3[1] = data[6][t]/1000.0;
|
||||||
|
d3[2] = 0.0;
|
||||||
|
rc = H5PartWriteStepAttrib(file,"RMSX", H5T_NATIVE_DOUBLE,&d3,3);
|
||||||
|
|
||||||
|
d3[0] = data[5][t]/1000000.0;
|
||||||
|
d3[1] = data[7][t]/1000000.0;
|
||||||
|
d3[2] = 0.0;
|
||||||
|
rc = H5PartWriteStepAttrib(file,"#varepsilon", H5T_NATIVE_DOUBLE,&d3,3);
|
||||||
|
|
||||||
|
|
||||||
|
d3[0] = 0.0;
|
||||||
|
d3[1] = 0.0;
|
||||||
|
d3[2] = 0.0;
|
||||||
|
|
||||||
|
rc = H5PartWriteStepAttrib(file,"#gamma", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"#varepsilonr", H5T_NATIVE_DOUBLE,&d3,3);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"#varepsilonr-geom", H5T_NATIVE_DOUBLE,&d3,3);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"RMSP", H5T_NATIVE_DOUBLE,&d3,3);
|
||||||
|
|
||||||
|
rc = H5PartWriteStepAttrib(file,"maxdE", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"max#phi", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"phiz", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
|
rc = H5PartWriteStepAttrib(file,"enez", H5T_NATIVE_DOUBLE,&dummy,1);
|
||||||
}
|
}
|
||||||
H5PartCloseFile(file);
|
H5PartCloseFile(file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
|
|
||||||
//h5part specific
|
//h5part specific
|
||||||
#include <H5Part.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -82,11 +81,11 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
|
|||||||
pointvarnames.resize(npointvars);
|
pointvarnames.resize(npointvars);
|
||||||
cout << "constructor: nvariables: " << npointvars << "\n";
|
cout << "constructor: nvariables: " << npointvars << "\n";
|
||||||
|
|
||||||
char name[64];
|
char name[128];
|
||||||
int status;
|
h5part_int64_t status;
|
||||||
for (j=0; j < npointvars; j++){
|
for (j=0; j < npointvars; j++){
|
||||||
status = H5PartGetDatasetName(file,j, name,64);
|
status = H5PartGetDatasetName(file,j, name,128);
|
||||||
if (status != 1){
|
if (status != H5PART_SUCCESS){
|
||||||
EXCEPTION1(VisItException, "could not read a variable name");
|
EXCEPTION1(VisItException, "could not read a variable name");
|
||||||
}
|
}
|
||||||
pointvarnames[j] = name;
|
pointvarnames[j] = name;
|
||||||
@@ -110,13 +109,13 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
|
|||||||
int
|
int
|
||||||
avth5partFileFormat::GetNTimesteps(void)
|
avth5partFileFormat::GetNTimesteps(void)
|
||||||
{
|
{
|
||||||
int nt;
|
h5part_int64_t nt;
|
||||||
H5PartFile *file;
|
H5PartFile *file;
|
||||||
file = H5PartOpenFile(fname.c_str(),H5PART_READ);
|
file = H5PartOpenFile(fname.c_str(),H5PART_READ);
|
||||||
H5PartSetStep(file,0);
|
H5PartSetStep(file,0);
|
||||||
nt=H5PartGetNumSteps(file); /* get number of steps in file */
|
nt=H5PartGetNumSteps(file); /* get number of steps in file */
|
||||||
H5PartCloseFile(file);
|
H5PartCloseFile(file);
|
||||||
return nt;
|
return (int) nt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -333,14 +332,15 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
|
|||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
nprocs = PAR_Size();
|
nprocs = PAR_Size();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
H5PartSetStep(file,timestate);
|
H5PartSetStep(file,timestate);
|
||||||
|
|
||||||
//points
|
//points
|
||||||
tnpoints= (int) H5PartGetNumParticles(file);
|
tnpoints= (int) H5PartGetNumParticles(file);
|
||||||
unsigned long long idStart = ((int)(tnpoints/nprocs))*domain;
|
h5part_int64_t idStart = (( h5part_int64_t)(tnpoints/nprocs))*domain;
|
||||||
unsigned long long idEnd;
|
h5part_int64_t idEnd;
|
||||||
if (domain < nprocs-1)
|
if (domain < nprocs-1)
|
||||||
idEnd = ((unsigned long int)(tnpoints/nprocs))*(domain+1);
|
idEnd = ((h5part_int64_t)(tnpoints/nprocs))*(domain+1);
|
||||||
else if (domain == nprocs - 1)
|
else if (domain == nprocs - 1)
|
||||||
idEnd = tnpoints;
|
idEnd = tnpoints;
|
||||||
|
|
||||||
@@ -358,21 +358,21 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
|
|||||||
EXCEPTION1(VisItException, "npoints is zero");
|
EXCEPTION1(VisItException, "npoints is zero");
|
||||||
|
|
||||||
points.resize(npoints*nspace);
|
points.resize(npoints*nspace);
|
||||||
double *x, *y, *z;
|
h5part_float64_t *x, *y, *z;
|
||||||
x = (double *) malloc(sizeof(double)*npoints);
|
x = (h5part_float64_t *) malloc(sizeof(h5part_float64_t)*npoints);
|
||||||
y = (double *) malloc(sizeof(double)*npoints);
|
y = (h5part_float64_t *) malloc(sizeof(h5part_float64_t)*npoints);
|
||||||
z = (double *) malloc(sizeof(double)*npoints);
|
z = (h5part_float64_t *) malloc(sizeof(h5part_float64_t)*npoints);
|
||||||
|
|
||||||
|
|
||||||
int status = 0;
|
h5part_int64_t status = H5PART_SUCCESS;
|
||||||
status = H5PartReadDataFloat64(file, "x", x);
|
status = H5PartReadDataFloat64(file, "x", x);
|
||||||
if (status != 1)
|
if (status != H5PART_SUCCESS)
|
||||||
EXCEPTION1(VisItException, "Could not read x coordinates");
|
EXCEPTION1(VisItException, "Could not read x coordinates");
|
||||||
status = H5PartReadDataFloat64(file, "y", y);
|
status = H5PartReadDataFloat64(file, "y", y);
|
||||||
if (status != 1)
|
if (status != H5PART_SUCCESS)
|
||||||
EXCEPTION1(VisItException, "Could not read y coordinates");
|
EXCEPTION1(VisItException, "Could not read y coordinates");
|
||||||
status = H5PartReadDataFloat64(file, "z", z);
|
status = H5PartReadDataFloat64(file, "z", z);
|
||||||
if (status != 1)
|
if (status != H5PART_SUCCESS)
|
||||||
EXCEPTION1(VisItException, "Could not read z coordinates");
|
EXCEPTION1(VisItException, "Could not read z coordinates");
|
||||||
for (long int i = 0; i < npoints; i++){
|
for (long int i = 0; i < npoints; i++){
|
||||||
points[nspace*i] = (float) x[i];
|
points[nspace*i] = (float) x[i];
|
||||||
@@ -464,8 +464,8 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
|
|||||||
if (!file)
|
if (!file)
|
||||||
EXCEPTION1(InvalidFilesException, fname.c_str());
|
EXCEPTION1(InvalidFilesException, fname.c_str());
|
||||||
|
|
||||||
int status;
|
h5part_int64_t status;
|
||||||
long int tnpoints, npoints;
|
h5part_int64_t tnpoints, npoints;
|
||||||
int npointvars;
|
int npointvars;
|
||||||
int nspace = 3;
|
int nspace = 3;
|
||||||
int nprocs = 1;
|
int nprocs = 1;
|
||||||
@@ -475,44 +475,44 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
|
|||||||
|
|
||||||
H5PartSetStep(file,timestate);
|
H5PartSetStep(file,timestate);
|
||||||
//points
|
//points
|
||||||
tnpoints= (long int) H5PartGetNumParticles(file);
|
tnpoints= H5PartGetNumParticles(file);
|
||||||
//point vars
|
//point vars
|
||||||
|
|
||||||
char name[64];
|
char name[64];
|
||||||
long long *idvar;
|
h5part_int64_t *idvar;
|
||||||
double *data;
|
double *data;
|
||||||
unsigned long long idStart = ((int)(tnpoints/nprocs))*domain;
|
h5part_int64_t idStart = ((h5part_int64_t)(tnpoints/nprocs))*domain;
|
||||||
unsigned long long idEnd;
|
h5part_int64_t idEnd;
|
||||||
if (domain < nprocs-1)
|
if (domain < nprocs-1)
|
||||||
idEnd = ((unsigned long int)(tnpoints/nprocs))*(domain+1);
|
idEnd = ((h5part_int64_t)(tnpoints/nprocs))*(domain+1);
|
||||||
else if (domain == nprocs - 1)
|
else if (domain == nprocs - 1)
|
||||||
idEnd = tnpoints;
|
idEnd = (h5part_int64_t)tnpoints;
|
||||||
|
|
||||||
H5PartSetView(file,idStart,idEnd);
|
H5PartSetView(file,idStart,idEnd);
|
||||||
npoints= (int) H5PartGetNumParticles(file);
|
npoints= H5PartGetNumParticles(file);
|
||||||
cout << "GetVar: npoints for domain " << domain << ": " << npoints << "\n";
|
cout << "GetVar: npoints for domain " << domain << ": " << npoints << "\n";
|
||||||
|
|
||||||
for (int j=0; j < pointvarnames.size(); j++){
|
for (size_t j=0; j < (size_t)(pointvarnames.size()); j++){
|
||||||
status = H5PartGetDatasetName(file,j, name,64);
|
status = H5PartGetDatasetName(file,j, name,64);
|
||||||
if (pointvarnames[j] == name) {
|
if (pointvarnames[j] == name) {
|
||||||
if (strstr(name, "id") != NULL){
|
if (strstr(name, "id") != NULL){
|
||||||
idvar = (long long *) malloc(sizeof(long long)*npoints);
|
idvar = (h5part_int64_t *) malloc(sizeof(h5part_int64_t)*npoints);
|
||||||
status = H5PartReadDataInt64(file, name, idvar);
|
status = H5PartReadDataInt64(file, name, idvar);
|
||||||
if (status != 1)
|
if (status != H5PART_SUCCESS)
|
||||||
EXCEPTION1(VisItException, "Could not read dataset");
|
EXCEPTION1(VisItException, "Could not read dataset");
|
||||||
pointvars[j].resize(npoints);
|
pointvars[j].resize(npoints);
|
||||||
for (long int i=0; i < npoints; i++){
|
for (size_t i=0; i < (size_t) npoints; i++){
|
||||||
pointvars[j][i] = (float) idvar[i];
|
pointvars[j][i] = (float) idvar[i];
|
||||||
}
|
}
|
||||||
if (idvar != NULL)
|
if (idvar != NULL)
|
||||||
free(idvar);
|
free(idvar);
|
||||||
} else {
|
} else {
|
||||||
data = (double *) malloc(sizeof(double)*npoints);
|
data = (h5part_float64_t *) malloc(sizeof(h5part_float64_t)*npoints);
|
||||||
status = H5PartReadDataFloat64(file, name, data);
|
status = H5PartReadDataFloat64(file, name, data);
|
||||||
if (status != 1)
|
if (status != H5PART_SUCCESS)
|
||||||
EXCEPTION1(VisItException, "Could not read dataset");
|
EXCEPTION1(VisItException, "Could not read dataset");
|
||||||
pointvars[j].resize(npoints);
|
pointvars[j].resize(npoints);
|
||||||
for (long int i=0; i < npoints; i++){
|
for (size_t i=0; i < (size_t)(npoints); i++){
|
||||||
pointvars[j][i] = (float) data[i];
|
pointvars[j][i] = (float) data[i];
|
||||||
}
|
}
|
||||||
if (data != NULL)
|
if (data != NULL)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#define AVT_h5part_FILE_FORMAT_H
|
#define AVT_h5part_FILE_FORMAT_H
|
||||||
|
|
||||||
#include <avtMTMDFileFormat.h>
|
#include <avtMTMDFileFormat.h>
|
||||||
#include <H5Part.hh>
|
#include <H5Part.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
Reference in New Issue
Block a user