Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
+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.2], [vis@hpcrdm.lbl.gov], 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
|
||||||
|
|||||||
+43
-8
@@ -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">
|
||||||
<head>
|
<head>
|
||||||
<title>Downloading HDF5 and H5Part</title>
|
<title>Downloading HDF5 and H5Part</title>
|
||||||
@@ -39,12 +37,49 @@
|
|||||||
ls
|
ls
|
||||||
get zlib-1.2.1.tar.gz (get the current version, this as the one on April 20th, 2006)
|
get zlib-1.2.1.tar.gz (get the current version, this as the one on April 20th, 2006)
|
||||||
</pre>
|
</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">
|
<P>
|
||||||
<h2>Downloading H5Part</h2></a>
|
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
|
||||||
Please contact <address><a href="mailto:andreas.adelmann@psi.ch">Andreas Adelmann</a></address>.
|
</P>
|
||||||
|
|
||||||
|
<h4>Building Parallel HDF5</h4>
|
||||||
|
<P>
|
||||||
|
When you build HDF5, you will need to build an version with parallel I/O
|
||||||
|
enabled. Here is a set of configure options that worked for us on a
|
||||||
|
Linux workstation running SuSE 10.1 with MPICH installed in /usr/local/mpich.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
./configure --prefix=/usr/local/hdf5-mpich --enable-parallel CC=mpicc CXX=mpicxx --disable-shared --enable-static --enable-stream-vfd
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<UL>
|
||||||
|
<li> --prefix=/usr/local/hdf5-mpich : the location where the HDF5 libs and
|
||||||
|
binaries will be installed.</LI>
|
||||||
|
<li> --enable-parallel : contrary to the HDF5 documentation, which says that
|
||||||
|
"--enable-parallel" is optional for building the parallel version of
|
||||||
|
HDF5, you <b>must</b> have --enable-parallel to get the parallel-enabled
|
||||||
|
build. See <a href="ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/INSTALL_parallel">these notes from HDF5</a> where they claim that
|
||||||
|
--enable-parallel is optional.</LI>
|
||||||
|
<li> CC=mpicc CXX=mpicxx : contrary to the output from configure --help, the
|
||||||
|
configure script seems to ignore the CC and CXX environment variables.
|
||||||
|
We tried setting these environment variables to mpicc and mpicxx,
|
||||||
|
respectively, and then ran configure with --enable-parallel. The configure
|
||||||
|
script would faile with this error message:
|
||||||
|
<pre>
|
||||||
|
checking whether a simple MPI-IO program can be linked... no
|
||||||
|
configure: error: unable to link a simple MPI-IO application
|
||||||
|
</pre>
|
||||||
|
</LI>
|
||||||
|
<LI> --disable-shared and --enable-static: the HDF5 build failed for us
|
||||||
|
w/o these options when attempting to read symbols from libmpich.a. The
|
||||||
|
result of these options is that your parallel-enabled HDF5 libaries
|
||||||
|
will be static rather than dynamic.
|
||||||
|
|
||||||
|
</UL>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="h5part">Downloading H5Part</h2>
|
||||||
|
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>.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|||||||
+165
-179
@@ -93,36 +93,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 +113,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->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
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);
|
f->access_prop = H5Pcreate (H5P_FILE_ACCESS);
|
||||||
if (f->access_prop < 0) {
|
if (f->access_prop < 0) {
|
||||||
HANDLE_H5P_CREATE_ERR;
|
HANDLE_H5P_CREATE_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_MPIO_ERR;
|
HANDLE_H5P_SET_FAPL_MPIO_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create_prop: tunable parameters like blocksize and btree sizes */
|
/* f->create_prop = H5Pcreate(H5P_FILE_CREATE); */
|
||||||
/* f->create_prop = H5Pcreate(H5P_FILE_CREATE); */
|
f->create_prop = H5P_DEFAULT;
|
||||||
f->create_prop = H5P_DEFAULT;
|
|
||||||
|
|
||||||
/* currently create_prop is empty */
|
/* currently create_prop is empty */
|
||||||
/* xfer_prop: also used for parallel I/O, during actual writes
|
/* xfer_prop: also used for parallel I/O, during actual writes
|
||||||
rather than the access_prop which is for file creation. */
|
rather than the access_prop which is for file creation. */
|
||||||
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
||||||
if (f->xfer_prop < 0) {
|
if (f->xfer_prop < 0) {
|
||||||
HANDLE_H5P_CREATE_ERR;
|
HANDLE_H5P_CREATE_ERR;
|
||||||
goto error_cleanup;
|
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_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 +185,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 +203,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 +234,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 +245,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 +306,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 +390,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 +403,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 +600,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 +834,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 +853,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 +1276,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 +1363,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 +1494,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 +1517,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 +1550,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,8 +1595,10 @@ 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,
|
||||||
@@ -1734,8 +1718,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 +1889,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);
|
||||||
};
|
};
|
||||||
|
|||||||
+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");
|
||||||
|
|
||||||
@@ -75,15 +76,97 @@ 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");
|
||||||
|
|
||||||
|
H5PartWriteFileAttribString(file,"tUnit","s");
|
||||||
|
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");
|
||||||
|
|
||||||
for (int c=0;c<nCol;c++)
|
/*
|
||||||
int rc = H5PartWriteFileAttribString(file,(headers[c]+string("Unit")).c_str(), " "); ;
|
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