Compare commits
17 Commits
H5Part-1.6.3
..
1.6
| Author | SHA1 | Date | |
|---|---|---|---|
| e8e2f62f37 | |||
| 23045a3fb3 | |||
| 9490449189 | |||
| 258200afe6 | |||
| d7406a63bd | |||
| d2f0eb194a | |||
| f58f435a65 | |||
| 8c6d7f7f54 | |||
| 1f647fc513 | |||
| 1bda4e3c70 | |||
| 819ddc4704 | |||
| 3894452bc9 | |||
| 58be7a8318 | |||
| 9a06157427 | |||
| a44e2b6a05 | |||
| ac8d16c0b6 | |||
| 6c944f2b16 |
+1
-2
@@ -9,8 +9,6 @@
|
|||||||
/NEWS -text
|
/NEWS -text
|
||||||
/README -text
|
/README -text
|
||||||
/autogen.sh -text
|
/autogen.sh -text
|
||||||
/config.guess -text
|
|
||||||
/config.sub -text
|
|
||||||
/configure-crayxt -text
|
/configure-crayxt -text
|
||||||
/configure.ac -text
|
/configure.ac -text
|
||||||
/depcomp -text
|
/depcomp -text
|
||||||
@@ -79,6 +77,7 @@ test/H5test.cc -text
|
|||||||
test/H5testF.f -text
|
test/H5testF.f -text
|
||||||
test/H5testFpar.F90 -text
|
test/H5testFpar.F90 -text
|
||||||
test/Makefile.am -text
|
test/Makefile.am -text
|
||||||
|
test/coords.F90 -text
|
||||||
test/params.h -text
|
test/params.h -text
|
||||||
test/read.c -text
|
test/read.c -text
|
||||||
test/test.c -text
|
test/test.c -text
|
||||||
|
|||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
/Makefile.in
|
||||||
|
/aclocal.m4
|
||||||
|
/autom4te.cache
|
||||||
|
/build
|
||||||
|
/config.h.in
|
||||||
|
/configure
|
||||||
|
doc/Makefile.in
|
||||||
|
/ltmain.sh
|
||||||
|
/m4
|
||||||
|
src/H5PartF.h
|
||||||
|
src/Makefile.in
|
||||||
|
test/Makefile.in
|
||||||
|
tools/Makefile.in
|
||||||
@@ -8,4 +8,4 @@ John Shalf (NERSC/LBNL)
|
|||||||
Cristina Siegerist (NERSC/LBNL)
|
Cristina Siegerist (NERSC/LBNL)
|
||||||
Mark Howison (NERSC/LBNL)
|
Mark Howison (NERSC/LBNL)
|
||||||
|
|
||||||
Please use h5part@lists.psi.ch for communicaion.
|
Please use h5part@lists.psi.ch for communication.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# Trial by Antino Kim
|
|
||||||
# Top level Makefile.am
|
|
||||||
ACLOCAL_AMFLAGS=-I m4
|
ACLOCAL_AMFLAGS=-I m4
|
||||||
|
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
#### H5PART 1.6.6 ############################################################
|
||||||
|
|
||||||
|
Fixed typo (Write instead of Read) in the h5bl_3d_read_scalar_field* Fortran
|
||||||
|
interface.
|
||||||
|
|
||||||
|
Added missing type normalization for int32 type.
|
||||||
|
|
||||||
|
Rewrite of h5pAttrib tool.
|
||||||
|
|
||||||
|
#### H5PART 1.6.5 ############################################################
|
||||||
|
|
||||||
|
Fixed several build errors reported by Iuri Prilepov on Ubuntu 11.04.
|
||||||
|
|
||||||
|
#### H5PART 1.6.4 ############################################################
|
||||||
|
|
||||||
|
Fixed bug where H5PartSetViewIndices was not setting an empty view when the
|
||||||
|
number of elements is 0.
|
||||||
|
|
||||||
|
Set a threshold on the HDF5 alignment parameter so that small metadata writes
|
||||||
|
are not aligned, which causes large gaps in the file.
|
||||||
|
|
||||||
#### H5PART 1.6.3 ############################################################
|
#### H5PART 1.6.3 ############################################################
|
||||||
|
|
||||||
New build system uses libtool and can build shared libraries.
|
New build system uses libtool and can build shared libraries.
|
||||||
|
|||||||
+26
-32
@@ -1,54 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Run this to generate all the initial makefiles, etc.
|
# Run this to generate all the initial makefiles, etc.
|
||||||
|
|
||||||
|
ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS"
|
||||||
|
LIBTOOLIZE_FLAGS="--force $LIBTOOLIZE_FLAGS"
|
||||||
|
AUTOMAKE_FLAGS="--add-missing --copy --foreign $AUTOMAKE_FLAGS"
|
||||||
|
|
||||||
|
LIBTOOLIZE=`which libtoolize`
|
||||||
|
if [ "$LIBTOOLIZE" = "" ]; then
|
||||||
|
LIBTOOLIZE=`which glibtoolize`
|
||||||
|
fi
|
||||||
|
if [ "$LIBTOOLIZE" = "" ]; then
|
||||||
|
echo "libtoolize not found" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "+ making misc files ..."
|
echo "+ making misc files ..."
|
||||||
touch NEWS README AUTHORS ChangeLog
|
touch NEWS README AUTHORS ChangeLog
|
||||||
echo
|
echo
|
||||||
echo
|
$LIBTOOLIZE $LIBTOOLIZE_FLAGS || {
|
||||||
|
echo "libtoolize failed"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
echo
|
echo
|
||||||
echo "+ running aclocal ..."
|
echo "+ running aclocal ..."
|
||||||
aclocal $ACLOCAL_FLAGS || {
|
aclocal $ACLOCAL_FLAGS || {
|
||||||
echo
|
echo "aclocal failed - check that all needed development files are present on system"
|
||||||
echo "aclocal failed - check that all needed development files are present on system"
|
exit 1
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
echo
|
echo
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "+ running autoheader ... "
|
echo "+ running autoheader ... "
|
||||||
autoheader || {
|
autoheader || {
|
||||||
echo
|
echo "autoheader failed"
|
||||||
echo "autoheader failed"
|
exit 1
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
echo
|
echo
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "+ running libtoolize ... "
|
|
||||||
libtoolize --force || {
|
|
||||||
echo
|
|
||||||
echo "libtoolize failed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "+ running autoconf ... "
|
echo "+ running autoconf ... "
|
||||||
autoconf || {
|
autoconf || {
|
||||||
echo
|
echo "autoconf failed"
|
||||||
echo "autoconf failed"
|
exit 1
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
echo
|
echo
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "+ running automake ... "
|
echo "+ running automake ... "
|
||||||
automake -a -c --foreign || {
|
automake $AUTOMAKE_FLAGS || {
|
||||||
echo
|
echo "automake failed"
|
||||||
echo "automake failed"
|
exit 1
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
|
|
||||||
|
|||||||
Vendored
-1561
File diff suppressed because it is too large
Load Diff
Vendored
-1686
File diff suppressed because it is too large
Load Diff
+1
-57
@@ -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.6.3], [h5part@lists.psi.ch], H5Part)
|
AC_INIT([H5Part], [1.6.6], [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.
|
||||||
# If the version of Autoconf being used to create configure is earlier than version,
|
# If the version of Autoconf being used to create configure is earlier than version,
|
||||||
@@ -54,20 +54,6 @@ AC_ARG_WITH(
|
|||||||
[path to HDF5 installation [default=""]])],
|
[path to HDF5 installation [default=""]])],
|
||||||
[HDF5PATH=$withval], [HDF5PATH=""])
|
[HDF5PATH=$withval], [HDF5PATH=""])
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
SAVE_CC=$CC
|
|
||||||
SAVE_CXX=$CXX
|
|
||||||
SAVE_FC=$FC
|
|
||||||
SAVE_CFLAGS=$CFLAGS
|
|
||||||
SAVE_CXXFLAGS=$CXXFLAGS
|
|
||||||
SAVE_FFLAGS=$FFLAGS
|
|
||||||
SAVE_INCLUDES=$INCLUDES
|
|
||||||
SAVE_LDFLAGS=$LDFLAGS
|
|
||||||
SAVE_LIBS=$LIBS
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
############### PATH SERACH FUNCTION - to be used later... ####################
|
############### PATH SERACH FUNCTION - to be used later... ####################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -316,48 +302,6 @@ AC_TYPE_SSIZE_T
|
|||||||
AC_FUNC_MALLOC
|
AC_FUNC_MALLOC
|
||||||
AC_CHECK_FUNCS([memset pow strchr strdup])
|
AC_CHECK_FUNCS([memset pow strchr strdup])
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
#if there was an external input for the variable...
|
|
||||||
if test -n "$SAVE_CC"; then
|
|
||||||
CC="$SAVE_CC"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_CXX"; then
|
|
||||||
CXX="$SAVE_CXX"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_FC"; then
|
|
||||||
FC="$SAVE_FC"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_CFLAGS"; then
|
|
||||||
CFLAGS="$SAVE_CFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_CXXFLAGS"; then
|
|
||||||
CFLAGS="$SAVE_CXXFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_FFLAGS"; then
|
|
||||||
FFLAGS="$SAVE_FFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_INCLUDES"; then
|
|
||||||
INCLUDES="$SAVE_INCLUDES"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_LDFLAGS"; then
|
|
||||||
LDFLAGS="$SAVE_LDFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$SAVE_LIBS"; then
|
|
||||||
LIBS="$SAVE_LIBS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
|
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
PROJECT_NAME = H5Part
|
PROJECT_NAME = H5Part
|
||||||
PROJECT_NUMBER = 1.6.1
|
PROJECT_NUMBER = 1.6.6
|
||||||
OUTPUT_DIRECTORY = ./ReferencePages
|
OUTPUT_DIRECTORY = ./ReferencePages
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|||||||
+247
-4
@@ -269,17 +269,16 @@ static h5part_int64_t
|
|||||||
_allgather (
|
_allgather (
|
||||||
const H5PartFile *f /*!< IN: file handle */
|
const H5PartFile *f /*!< IN: file handle */
|
||||||
) {
|
) {
|
||||||
struct H5BlockPartition *partition = &f->block->user_layout[f->myproc];
|
|
||||||
struct H5BlockPartition *layout = f->block->user_layout;
|
struct H5BlockPartition *layout = f->block->user_layout;
|
||||||
|
|
||||||
MPI_Datatype partition_m;
|
MPI_Datatype partition_m;
|
||||||
size_t n = sizeof (struct H5BlockPartition) / sizeof (h5part_int64_t);
|
size_t n = sizeof (struct H5BlockPartition) / sizeof (h5part_int64_t);
|
||||||
|
|
||||||
MPI_Type_contiguous ( n, MPI_LONG_LONG, &partition_m );
|
MPI_Type_contiguous ( n, MPI_LONG_LONG, &partition_m );
|
||||||
MPI_Type_commit ( &partition_m );
|
MPI_Type_commit ( &partition_m );
|
||||||
|
|
||||||
MPI_Allgather ( partition, 1, partition_m, layout, 1, partition_m,
|
MPI_Allgather ( MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
|
||||||
f->comm );
|
layout, 1, partition_m, f->comm );
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -2010,6 +2009,250 @@ H5Block3dSetFieldSpacing (
|
|||||||
3 );
|
3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Get the explicit list of X coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are read into the 1D array \c coords which has
|
||||||
|
length \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the X
|
||||||
|
dimension of the field, and a warning will be printed if they differ.
|
||||||
|
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldXCoords(
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
h5part_float64_t *coords, /*!< OUT: X coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: length of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockGetFieldXCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->i_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match X dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->i_max + 1);
|
||||||
|
|
||||||
|
return _read_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_XCOORD_NAME,
|
||||||
|
coords );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Set an explicit list of X coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are a 1D array of floating point values with
|
||||||
|
dimension \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the X
|
||||||
|
dimension of the field, and a warning will be printed if not.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetFieldXCoords (
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
const h5part_float64_t *coords, /*!< IN: X coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: number of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockSetFieldXCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_WRITABLE_MODE( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->i_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match X dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->i_max + 1);
|
||||||
|
|
||||||
|
return _write_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_XCOORD_NAME,
|
||||||
|
(const hid_t)H5PART_FLOAT64,
|
||||||
|
coords,
|
||||||
|
coords_len
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Get the explicit list of Y coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are read into the 1D array \c coords which has
|
||||||
|
length \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the Y
|
||||||
|
dimension of the field, and a warning will be printed if they differ.
|
||||||
|
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldYCoords(
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
h5part_float64_t *coords, /*!< OUT: Y coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: length of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockGetFieldYCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->j_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match Y dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->j_max + 1);
|
||||||
|
|
||||||
|
return _read_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_YCOORD_NAME,
|
||||||
|
coords );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Set an explicit list of Y coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are a 1D array of floating point values with
|
||||||
|
dimension \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the Y
|
||||||
|
dimension of the field, and a warning will be printed if not.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetFieldYCoords (
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
const h5part_float64_t *coords, /*!< IN: Y coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: number of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockSetFieldYCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_WRITABLE_MODE( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->j_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match X dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->j_max + 1);
|
||||||
|
|
||||||
|
return _write_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_YCOORD_NAME,
|
||||||
|
(const hid_t)H5PART_FLOAT64,
|
||||||
|
coords,
|
||||||
|
coords_len
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Get the explicit list of Z coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are read into the 1D array \c coords which has
|
||||||
|
length \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the Z
|
||||||
|
dimension of the field, and a warning will be printed if they differ.
|
||||||
|
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldZCoords(
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
h5part_float64_t *coords, /*!< OUT: Z coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: length of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockGetFieldZCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->k_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match Z dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->k_max + 1);
|
||||||
|
|
||||||
|
return _read_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_ZCOORD_NAME,
|
||||||
|
coords );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5block_attrib
|
||||||
|
|
||||||
|
Set an explicit list of Z coordinates for field \c field_name in the current
|
||||||
|
time step. The coordinates are a 1D array of floating point values with
|
||||||
|
dimension \c coords_len.
|
||||||
|
|
||||||
|
By convention, the \c coords array should have the same length as the Z
|
||||||
|
dimension of the field, and a warning will be printed if not.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetFieldZCoords (
|
||||||
|
H5PartFile *f, /*!< IN: file handle */
|
||||||
|
const char *field_name, /*!< IN: field name */
|
||||||
|
const h5part_float64_t *coords, /*!< IN: Z coordinates */
|
||||||
|
const h5part_int64_t coords_len /*!< IN: number of coordinates */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5BlockSetFieldZCoords" );
|
||||||
|
BLOCK_INIT ( f );
|
||||||
|
CHECK_WRITABLE_MODE( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
CHECK_LAYOUT( f );
|
||||||
|
|
||||||
|
struct H5BlockStruct *b = f->block;
|
||||||
|
|
||||||
|
if (coords_len != b->k_max + 1)
|
||||||
|
_H5Part_print_warn( "Coordinate array length (%lld) does not match X dimension (%lld)",
|
||||||
|
(long long)coords_len, (long long)b->k_max + 1);
|
||||||
|
|
||||||
|
return _write_field_attrib (
|
||||||
|
f,
|
||||||
|
field_name,
|
||||||
|
H5BLOCK_FIELD_ZCOORD_NAME,
|
||||||
|
(const hid_t)H5PART_FLOAT64,
|
||||||
|
coords,
|
||||||
|
coords_len
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5block_model
|
\ingroup h5block_model
|
||||||
|
|
||||||
|
|||||||
@@ -232,4 +232,69 @@ INTEGER*8 FUNCTION h5bl_3d_set_field_origin ( filehandle, name, x, y, z )
|
|||||||
REAL*8, INTENT(IN) :: z
|
REAL*8, INTENT(IN) :: z
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dGetFieldXCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_get_field_xcoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(OUT) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dSetFieldXCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_set_field_xcoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(IN) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dGetFieldYCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_get_field_ycoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(OUT) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dSetFieldYCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_set_field_ycoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(IN) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dGetFieldZCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_get_field_zcoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(OUT) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
!> \ingroup h5blockf_attrib
|
||||||
|
!! See \ref H5Block3dSetFieldZCoords
|
||||||
|
!! \return 0 on success or error code
|
||||||
|
!<
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_set_field_zcoords ( filehandle, name, coords )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(IN) :: coords(*)
|
||||||
|
INTEGER*8, INTENT(IN) :: coords_len
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ extern "C" {
|
|||||||
|
|
||||||
#define H5BLOCK_FIELD_ORIGIN_NAME "__Origin__"
|
#define H5BLOCK_FIELD_ORIGIN_NAME "__Origin__"
|
||||||
#define H5BLOCK_FIELD_SPACING_NAME "__Spacing__"
|
#define H5BLOCK_FIELD_SPACING_NAME "__Spacing__"
|
||||||
|
#define H5BLOCK_FIELD_XCOORD_NAME "__X_Coordinates__"
|
||||||
|
#define H5BLOCK_FIELD_YCOORD_NAME "__Y_Coordinates__"
|
||||||
|
#define H5BLOCK_FIELD_ZCOORD_NAME "__Z_Coordinates__"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Interface for block structured field data.
|
Interface for block structured field data.
|
||||||
@@ -138,6 +141,54 @@ H5Block3dSetFieldSpacing (
|
|||||||
const h5part_float64_t z_spacing
|
const h5part_float64_t z_spacing
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldXCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetFieldXCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldYCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetFieldYCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dGetFieldZCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dSetZCoords (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t coords_len
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5BlockWriteFieldAttrib (
|
H5BlockWriteFieldAttrib (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
|
|||||||
+138
@@ -68,6 +68,24 @@
|
|||||||
#define h5bl_3d_get_field_origin F77NAME ( \
|
#define h5bl_3d_get_field_origin F77NAME ( \
|
||||||
h5bl_3d_get_field_origin_, \
|
h5bl_3d_get_field_origin_, \
|
||||||
H5BL_3D_GET_FIELD_origin )
|
H5BL_3D_GET_FIELD_origin )
|
||||||
|
#define h5bl_3d_get_field_xcoords F77NAME ( \
|
||||||
|
h5bl_3d_get_field_xcoords_, \
|
||||||
|
H5BL_3D_GET_FIELD_XCOORDS )
|
||||||
|
#define h5bl_3d_set_field_xcoords F77NAME ( \
|
||||||
|
h5bl_3d_set_field_xcoords_, \
|
||||||
|
H5BL_3D_SET_FIELD_XCOORDS )
|
||||||
|
#define h5bl_3d_get_field_ycoords F77NAME ( \
|
||||||
|
h5bl_3d_get_field_ycoords_, \
|
||||||
|
H5BL_3D_GET_FIELD_YCOORDS )
|
||||||
|
#define h5bl_3d_set_field_ycoords F77NAME ( \
|
||||||
|
h5bl_3d_set_field_ycoords_, \
|
||||||
|
H5BL_3D_SET_FIELD_YCOORDS )
|
||||||
|
#define h5bl_3d_get_field_zcoords F77NAME ( \
|
||||||
|
h5bl_3d_get_field_zcoords_, \
|
||||||
|
H5BL_3D_GET_FIELD_ZCOORDS )
|
||||||
|
#define h5bl_3d_set_field_zcoords F77NAME ( \
|
||||||
|
h5bl_3d_set_field_zcoords_, \
|
||||||
|
H5BL_3D_SET_FIELD_ZCOORDS )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -447,3 +465,123 @@ h5bl_3d_set_field_origin (
|
|||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
return herr;
|
return herr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_set_field_xcoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dSetFieldXCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_get_field_xcoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dGetFieldXCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_set_field_ycoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dSetFieldYCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_get_field_ycoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dGetFieldYCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_set_field_zcoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dSetFieldZCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5bl_3d_get_field_zcoords (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *coords,
|
||||||
|
const h5part_int64_t *coords_len,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dGetFieldZCoords (
|
||||||
|
filehandle, field_name2, coords, *coords_len );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ h5bl_3d_read_scalar_field_r8 (
|
|||||||
|
|
||||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat64 (
|
h5part_int64_t herr = H5Block3dReadScalarFieldFloat64 (
|
||||||
filehandle, field_name2, data );
|
filehandle, field_name2, data );
|
||||||
|
|
||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
@@ -161,7 +161,7 @@ h5bl_3d_read_scalar_field_r4 (
|
|||||||
|
|
||||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat32 (
|
h5part_int64_t herr = H5Block3dReadScalarFieldFloat32 (
|
||||||
filehandle, field_name2, data );
|
filehandle, field_name2, data );
|
||||||
|
|
||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
@@ -265,7 +265,7 @@ h5bl_3d_read_scalar_field_i8 (
|
|||||||
|
|
||||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt64 (
|
h5part_int64_t herr = H5Block3dReadScalarFieldInt64 (
|
||||||
filehandle, field_name2, data );
|
filehandle, field_name2, data );
|
||||||
|
|
||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
@@ -369,7 +369,7 @@ h5bl_3d_read_scalar_field_i4 (
|
|||||||
|
|
||||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt32 (
|
h5part_int64_t herr = H5Block3dReadScalarFieldInt32 (
|
||||||
filehandle, field_name2, data );
|
filehandle, field_name2, data );
|
||||||
|
|
||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
|
|||||||
+2
-2
@@ -567,10 +567,10 @@ _halo_exchange_buffers (
|
|||||||
ibufsize = (int)bufsize;
|
ibufsize = (int)bufsize;
|
||||||
if ( (h5part_int64_t)ibufsize != bufsize ) return HANDLE_MPI_INT64_ERR;
|
if ( (h5part_int64_t)ibufsize != bufsize ) return HANDLE_MPI_INT64_ERR;
|
||||||
|
|
||||||
send_buffer = malloc ( bufsize );
|
send_buffer = (char*) malloc ( bufsize );
|
||||||
if ( send_buffer == NULL ) return HANDLE_H5PART_NOMEM_ERR;
|
if ( send_buffer == NULL ) return HANDLE_H5PART_NOMEM_ERR;
|
||||||
|
|
||||||
recv_buffer = malloc ( bufsize );
|
recv_buffer = (char*) malloc ( bufsize );
|
||||||
if ( recv_buffer == NULL ) return HANDLE_H5PART_NOMEM_ERR;
|
if ( recv_buffer == NULL ) return HANDLE_H5PART_NOMEM_ERR;
|
||||||
|
|
||||||
/* forward */
|
/* forward */
|
||||||
|
|||||||
+15
-20
@@ -291,15 +291,15 @@ _H5Part_open_file (
|
|||||||
|
|
||||||
if ( align != 0 ) {
|
if ( align != 0 ) {
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
"Setting HDF5 alignment to %ld bytes",
|
"Setting HDF5 alignment to %lld bytes with threshold at half that many bytes",
|
||||||
align );
|
(long long)align );
|
||||||
if (H5Pset_alignment ( f->access_prop, 0, align ) < 0) {
|
if (H5Pset_alignment ( f->access_prop, align/2, align ) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
"Setting HDF5 meta block to %ld bytes",
|
"Setting HDF5 meta block to %lld bytes",
|
||||||
align );
|
(long long)align );
|
||||||
if (H5Pset_meta_block_size ( f->access_prop, align ) < 0) {
|
if (H5Pset_meta_block_size ( f->access_prop, align ) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
@@ -1314,6 +1314,9 @@ _H5Part_normalize_h5_type (
|
|||||||
if ( size==8 ) {
|
if ( size==8 ) {
|
||||||
return H5PART_INT64;
|
return H5PART_INT64;
|
||||||
}
|
}
|
||||||
|
else if ( size==4 ) {
|
||||||
|
return H5PART_INT32;
|
||||||
|
}
|
||||||
else if ( size==1 ) {
|
else if ( size==1 ) {
|
||||||
return H5PART_CHAR;
|
return H5PART_CHAR;
|
||||||
}
|
}
|
||||||
@@ -1343,9 +1346,7 @@ _H5Part_read_attrib (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
herr_t herr;
|
herr_t herr;
|
||||||
h5part_int64_t h5err;
|
|
||||||
hid_t attrib_id;
|
hid_t attrib_id;
|
||||||
hid_t space_id;
|
|
||||||
hid_t type_id;
|
hid_t type_id;
|
||||||
|
|
||||||
#ifdef H5PART_HAVE_HDF5_18
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
@@ -1361,15 +1362,9 @@ _H5Part_read_attrib (
|
|||||||
type_id = H5Aget_type ( attrib_id );
|
type_id = H5Aget_type ( attrib_id );
|
||||||
if ( type_id < 0 ) return HANDLE_H5A_GET_TYPE_ERR;
|
if ( type_id < 0 ) return HANDLE_H5A_GET_TYPE_ERR;
|
||||||
|
|
||||||
space_id = H5Aget_space ( attrib_id );
|
|
||||||
if ( space_id < 0 ) return HANDLE_H5A_GET_SPACE_ERR;
|
|
||||||
|
|
||||||
herr = H5Aread ( attrib_id, type_id, attrib_value );
|
herr = H5Aread ( attrib_id, type_id, attrib_value );
|
||||||
if ( herr < 0 ) return HANDLE_H5A_READ_ERR;
|
if ( herr < 0 ) return HANDLE_H5A_READ_ERR;
|
||||||
|
|
||||||
herr = H5Sclose ( space_id );
|
|
||||||
if ( herr < 0 ) return HANDLE_H5S_CLOSE_ERR;
|
|
||||||
|
|
||||||
herr = H5Tclose ( type_id );
|
herr = H5Tclose ( type_id );
|
||||||
if ( herr < 0 ) return HANDLE_H5T_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5T_CLOSE_ERR;
|
||||||
|
|
||||||
@@ -2086,9 +2081,6 @@ _H5Part_iteration_operator2 (
|
|||||||
void *operator_data /*!< [in,out] data passed to the iterator */
|
void *operator_data /*!< [in,out] data passed to the iterator */
|
||||||
) {
|
) {
|
||||||
|
|
||||||
struct _iter_op_data *data = (struct _iter_op_data*)operator_data;
|
|
||||||
herr_t herr = 0;
|
|
||||||
|
|
||||||
switch (linfo->type) {
|
switch (linfo->type) {
|
||||||
case H5L_TYPE_HARD: {
|
case H5L_TYPE_HARD: {
|
||||||
|
|
||||||
@@ -2332,7 +2324,11 @@ _H5Part_get_object_name (
|
|||||||
data.len = (size_t)len_obj_name;
|
data.len = (size_t)len_obj_name;
|
||||||
|
|
||||||
#ifdef H5PART_HAVE_HDF5_18
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
hid_t child_id = H5Gopen ( group_id, group_name, H5P_DEFAULT );
|
hid_t child_id = H5Gopen ( group_id, group_name
|
||||||
|
#ifndef H5_USE_16_API
|
||||||
|
, H5P_DEFAULT
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if ( child_id < 0 ) return child_id;
|
if ( child_id < 0 ) return child_id;
|
||||||
herr = H5Literate ( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
herr = H5Literate ( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
||||||
_H5Part_iteration_operator2, &data );
|
_H5Part_iteration_operator2, &data );
|
||||||
@@ -2855,9 +2851,9 @@ _set_view_indices (
|
|||||||
herr = _reset_view ( f );
|
herr = _reset_view ( f );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
if ( indices == NULL || nelems <= 0 ) {
|
if ( indices == NULL || nelems < 0 ) {
|
||||||
_H5Part_print_warn (
|
_H5Part_print_warn (
|
||||||
"View indices array is null or size is <= 0: reseting view." );
|
"View indices array is null or size is < 0: reseting view." );
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3210,7 +3206,6 @@ _read_data (
|
|||||||
"elements selected (%lld) than are available "
|
"elements selected (%lld) than are available "
|
||||||
"in memory (%lld).",
|
"in memory (%lld).",
|
||||||
name2, (long long)nread, (long long)nmem );
|
name2, (long long)nread, (long long)nmem );
|
||||||
memspace_id == H5S_ALL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -115,9 +115,10 @@ END FUNCTION
|
|||||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||||
!!
|
!!
|
||||||
|
!! See \ref H5PartOpenFileParallelAlign
|
||||||
!! \return 0 on success or error code
|
!! \return 0 on success or error code
|
||||||
!<
|
!<
|
||||||
INTEGER*8 FUNCTION h5pt_openr_par_align ( filename, mpi_communicator, align )
|
INTEGER*8 FUNCTION h5pt_openr_par_align ( filename, mpi_communicator, align, flags )
|
||||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||||
|
|||||||
+2
-2
@@ -16,10 +16,10 @@ extern "C" {
|
|||||||
#include "H5MultiBlock.h"
|
#include "H5MultiBlock.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define H5PART_VER_STRING "1.6.3"
|
#define H5PART_VER_STRING "1.6.6"
|
||||||
#define H5PART_VER_MAJOR 1
|
#define H5PART_VER_MAJOR 1
|
||||||
#define H5PART_VER_MINOR 6
|
#define H5PART_VER_MINOR 6
|
||||||
#define H5PART_VER_RELEASE 3
|
#define H5PART_VER_RELEASE 6
|
||||||
|
|
||||||
/* error values */
|
/* error values */
|
||||||
#define H5PART_SUCCESS 0
|
#define H5PART_SUCCESS 0
|
||||||
|
|||||||
@@ -116,6 +116,24 @@ _H5Part_write_attrib (
|
|||||||
const hsize_t attrib_nelem
|
const hsize_t attrib_nelem
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
_H5Part_write_file_attrib (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const hid_t type,
|
||||||
|
const void *value,
|
||||||
|
const hsize_t nelem
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
_H5Part_write_step_attrib (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const hid_t type,
|
||||||
|
const void *value,
|
||||||
|
const hsize_t nelem
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
_H5Part_get_attrib_info (
|
_H5Part_get_attrib_info (
|
||||||
hid_t id,
|
hid_t id,
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# (
|
|||||||
|
|
||||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
h5part_int64_t herr = H5Block#DIM#dWriteScalarField#TYPE_ABV# (
|
h5part_int64_t herr = H5Block#DIM#dReadScalarField#TYPE_ABV# (
|
||||||
filehandle, field_name2, data );
|
filehandle, field_name2, data );
|
||||||
|
|
||||||
free ( field_name2 );
|
free ( field_name2 );
|
||||||
|
|||||||
+2
-2
@@ -22,6 +22,6 @@ test_LDADD = ../src/libH5Part.la
|
|||||||
testf_SOURCES = testf.F90
|
testf_SOURCES = testf.F90
|
||||||
testf_LDADD = ../src/libH5PartF.la
|
testf_LDADD = ../src/libH5PartF.la
|
||||||
|
|
||||||
clean: clean-am
|
clean-local:
|
||||||
rm -f *.h5
|
$(RM) -f *.h5
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
program H5BlockCoordsTest
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
include 'mpif.h'
|
||||||
|
#endif
|
||||||
|
include 'H5PartF.h'
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
integer :: ierr, comm
|
||||||
|
#endif
|
||||||
|
integer*8 :: file_id, status, i
|
||||||
|
real*8, allocatable :: r8buf(:,:,:), r8buf3(:,:,:,:), coords(:)
|
||||||
|
real*8 :: x, y, z
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
call MPI_INIT(ierr)
|
||||||
|
comm = MPI_COMM_WORLD
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! this enables level 4 ("debug") messages to be
|
||||||
|
! printed by the H5Part library
|
||||||
|
! (4_8 is the literal for an integer*8 with value 4)
|
||||||
|
status = h5pt_set_verbosity_level (4_8)
|
||||||
|
|
||||||
|
! open the a file called 'test.h5' in parallel for writing
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
file_id = h5pt_openw_par_align ('test.h5', comm, 1048576_8, "vfd_mpiposix")
|
||||||
|
#else
|
||||||
|
file_id = h5pt_openw_align ('test.h5', 1048576_8, "vfd_mpiposix")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
status = h5bl_define3dlayout(file_id, 1_8, 30_8, 1_8, 30_8, 1_8, 30_8)
|
||||||
|
|
||||||
|
! in the Fortran API, steps start at 1
|
||||||
|
status = h5pt_setstep (file_id, 1_8)
|
||||||
|
|
||||||
|
! create fake data
|
||||||
|
allocate(r8buf(30,30,30))
|
||||||
|
allocate(r8buf3(30,30,30,3))
|
||||||
|
allocate(coords(30))
|
||||||
|
x = 1.0
|
||||||
|
y = 2.0
|
||||||
|
z = 3.0
|
||||||
|
|
||||||
|
! write the data
|
||||||
|
status = h5bl_3d_write_scalar_field_r8(file_id, "x", r8buf(1,1,1))
|
||||||
|
status = h5bl_3d_set_field_origin(file_id, "x", x, y, z)
|
||||||
|
status = h5bl_3d_set_field_spacing(file_id, "x", x, y, z)
|
||||||
|
|
||||||
|
status = h5bl_3d_write_3dvector_field_r8(file_id, "v", r8buf3(1,1,1,1), r8buf3(1,1,1,2), r8buf3(1,1,1,3))
|
||||||
|
status = h5bl_3d_set_field_origin(file_id, "v", x, y, z)
|
||||||
|
status = h5bl_3d_set_field_spacing(file_id, "v", x, y, z)
|
||||||
|
|
||||||
|
! create fake coordinates
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = 3*i
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_set_field_xcoords(file_id, "v", coords, 30_8)
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = 3*i + 1
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_set_field_ycoords(file_id, "v", coords, 30_8)
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = 3*i + 2
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_set_field_zcoords(file_id, "v", coords, 30_8)
|
||||||
|
|
||||||
|
! read fake coordinates
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = -1
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_get_field_xcoords(file_id, "v", coords, 30_8)
|
||||||
|
write(*, *) coords
|
||||||
|
!write(*, "I3") ( coords(i), i=1, 30 )
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = -1
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_get_field_ycoords(file_id, "v", coords, 30_8)
|
||||||
|
write(*, *) coords
|
||||||
|
!write(*, "I3") ( coords(i), i=1, 30 )
|
||||||
|
do i = 1, 30
|
||||||
|
coords(i) = -1
|
||||||
|
enddo
|
||||||
|
status = h5bl_3d_get_field_zcoords(file_id, "v", coords, 30_8)
|
||||||
|
write(*, *) coords
|
||||||
|
!write(*, "I3") ( coords(i), i=1, 30 )
|
||||||
|
|
||||||
|
! close the file
|
||||||
|
status = h5pt_close (file_id)
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
call MPI_FINALIZE(ierr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
end program H5BlockCoordsTest
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <string.h>
|
||||||
#include <H5Part.h>
|
#include <H5Part.h>
|
||||||
|
|
||||||
#include "testframe.h"
|
#include "testframe.h"
|
||||||
|
|||||||
+3
-3
@@ -536,7 +536,7 @@ TestPrintf(const char *format, ...)
|
|||||||
int nproc;
|
int nproc;
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
||||||
if ( nproc == 0 || VERBOSE_HI ) {
|
if ( nproc == 0 || VERBOSE_HI ) {
|
||||||
char *format2 = malloc(strlen(format)+8);
|
char *format2 = (char*)malloc(strlen(format)+8);
|
||||||
sprintf(format2, "[%d] %s", nproc, format);
|
sprintf(format2, "[%d] %s", nproc, format);
|
||||||
va_start(arglist, format);
|
va_start(arglist, format);
|
||||||
ret_value = vprintf(format2, arglist);
|
ret_value = vprintf(format2, arglist);
|
||||||
@@ -570,7 +570,7 @@ TestErrPrintf(const char *format, ...)
|
|||||||
int nproc;
|
int nproc;
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
||||||
if ( nproc == 0 || VERBOSE_HI ) {
|
if ( nproc == 0 || VERBOSE_HI ) {
|
||||||
char *format2 = malloc(strlen(format)+8);
|
char *format2 = (char*)malloc(strlen(format)+8);
|
||||||
sprintf(format2, "[%d] %s", nproc, format);
|
sprintf(format2, "[%d] %s", nproc, format);
|
||||||
va_start(arglist, format);
|
va_start(arglist, format);
|
||||||
ret_value = vfprintf(stderr, format2, arglist);
|
ret_value = vfprintf(stderr, format2, arglist);
|
||||||
@@ -661,7 +661,7 @@ test_open_objects(H5PartFile *file, int max_objects)
|
|||||||
"at line %4d in %s\n", nopen, max_objects,
|
"at line %4d in %s\n", nopen, max_objects,
|
||||||
(int)__LINE__, __FILE__ );
|
(int)__LINE__, __FILE__ );
|
||||||
|
|
||||||
hid_t *list = malloc(sizeof(hid_t)*nopen);
|
hid_t *list = (hid_t)malloc(sizeof(hid_t)*nopen);
|
||||||
H5Fget_obj_ids(file->file, H5F_OBJ_ALL, nopen, list);
|
H5Fget_obj_ids(file->file, H5F_OBJ_ALL, nopen, list);
|
||||||
|
|
||||||
H5O_info_t info;
|
H5O_info_t info;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#ifndef _H5PART_TESTFRAME_H_
|
#ifndef _H5PART_TESTFRAME_H_
|
||||||
#define _H5PART_TESTFRAME_H_
|
#define _H5PART_TESTFRAME_H_
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
#define OPEN(file,mode) \
|
#define OPEN(file,mode) \
|
||||||
H5PartOpenFileParallel(file,mode,MPI_COMM_WORLD)
|
H5PartOpenFileParallel(file,mode,MPI_COMM_WORLD)
|
||||||
|
|||||||
+330
-919
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user