added h5hutcc wrapper

updated documentation
finished merging the Fortran interface and refactoring H5Block
started an H5Block regression test
This commit is contained in:
Marc Howison
2010-07-20 18:23:48 +00:00
parent 7ea00c38f8
commit 5f6808947a
37 changed files with 1322 additions and 647 deletions
+1
View File
@@ -554,6 +554,7 @@ tools/H5PartMerge/src/optparse.cpp -text
tools/H5PartMerge/src/optparse.hh -text
tools/Makefile.am -text
tools/README -text
tools/h5hutcc.in -text
tools/h5pAttrib.cc -text
tools/h5pToGNUplot.cc -text
tools/homdynToH5p.cc -text
+1 -1
View File
@@ -1,6 +1,6 @@
*** Copyright Notice ***
H5Part Copyright (c) 2006-2009, The Regents of the University of California,
H5hut Copyright (c) 2006-2010, 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.
+42 -41
View File
@@ -77,13 +77,13 @@ SAVE_FC=$FC
SAVE_MPICC=$MPICC
SAVE_MPICXX=$MPICXX
SAVE_MPIFC=$MPIFC
SAVE_MPILIB=$MPILIB
SAVE_MPIINC=$MPIINC
SAVE_CFLAGS=$CFLAGS
SAVE_FFLAGS=$FFLAGS
SAVE_INCLUDES=$INCLUDES
SAVE_LDFLAGS=$LDFLAGS
SAVE_LIBS=$LIBS
SAVE_MPIROOT=$MPIROOT
SAVE_HDF5ROOT=$HDF5ROOT
SAVE_LDFLAGS=$LDFLAGS
###############################################################################
############### PATH SERACH FUNCTION - to be used later... ####################
@@ -241,7 +241,7 @@ AC_MSG_CHECKING([if parallel interface enabled])
if test "X$USE_PARALLEL" = "Xyes"; then
AC_MSG_RESULT([yes])
CFLAGS="${CFLAGS} -DPARALLEL_IO -DH5_HAVE_PARALLEL -DMPICH_IGNORE_CXX_SEEK"
CFLAGS="${CFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
AC_MSG_CHECKING([if we can compile MPI code without setting flags])
AC_TRY_LINK([#include "mpi.h"], [
@@ -288,8 +288,7 @@ if test "X$USE_PARALLEL" = "Xyes"; then
fi
if test -z "$MPICC" -o -z "$MPICXX"; then
MPIINC="${MPIINC} -I${MPIROOT}/include"
FFLAGS="${FFLAGS} -I${MPIROOT}/include"
INCLUDES="${INCLUDES} -I${MPIROOT}/include"
AC_MSG_CHECKING([for name of MPI lib ])
if test -e ${MPIROOT}/lib/libmpi.a; then
MPILIB="-L${MPIROOT}/lib -lmpi"
@@ -391,24 +390,21 @@ if test -z "$HDF5ROOT"; then
exit 1
fi
INCLUDES="$INCLUDES -I$HDF5ROOT/include"
LDFLAGS="$LDFLAGS -L$HDF5ROOT/lib"
LIBS="$LIBS -lhdf5"
AC_MSG_CHECKING([if we need to link to libsz ])
if test -n "$HDF5ROOT"; then
if test -f $HDF5ROOT/lib/libsz.a; then
AC_MSG_RESULT([yes])
SZLIB="-L$HDF5ROOT/lib/ -lsz"
LDFLAGS="$LDFLAGS -L$HDF5ROOT/lib"
LIBS="$LIBS -lsz"
else
AC_MSG_RESULT([no])
SZLIB=""
fi
fi
AC_MSG_CHECKING([for static zlib root ])
AC_MSG_RESULT([ ])
PATH_Search ZLIBROOT '/apps/zlib' lib/libz.a
if test -n "$ZLIBROOT"; then
LDFLAGS="$LDFLAGS -L$ZLIBROOT/lib"
fi
AC_MSG_CHECKING([for lustre API ])
AC_MSG_RESULT([])
if test -n "${LUSTREPATH}"; then
@@ -427,8 +423,13 @@ if test -z "$LUSTREROOT"; then
AC_MSG_WARN([Couldn't locate the lustre API... building without support for lustre striping!])
else
CFLAGS="$CFLAGS -DH5_USE_LUSTRE"
INCLUDES="$INCLUDES -I$LUSTREROOT/include"
LDFLAGS="LDFLAGS -L$LUSTREROOT/lib"
LIBS="$LIBS -llustreapi"
fi
LIBS="$LIBS -lz -lm"
###############################################################################
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
@@ -459,14 +460,6 @@ if test -n "$SAVE_MPIFC"; then
MPIFC=$SAVE_MPIFC
fi
if test -n "$SAVE_MPILIB"; then
MPILIB=$SAVE_MPILIB
fi
if test -n "$SAVE_MPIINC"; then
MPIINC=$SAVE_MPIINC
fi
if test -n "$SAVE_CFLAGS"; then
CFLAGS=$SAVE_CFLAGS $CFLAGS
fi
@@ -475,6 +468,18 @@ 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
if test -n "$SAVE_MPIROOT"; then
MPIROOT=$SAVE_MPIROOT
fi
@@ -483,39 +488,34 @@ if test -n "$SAVE_HDF5ROOT"; then
HDF5ROOT=$SAVE_HDF5ROOT
fi
if test -n "$SAVE_LDFLAGS"; then
LDFLAGS=$SAVE_LDFLAGS
fi
###############################################################################
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
###############################################################################
# AC_SUBST (variable, [value])
# Create an output variable from a shell variable.
# Make AC_OUTPUT substitute the variable variable into output files (typically one or more `Makefile's).
# This means that AC_OUTPUT will replace instances of `@variable@' in input files with the value that
# the shell variable variable has when AC_OUTPUT is called.
# This value of variable should not contain literal newlines.
# If value is given, in addition assign it to variable.
# Create an output variable from a shell variable. Make AC_OUTPUT substitute
# the variable variable into output files (typically one or more `Makefile's).
# This means that AC_OUTPUT will replace instances of `@variable@' in input
# files with the value that the shell variable variable has when AC_OUTPUT is
# called. This value of variable should not contain literal newlines. If
# value is given, in addition assign it to variable.
AC_SUBST(MPIROOT)
AC_SUBST(HDF5ROOT)
AC_SUBST(LUSTREROOT)
AC_SUBST(MPIINC)
AC_SUBST(MPILIB)
AC_SUBST(MPICC)
AC_SUBST(MPICXX)
AC_SUBST(MPIFC)
AC_SUBST(TPTARGET)
AC_SUBST(TBTARGET)
AC_SUBST(TFTARGET)
AC_SUBST(SZLIB)
AC_SUBST(CFLAGS)
AC_SUBST(FFLAGS)
AC_SUBST(INCLUDES)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(STDCXX)
AC_SUBST(UNDERSCORE_H)
AC_SUBST(BUILD_TOOLS)
AC_SUBST(FORTRAN_LIB)
AC_SUBST(LDFLAGS)
# Make AC_OUTPUT create each `file' by copying an input file (by default `file.in'),
# substituting the output variable values.
@@ -531,6 +531,7 @@ AC_CONFIG_FILES([
test/H5Block/Makefile
test/H5Fed/Makefile
tools/Makefile
tools/h5hutcc
])
AC_OUTPUT
@@ -544,7 +545,7 @@ AC_MSG_RESULT([ ])
AC_MSG_RESULT([Host OS: $host_os])
AC_MSG_RESULT([Host CPU: $host_cpu])
AC_MSG_RESULT([Host vendor: $host_vendor])
AC_MSG_RESULT([Build libraries: libH5Core.a libH5hutC.a $FORTRAN_LIB])
AC_MSG_RESULT([Build libraries: libH5hut.a libH5hutC.a $FORTRAN_LIB])
AC_MSG_RESULT([Build test programs: $TTARGET])
AC_MSG_RESULT([Build tools: $BUILD_TOOLS])
AC_MSG_RESULT([CC = $CC])
@@ -555,10 +556,10 @@ AC_MSG_RESULT([MPICXX = $MPICXX])
AC_MSG_RESULT([MPIFC = $MPIFC])
AC_MSG_RESULT([CFLAGS = $CFLAGS])
AC_MSG_RESULT([FFLAGS = $FFLAGS])
AC_MSG_RESULT([MPILIB = $MPILIB])
AC_MSG_RESULT([MPIINC = $MPIINC])
AC_MSG_RESULT([INCLUDES = $INCLUDES])
AC_MSG_RESULT([LDFLAGS = $LDFLAGS])
AC_MSG_RESULT([LIBS = $LIBS])
AC_MSG_RESULT([MPIROOT = $MPIROOT])
AC_MSG_RESULT([HDF5ROOT = $HDF5ROOT])
AC_MSG_RESULT([LUSTREROOT = $LUSTREROOT])
AC_MSG_RESULT([LDFLAGS = $LDFLAGS])
AC_MSG_RESULT([ ])
+12 -15
View File
@@ -3,8 +3,8 @@
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = H5Part
PROJECT_NUMBER = 1.5.x
PROJECT_NAME = H5hut
PROJECT_NUMBER = 1.9.9
OUTPUT_DIRECTORY = ./ReferencePages
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
@@ -32,7 +32,7 @@ JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
@@ -83,12 +83,9 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT += H5.dox
INPUT += ../src/h5_core/h5_attribs.c
INPUT += ../src/h5_core/h5_errorhandling.c
INPUT += ../src/H5.c
INPUT += ../src/H5Part.c
INPUT += ../src/H5Block.c
INPUT += ../src/H5Fed.c
INPUT += ../src/h5core/
INPUT += ../src/C/
INPUT += ../src/Fortran/
FILE_PATTERNS =
RECURSIVE = YES
EXCLUDE =
@@ -123,8 +120,8 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
HTML_HEADER = doxyheader
HTML_FOOTER = doxyfooter
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
@@ -133,7 +130,7 @@ HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = YES
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
@@ -196,7 +193,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
PREDEFINED = PARALLEL_IO
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@@ -212,7 +209,7 @@ PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
HAVE_DOT = NO
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO
@@ -224,7 +221,7 @@ CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = png
DOT_PATH = /Applications/Graphviz.app/Contents/MacOS
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
+109 -20
View File
@@ -1,50 +1,139 @@
/*! \mainpage H5Part: A Portable High Performance Parallel Data Interface to HDF5
/*!
\mainpage H5hut: A High-Performance I/O Library for Particle-based Simulations
Particle based simulations of accelerator beam-lines, especially in
six dimensional phase space, generate vast amounts of data. Even
though a subset of statistical information regarding phase space or
analysis needs to be preserved, reading and writing such enormous
restart files on massively parallel supercomputing systems remains
challenging.
Particle-based simulations running on large high-performance computing systems
over many time steps can generate an enormous amount of particle- and
field-based data for post-processing and analysis. Achieving high-performance
I/O for this data, effectively managing it on disk, and interfacing it with
analysis and visualization tools can be challenging, especially for domain
scientists who do not have I/O and data management expertise. We present the
H5hut library, an implementation of several data models for particle-based
simulations that encapsulates the complexity of HDF5 and is simple to use, yet
does not compromise performance.
H5Part consists of Particles and Block structured Fields.
Developed by:
Developers:
<UL>
<LI> Andreas Adelmann (PSI) </LI>
<LI> Achim Gsell (PSI) </LI>
<LI> Benedikt Oswald (PSI) </LI>
<LI> Mark Howison (NERSC/LBNL) </LI>
<LI> Prabhat (NERSC/LBNL) </LI>
<LI> Wes Bethel (NERSC/LBNL) </LI>
</UL>
<LI> Wes Bethel (NERSC/LBNL)</LI>
Previous developers:
<UL>
<LI> John Shalf (NERSC/LBNL)</LI>
<LI> Cristina Siegerist (NERSC/LBNL)</LI>
</UL>
For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
For more information, please contact the <a href="mailto:h5part@lists.psi.ch">h5part</a> mailing list.
Last modified on April 19, 2007.
*/
/*!
\defgroup h5_core H5 core functions
*/
/*!
\defgroup h5_c_api H5 C API
\defgroup h5hut_c_api H5hut C API
*/
/*!
\ingroup h5hut_c_api
\defgroup h5hut_file File Handling
*/
/*!
\ingroup h5hut_c_api
\defgroup h5hut_error Error Handling
*/
/*!
\ingroup h5hut_c_api
\defgroup h5hut_model Setting up the Data Model
*/
/*!
\ingroup h5hut_c_api
\defgroup h5hut_attrib Reading and Writing Attributes
*/
/*!
\defgroup h5part_c_api H5Part C API
*/
/*!
\ingroup h5part_c_api
\defgroup h5part_model Setting up the Data Model
*/
/*!
\ingroup h5part_c_api
\defgroup h5part_data Reading and Writing Datasets
*/
/*!
\defgroup h5block_c_api H5Block C API
*/
*/!
\ingroup h5block_c_api
\defgroup h5block_model Setting up the Data Model
*/
\ingroup h5block_c_api
\defgroup h5block_data Reading and Writing Datasets
*/
\ingroup h5block_c_api
\defgroup h5block_attrib Reading and Writing Attributes
*/
/*!
\defgroup h5fed_c_api H5Fed C API
*/
/*!
\defgroup h5hut_f90_api H5hut F90 API
*/
/*!
\ingroup h5hut_f90_api
\defgroup h5hut_file_f File Handling
*/
/*!
\ingroup h5hut_f90_api
\defgroup h5hut_model_f Setting up the Data Model
*/
/*!
\ingroup h5hut_f90_api
\defgroup h5hut_attrib_f Reading and Writing Attributes
!<
/*!
\defgroup h5part_f90_api H5Part F90 API
*/
/*!
\ingroup h5part_f90_api
\defgroup h5part_model_f Setting up the Data Model
*/
/*!
\ingroup h5part_f90_api
\defgroup h5part_data_f Reading and Writing Datasets
*/
/*!
\defgroup h5block_f90_api H5Block F90 API
*/
/*!
\ingroup h5block_f90_api
\defgroup h5block_model_f Setting up the Data Model
*/
/*!
\ingroup h5block_f90_api
\defgroup h5block_data_f Reading and Writing Datasets
*/
/*!
\ingroup h5block_f90_api
\defgroup h5block_attrib_f Reading and Writing Attributes
*/
+3 -7
View File
@@ -1,16 +1,12 @@
HDF5ROOT = @HDF5ROOT@
# COMPILERS
CC = @CC@
CXX = @CXX@
HDF5INC = -I@HDF5ROOT@/include
MPIINC = -I@MPIROOT@/include
INCL = $(HDF5INC) ${MPIINC} -I../../
CFLAGS = @CFLAGS@ $(INCL)
LIBS = @LIBS@
INCLUDES = -I../include @INCLUDES@
OBJEXT = o
lib_LIBRARIES = libH5XX.a
include_HEADERS = H5Fed.hh
libH5XX_a_SOURCES = H5Fed.cc
+16 -28
View File
@@ -30,19 +30,13 @@
functions.
*/
/*!
\ingroup h5_c_api
\defgroup h5_c_api_general
*/
#include "h5core/h5_core.h"
#include "H5.h"
/****** General routines *****************************************************/
/*!
\ingroup h5_c_api_general
\ingroup h5hut_file
Open file with name \c filename. This function is available in the parallel
and serial version. In the serial case \c comm may have any value.
@@ -60,7 +54,7 @@ H5OpenFile (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_file
Close file.
@@ -75,7 +69,7 @@ H5CloseFile (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_file
Close file.
@@ -90,7 +84,7 @@ H5CheckFile (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Define format of the step names.
@@ -111,7 +105,7 @@ H5SetStepNameFormat (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Get format of the step names.
@@ -131,7 +125,7 @@ H5GetStepNameFormat (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Set the current step.
@@ -148,7 +142,7 @@ H5SetStep (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Get current step.
@@ -164,7 +158,7 @@ H5GetStep (
}
/*!
\ingroup h5_inquiry
\ingroup h5hut_file
Get the number of processors.
@@ -182,7 +176,7 @@ H5GetNumProcs (
}
/*!
\ingroup h5part_c_api_read
\ingroup h5hut_model
Get the number of time-steps that are currently stored in the file
\c f.
@@ -226,7 +220,7 @@ H5HasStep (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Start traversing steps.
@@ -243,7 +237,7 @@ H5StartTraverseSteps (
}
/*!
\ingroup h5_c_api_general
\ingroup h5hut_model
Traverse steps.
@@ -260,7 +254,7 @@ H5TraverseSteps (
}
/*!
\ingroup h5part_performance
\ingroup h5hut_file
Set the `throttle` factor, which causes HDF5 write and read
calls to be issued in that number of batches.
@@ -289,12 +283,7 @@ H5SetThrottle (
#endif // PARALLEL_IO
/*!
\ingroup h5part_c_api
\defgroup h5part_c_api_errhandling Error Handling
*/
/*!
\ingroup h5part_c_api_errhandling
\ingroup h5hut_error
Set verbosity level to \c level.
@@ -308,7 +297,7 @@ H5SetVerbosityLevel (
}
/*!
\ingroup h5part_c_api_errhandling
\ingroup h5hut_error
Set error handler to \c handler.
@@ -322,7 +311,7 @@ H5SetErrorHandler (
}
/*!
\ingroup h5part_c_api_errhandling
\ingroup h5hut_error
Get current error handler.
@@ -354,7 +343,7 @@ H5AbortErrorhandler (
}
/*!
\ingroup h5part_c_api_errhandling
\ingroup h5hut_error
Get last error code.
@@ -366,6 +355,5 @@ H5GetErrno (
) {
return h5_get_errno (f);
}
/*! @} */
+121 -33
View File
@@ -59,6 +59,23 @@
/********************** defining the layout **********************************/
/*!
\ingroup h5block_model
Tests whether a view has been set, either directly with
\ref H5Block3dSetView or indirectly with \ref H5Block3dSetGrid.
\return 0 on false, 1 on true
*/
h5_int64_t
H5Block3dHasView (
h5_file_t *const f /*!< IN: File handle */
) {
SET_FNAME( f, __func__ );
return h5b_3d_has_view(f);
}
/*!
\ingroup h5block_model
@@ -92,15 +109,13 @@ H5Block3dSetView (
/*!
\ingroup h5block_model
Return partition of processor \c proc as specified with
\ref H5Block3dSetView.
Return the view of this processor.
\return \c H5_SUCCESS on success
*/
h5_err_t
H5Block3dGetView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
@@ -111,7 +126,30 @@ H5Block3dGetView (
SET_FNAME( f, __func__ );
return h5b_3d_get_view(f, proc, i_start, i_end, j_start, j_end, k_start, k_end);
return h5b_3d_get_view(f, i_start, i_end, j_start, j_end, k_start, k_end);
}
/*!
\ingroup h5block_model
Return the reduced (ghost-zone free) view of this processor.
\return \c H5_SUCCESS on success
*/
h5_err_t
H5Block3dGetReducedView (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c j */
h5_size_t *k_end /*!< OUT: end index of \c j */
) {
SET_FNAME( f, __func__ );
return h5b_3d_get_reduced_view(f, i_start, i_end, j_start, j_end, k_start, k_end);
}
/*!
@@ -154,52 +192,102 @@ H5Block3dGetChunk (
return h5b_3d_get_chunk(f, field_name, dims);
}
/*!
\ingroup h5block_model
Return reduced (ghost-zone free) partition of processor \c proc
as specified with \ref H5Block3dSetView.
Define an underlying 3D Cartesian grid on the processors with dimensions
(\c i,\c j,\c k). You can look up a processor's index into the grid
using \ref H5Block3dGetGridCoords.
This function can be used in conjunction with \ref H5Block3dSetDims
to setup the view for a regular grid.
The product of the dimensions must equal the size of the MPI communicator.
\return \c H5_SUCCESS on success
*/
h5_err_t
H5Block3dGetReducedView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c j */
h5_size_t *k_end /*!< OUT: end index of \c j */
H5Block3dSetGrid (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
) {
SET_FNAME( f, __func__ );
return h5b_3d_get_reduced_view(f, proc, i_start, i_end, j_start, j_end, k_start, k_end);
return h5b_3d_set_grid(f, i, j, k);
}
/*!
\ingroup h5block_model
Returns the processor computing the reduced (ghostzone-free)
partition given by the coordinates \c i, \c j and \c k.
Look up the index (\c i, \c j, \c k) in the grid belonging to MPI processor
\c proc.
\return \c H5_SUCCESS or error code
\return \c H5_SUCCESS on success
*/
int
H5Block3dGetProc (
h5_err_t
H5Block3dGetGridCoords (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: \c i coordinate */
const h5_int64_t j, /*!< IN: \c j coordinate */
const h5_int64_t k /*!< IN: \c k coordinate */
const int proc, /*!< IN: MPI processor */
h5_int64_t *i, /*!< OUT: index in \c i */
h5_int64_t *j, /*!< OUT: index in \c j */
h5_int64_t *k /*!< OUT: index in \c k */
) {
SET_FNAME( f, __func__ );
//CHECK_LAYOUT ( f );
return h5b_3d_get_proc(f, i, j, k);
return h5b_3d_get_grid_coords(f, proc, i, j, k);
}
/*!
\ingroup h5block_model
Set the dimensions of each processor's block when the field is a regular
grid.
A grid must be already set with \ref H5Block3dSetGrid, and all processors
must specify the same dimensions.
\return \c H5_SUCCESS on success
*/
h5_err_t
H5Block3dSetDims (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
) {
SET_FNAME( f, __func__ );
return h5b_3d_set_dims(f, i, j, k);
}
/*!
\ingroup h5block_model
Sets the additional cells (\c i, \c j, \c k) in each direction to use as
the `halo` region (or `ghost zone`) that overlaps between neighboring
processors on the grid.
A grid with dimensions must already be set with \ref H5Block3dSetGrid and
\ref H5Block3dSetDims, and all processors must specify the same halo radii.
\return \c H5_SUCCESS on success
*/
h5_err_t
H5Block3dSetHalo (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: radius in \c i */
const h5_size_t j, /*!< IN: radius in \c j */
const h5_size_t k /*!< IN: radius in \c k */
) {
SET_FNAME( f, __func__ );
return h5b_3d_set_halo(f, i, j, k);
}
/*!
@@ -366,15 +454,15 @@ H5BlockGetNumFieldAttribs (
*/
h5_int64_t
H5BlockGetFieldAttribInfo (
h5_file_t *const f, /*!< [in] Handle to open file */
h5_file_t *const f, /*<! IN: Handle to open file */
const char *field_name, /*<! IN: field name */
const h5_size_t attrib_idx, /*!< [in] Index of attribute to
const h5_size_t attrib_idx, /*<! IN: Index of attribute to
get infos about */
char *attrib_name, /*!< [out] Name of attribute */
char *attrib_name, /*<! OUT: Name of attribute */
const h5_size_t len_of_attrib_name,
/*!< [in] length of buffer \c name */
h5_int64_t *attrib_type, /*!< [out] Type of value. */
h5_size_t *attrib_nelem /*!< [out] Number of elements */
/*<! IN: length of buffer \c name */
h5_int64_t *attrib_type, /*<! OUT: Type of value. */
h5_size_t *attrib_nelem /*<! OUT: Number of elements */
) {
SET_FNAME ( f, __func__ );
+10 -62
View File
@@ -1,65 +1,3 @@
/*! \mainpage H5Part: A Portable High Performance Parallel Data Interface to HDF5
Particle based simulations of accelerator beam-lines, especially in
six dimensional phase space, generate vast amounts of data. Even
though a subset of statistical information regarding phase space or
analysis needs to be preserved, reading and writing such enormous
restart files on massively parallel supercomputing systems remains
challenging.
H5Part consists of Particles and Block structured Fields.
Developed by:
<UL>
<LI> Andreas Adelmann (PSI) </LI>
<LI> Achim Gsell (PSI) </LI>
<LI> Benedikt Oswald (PSI) </LI>
<LI> Wes Bethel (NERSC/LBNL)</LI>
<LI> John Shalf (NERSC/LBNL)</LI>
<LI> Cristina Siegerist (NERSC/LBNL)</LI>
<LI> Mark Howison (NERSC/LBNL)</LI>
</UL>
Papers:
<UL>
<LI> A. Adelmann, R.D. Ryne, C. Siegerist, J. Shalf,"From Visualization to Data Mining with Large Data Sets," <i>
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005. (LBNL-57603)
<a href="http://vis.lbl.gov/Publications/2005/FPAT082.pdf">FPAT082.pdf</a>
</LI>
<LI> A. Adelmann, R.D. Ryne, J. Shalf, C. Siegerist, "H5Part: A Portable High Performance Parallel Data Interface for Particle Simulations," <i>
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005.
<a href="http://vis.lbl.gov/Publications/2005/FPAT083.pdf">FPAT083.pdf</a>
</LI>
</UL>
For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
*/
/*!
\defgroup h5part_c_api H5Part C API
*/
/*!
\ingroup h5part_c_api
\defgroup h5part_open File Opening and Closing
*/
/*!
\ingroup h5part_c_api
\defgroup h5part_model Setting up the Data Model
*/
/*!
\ingroup h5part_c_api
\defgroup h5part_data Reading and Writing Datasets
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h> /* va_arg - System dependent ?! */
@@ -536,6 +474,10 @@ H5PartGetNumParticles (
/*!
\ingroup h5part_model
Reset the view.
\return \c H5_SUCCESS
*/
h5_err_t
H5PartResetView (
@@ -549,6 +491,12 @@ H5PartResetView (
/*!
\ingroup h5part_model
Check whether a view has been set, either automatically with
\ref H5PartSetNumParticles or manually with \ref H5PartSetView
or \ref H5PartSetViewIndices.
\return 0 for false or 1 for true
*/
h5_err_t
H5PartHasView (
+24 -24
View File
@@ -7,7 +7,7 @@
/*** WRITE ***/
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with the string \c value to
the file root ("/").
@@ -33,7 +33,7 @@ H5WriteFileAttribString (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with the string \c value to
the current timestep.
@@ -59,7 +59,7 @@ H5WriteStepAttribString (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with float32 \c values to
the file root ("/").
@@ -86,7 +86,7 @@ H5WriteFileAttribFloat32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with float32 \c values to
the current time step.
@@ -113,7 +113,7 @@ H5WriteStepAttribFloat32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with float64 \c values to
the file root ("/").
@@ -140,7 +140,7 @@ H5WriteFileAttribFloat64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with float64 \c values to
the current time step.
@@ -167,7 +167,7 @@ H5WriteStepAttribFloat64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with int32 \c values to
the file root ("/").
@@ -194,7 +194,7 @@ H5WriteFileAttribInt32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with int32 \c values to
the current time step.
@@ -221,7 +221,7 @@ H5WriteStepAttribInt32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with int64 \c values to
the file root ("/").
@@ -248,7 +248,7 @@ H5WriteFileAttribInt64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Write an attribute \c name with int64 \c values to
the current time step.
@@ -277,7 +277,7 @@ H5WriteStepAttribInt64 (
/*** READ ***/
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read a string into a \c buffer from an attribute \c name
in the file root ("/").
@@ -302,7 +302,7 @@ H5ReadFileAttribString (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read a string into a \c buffer from an attribute \c name
in the current timestep.
@@ -327,7 +327,7 @@ H5ReadStepAttribString (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read int32 values into a \c buffer from an attribute \c name
in the file root ("/").
@@ -352,7 +352,7 @@ H5ReadFileAttribInt32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read int32 values into a \c buffer from an attribute \c name
in the current time step.
@@ -377,7 +377,7 @@ H5ReadStepAttribInt32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read int64 values into a \c buffer from an attribute \c name
in the file root ("/").
@@ -402,7 +402,7 @@ H5ReadFileAttribInt64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read int64 values into a \c buffer from an attribute \c name
in the current time step.
@@ -427,7 +427,7 @@ H5ReadStepAttribInt64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read float32 values into a \c buffer from an attribute \c name
in the file root ("/").
@@ -452,7 +452,7 @@ H5ReadFileAttribFloat32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read float32 values into a \c buffer from an attribute \c name
in the current time step.
@@ -477,7 +477,7 @@ H5ReadStepAttribFloat32 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read float64 values into a \c buffer from an attribute \c name
in the file root ("/").
@@ -502,7 +502,7 @@ H5ReadFileAttribFloat64 (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Read float64 values into a \c buffer from an attribute \c name
in the current time step.
@@ -529,7 +529,7 @@ H5ReadStepAttribFloat64 (
/*** QUERY ***/
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Gets the number of attributes in the file's root ("/").
@@ -545,7 +545,7 @@ H5GetNumFileAttribs (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Gets the number of attributes bound to the current step.
@@ -562,7 +562,7 @@ H5GetNumStepAttribs (
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Gets the name, type and number of elements of the file attribute
specified by its index.
@@ -603,7 +603,7 @@ H5GetFileAttribInfo (
}
/*!
\ingroup h5_attrib
\ingroup h5hut_attrib
Gets the name, type and number of elements of the step attribute
specified by its index.
+2 -4
View File
@@ -2,10 +2,8 @@
OBJEXT=o
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
LIBS = $(HDFLIB) @MPILIB@
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
LIBS = @LIBS@
INCLUDES = -I../include @INCLUDES@
# What to build... Will be determined by configure script.
lib_LIBRARIES = libH5hutC.a
+6 -6
View File
@@ -98,7 +98,7 @@ H5Block#DIM#dReadScalarField#TYPE_ABV# (
"""
write_scalar_fi = """
!> \\ingroup h5blockf_data
!> \\ingroup h5block_data_f
!! See \\ref H5Block#DIM#dWriteScalarField#TYPE_ABV#
!! \\return 0 on success or error code
!<
@@ -110,7 +110,7 @@ END FUNCTION
"""
read_scalar_fi = """
!> \\ingroup h5blockf_data
!> \\ingroup h5block_data_f
!! See \\ref H5Block#DIM#dReadScalarField#TYPE_ABV#
!! \\return 0 on success or error code
!<
@@ -258,7 +258,7 @@ H5Block#DIM#dReadVector3dField#TYPE_ABV# (
"""
write_vector_fi = """
!> \\ingroup h5blockf_data
!> \\ingroup h5block_data_f
!! See \\ref H5Block#DIM#dWriteVector3dField#TYPE_ABV#
!! \\return 0 on success or error code
!<
@@ -272,7 +272,7 @@ END FUNCTION
"""
read_vector_fi = """
!> \\ingroup h5blockf_data
!> \\ingroup h5block_data_f
!! See \\ref H5Block#DIM#dReadVector3dField#TYPE_ABV#
!! \\return 0 on success or error code
!<
@@ -385,7 +385,7 @@ H5BlockWriteFieldAttrib#TYPE_ABV# (
"""
write_attr_fi = """
!> \\ingroup h5_attrib_f
!> \\ingroup h5block_attrib_f
!! See \\ref H5BlockWriteFieldAttrib#TYPE_ABV#
!! \\return 0 on success or error code
!<
@@ -469,7 +469,7 @@ H5BlockReadFieldAttrib#TYPE_ABV# (
"""
read_attr_fi = """
!> \\ingroup h5_attrib_f
!> \\ingroup h5block_attrib_f
!! See \\ref H5BlockReadFieldAttrib#TYPE_ABV#
!! \\return 0 on success or error code
!<
+11 -35
View File
@@ -1,27 +1,6 @@
! Declaration of subroutines for Fortran Bindings
!> \defgroup h5_f90_api H5hut F90 API
!> \ingroup h5_f90_api
!! \defgroup h5_open_f File Handling
!<
!> \ingroup h5_f90_api
!! \defgroup h5_model_f Setting up the Data Model
!<
!> \ingroup h5_f90_api
!! \defgroup h5_data_f Reading and Writing Datasets
!<
!> \ingroup h5_f90_api
!! \defgroup h5_attrib_f Reading and Writing Attributes
!<
!!!!!!!! File Opening and Closing !!!!!!!!
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a file for reading. See \ref H5OpenFile
!! \return 0 on success or error code
!<
@@ -29,7 +8,7 @@ INTEGER*8 FUNCTION h5_openr ( filename )
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a file for writing in truncate mode. See \ref H5OpenFile
!! \return 0 on success or error code
!<
@@ -37,7 +16,7 @@ INTEGER*8 FUNCTION h5_openw ( filename )
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a file for writing in append mode. See \ref H5OpenFile
!! \return 0 on success or error code
!<
@@ -45,7 +24,7 @@ INTEGER*8 FUNCTION h5_opena ( filename )
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a parallel file for reading.
!! See \ref H5OpenFile
!!
@@ -62,7 +41,7 @@ INTEGER*8 FUNCTION h5_openr_par_align ( filename, mpi_communicator, align )
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a parallel file for writing.
!! See \ref H5OpenFile
!!
@@ -70,9 +49,7 @@ END FUNCTION
!!
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
!! - \c vfd_indendent - 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
!<
INTEGER*8 FUNCTION h5_openw_par_align ( filename, mpi_communicator, align, flags )
@@ -81,7 +58,7 @@ INTEGER*8 FUNCTION h5_openw_par_align ( filename, mpi_communicator, align, flags
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Opens a parallel file for writing in append mode.
!! See \ref H5OpenFile
!!
@@ -90,7 +67,6 @@ END FUNCTION
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
!! - \c vfd_indendent - use MPI-IO in indepedent mode
!!
!! See \ref H5PartOpenFileParallelAlign
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5_opena_par_align ( filename, mpi_communicator, align, flags )
@@ -99,7 +75,7 @@ INTEGER*8 FUNCTION h5_opena_par_align ( filename, mpi_communicator, align, flags
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Closes a file. See \ref H5CloseFile
!! \return 0 on success or error code
!<
@@ -107,7 +83,7 @@ INTEGER*8 FUNCTION h5_close ( filehandle )
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! Checks that a file is valid. See \ref H5CheckFile
!! \return 0 on success or error code
!<
@@ -115,7 +91,7 @@ INTEGER*8 FUNCTION h5_check ( filehandle )
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_open_f
!> \ingroup h5hut_file_f
!! See \ref H5SetVerbosityLevel
!! \return 0 on success or error code
!<
@@ -123,7 +99,7 @@ INTEGER*8 FUNCTION h5_set_verbosity_level ( level )
INTEGER*8, INTENT(IN) :: level !< the level from 0 (no output) to 5 (most detailed)
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5hut_model_f
!! See \ref H5SetStep
!! \return 0 on success or error code
!<
@@ -132,7 +108,7 @@ INTEGER*8 FUNCTION h5_setstep (filehandle,step)
INTEGER*8, INTENT(IN) :: step !< a timestep value >= 1
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5hut_model_f
!! See \ref H5GetNumSteps
!! \return the number of steps or error code
!<
+36 -140
View File
@@ -1,27 +1,10 @@
! Declaration of subroutines for Fortran Bindings
!> \defgroup h5block_f90_api H5Block F90 API
!> \ingroup h5block_f90_api
!! \defgroup h5blockf_model Setting up the Data Model
!<
!> \ingroup h5block_f90_api
!! \defgroup h5blockf_data Reading and Writing Datasets
!<
!> \ingroup h5block_f90_api
!! \defgroup h5blockf_attrib Reading and Writing Attributes
!<
!!!!!!!! Setting up the Data Model !!!!!!!!
!> \ingroup h5blockf_model
!! See \ref H5BlockDefine3DFieldLayout
!> \ingroup h5block_model_f
!! See \ref H5Block3dSetView
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_define3dlayout ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8 FUNCTION h5bl_3d_setview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(IN) :: i_start
INTEGER*8, INTENT(IN) :: i_end
@@ -30,40 +13,39 @@ INTEGER*8 FUNCTION h5bl_define3dlayout ( filehandle, i_start, i_end, j_start, j_
INTEGER*8, INTENT(IN) :: k_start
INTEGER*8, INTENT(IN) :: k_end
END FUNCTION
!> \ingroup h5blockf_model
!! See \ref H5BlockDefine3DChunkDims
!> \ingroup h5block_model_f
!! See \ref H5Block3dGetView
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_define3dchunkdims ( filehandle, i, j, k )
INTEGER*8 FUNCTION h5bl_3d_getview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(OUT) :: i_start
INTEGER*8, INTENT(OUT) :: i_end
INTEGER*8, INTENT(OUT) :: j_start
INTEGER*8, INTENT(OUT) :: j_end
INTEGER*8, INTENT(OUT) :: k_start
INTEGER*8, INTENT(OUT) :: k_end
END FUNCTION
!> \ingroup h5block_model_f
!! See \ref H5Block3dSetChunk
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_3d_setchunk ( filehandle, i, j, k )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(IN) :: i
INTEGER*8, INTENT(IN) :: j
INTEGER*8, INTENT(IN) :: k
END FUNCTION
!> \ingroup h5blockf_model
!! See \ref H5Block3dGetPartitionOfProc
!> \ingroup h5block_model_f
!! See \ref H5Block3dGetReducedView
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_get_partition_of_proc ( filehandle, proc, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8 FUNCTION h5bl_3d_getreducedview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(OUT) :: proc
INTEGER*8, INTENT(OUT) :: i_start
INTEGER*8, INTENT(OUT) :: i_end
INTEGER*8, INTENT(OUT) :: j_start
INTEGER*8, INTENT(OUT) :: j_end
INTEGER*8, INTENT(OUT) :: k_start
INTEGER*8, INTENT(OUT) :: k_end
END FUNCTION
!> \ingroup h5blockf_model
!! See \ref H5Block3dGetReducedPartitionOfProc
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_get_reduced_partition_of_proc ( filehandle, proc, i_start, i_end, j_start, j_end, k_start, k_end )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(OUT) :: proc
INTEGER*8, INTENT(OUT) :: i_start
INTEGER*8, INTENT(OUT) :: i_end
INTEGER*8, INTENT(OUT) :: j_start
@@ -72,18 +54,15 @@ INTEGER*8 FUNCTION h5bl_get_reduced_partition_of_proc ( filehandle, proc, i_star
INTEGER*8, INTENT(OUT) :: k_end
END FUNCTION
!> \ingroup h5blockf_model
!! See \ref H5Block3dGetProcOf
!> \ingroup h5block_model_f
!! See \ref H5Block3dHasView
!! \return rank of processor error code
!<
INTEGER*8 FUNCTION h5bl_get_proc_of ( filehandle, i, j, k )
INTEGER*8 FUNCTION h5bl_3d_hasview ( filehandle )
INTEGER*8, INTENT(IN) :: filehandle
INTEGER*8, INTENT(IN) :: i
INTEGER*8, INTENT(IN) :: j
INTEGER*8, INTENT(IN) :: k
END FUNCTION
!> \ingroup h5blockf_model
!> \ingroup h5block_model_f
!! See \ref H5BlockGetNumFields
!! \return number of fields or error code
!<
@@ -91,7 +70,7 @@ INTEGER*8 FUNCTION h5bl_getnumfields ( filehandle )
INTEGER*8, INTENT(IN) :: filehandle
END FUNCTION
!> \ingroup h5blockf_model
!> \ingroup h5block_model_f
!! See \ref H5BlockGetFieldInfo
!! \return 0 on success or error code
!<
@@ -105,18 +84,9 @@ INTEGER*8 FUNCTION h5bl_getfieldinfo ( filehandle, idx, field_name, grid_rank, g
INTEGER*8, INTENT(OUT) :: type
END FUNCTION
!> \ingroup h5blockf_model
!! See \ref H5BlockHasFieldData
!! \return 0 if false, 1 if true, or error code
!<
INTEGER*8 FUNCTION h5bl_has_fielddata ( filehandle )
INTEGER*8, INTENT(IN) :: filehandle
END FUNCTION
!!!!!!!! Reading and Writing Attributes !!!!!!!!
!> \ingroup h5blockf_attrib
!> \ingroup h5block_attrib_f
!! See \ref H5BlockWriteFieldAttribString
!! \return 0 on success or error code
!<
@@ -127,7 +97,7 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_string ( filehandle, field_name, attrib
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
END FUNCTION
!> \ingroup h5blockf_attrib
!> \ingroup h5block_attrib_f
!! See \ref H5BlockGetNumFieldAttribs
!! \return number of attributes or error code
!<
@@ -136,7 +106,7 @@ INTEGER*8 FUNCTION h5bl_getnfieldattribs ( filehandle, field_name )
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
END FUNCTION
!> \ingroup h5blockf_attrib
!> \ingroup h5block_attrib_f
!! See \ref H5BlockGetFieldAttribInfo
!! \return 0 on success or error code
!<
@@ -148,33 +118,8 @@ INTEGER*8 FUNCTION h5bl_getfieldattribinfo ( filehandle, field_name, idx, attrib
INTEGER*8,INTENT(OUT):: attrib_nelem ! Number of elements in the attrib array
END FUNCTION
!> \ingroup h5blockf_attrib
!! Read the attribute \c attrib_name from the field \c field_name at the
!! current timestep, and store the int64 value in \c attrib_value.
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_readfieldattrib_i8 ( filehandle, field_name, attrib_name, attrib_value )
INTEGER*8,INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! name of the attribute to read
INTEGER*8,INTENT(OUT):: attrib_value(*)! the attribute data will be read into this array
END FUNCTION
!> \ingroup h5blockf_attrib
!! Read the attribute \c attrib_name from the field \c field_name at the
!! current timestep, and store the float64 value in \c attrib_value.
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_readfieldattrib_r8 ( filehandle, field_name, attrib_name, attrib_value )
INTEGER*8,INTENT(IN) :: filehandle
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! name of the attribute to read
REAL*8, INTENT(OUT):: attrib_value(*)! the attribute data will be read into this array
END FUNCTION
!> \ingroup h5blockf_attrib
!! Read the attribute \c attrib_name from the field \c field_name at the
!! current timestep, and store the string value in \c attrib_value.
!> \ingroup h5block_attrib_f
!! See \ref H5BlockReadFieldAttribString
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_readfieldattrib_string ( filehandle, field_name, attrib_name, attrib_value )
@@ -183,53 +128,4 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_string ( filehandle, field_name, attrib_
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! name of the attribute to read
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
END FUNCTION
!> \ingroup h5blockf_attrib
!! See \ref H5Block3dGetFieldSpacing
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_3d_get_field_spacing ( 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
!> \ingroup h5blockf_attrib
!! See \ref H5Block3dSetFieldSpacing
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_3d_set_field_spacing ( 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
!> \ingroup h5blockf_attrib
!! See \ref H5Block3dGetFieldOrigin
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_3d_get_field_origin ( 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
!> \ingroup h5blockf_attrib
!! See \ref H5Block3dSetFieldOrigin
!! \return 0 on success or error code
!<
INTEGER*8 FUNCTION h5bl_3d_set_field_origin ( 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
+7 -14
View File
@@ -26,9 +26,9 @@
#define h5bl_3d_getreducedview F77NAME ( \
h5bl_3d_getreducedview_,\
H5BL_3D_GETREDUCEDVIEW )
#define h5bl_3d_getproc F77NAME ( \
h5bl_getproc_, \
H5BL_GETPROC )
#define h5bl_3d_hasview F77NAME ( \
h5bl_hasview_, \
H5BL_HASVIEW )
#define h5bl_getnumfields F77NAME ( \
h5bl_getnumfields_, \
H5BL_GETNUMFIELDS )
@@ -85,7 +85,6 @@ h5bl_3d_setchunk (
h5_err_t
h5bl_3d_getview (
h5_int64_t *f, /*!< file handle */
const h5_int64_t *proc,
h5_int64_t *i_start, /*!< start index of i */
h5_int64_t *i_end, /*!< end index of i */
h5_int64_t *j_start, /*!< start index of j */
@@ -98,7 +97,6 @@ h5bl_3d_getview (
h5_err_t herr = H5Block3dGetView (
filehandle,
*proc,
i_start, i_end, j_start, j_end, k_start, k_end );
if ( herr < 0 ) return herr;
@@ -115,7 +113,6 @@ h5bl_3d_getview (
h5_err_t
h5bl_3d_getreducedview (
h5_int64_t *f,
const h5_int64_t *proc,
h5_int64_t *i_start,
h5_int64_t *i_end,
h5_int64_t *j_start,
@@ -128,7 +125,6 @@ h5bl_3d_getreducedview (
h5_err_t herr = H5Block3dGetReducedView (
filehandle,
*proc,
i_start, i_end, j_start, j_end, k_start, k_end );
if ( herr < 0 ) return herr;
@@ -142,17 +138,14 @@ h5bl_3d_getreducedview (
return H5_SUCCESS;
}
h5_err_t
h5bl_3d_getproc (
h5_int64_t *f,
const h5_int64_t *i,
const h5_int64_t *j,
const h5_int64_t *k
h5_int64_t
h5bl_3d_hasview (
h5_int64_t *f
) {
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
return H5Block3dGetProc ( filehandle, (*i)-1, (*j)-1, (*k)-1 );
return H5Block3dHasView ( filehandle );
}
h5_err_t
+24 -24
View File
@@ -1,5 +1,5 @@
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteScalarFieldFloat64
!! \return 0 on success or error code
!<
@@ -9,7 +9,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, data )
REAL*8, INTENT(IN) :: data(*) !< the array of data
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadScalarFieldFloat64
!! \return 0 on success or error code
!<
@@ -19,7 +19,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, data )
REAL*8, INTENT(OUT) :: data(*) !< buffer to read the data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteVector3dFieldFloat64
!! \return 0 on success or error code
!<
@@ -31,7 +31,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_r8 ( filehandle, name, x, y, z )
REAL*8, INTENT(IN) :: z(*) !< the array of z data to write
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadVector3dFieldFloat64
!! \return 0 on success or error code
!<
@@ -43,7 +43,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_r8 ( filehandle, name, x, y, z )
REAL*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteScalarFieldFloat32
!! \return 0 on success or error code
!<
@@ -53,7 +53,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, data )
REAL*4, INTENT(IN) :: data(*) !< the array of data
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadScalarFieldFloat32
!! \return 0 on success or error code
!<
@@ -63,7 +63,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, data )
REAL*4, INTENT(OUT) :: data(*) !< buffer to read the data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteVector3dFieldFloat32
!! \return 0 on success or error code
!<
@@ -75,7 +75,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_r4 ( filehandle, name, x, y, z )
REAL*4, INTENT(IN) :: z(*) !< the array of z data to write
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadVector3dFieldFloat32
!! \return 0 on success or error code
!<
@@ -87,7 +87,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_r4 ( filehandle, name, x, y, z )
REAL*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteScalarFieldInt64
!! \return 0 on success or error code
!<
@@ -97,7 +97,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: data(*) !< the array of data
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadScalarFieldInt64
!! \return 0 on success or error code
!<
@@ -107,7 +107,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, data )
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read the data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteVector3dFieldInt64
!! \return 0 on success or error code
!<
@@ -119,7 +119,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_i8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(IN) :: z(*) !< the array of z data to write
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadVector3dFieldInt64
!! \return 0 on success or error code
!<
@@ -131,7 +131,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_i8 ( filehandle, name, x, y, z )
INTEGER*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteScalarFieldInt32
!! \return 0 on success or error code
!<
@@ -141,7 +141,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, data )
INTEGER*4, INTENT(IN) :: data(*) !< the array of data
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadScalarFieldInt32
!! \return 0 on success or error code
!<
@@ -151,7 +151,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, data )
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read the data into
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dWriteVector3dFieldInt32
!! \return 0 on success or error code
!<
@@ -163,7 +163,7 @@ INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_i4 ( filehandle, name, x, y, z )
INTEGER*4, INTENT(IN) :: z(*) !< the array of z data to write
END FUNCTION
!> \ingroup h5blockf_data
!> \ingroup h5block_data_f
!! See \ref H5Block3dReadVector3dFieldInt32
!! \return 0 on success or error code
!<
@@ -175,7 +175,7 @@ INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_i4 ( filehandle, name, x, y, z )
INTEGER*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockWriteFieldAttribFloat64
!! \return 0 on success or error code
!<
@@ -187,7 +187,7 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_r8 ( filehandle, field_name, attrib_nam
INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockReadFieldAttribFloat64
!! \return 0 on success or error code
!<
@@ -198,7 +198,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_r8 ( filehandle, field_name, attrib_name
REAL*8, INTENT(IN) :: values(*) !< the buffer to read into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockWriteFieldAttribFloat32
!! \return 0 on success or error code
!<
@@ -210,7 +210,7 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_r4 ( filehandle, field_name, attrib_nam
INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockReadFieldAttribFloat32
!! \return 0 on success or error code
!<
@@ -221,7 +221,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_r4 ( filehandle, field_name, attrib_name
REAL*4, INTENT(IN) :: values(*) !< the buffer to read into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockWriteFieldAttribInt64
!! \return 0 on success or error code
!<
@@ -233,7 +233,7 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_i8 ( filehandle, field_name, attrib_nam
INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockReadFieldAttribInt64
!! \return 0 on success or error code
!<
@@ -244,7 +244,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_i8 ( filehandle, field_name, attrib_name
INTEGER*8, INTENT(IN) :: values(*) !< the buffer to read into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockWriteFieldAttribInt32
!! \return 0 on success or error code
!<
@@ -256,7 +256,7 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_i4 ( filehandle, field_name, attrib_nam
INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5block_attrib_f
!! See \ref H5BlockReadFieldAttribInt32
!! \return 0 on success or error code
!<
+19 -19
View File
@@ -1,6 +1,6 @@
!!!!!!!! Setting up the Data Model !!!!!!!!
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartSetNumParticles
!! \return 0 on success or error code
!<
@@ -9,7 +9,7 @@ INTEGER*8 FUNCTION h5pt_setnpoints ( filehandle, npoints )
INTEGER*8, INTENT(IN) :: npoints !< the number of particles on *this* processor
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartSetNumParticlesStrided
!! \return 0 on success or error code
!<
@@ -19,7 +19,7 @@ INTEGER*8 FUNCTION h5pt_setnpoints_strided ( filehandle, npoints, stride )
INTEGER*8, INTENT(IN) :: stride !< the stride value (e.g. the number of fields in the particle data array)
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartGetNumDatasets
!! \return the number of datasets or error code
!<
@@ -27,7 +27,7 @@ INTEGER*8 FUNCTION h5pt_getndatasets (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartGetNumParticles
!! \return the number of particles or error code
!<
@@ -35,7 +35,7 @@ INTEGER*8 FUNCTION h5pt_getnpoints (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartGetDatasetName
!! \return 0 on success or error code
!<
@@ -45,7 +45,7 @@ INTEGER*8 FUNCTION h5pt_getdatasetname (filehandle,index,name)
CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the dataset name into
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartSetView
!! \return 0 on success or error code
!<
@@ -55,7 +55,7 @@ INTEGER*8 FUNCTION h5pt_setview (filehandle,start,end)
INTEGER*8, INTENT(IN) :: end !< offset of the last particle in the view (inclusive)
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartSetViewIndices
!! \return 0 on success or error code
!<
@@ -65,7 +65,7 @@ INTEGER*8 FUNCTION h5pt_setview_indices (filehandle,indices,nelem)
INTEGER*8, INTENT(IN) :: nelem !< number of particles in the list
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartSetViewEmpty
!! \return 0 on success or error code
!<
@@ -73,7 +73,7 @@ INTEGER*8 FUNCTION h5pt_setview_empty (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartResetView
!! \return 0 on success or error code
!<
@@ -81,7 +81,7 @@ INTEGER*8 FUNCTION h5pt_resetview (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartResetView
!! \return 1 if true, 0 if false, or error code
!<
@@ -89,7 +89,7 @@ INTEGER*8 FUNCTION h5pt_hasview (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_model_f
!> \ingroup h5part_model_f
!! See \ref H5PartGetView
!! \return 0 on success or error code
!<
@@ -102,7 +102,7 @@ END FUNCTION
!!!!!!!! Reading and Writing Datasets !!!!!!!!
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartWriteDataFloat64
!! \return 0 on success or error code
!<
@@ -112,7 +112,7 @@ INTEGER*8 FUNCTION h5pt_writedata_r8 ( filehandle, name, data )
REAL*8, INTENT(IN) :: data(*) !< the array of float64 data to write
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartWriteDataFloat32
!! \return 0 on success or error code
!<
@@ -122,7 +122,7 @@ INTEGER*8 FUNCTION h5pt_writedata_r4 ( filehandle, name, data )
REAL, INTENT(IN) :: data(*) !< the array of float32 data to write
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartWriteDataInt64
!! \return 0 on success or error code
!<
@@ -132,7 +132,7 @@ INTEGER*8 FUNCTION h5pt_writedata_i8 ( filehandle, name, data )
INTEGER*8, INTENT(IN) :: data(*) !< the array of int64 data to write
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartWriteDataInt32
!! \return 0 on success or error code
!<
@@ -143,7 +143,7 @@ INTEGER*8 FUNCTION h5pt_writedata_i4 ( filehandle, name, data )
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartReadDataFloat64
!! \return 0 on success or error code
!<
@@ -153,7 +153,7 @@ INTEGER*8 FUNCTION h5pt_readdata_r8 (filehandle,name,data)
REAL*8, INTENT(OUT) :: data(*) !< array to read float64 data into
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartReadDataFloat32
!! \return 0 on success or error code
!<
@@ -163,7 +163,7 @@ INTEGER*8 FUNCTION h5pt_readdata_r4 (filehandle,name,data)
REAL, INTENT(OUT) :: data(*) !< array to read float32 data into
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartReadDataInt64
!! \return 0 on success or error code
!<
@@ -173,7 +173,7 @@ INTEGER*8 FUNCTION h5pt_readdata_i8 (filehandle,name,data)
INTEGER*8, INTENT(OUT) :: data(*) !< array to read int64 data into
END FUNCTION
!> \ingroup h5_data_f
!> \ingroup h5part_data_f
!! See \ref H5PartReadDataInt32
!! \return 0 on success or error code
!<
+24 -24
View File
@@ -1,6 +1,6 @@
!!!!!!!! Reading and Writing Attributes !!!!!!!!
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5WriteFileAttribString
!! \return 0 on success or error code
!<
@@ -10,7 +10,7 @@ INTEGER*8 FUNCTION h5_writefileattrib_string (filehandle,attrib_name,attrib_valu
CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5WriteStepAttribString
!! \return 0 on success or error code
!<
@@ -20,7 +20,7 @@ INTEGER*8 FUNCTION h5_writestepattrib_string (filehandle,attrib_name,attrib_valu
CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5ReadFileAttribString
!! \return 0 on success or error code
!<
@@ -30,7 +30,7 @@ INTEGER*8 FUNCTION h5_readfileattrib_string (filehandle,attrib_name,attrib_value
CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5ReadStepAttribString
!! \return 0 on success or error code
!<
@@ -40,7 +40,7 @@ INTEGER*8 FUNCTION h5_readstepattrib_string (filehandle,attrib_name,attrib_value
CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteFileAttribFloat64
!! \return 0 on success or error code
!>
@@ -51,7 +51,7 @@ INTEGER*8 FUNCTION h5_writefileattrib_r8 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadFileAttribFloat64
!! \return 0 on success or error code
!>
@@ -61,7 +61,7 @@ INTEGER*8 FUNCTION h5_readfileattrib_r8 ( filehandle, name, data )
REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteFileAttribFloat32
!! \return 0 on success or error code
!>
@@ -72,7 +72,7 @@ INTEGER*8 FUNCTION h5_writefileattrib_r4 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadFileAttribFloat32
!! \return 0 on success or error code
!>
@@ -82,7 +82,7 @@ INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, name, data )
REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteFileAttribInt64
!! \return 0 on success or error code
!>
@@ -93,7 +93,7 @@ INTEGER*8 FUNCTION h5_writefileattrib_i8 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadFileAttribInt64
!! \return 0 on success or error code
!>
@@ -103,7 +103,7 @@ INTEGER*8 FUNCTION h5_readfileattrib_i8 ( filehandle, name, data )
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteFileAttribInt32
!! \return 0 on success or error code
!>
@@ -114,7 +114,7 @@ INTEGER*8 FUNCTION h5_writefileattrib_i4 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadFileAttribInt32
!! \return 0 on success or error code
!>
@@ -124,7 +124,7 @@ INTEGER*8 FUNCTION h5_readfileattrib_i4 ( filehandle, name, data )
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteStepAttribFloat64
!! \return 0 on success or error code
!>
@@ -135,7 +135,7 @@ INTEGER*8 FUNCTION h5_writestepattrib_r8 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadStepAttribFloat64
!! \return 0 on success or error code
!>
@@ -145,7 +145,7 @@ INTEGER*8 FUNCTION h5_readstepattrib_r8 ( filehandle, name, data )
REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteStepAttribFloat32
!! \return 0 on success or error code
!>
@@ -156,7 +156,7 @@ INTEGER*8 FUNCTION h5_writestepattrib_r4 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadStepAttribFloat32
!! \return 0 on success or error code
!>
@@ -166,7 +166,7 @@ INTEGER*8 FUNCTION h5_readstepattrib_r4 ( filehandle, name, data )
REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteStepAttribInt64
!! \return 0 on success or error code
!>
@@ -177,7 +177,7 @@ INTEGER*8 FUNCTION h5_writestepattrib_i8 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadStepAttribInt64
!! \return 0 on success or error code
!>
@@ -187,7 +187,7 @@ INTEGER*8 FUNCTION h5_readstepattrib_i8 ( filehandle, name, data )
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5WriteStepAttribInt32
!! \return 0 on success or error code
!>
@@ -198,7 +198,7 @@ INTEGER*8 FUNCTION h5_writestepattrib_i4 ( filehandle, field_name, attrib_name,
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
END FUNCTION
!< \ingroup h5_attrib_f
!< \ingroup h5hut_attrib_f
!! See \ref H5ReadStepAttribInt32
!! \return 0 on success or error code
!>
@@ -208,7 +208,7 @@ INTEGER*8 FUNCTION h5_readstepattrib_i4 ( filehandle, name, data )
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5GetNumStepAttribs
!! \return number of attributes or error code
!<
@@ -216,7 +216,7 @@ INTEGER*8 FUNCTION h5_getnstepattribs (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5GetNumFileAttribs
!! \return number of attributes or error code
!<
@@ -224,7 +224,7 @@ INTEGER*8 FUNCTION h5_getnfileattribs (filehandle)
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5GetStepAttribInfo
!! \return 0 on success or error code
!<
@@ -235,7 +235,7 @@ INTEGER*8 FUNCTION h5_getstepattribinfo (filehandle,idx,attrib_name,attrib_nelem
INTEGER*8, INTENT(OUT) :: nelem !< number of elements in the attribute's array
END FUNCTION
!> \ingroup h5_attrib_f
!> \ingroup h5hut_attrib_f
!! See \ref H5GetFileAttribInfo
!! \return 0 on success or error code
!<
+2 -4
View File
@@ -2,10 +2,8 @@
OBJEXT=o
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
LIBS = $(HDFLIB) @MPILIB@
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
LIBS = @LIBS@
INCLUDES = -I../include @INCLUDES@
F90_FILES = H5.f90 \
H5_attribs.f90 \
+2 -4
View File
@@ -2,10 +2,8 @@
OBJEXT=o
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
LIBS = $(HDFLIB) @MPILIB@
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
LIBS = @LIBS@
INCLUDES = -I../include @INCLUDES@
EXTRA_HEADERS = \
../include/h5core/h5_attribs.h \
+33 -2
View File
@@ -188,9 +188,40 @@ h5priv_mpi_type_free (
h5_file_t* const f,
MPI_Datatype *type
) {
int err = MPI_Type_free ( type );
int err = MPI_Type_free( type );
if (err != MPI_SUCCESS)
return h5_error (f, H5_ERR_MPI, "Cannot free MPI type");
return h5_error(f, H5_ERR_MPI, "Cannot free MPI type");
return H5_SUCCESS;
}
h5_err_t
h5priv_mpi_cart_create (
h5_file_t* const f,
MPI_Comm old_comm,
int ndims,
int *dims,
int *period,
int *reorder,
MPI_Comm *new_comm
) {
int err = MPI_Cart_create(
old_comm, ndims, dims, period, reorder, new_comm);
if (err != MPI_SUCCESS)
return h5_error(f, H5_ERR_MPI, "Cannot create cartesian grid");
return H5_SUCCESS;
}
h5_err_t
h5priv_mpi_cart_coords (
h5_file_t* const f,
MPI_Comm comm,
int rank,
int maxdim,
int *coords
) {
int err = MPI_Cart_coords( comm, rank, maxdim, coords );
if (err != MPI_SUCCESS)
return h5_error(f, H5_ERR_MPI, "Cannot create cartesian grid");
return H5_SUCCESS;
}
+20
View File
@@ -94,5 +94,25 @@ h5priv_mpi_type_free (
MPI_Datatype *type
);
h5_err_t
h5priv_mpi_cart_create (
h5_file_t* const f,
MPI_Comm old_comm,
int ndims,
int *dims,
int *period,
int *reorder,
MPI_Comm *new_comm
);
h5_err_t
h5priv_mpi_cart_coords (
h5_file_t* const f,
MPI_Comm comm,
int rank,
int maxdim,
int *coords
);
#endif
#endif
+3 -3
View File
@@ -5,9 +5,9 @@
\struct h5_file
This is an essentially opaque datastructure that
acts as the filehandle for all practical purposes.
It is created by H5PartOpenFile<xx>() and destroyed by
H5PartCloseFile().
acts as a filehandle and is defined as type \c h5_file_t.
It is created by \ref H5OpenFile and destroyed by
\ref H5CloseFile.
*/
struct h5_file {
hid_t file; /* file id -> fid */
-9
View File
@@ -59,15 +59,6 @@ h5b_get_num_field_attribs (
return n;
}
/*!
\ingroup h5block_attrib
Query information about a attribute given by index \c attrib_idx and
field name \c field_name. The function returns the name of the attribute,
the type of the attribute and the number of elements of this type.
\return \c H5_SUCCESS or error code
*/
h5_err_t
h5b_get_field_attrib_info (
h5_file_t *const f, /*!< IN: file handle */
+178 -54
View File
@@ -4,6 +4,9 @@
#include "h5core/h5_core.h"
#include "h5_core_private.h"
#define MIN( x, y ) ( (x) <= (y) ? (x) : (y) )
#define MAX( x, y ) ( (x) >= (y) ? (x) : (y) )
/*!
\note
A partition must not be part of another partition.
@@ -21,6 +24,10 @@ _normalize_partition (
) {
h5_size_t tmp;
p->i_start = MAX(0, p->i_start);
p->j_start = MAX(0, p->j_start);
p->k_start = MAX(0, p->k_start);
if ( p->i_start > p->i_end ) {
tmp = p->i_start;
p->i_start = p->i_end;
@@ -101,9 +108,6 @@ _volume_of_partition (
}
#define MIN( x, y ) ( (x) <= (y) ? (x) : (y) )
#define MAX( x, y ) ( (x) >= (y) ? (x) : (y) )
/*!
\ingroup h5block_private
@@ -509,6 +513,13 @@ h5bpriv_create_field_group (
return H5_SUCCESS;
}
h5_int64_t
h5b_3d_has_view (
h5_file_t *const f /*!< IN: File handle */
) {
return f->b->have_layout;
}
h5_err_t
h5b_3d_set_view (
h5_file_t *const f, /*!< IN: File handle */
@@ -576,6 +587,52 @@ h5b_3d_set_view (
return H5_SUCCESS;
}
h5_err_t
h5b_3d_get_view (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
) {
h5b_partition_t *p = f->b->user_layout;
*i_start = p->i_start;
*i_end = p->i_end;
*j_start = p->j_start;
*j_end = p->j_end;
*k_start = p->k_start;
*k_end = p->k_end;
return H5_SUCCESS;
}
h5_err_t
h5b_3d_get_reduced_view (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
) {
h5b_partition_t *p = f->b->write_layout;
*i_start = p->i_start;
*i_end = p->i_end;
*j_start = p->j_start;
*j_end = p->j_end;
*k_start = p->k_start;
*k_end = p->k_end;
return H5_SUCCESS;
}
h5_err_t
h5b_3d_set_chunk (
h5_file_t *const f, /*!< IN: File handle */
@@ -638,78 +695,145 @@ h5b_3d_get_chunk (
}
h5_err_t
h5b_3d_get_view (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
h5b_3d_set_grid (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
) {
if ( ( proc < 0 ) || ( proc >= f->nprocs ) )
return h5_error(f, H5_ERR_INVAL, "Invalid processor id %d!", proc);
if (i*j*k != f->nprocs) {
return h5_error(f, H5_ERR_INVAL,
"Grid dimensions (%lld,%lld,%lld) do not multiply "
"out to %d MPI processors!",
(long long)i,
(long long)j,
(long long)k,
f->nprocs);
}
h5b_partition_t *p = &f->b->user_layout[(size_t)proc];
f->b->k_grid = i;
f->b->j_grid = j;
f->b->i_grid = k;
*i_start = p->i_start;
*i_end = p->i_end;
*j_start = p->j_start;
*j_end = p->j_end;
*k_start = p->k_start;
*k_end = p->k_end;
int dims[3] = { k, j, i };
int period[3] = { 0, 0, 0 };
TRY( h5priv_mpi_cart_create(f,
f->comm, 3, dims, period, period, &f->b->cart_comm) );
f->b->have_grid = 1;
return H5_SUCCESS;
}
h5_err_t
h5b_3d_get_reduced_view (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
h5b_3d_get_grid_coords (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: MPI processor */
h5_int64_t *i, /*!< OUT: index in \c i */
h5_int64_t *j, /*!< OUT: index in \c j */
h5_int64_t *k /*!< OUT: index in \c k */
) {
if ( ( proc < 0 ) || ( proc >= f->nprocs ) )
return h5_error(f, H5_ERR_INVAL, "Invalid processor id %d!", proc);
if ( ! f->b->have_grid )
return h5_error(f, H5_ERR_INVAL,
"Grid dimensions have not been set!");
h5b_partition_t *p = &f->b->write_layout[(size_t)proc];
int coords[3];
TRY( h5priv_mpi_cart_coords(f, f->b->cart_comm, proc, 3, coords) );
*k = coords[0];
*j = coords[1];
*i = coords[2];
return H5_SUCCESS;
}
*i_start = p->i_start;
*i_end = p->i_end;
*j_start = p->j_start;
*j_end = p->j_end;
*k_start = p->k_start;
*k_end = p->k_end;
h5_err_t
h5b_3d_set_dims (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
) {
if ( ! f->b->have_grid )
return h5_error(f, H5_ERR_INVAL,
"Grid dimensions have not been set!");
h5_size_t dims[3] = { k, j, i };
h5_size_t check_dims[3] = { k, j, i };
TRY( h5priv_mpi_bcast(f,
check_dims, 3, MPI_LONG_LONG, 0, f->comm) );
if ( dims[0] != check_dims[0] ||
dims[1] != check_dims[1] ||
dims[2] != check_dims[2]
) {
return h5_error(f, H5_ERR_INVAL,
"[%d] Block dimensions do not agree: "
"(%lld,%lld,%lld) != (%lld,%lld,%lld)!",
f->myproc,
(long long)dims[0], (long long)dims[1], (long long)dims[2],
(long long)check_dims[0], (long long)check_dims[1], (long long)check_dims[2]);
}
h5_int64_t coords[3];
TRY( h5b_3d_get_grid_coords(f,
f->myproc, coords+0, coords+1, coords+2) );
h5b_fdata_t *b = f->b;
b->user_layout->i_start = coords[2]*dims[2];
b->user_layout->i_end = (coords[2]+1)*dims[2] - 1;
b->user_layout->j_start = coords[1]*dims[1];
b->user_layout->j_end = (coords[1]+1)*dims[1] - 1;
b->user_layout->k_start = coords[0]*dims[0];
b->user_layout->k_end = (coords[0]+1)*dims[0] - 1;
b->write_layout[0] = b->user_layout[0];
b->i_max = b->i_grid * dims[2] - 1;
b->j_max = b->j_grid * dims[1] - 1;
b->k_max = b->k_grid * dims[0] - 1;
b->have_layout = 1;
return H5_SUCCESS;
}
int
h5b_3d_get_proc (
h5_err_t
h5b_3d_set_halo (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: \c i coordinate */
const h5_int64_t j, /*!< IN: \c j coordinate */
const h5_int64_t k /*!< IN: \c k coordinate */
const h5_size_t i, /*!< IN: radius in \c i */
const h5_size_t j, /*!< IN: radius in \c j */
const h5_size_t k /*!< IN: radius in \c k */
) {
h5b_partition_t *layout = f->b->write_layout;
int proc;
if ( ! f->b->have_grid )
return h5_error(f, H5_ERR_INVAL,
"Grid dimensions have not been set!");
else if ( ! f->b->have_layout )
return h5_error(f, H5_ERR_INVAL,
"Block dimensions for grid have not been set!");
for ( proc = 0; proc < f->nprocs; proc++, layout++ ) {
if ( (layout->i_start <= i) && (i <= layout->i_end) &&
(layout->j_start <= j) && (j <= layout->j_end) &&
(layout->k_start <= k) && (k <= layout->k_end) )
return proc;
}
return -1;
h5b_fdata_t *b = f->b;
b->user_layout->i_start -= k;
b->user_layout->i_end += k;
b->user_layout->j_start -= j;
b->user_layout->j_end += j;
b->user_layout->k_start -= i;
b->user_layout->k_end += i;
b->user_layout->i_start = MAX(0, b->user_layout->i_start);
b->user_layout->j_start = MAX(0, b->user_layout->j_start);
b->user_layout->k_start = MAX(0, b->user_layout->k_start);
b->user_layout->i_end = MIN(b->i_max, b->user_layout->i_end);
b->user_layout->j_end = MIN(b->j_max, b->user_layout->j_end);
b->user_layout->k_end = MIN(b->k_max, b->user_layout->k_end);
return H5_SUCCESS;
}
h5_ssize_t
+1 -1
View File
@@ -230,7 +230,7 @@ _select_hyperslab_for_reading (
"Is the file corrupt?");
h5_debug (f,
"PROC[%d]: field_dims: (%lld,%lld,%lld)",
"[%d]: field_dims: (%lld,%lld,%lld)",
f->myproc,
(long long)field_dims[2],
(long long)field_dims[1],
+6
View File
@@ -19,6 +19,12 @@ struct h5b_fdata {
struct h5b_partition write_layout[1];
int have_layout;
MPI_Comm cart_comm;
h5_size_t i_grid;
h5_size_t j_grid;
h5_size_t k_grid;
int have_grid;
hid_t shape;
hid_t memshape;
hid_t diskshape;
-2
View File
@@ -16,8 +16,6 @@
#ifndef __H5_H
#define __H5_H
#include "H5_attribs.h"
h5_file_t *
H5OpenFile (
const char * filename,
+48 -23
View File
@@ -1,8 +1,10 @@
#ifndef __H5BLOCK_H
#define __H5BLOCK_H
#include "H5.h"
#include "H5Block_readwrite.h"
h5_int64_t
H5Block3dHasView (
h5_file_t *const f /*!< IN: File handle */
);
h5_err_t
H5Block3dSetView (
@@ -18,7 +20,6 @@ H5Block3dSetView (
h5_err_t
H5Block3dGetView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
@@ -27,6 +28,17 @@ H5Block3dGetView (
h5_size_t *k_end /*!< OUT: end index of \c k */
);
h5_err_t
H5Block3dGetReducedView (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c j */
h5_size_t *k_end /*!< OUT: end index of \c j */
);
h5_err_t
H5Block3dSetChunk (
h5_file_t *const f, /*!< IN: File handle */
@@ -43,23 +55,36 @@ H5Block3dGetChunk (
);
h5_err_t
H5Block3dGetReducedView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c j */
h5_size_t *k_end /*!< OUT: end index of \c j */
H5Block3dSetGrid (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
);
int
H5Block3dGetProc (
h5_err_t
H5Block3dGetGridCoords (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: \c i coordinate */
const h5_int64_t j, /*!< IN: \c j coordinate */
const h5_int64_t k /*!< IN: \c k coordinate */
const int proc, /*!< IN: MPI processor */
h5_int64_t *i, /*!< OUT: index in \c i */
h5_int64_t *j, /*!< OUT: index in \c j */
h5_int64_t *k /*!< OUT: index in \c k */
);
h5_err_t
H5Block3dSetDims (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
);
h5_err_t
H5Block3dSetHalo (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: radius in \c i */
const h5_size_t j, /*!< IN: radius in \c j */
const h5_size_t k /*!< IN: radius in \c k */
);
h5_size_t
@@ -113,15 +138,15 @@ H5BlockGetNumFieldAttribs (
h5_int64_t
H5BlockGetFieldAttribInfo (
h5_file_t *const f, /*!< [in] Handle to open file */
h5_file_t *const f, /*<! IN: Handle to open file */
const char *field_name, /*<! IN: field name */
const h5_size_t attrib_idx, /*!< [in] Index of attribute to
const h5_size_t attrib_idx, /*<! IN: Index of attribute to
get infos about */
char *attrib_name, /*!< [out] Name of attribute */
char *attrib_name, /*<! OUT: Name of attribute */
const h5_size_t len_of_attrib_name,
/*!< [in] length of buffer \c name */
h5_int64_t *attrib_type, /*!< [out] Type of value. */
h5_size_t *attrib_nelem /*!< [out] Number of elements */
/*<! IN: length of buffer \c name */
h5_int64_t *attrib_type, /*<! OUT: Type of value. */
h5_size_t *attrib_nelem /*<! OUT: Number of elements */
);
+2
View File
@@ -7,8 +7,10 @@ extern "C" {
#include "h5core/h5_core.h"
#include "H5.h"
#include "H5_attribs.h"
#include "H5Part.h"
#include "H5Block.h"
#include "H5Block_readwrite.h"
#include "H5Fed.h"
#ifdef __cplusplus
+89 -33
View File
@@ -1,15 +1,70 @@
#ifndef __H5B_MODEL_H
#define __H5B_MODEL_H
h5_err_t
h5bpriv_release_hyperslab (
h5_file_t *const f /*!< IN: file handle */
);
h5_err_t
h5bpriv_open_block_group (
h5_file_t *const f /*!< IN: file handle */
);
h5_err_t
h5bpriv_have_field_group (
h5_file_t *const f, /*!< IN: file handle */
const char *name
);
h5_err_t
h5bpriv_open_field_group (
h5_file_t *const f, /*!< IN: file handle */
const char *name
);
h5_err_t
h5bpriv_create_field_group (
h5_file_t *const f, /*!< IN: file handle */
const char *name /*!< IN: name of field group to create */
);
h5_int64_t
h5b_3d_has_view (
h5_file_t *const f /*!< IN: File handle */
);
h5_err_t
h5b_3d_set_view (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i_start, /*!< IN: start index of \c i */
const h5_size_t i_end, /*!< IN: end index of \c i */
const h5_size_t j_start, /*!< IN: start index of \c j */
const h5_size_t j_end, /*!< IN: end index of \c j */
const h5_size_t j_end, /*!< IN: end index of \c j */
const h5_size_t k_start, /*!< IN: start index of \c k */
const h5_size_t k_end /*!< IN: end index of \c k */
const h5_size_t k_end /*!< IN: end index of \c k */
);
h5_err_t
h5b_3d_get_view (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
);
h5_err_t
h5b_3d_get_reduced_view (
h5_file_t *const f, /*!< IN: File handle */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
);
h5_err_t
@@ -24,45 +79,46 @@ h5_err_t
h5b_3d_get_chunk (
h5_file_t *const f, /*!< IN: File handle */
const char *field_name, /*!< IN: name of dataset */
h5_size_t *dims /*!< OUT: array containing the chunk dimensions */
h5_size_t *dims /*!< OUT: array containing the chunk dimensions */
);
h5_err_t
h5b_3d_get_view (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
);
h5_err_t
h5b_3d_get_reduced_view (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
);
int
h5b_3d_get_proc (
h5b_3d_set_grid (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: \c i coordinate */
const h5_int64_t j, /*!< IN: \c j coordinate */
const h5_int64_t k /*!< IN: \c k coordinate */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
);
h5_err_t
h5b_3d_get_grid_coords (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: MPI processor */
h5_int64_t *i, /*!< OUT: index in \c i */
h5_int64_t *j, /*!< OUT: index in \c j */
h5_int64_t *k /*!< OUT: index in \c k */
);
h5_err_t
h5b_3d_set_dims (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: dimension in \c i */
const h5_size_t j, /*!< IN: dimension in \c j */
const h5_size_t k /*!< IN: dimension in \c k */
);
h5_err_t
h5b_3d_set_halo (
h5_file_t *const f, /*!< IN: File handle */
const h5_size_t i, /*!< IN: radius in \c i */
const h5_size_t j, /*!< IN: radius in \c j */
const h5_size_t k /*!< IN: radius in \c k */
);
h5_ssize_t
h5b_get_num_fields (
h5_file_t *const f /*!< IN: File handle */
);
);
h5_err_t
h5b_get_field_info_by_name (
@@ -86,5 +142,5 @@ h5b_get_field_info (
h5_int64_t *type /*!< OUT: datatype */
);
#endif
#endif
+3 -4
View File
@@ -4,11 +4,10 @@
OBJEXT=o
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@ -lm
H5LIB = -L../src/lib -lH5hutC -lH5hut
LIBS = $(H5LIB) $(HDFLIB) @MPILIB@
LDFLAGS = -L../src/lib @LDFLAGS@
LIBS = -lH5hutC -lH5hut @LIBS@
INCLUDES = -I../src/include -I@HDF5ROOT@/include @MPIINC@
INCLUDES = -I../src/include @INCLUDES@
noinst_PROGRAMS = h5u_test h5b_test
+86
View File
@@ -178,6 +178,68 @@ test_read_data64(h5_file_t *file, int step)
}
}
static void
test_read_data32(h5_file_t *file, int step)
{
extern h5_size_t grid[3];
int t;
h5_err_t status;
float *e;
float *ex,*ey,*ez;
int *id;
const size_t nelems = NBLOCKX * NBLOCKY * NBLOCKZ;
e=(float*)malloc(nelems*sizeof(double));
ex=(float*)malloc(nelems*sizeof(double));
ey=(float*)malloc(nelems*sizeof(double));
ez=(float*)malloc(nelems*sizeof(double));
id=(int*)malloc(nelems*sizeof(int));
TEST("Reading 32-bit data");
for (t=step; t<step+NTIMESTEPS; t++)
{
h5_int64_t val;
val = H5HasStep(file, t);
IVALUE(val, 1, "has step");
status = H5SetStep(file, t);
RETURN(status, H5_SUCCESS, "H5SetStep");
test_read_field_attribs(file, "e", t);
status = H5Block3dSetGrid(file, grid[0], grid[1], grid[2]);
RETURN(status, H5_SUCCESS, "H5Block3dSetGrid");
status = H5Block3dSetDims(file, NBLOCKX, NBLOCKY, NBLOCKZ);
RETURN(status, H5_SUCCESS, "H5Block3dSetDims");
status = H5Block3dReadScalarFieldFloat32(file, "e", e);
RETURN(status, H5_SUCCESS, "H5Block3dReadScalarFieldFloat32");
status = H5Block3dReadVector3dFieldFloat32(file,
"E", ex, ey, ez);
RETURN(status, H5_SUCCESS,
"H5Block3dReadVector3dFieldFloat32");
status = H5Block3dReadScalarFieldInt32(file, "id", id);
RETURN(status, H5_SUCCESS, "H5Block3dReadScalarFieldInt32");
int i;
for (i=0; i<nelems; i++)
{
FVALUE(e[i] , 0.0 + (float)(i+nelems*t), " e data");
FVALUE(ex[i], 0.1 + (float)(i+nelems*t), " ex data");
FVALUE(ey[i], 0.2 + (float)(i+nelems*t), " ey data");
FVALUE(ez[i], 0.3 + (float)(i+nelems*t), " ez data");
IVALUE(id[i], (i+nelems*t), " id data");
}
}
}
void h5b_test_read1(void)
{
h5_file_t *file1;
@@ -195,3 +257,27 @@ void h5b_test_read1(void)
RETURN(status, H5_SUCCESS, "H5CloseFile");
}
void h5b_test_read2(void)
{
h5_file_t *file1;
h5_file_t *file2;
h5_int64_t status;
TEST("Opening file twice, read-only");
file1 = H5OpenFile(FILENAME, H5_O_RDONLY, MPI_COMM_WORLD);
status = H5CheckFile(file1);
RETURN(status, H5_SUCCESS, "H5CheckFile");
file2 = H5OpenFile(FILENAME, H5_O_RDONLY, MPI_COMM_WORLD);
status = H5CheckFile(file2);
RETURN(status, H5_SUCCESS, "H5CheckFile");
test_read_data32(file1, NTIMESTEPS+1);
status = H5CloseFile(file1);
RETURN(status, H5_SUCCESS, "H5CloseFile");
status = H5CloseFile(file2);
RETURN(status, H5_SUCCESS, "H5CloseFile");
}
+15 -7
View File
@@ -6,13 +6,16 @@
#include "params.h"
/* global */
h5_size_t grid[3];
h5_size_t layout[6];
/* from write.c */
void h5b_test_write1(void);
void h5b_test_write2(void);
/* from read.c */
void h5b_test_read1(void);
void h5b_test_read2(void);
static int
_nth_root_int_divisor (const int m, const int n)
@@ -48,15 +51,14 @@ int main(int argc, char **argv)
}
/* make up a 3D layout */
h5_size_t decomp[3];
decomp[0] = _nth_root_int_divisor (procs, 3);
decomp[1] = _nth_root_int_divisor (procs / decomp[0], 2);
decomp[2] = procs / decomp[0] / decomp[1];
grid[0] = _nth_root_int_divisor (procs, 3);
grid[1] = _nth_root_int_divisor (procs / grid[0], 2);
grid[2] = procs / grid[0] / grid[1];
h5_size_t i,j,k;
k = rank % decomp[2];
j = (rank / decomp[2]) % decomp[1];
i = rank / (decomp[2] * decomp[1]);
k = rank % grid[2];
j = (rank / grid[2]) % grid[1];
i = rank / (grid[2] * grid[1]);
layout[0] = i*NBLOCKX;
layout[1] = (i+1)*NBLOCKX - 1;
@@ -65,6 +67,10 @@ int main(int argc, char **argv)
layout[4] = k*NBLOCKZ;
layout[5] = (k+1)*NBLOCKZ - 1;
#else // PARALLEL_IO
grid[0] = 1;
grid[1] = 1;
grid[2] = 1;
layout[0] = 0;
layout[1] = NBLOCKX - 1;
layout[2] = 0;
@@ -79,6 +85,8 @@ int main(int argc, char **argv)
/* Tests are generally arranged from least to most complexity... */
AddTest("write1", h5b_test_write1, NULL, "Write 64-bit data", NULL);
AddTest("read1", h5b_test_read1, NULL, "Read 64-bit data", NULL);
AddTest("write2", h5b_test_write2, NULL, "Write 32-bit data", NULL);
AddTest("read2", h5b_test_read2, NULL, "Read 32-bit data", NULL);
/* Display testing information */
TestInfo(argv[0]);
+87
View File
@@ -111,6 +111,68 @@ test_write_data64(h5_file_t *file, int step)
}
}
static void
test_write_data32(h5_file_t *file, int step)
{
extern h5_size_t grid[3];
int i,t;
h5_int64_t status, val;
float *e;
float *ex,*ey,*ez;
int *id;
const size_t nelems = NBLOCKX * (NBLOCKY+2) * (NBLOCKZ+4);
e=(float*)malloc(nelems*sizeof(double));
ex=(float*)malloc(nelems*sizeof(double));
ey=(float*)malloc(nelems*sizeof(double));
ez=(float*)malloc(nelems*sizeof(double));
id=(int*)malloc(nelems*sizeof(int));
TEST("Writing 32-bit data");
for (t=step; t<step+NTIMESTEPS; t++)
{
for (i=0; i<nelems; i++)
{
e[i] = 0.0 + (float)(i+nelems*t);
ex[i] = 0.1 + (float)(i+nelems*t);
ey[i] = 0.2 + (float)(i+nelems*t);
ez[i] = 0.3 + (float)(i+nelems*t);
id[i] = i + nelems*t;
}
val = H5HasStep(file, t);
status = H5SetStep(file, t);
RETURN(status, H5_SUCCESS, "H5SetStep");
if (val == 0) test_write_field_attribs(file, "e", t);
status = H5Block3dSetGrid(file, grid[0], grid[1], grid[2]);
RETURN(status, H5_SUCCESS, "H5Block3dSetGrid");
status = H5Block3dSetDims(file, NBLOCKX, NBLOCKY, NBLOCKZ);
RETURN(status, H5_SUCCESS, "H5Block3dSetDims");
status = H5Block3dSetHalo(file, 0, 1, 2);
RETURN(status, H5_SUCCESS, "H5Block3dSetHalo");
status = H5Block3dWriteScalarFieldFloat32(file, "e", e);
RETURN(status, H5_SUCCESS, "H5Block3dWriteScalarFieldFloat32");
status = H5Block3dWriteVector3dFieldFloat32(file,
"E", ex, ey, ez);
RETURN(status, H5_SUCCESS,
"H5Block3dWriteVector3dFieldFloat32");
status = H5Block3dWriteScalarFieldInt32(file, "id", id);
RETURN(status, H5_SUCCESS, "H5Block3dWriteScalarFieldInt32");
}
}
void h5b_test_write1(void)
{
h5_file_t *file1;
@@ -129,3 +191,28 @@ void h5b_test_write1(void)
RETURN(status, H5_SUCCESS, "H5CloseFile");
}
void h5b_test_write2(void)
{
h5_file_t *file1;
h5_file_t *file2;
h5_err_t status;
TEST("Opening file twice, write-append + read-only");
file1 = H5OpenFile(FILENAME, H5_O_APPEND, MPI_COMM_WORLD);
status = H5CheckFile(file1);
RETURN(status, H5_SUCCESS, "H5CheckFile");
file2 = H5OpenFile(FILENAME, H5_O_RDONLY, MPI_COMM_WORLD);
status = H5CheckFile(file2);
RETURN(status, H5_SUCCESS, "H5CheckFile");
test_write_data32(file1, NTIMESTEPS+1);
status = H5CloseFile(file1);
RETURN(status, H5_SUCCESS, "H5CloseFile");
status = H5CloseFile(file2);
RETURN(status, H5_SUCCESS, "H5CloseFile");
}
+3 -4
View File
@@ -2,11 +2,10 @@
OBJEXT=o
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
H5LIB = -L../src/lib -lH5hutC -lH5core
LIBS = $(H5LIB) $(HDFLIB) @MPILIB@
LDFLAGS = -L../src/lib @LFLAGS@
LIBS = -lH5hutC -lH5hut @LIBS@
INCLUDES = -I../src/include -I@HDF5ROOT@/include @MPIINC@
INCLUDES = -I../src/include @INCLUDES@
# What to build... make install will place these files in the $(prefix)/bin directory.
bin_PROGRAMS = @BUILD_TOOLS@
+276
View File
@@ -0,0 +1,276 @@
#! /bin/sh
# This tool is adapted from the h5cc command from HDF5, which is
# in turn adapted from mpicc command of the MPICH Software.
############################################################################
## ##
## Things You May Have to Modify: ##
## ##
## If the following paths don't point to the place were HDF5 is installed ##
## on your system (i.e., you received a binary distribution or moved the ##
## files from the originally installed directory to another directory) ##
## then modify them accordingly to represent the new paths. ##
## ##
############################################################################
prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
includedir="@includedir@"
hdf5dir="@HDF5ROOT@"
############################################################################
## ##
## You shouldn't have to modify anything below this line. ##
## ##
############################################################################
host_os="@host_os@"
prog_name="`basename $0`"
allargs=""
compile_args=""
libraries=""
link_args=""
link_objs=""
clibpath=""
do_link="yes"
do_compile="no"
dash_o="no"
dash_c="no"
get_output_file="no"
SHOW="eval"
CCBASE="@CC@"
CLINKERBASE="@CC@"
CFLAGS="@CFLAGS@"
CPPFLAGS="@CPPFLAGS@"
INCLUDES="@INCLUDES@"
LDFLAGS="@LDFLAGS@"
LIBS="@LIBS@"
CC="${H5HUT_CC:-$CCBASE}"
CLINKER="${H5HUT_CLINKER:-$CLINKERBASE}"
usage() {
# A wonderfully informative "usage" message.
echo "usage: $prog_name [OPTIONS] <compile line>"
echo " OPTIONS:"
echo " -help This help message."
echo " -echo Show all the shell commands executed"
echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/"
echo " subdirectories [default: $prefix]"
echo " -show Show the commands without executing them"
echo " -showconfig Show the HDF5 library configuration summary"
echo " "
echo " <compile line> - the normal compile line options for your compiler."
echo " $prog_name uses the same compiler you used to compile"
echo " HDF5. Check with your compiler's man pages for more"
echo " information on which options are needed."
echo " "
echo " You can override the compiler, linker, and whether or not to use static"
echo " or shared libraries to compile your program by setting the following"
echo " environment variables accordingly:"
echo " "
echo " H5HUT_CC - use a different C compiler"
echo " H5HUT_CLINKER - use a different linker"
echo " "
exit 1
}
# Show the configuration summary of the library recorded in the
# libhdf5.settings file reside in the lib directory.
showconfigure()
{
cat ${hdf5dir}/lib/libhdf5.settings
status=$?
}
# Main
status=0
if test "$#" = "0"; then
# No parameters specified, issue usage statement and exit.
usage
fi
case "$CC" in
gcc)
kind="gcc"
;;
mpicc|mpcc|mpicc_r)
# Is this gcc masquarading as an MPI compiler?
if test "`${CC} -v 2>&1 | sed -n 2p | cut -c1-3`" = "gcc"; then
kind="gcc"
else
# Nope
kind="$host_os"
fi
;;
*)
kind="$host_os"
;;
esac
for arg in $@ ; do
if test "x$get_output_file" = "xyes"; then
link_args="$link_args $arg"
output_file="$arg"
get_output_file="no"
continue
fi
case "$arg" in
-c)
allargs="$allargs $arg"
compile_args="$compile_args $arg"
if test "x$do_link" = "xyes" -a -n "$output_file"; then
compile_args="$compile_args -o $outputfile"
fi
do_link="no"
dash_c="yes"
;;
-o)
allargs="$allargs $arg"
dash_o="yes"
if test "x$dash_c" = "xyes"; then
compile_args="$compile_args $arg"
else
link_args="$link_args $arg"
do_link="yes"
get_output_file="yes"
fi
;;
-E|-M)
allargs="$allargs $arg"
compile_args="$compile_args $arg"
dash_c="yes"
do_link="no"
;;
-l*)
libraries=" $libraries $arg "
allargs="$allargs $arg"
;;
-prefix=*)
prefix="`expr "$arg" : '-prefix=\(.*\)'`"
;;
-echo)
set -x
;;
-show)
SHOW="echo"
;;
-showconfig)
showconfigure
exit $status
;;
-help)
usage
;;
*\"*)
qarg="'"$arg"'"
allargs="$allargs $qarg"
;;
*\'*)
qarg='\"'"$arg"'\"'
allargs="$allargs $qarg"
;;
*)
allargs="$allargs $qarg"
if test -s "$arg"; then
ext=`expr "$arg" : '.*\(\..*\)'`
if test "x$ext" = "x.c"; then
do_compile="yes"
compile_args="$compile_args $arg"
fname=`basename $arg .c`
link_objs="$link_objs $fname.o"
elif test "x$ext" = "x.o"; then
if test "x$dash_c" = "xyes"; then
compile_args="$compile_args $arg"
else
do_link="yes"
link_objs="$link_objs $arg"
fi
elif test "x$ext" = "x.a"; then
# This is an archive that we're linking in
libraries=" $libraries $arg "
else
compile_args="$compile_args $arg"
link_args="$link_args $arg"
fi
else
compile_args="$compile_args $arg"
link_args="$link_args $arg"
fi
;;
esac
done
if test "$dash_c" = "yes" -a "$do_compile" = no -a "$do_link" = no ; then
# -c was specified. Force do_compile on.
do_compile=yes
fi
if test "x$do_compile" = "xyes"; then
if test "x$dash_c" != "xyes"; then
compile_args="-c $compile_args"
fi
$SHOW $CC -I$includedir $INCLUDES $CPPFLAGS $CFLAGS $compile_args
status=$?
if test "$status" != "0"; then
exit $status
fi
fi
if test "x$do_link" = "xyes"; then
shared_link=""
libraries=" $libraries -lH5hutC -lH5hut "
link_args="$link_args -L${libdir}"
case "$kind" in
gcc|linux*)
# MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
# It appears to want none of them specified.
case "$host_os" in
darwin*) flag="" ;;
*) flag="-Wl,-rpath -Wl," ;;
esac
;;
hpux*) flag="-Wl,+b -Wl," ;;
freebsd*|solaris*) flag="-R" ;;
rs6000*|aix*) flag="-L" ;;
irix*|sgi) flag="-rpath " ;;
*) flag="" ;;
esac
if test -n "$flag"; then
shared_link="${flag}${libdir}"
fi
for lib in $libraries; do
if echo $link_args | grep " $lib " > /dev/null ||
echo $link_args | grep " $lib$" > /dev/null; then
:
else
link_args="$link_args $lib "
fi
done
# The LIBS are just a bunch of -l* libraries necessary for the HDF5
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $LIBS"
$SHOW $CLINKER $CFLAGS $LDFLAGS $clibpath $link_objs $link_args
status=$?
fi
exit $status