Commit 122e913f authored by Marc Howison's avatar Marc Howison

Merged changes from LBL, including:

* read/write call variants for different datatypes
* HDF5 properties tuned for lustre filesystems and the Cray XT (enabled using flags passed during file open)
* HDF5 chunking for field data
* HDF5 alignment (set during file open)
* support for both HDF5 1.6 and 1.8 using #if statements
* a new error reporting level: debug_detail (HDF5 errors are now printed at debug level 1 by default)

These changes have undergone limited testing.
I will begin using this version for my H5Part projects so that I can test it more thoroughly.

~Mark
parent a2d2a02c
* text=auto !eol
/AUTHORS -text
/COPYRIGHT -text
/COPYING -text
/ChangeLog -text
/GNUmakefile.orig -text
/INSTALL -text
/Makefile.am -text
/Makefile.orig -text
/NEWS -text
......@@ -27,6 +28,10 @@ src/H5BlockErrors.h -text
src/H5BlockF.c -text
src/H5BlockF90.inc -text
src/H5BlockPrivate.h -text
src/H5BlockReadWrite.c -text
src/H5BlockReadWrite.h -text
src/H5BlockReadWriteF.c -text
src/H5BlockReadWriteF90.inc -text
src/H5BlockTypes.h -text
src/H5Part.c -text
src/H5Part.h -text
......@@ -38,6 +43,7 @@ src/H5PartTypes.h -text
src/Makefile.am -text
src/TestUnderscore.f -text
src/TestUnderscoreC.c -text
src/generate-h5bl-readwrite.py -text
test/Bench.c -text
test/BlockTestSpecs.txt -text
test/H5BlockDissolveGhosts.c -text
......
......@@ -6,5 +6,6 @@ Benedikt Oswald (PSI)
Wes Bethel (NERSC/LBNL)
John Shalf (NERSC/LBNL)
Cristina Siegerist (NERSC/LBNL)
Mark Howison (NERSC/LBNL)
Please use h5part@lists.psi.ch for communicaion.
*** Copyright Notice ***
H5Part Copyright (c) 2006-2009, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of any
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
Institut (Switzerland). All rights reserved.
If you have questions about your rights to use or distribute this
software, please contact Berkeley Lab's Technology Transfer Department
at TTD@lbl.gov referring to "H5Part (LBNL Ref CR-2255)"
NOTICE. This software was developed under partial funding from the U.S.
Department of Energy. As such, the U.S. Government has been granted for
itself and others acting on its behalf a paid-up, nonexclusive,
irrevocable, worldwide license in the Software to reproduce, prepare
derivative works, and perform publicly and display publicly. Beginning
five (5) years after the date permission to assert copyright is obtained
from the U.S. Department of Energy, and subject to any subsequent five
(5) year renewals, the U.S. Government is granted for itself and others
acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide
license in the Software to reproduce, prepare derivative works,
distribute copies to the public, perform publicly and display publicly,
and to permit others to do so.
*** License agreement ***
H5Part Copyright (c) 2006-2009, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of any
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
Institut (Switzerland). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
(1) Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
(3) Neither the name of the University of California, Lawrence Berkeley
National Laboratory, U.S. Dept. of Energy, Paul Scherrer Institut
(Switzerland) nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You are under no obligation whatsoever to provide any bug fixes,
patches, or upgrades to the features, functionality or performance of
the source code ("Enhancements") to anyone; however, if you choose to
make your Enhancements available either publicly, or directly to
Lawrence Berkeley National Laboratory, without imposing a separate
written license agreement for such Enhancements, then you hereby grant
the following license: a non-exclusive, royalty-free perpetual license
to install, use, modify, prepare derivative works, incorporate into
other computer software, distribute, and sublicense such enhancements or
derivative works thereof, in binary and source code form.
*** Copyright Notice ***
H5Part Copyright (c) 2006, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov referring to "H5Part (LBNL Ref CR-2255)"
NOTICE. This software was developed under partial funding from the U.S. Department of Energy. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.
This diff is collapsed.
This diff is collapsed.
# Every configure script must call AC_INIT before doing anything else.
# AC_INIT (package, version, [bug-report], [tarname])
AC_INIT([H5Part], [1.4.0], [h5part@lists.psi.ch], H5Part)
AC_INIT([H5Part], [1.5], [h5part@lists.psi.ch], H5Part)
# Ensure that a recent enough version of Autoconf is being used.
......@@ -245,7 +245,15 @@ if test "X$USE_FORTRAN" = "Xyes"; then
fi
if test ! $uname = "AIX"; then
FFLAGS="${FFLAGS} -fPIC -fno-second-underscore"
FFLAGS="${FFLAGS} -fPIC"
fi
if test $FC = "g90"; then
FFLAGS="${FFLAGS} -fno-second-underscore"
fi
if test $FC = "g95"; then
FFLAGS="${FFLAGS} -fno-second-underscore"
fi
AC_MSG_CHECKING([symbol convention in object files])
......
This diff is collapsed.
......@@ -5,11 +5,18 @@
extern "C" {
#endif
/*!
Interface for block structured field data
/*!
Include read/write call variants for different data types and
field dimensions.
*/
#include "H5BlockReadWrite.h"
#define H5BLOCK_FIELD_ORIGIN_NAME "__Origin__"
#define H5BLOCK_FIELD_SPACING_NAME "__Spacing__"
/*!
Interface for block structured field data.
*/
h5part_int64_t
H5BlockDefine3DFieldLayout (
H5PartFile *f,
......@@ -21,6 +28,21 @@ H5BlockDefine3DFieldLayout (
const h5part_int64_t k_end
);
h5part_int64_t
H5BlockDefine3DChunkDims (
H5PartFile *f,
const h5part_int64_t i,
const h5part_int64_t j,
const h5part_int64_t k
);
h5part_int64_t
H5BlockGet3DChunkDims(
H5PartFile *f,
const char *field_name,
h5part_int64_t *dims
);
h5part_int64_t
H5Block3dGetPartitionOfProc (
H5PartFile *f,
......@@ -53,20 +75,6 @@ H5Block3dGetProcOf (
h5part_int64_t k
);
h5part_int64_t
H5Block3dWriteScalarField (
H5PartFile *f,
const char *name,
const h5part_float64_t *data
);
h5part_int64_t
H5Block3dReadScalarField (
H5PartFile *f,
const char *name,
h5part_float64_t *data
);
h5part_int64_t
H5BlockGetNumFields (
H5PartFile *f
......@@ -80,7 +88,7 @@ H5BlockGetFieldInfo (
const h5part_int64_t len_name,
h5part_int64_t *grid_rank,
h5part_int64_t *grid_dims,
h5part_int64_t *field_dims
h5part_int64_t *field_rank
);
h5part_int64_t
......@@ -89,7 +97,7 @@ H5BlockGetFieldInfoByName (
const char *field_name,
h5part_int64_t *grid_rank,
h5part_int64_t *grid_dims,
h5part_int64_t *field_dims
h5part_int64_t *field_rank
);
h5part_int64_t
......@@ -128,26 +136,6 @@ H5Block3dSetFieldSpacing (
const h5part_float64_t z_spacing
);
h5part_int64_t
H5Block3dWrite3dVectorField (
H5PartFile *f,
const char *name,
const h5part_float64_t *xval,
const h5part_float64_t *yval,
const h5part_float64_t *zval
);
h5part_int64_t
H5Block3dRead3dVectorField (
H5PartFile *f,
const char *name,
h5part_float64_t *xval,
h5part_float64_t *yval,
h5part_float64_t *zval
);
h5part_int64_t
H5BlockWriteFieldAttrib (
H5PartFile *f,
......
......@@ -17,6 +17,9 @@
#define h5bl_define3dlayout F77NAME ( \
h5bl_define3dlayout_, \
H5BL_DEFINE3DLAYOUT )
#define h5bl_define3dchunkdims F77NAME ( \
h5bl_define3dchunkdims_, \
H5BL_DEFINE3DCHUNKDIMS )
#define h5bl_get_partition_of_proc F77NAME ( \
h5bl_get_partition_of_proc_, \
H5BL_GET_PARTITION_OF_PROC )
......@@ -26,18 +29,6 @@
#define h5bl_get_proc_of F77NAME ( \
h5bl_get_proc_of_, \
H5BL_GET_PROC_OF )
#define h5bl_3d_read_scalar_field F77NAME ( \
h5bl_3d_read_scalar_field_, \
H5BL_3D_READ_SCALAR_FIELD )
#define h5bl_3d_write_scalar_field F77NAME ( \
h5bl_3d_write_scalar_field_, \
H5BL_3D_WRITE_SCALAR_FIELD )
#define h5bl_3d_read_3dvector_field F77NAME ( \
h5bl_3d_read_3dvector_field_, \
H5BL_3D_READ_3DVECTOR_FIELD )
#define h5bl_3d_write_3dvector_field F77NAME ( \
h5bl_3d_write_3dvector_field_, \
H5BL_3D_WRITE_3DVECTOR_FIELD )
#define h5bl_getnumfields F77NAME ( \
h5bl_getnumfields_, \
H5BL_GETNUMFIELDS )
......@@ -105,6 +96,19 @@ h5bl_define3dlayout (
*k_start-1, *k_end-1 );
}
h5part_int64_t
h5bl_define3dchunkdims (
h5part_int64_t *f,
const h5part_int64_t i,
const h5part_int64_t j,
const h5part_int64_t k
) {
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
return H5BlockDefine3DChunkDims ( filehandle, i, j, k );
}
h5part_int64_t
h5bl_get_partition_of_proc (
h5part_int64_t *f, /*!< file handle */
......@@ -178,86 +182,6 @@ h5bl_get_proc_of (
return H5Block3dGetProcOf ( filehandle, (*i)-1, (*j)-1, (*k)-1 );
}
h5part_int64_t
h5bl_3d_read_scalar_field (
h5part_int64_t *f,
const char *field_name,
h5part_float64_t *data,
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 = H5Block3dReadScalarField (
filehandle, field_name2, data );
free ( field_name2 );
return herr;
}
h5part_int64_t
h5bl_3d_write_scalar_field (
h5part_int64_t *f,
const char *field_name,
const h5part_float64_t *data,
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 = H5Block3dWriteScalarField (
filehandle, field_name2, data );
free ( field_name2 );
return herr;
}
h5part_int64_t
h5bl_3d_read_3dvector_field (
h5part_int64_t *f, /*!< file handle */
const char *field_name, /*!< name of the data set */
h5part_float64_t *xval, /*!< array of x component data */
h5part_float64_t *yval, /*!< array of y component data */
h5part_float64_t *zval, /*!< array of z component data */
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 = H5Block3dRead3dVectorField (
filehandle, field_name2, xval, yval, zval );
free ( field_name2 );
return herr;
}
h5part_int64_t
h5bl_3d_write_3dvector_field (
h5part_int64_t *f, /*!< file handle */
const char *field_name, /*!< name of the data set */
const h5part_float64_t *xval, /*!< array of x component data */
const h5part_float64_t *yval, /*!< array of y component data */
const h5part_float64_t *zval, /*!< array of z component data */
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 = H5Block3dWrite3dVectorField (
filehandle, field_name2, xval, yval, zval );
free ( field_name2 );
return herr;
}
h5part_int64_t
h5bl_getnumfields (
h5part_int64_t *f /*!< file handle */
......
This diff is collapsed.
......@@ -3,4 +3,52 @@
#define H5BLOCK_GROUPNAME_BLOCK "Block"
#define INIT( f ) { \
h5part_int64_t herr = _H5Block_init ( f ); \
if ( herr < 0 ) return herr; \
}
h5part_int64_t
_H5Block_init (
H5PartFile *f
);
h5part_int64_t
_H5Block_close (
H5PartFile *f
);
h5part_int64_t
_H5Block_open_field_group (
H5PartFile *f,
const char *name
);
h5part_int64_t
_H5Block_close_field_group (
H5PartFile *f
);
h5part_int64_t
_H5Block_create_field_group (
H5PartFile *f,
const char *name
);
h5part_int64_t
_H5Block_write_data (
H5PartFile *f,
const char *name,
const void *data,
const hid_t type
);
h5part_int64_t
_H5Block_read_data (
H5PartFile *f,
const char *name,
void *data,
hid_t type
);
#endif
This diff is collapsed.
#ifndef __H5BLOCKREADWRITE_H
#define __H5BLOCKREADWRITE_H
#ifdef __cplusplus
extern "C" {
#endif
h5part_int64_t
H5Block3dWriteScalarFieldFloat64 (
H5PartFile *f,
const char *name,
const h5part_float64_t *data
);
h5part_int64_t
H5Block3dReadScalarFieldFloat64 (
H5PartFile *f,
const char *name,
h5part_float64_t *data
);
h5part_int64_t
H5Block3dWrite3dVectorFieldFloat64 (
H5PartFile *f,
const char *name,
const h5part_float64_t *xval,
const h5part_float64_t *yval,
const h5part_float64_t *zval
);
h5part_int64_t
H5Block3dRead3dVectorFieldFloat64 (
H5PartFile *f,
const char *name,
h5part_float64_t *xval,
h5part_float64_t *yval,
h5part_float64_t *zval
);
h5part_int64_t
H5Block3dWriteScalarFieldFloat32 (
H5PartFile *f,
const char *name,
const h5part_float32_t *data
);
h5part_int64_t
H5Block3dReadScalarFieldFloat32 (
H5PartFile *f,
const char *name,
h5part_float32_t *data
);
h5part_int64_t
H5Block3dWrite3dVectorFieldFloat32 (
H5PartFile *f,
const char *name,
const h5part_float32_t *xval,
const h5part_float32_t *yval,
const h5part_float32_t *zval
);
h5part_int64_t
H5Block3dRead3dVectorFieldFloat32 (
H5PartFile *f,
const char *name,
h5part_float32_t *xval,
h5part_float32_t *yval,
h5part_float32_t *zval
);
h5part_int64_t
H5Block3dWriteScalarFieldInt64 (
H5PartFile *f,
const char *name,
const h5part_int64_t *data
);
h5part_int64_t
H5Block3dReadScalarFieldInt64 (
H5PartFile *f,
const char *name,
h5part_int64_t *data
);
h5part_int64_t
H5Block3dWrite3dVectorFieldInt64 (
H5PartFile *f,
const char *name,
const h5part_int64_t *xval,
const h5part_int64_t *yval,
const h5part_int64_t *zval
);
h5part_int64_t
H5Block3dRead3dVectorFieldInt64 (
H5PartFile *f,
const char *name,
h5part_int64_t *xval,
h5part_int64_t *yval,
h5part_int64_t *zval
);
h5part_int64_t
H5Block3dWriteScalarFieldInt32 (
H5PartFile *f,
const char *name,
const h5part_int32_t *data
);
h5part_int64_t
H5Block3dReadScalarFieldInt32 (
H5PartFile *f,
const char *name,
h5part_int32_t *data
);
h5part_int64_t
H5Block3dWrite3dVectorFieldInt32 (
H5PartFile *f,
const char *name,
const h5part_int32_t *xval,
const h5part_int32_t *yval,
const h5part_int32_t *zval
);
h5part_int64_t
H5Block3dRead3dVectorFieldInt32 (
H5PartFile *f,
const char *name,
h5part_int32_t *xval,
h5part_int32_t *yval,
h5part_int32_t *zval
);
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
INTERFACE
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*8, INTENT(IN) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*8, INTENT(OUT) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_r8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*8, INTENT(IN) :: x(*)
REAL*8, INTENT(IN) :: y(*)
REAL*8, INTENT(IN) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_r8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*8, INTENT(OUT) :: x(*)
REAL*8, INTENT(OUT) :: y(*)
REAL*8, INTENT(OUT) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*4, INTENT(IN) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*4, INTENT(OUT) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_r4 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*4, INTENT(IN) :: x(*)
REAL*4, INTENT(IN) :: y(*)
REAL*4, INTENT(IN) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_r4 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
REAL*4, INTENT(OUT) :: x(*)
REAL*4, INTENT(OUT) :: y(*)
REAL*4, INTENT(OUT) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*8, INTENT(IN) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*8, INTENT(OUT) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_i8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*8, INTENT(IN) :: x(*)
INTEGER*8, INTENT(IN) :: y(*)
INTEGER*8, INTENT(IN) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_i8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*8, INTENT(OUT) :: x(*)
INTEGER*8, INTENT(OUT) :: y(*)
INTEGER*8, INTENT(OUT) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*4, INTENT(IN) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*4, INTENT(OUT) :: data(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_i4 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*4, INTENT(IN) :: x(*)
INTEGER*4, INTENT(IN) :: y(*)
INTEGER*4, INTENT(IN) :: z(*)
END FUNCTION
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_i4 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER*4, INTENT(OUT) :: x(*)