continued merging H5Block: still some functionality missing (attribs, read, write); added H5Part regression tests; simplified several Makefile.am files and configure.ac; began merging new Fortran interface
This commit is contained in:
+15
@@ -74,6 +74,21 @@ H5CloseFile (
|
||||
return h5_close_file (f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_c_api_general
|
||||
|
||||
Close file.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5CheckFile (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME (f, __func__);
|
||||
return h5_check_filehandle (f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_c_api_general
|
||||
|
||||
|
||||
+177
-1653
File diff suppressed because it is too large
Load Diff
+7
-9
@@ -108,7 +108,7 @@ For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetNumParticles (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t nparticles /*!< [in] Number of particles */
|
||||
) {
|
||||
|
||||
@@ -147,9 +147,9 @@ H5PartSetNumParticles (
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetNumParticlesStrided (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t nparticles, /*!< [in] Number of particles */
|
||||
h5_int64_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
h5_int64_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
@@ -161,14 +161,12 @@ H5PartSetNumParticlesStrided (
|
||||
\ingroup h5part_model
|
||||
|
||||
Define the chunk \c size and enables chunking in the underlying
|
||||
HDF5 layer. When combined with the \c align value in the
|
||||
\ref H5OpenFileAlign or \ref H5OpenFileParallelAlign
|
||||
function, this causes each group of \c size particles to be
|
||||
padded on disk out to the nearest multiple of \c align bytes.
|
||||
HDF5 layer.
|
||||
|
||||
Note that this policy wastes disk space, but can improve write
|
||||
bandwidth on parallel filesystems that are sensitive to alignment
|
||||
to stripe boundaries (e.g. lustre).
|
||||
bandwidth on parallel filesystems that are sensitive to write alignment
|
||||
(e.g. lustre). It is only recommended when using the MPI-POSIX or MPI-IO
|
||||
independent VFDs (see \ref H5OpenFile).
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
+480
-21
@@ -3,12 +3,13 @@
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5.h"
|
||||
|
||||
/********************** attribute API ****************************************/
|
||||
|
||||
/*** WRITE ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Writes an attribute \c name with the string \c value to
|
||||
Write an attribute \c name with the string \c value to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
@@ -22,9 +23,6 @@ H5WriteFileAttribString (
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
|
||||
return h5_get_errno( f );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
@@ -37,7 +35,7 @@ H5WriteFileAttribString (
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Writes an attribute \c name with the string \c value to
|
||||
Write an attribute \c name with the string \c value to
|
||||
the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
@@ -51,9 +49,6 @@ H5WriteStepAttribString (
|
||||
|
||||
SET_FNAME ( f, __func__ );
|
||||
|
||||
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
|
||||
return h5_get_errno( f );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
@@ -63,6 +58,476 @@ H5WriteStepAttribString (
|
||||
strlen(value) + 1 );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
/*** READ ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME ( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer);
|
||||
}
|
||||
|
||||
/*** QUERY ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5_attrib
|
||||
|
||||
@@ -76,9 +541,6 @@ H5GetNumFileAttribs (
|
||||
) {
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
|
||||
return h5_get_errno( f );
|
||||
|
||||
return h5_get_num_attribs ( f, H5_ATTRIB_FILE );
|
||||
}
|
||||
|
||||
@@ -95,9 +557,6 @@ H5GetNumStepAttribs (
|
||||
) {
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
|
||||
return h5_get_errno( f );
|
||||
|
||||
return h5_get_num_attribs ( f, H5_ATTRIB_STEP );
|
||||
}
|
||||
|
||||
@@ -119,13 +578,13 @@ H5GetNumStepAttribs (
|
||||
h5_int64_t
|
||||
H5GetFileAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
infos about */
|
||||
char *attrib_name, /*!< [out] Name of attribute */
|
||||
const h5_int64_t len_of_attrib_name,
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_int64_t *attrib_nelem /*!< [out] Number of elements */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
) {
|
||||
|
||||
SET_FNAME ( f, __func__ );
|
||||
@@ -160,13 +619,13 @@ H5GetFileAttribInfo (
|
||||
h5_int64_t
|
||||
H5GetStepAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_int64_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 */
|
||||
const h5_int64_t len_of_attrib_name,
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_int64_t *attrib_nelem /*!< [out] Number of elements */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
) {
|
||||
|
||||
SET_FNAME ( f, __func__ );
|
||||
|
||||
+12
-49
@@ -1,49 +1,23 @@
|
||||
# src level Makefile.am
|
||||
# src/C level Makefile.am
|
||||
|
||||
# PATH SETTING (IMPORTED FROM CONFIGURE)
|
||||
HDF5ROOT = @HDF5ROOT@
|
||||
OBJEXT=o
|
||||
|
||||
# COMPILERS
|
||||
CC = @CC@
|
||||
|
||||
#INCLUDES
|
||||
HDFINC = -I$(HDF5ROOT)/include
|
||||
MPIINC = @MPIINC@
|
||||
|
||||
INC = $(HDFINC) ${MPIINC} -I../include
|
||||
|
||||
# H5Part header file location
|
||||
H5PINC = -I@prefix@/include
|
||||
|
||||
# COMPILER FLAGS
|
||||
CFLAGS = @CFLAGS@ ${INC}
|
||||
|
||||
# H5Part compiled library location
|
||||
H5PLIB = -L@prefix@/lib
|
||||
|
||||
# HDF5 LIBRARY
|
||||
HDFLIB = -L$(HDF5ROOT)/lib -lhdf5 -lz $(SZLIB) @LDFLAGS@
|
||||
|
||||
# SZ LIBRARY
|
||||
SZLIB = @SZLIB@
|
||||
|
||||
# Extra files that I wish to include in the dist tar ball.
|
||||
EXTRA_DIST = TestUnderscoreC.c TestUnderscore.f $(EXTRA_HEADERS)
|
||||
|
||||
# Files that I don't want to include in the dist tar ball
|
||||
nodist_include_HEADERS = @UNDERSCORE_H@
|
||||
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
|
||||
LIBS = $(HDFLIB) @MPILIB@
|
||||
|
||||
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
|
||||
|
||||
# What to build... Will be determined by configure script.
|
||||
OBJEXT = o
|
||||
lib_LIBRARIES = libH5.a
|
||||
lib_LIBRARIES = libH5hutC.a
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LIBRARIES = libH5.a
|
||||
EXTRA_LIBRARIES = libH5hutC.a
|
||||
|
||||
# Header files that I wish to install in $(prefix)/include
|
||||
include_HEADERS = \
|
||||
../include/H5hut.h \
|
||||
../include/H5.h \
|
||||
../include/H5_inquiry.h \
|
||||
../include/H5_attribs.h \
|
||||
../include/H5Block.h \
|
||||
../include/H5Fed.h \
|
||||
@@ -55,7 +29,7 @@ include_HEADERS = \
|
||||
EXTRA_HEADERS =
|
||||
|
||||
# Listing of sources
|
||||
libH5_a_SOURCES = \
|
||||
libH5hutC_a_SOURCES = \
|
||||
H5.c \
|
||||
H5_attribs.c \
|
||||
H5_inquiry.c \
|
||||
@@ -68,19 +42,8 @@ libH5_a_SOURCES = \
|
||||
H5Fed_tags.c \
|
||||
H5Part.c
|
||||
|
||||
all: ../lib/libH5.a
|
||||
all: ../lib/libH5hutC.a
|
||||
|
||||
../lib/libH5.a: libH5.a
|
||||
../lib/libH5hutC.a: libH5hutC.a
|
||||
-cp $^ $@
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) $(INC) -c $<
|
||||
|
||||
clean:
|
||||
$(RM) -f *~ *.o *.a *.so
|
||||
|
||||
distclean: clean
|
||||
$(RM) -f Underscore.h
|
||||
$(RM) -rf .deps
|
||||
$(RM) -rf .libs
|
||||
$(RM) -f Makefile
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
! 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
|
||||
!! \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, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: i_start
|
||||
INTEGER*8, INTENT(IN) :: i_end
|
||||
INTEGER*8, INTENT(IN) :: j_start
|
||||
INTEGER*8, INTENT(IN) :: j_end
|
||||
INTEGER*8, INTENT(IN) :: k_start
|
||||
INTEGER*8, INTENT(IN) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_model
|
||||
!! See \ref H5BlockDefine3DChunkDims
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_define3dchunkdims ( 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
|
||||
!! \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, 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
|
||||
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 H5Block3dGetProcOf
|
||||
!! \return rank of processor error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_get_proc_of ( 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 H5BlockGetNumFields
|
||||
!! \return number of fields or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getnumfields ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_model
|
||||
!! See \ref H5BlockGetFieldInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getfieldinfo ( filehandle, idx, field_name, grid_rank, grid_dims, field_dims )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: idx
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: field_name
|
||||
INTEGER*8, INTENT(OUT) :: grid_rank
|
||||
INTEGER*8, INTENT(OUT) :: grid_dims(*)
|
||||
INTEGER*8, INTENT(OUT) :: field_dims
|
||||
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
|
||||
!! See \ref H5BlockWriteFieldAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_string ( 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 ! The name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockGetNumFieldAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getnfieldattribs ( filehandle, field_name )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockGetFieldAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getfieldattribinfo ( filehandle, field_name, idx, attrib_name, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
INTEGER*8,INTENT(IN) :: idx ! index of the attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: attrib_name ! The name of the attribute
|
||||
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.
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_string ( 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
|
||||
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
|
||||
|
||||
|
||||
+36
-170
@@ -1,6 +1,4 @@
|
||||
#include "H5Part.h"
|
||||
#include "H5PartPrivate.h"
|
||||
#include "H5Block.h"
|
||||
#include "H5hut.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
@@ -17,6 +15,9 @@
|
||||
#define h5bl_define3dlayout F77NAME ( \
|
||||
h5bl_define3dlayout_, \
|
||||
H5BL_DEFINE3DLAYOUT )
|
||||
#define h5bl_define3dchunkdims F77NAME ( \
|
||||
h5bl_define3dchunkdims_, \
|
||||
H5BL_DEFINE3DCHUNKDIMS )
|
||||
#define h5bl_get_partition_of_proc F77NAME ( \
|
||||
h5bl_get_partition_of_proc_, \
|
||||
H5BL_GET_PARTITION_OF_PROC )
|
||||
@@ -26,30 +27,12 @@
|
||||
#define h5bl_get_proc_of F77NAME ( \
|
||||
h5bl_get_proc_of_, \
|
||||
H5BL_GET_PROC_OF )
|
||||
#define h5bl_3d_read_scalar_field F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD )
|
||||
#define h5bl_3d_write_scalar_field F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD )
|
||||
#define h5bl_3d_read_3dvector_field F77NAME ( \
|
||||
h5bl_3d_read_3dvector_field_, \
|
||||
H5BL_3D_READ_3DVECTOR_FIELD )
|
||||
#define h5bl_3d_write_3dvector_field F77NAME ( \
|
||||
h5bl_3d_write_3dvector_field_, \
|
||||
H5BL_3D_WRITE_3DVECTOR_FIELD )
|
||||
#define h5bl_getnumfields F77NAME ( \
|
||||
h5bl_getnumfields_, \
|
||||
H5BL_GETNUMFIELDS )
|
||||
#define h5bl_getfieldinfo F77NAME ( \
|
||||
h5bl_getfieldinfo_, \
|
||||
H5BL_GETFIELDINFO )
|
||||
#define h5bl_writefieldattrib_r8 F77NAME ( \
|
||||
h5bl_writefieldattrib_r8_, \
|
||||
H5BL_WRITEFIELDATTRIB_R8 )
|
||||
#define h5bl_writefieldattrib_i8 F77NAME ( \
|
||||
h5bl_writefieldattrib_i8_, \
|
||||
H5BL_WRITEFIELDATTRIB_I8 )
|
||||
#define h5bl_writefieldattrib_string F77NAME ( \
|
||||
h5bl_writefieldattrib_string_, \
|
||||
H5BL_WRITEFIELDATTRIB_STRING )
|
||||
@@ -96,7 +79,7 @@ h5bl_define3dlayout (
|
||||
const h5part_int64_t *k_end /*!< end index of k */
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
return H5BlockDefine3DFieldLayout (
|
||||
filehandle,
|
||||
@@ -105,6 +88,19 @@ h5bl_define3dlayout (
|
||||
*k_start-1, *k_end-1 );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_define3dchunkdims (
|
||||
h5part_int64_t *f,
|
||||
const h5part_int64_t *i,
|
||||
const h5part_int64_t *j,
|
||||
const h5part_int64_t *k
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
return H5BlockDefine3DChunkDims ( filehandle, *i, *j, *k );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_get_partition_of_proc (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
@@ -117,7 +113,7 @@ h5bl_get_partition_of_proc (
|
||||
h5part_int64_t *k_end /*!< end index of k */
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
h5part_int64_t herr = H5Block3dGetPartitionOfProc (
|
||||
filehandle,
|
||||
@@ -147,7 +143,7 @@ h5bl_get_reduced_partition_of_proc (
|
||||
h5part_int64_t *k_end
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
h5part_int64_t herr = H5Block3dGetReducedPartitionOfProc (
|
||||
filehandle,
|
||||
@@ -173,97 +169,17 @@ h5bl_get_proc_of (
|
||||
const h5part_int64_t *k
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
return H5Block3dGetProcOf ( filehandle, (*i)-1, (*j)-1, (*k)-1 );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_scalar_field (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
h5part_float64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dReadScalarField (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_scalar_field (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const h5part_float64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarField (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_3dvector_field (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
h5part_float64_t *xval, /*!< array of x component data */
|
||||
h5part_float64_t *yval, /*!< array of y component data */
|
||||
h5part_float64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dRead3dVectorField (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_3dvector_field (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
const h5part_float64_t *xval, /*!< array of x component data */
|
||||
const h5part_float64_t *yval, /*!< array of y component data */
|
||||
const h5part_float64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWrite3dVectorField (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_getnumfields (
|
||||
h5part_int64_t *f /*!< file handle */
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
return H5BlockGetNumFields ( filehandle );
|
||||
}
|
||||
@@ -276,69 +192,19 @@ h5bl_getfieldinfo (
|
||||
h5part_int64_t *grid_rank,
|
||||
h5part_int64_t *grid_dims,
|
||||
h5part_int64_t *field_dims,
|
||||
h5part_int64_t *type,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
h5part_int64_t herr = H5BlockGetFieldInfo (
|
||||
filehandle, *idx, field_name, l_field_name,
|
||||
grid_rank, grid_dims, field_dims );
|
||||
grid_rank, grid_dims, field_dims, type );
|
||||
_H5Part_strc2for ( field_name, l_field_name );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_float64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttrib (
|
||||
filehandle, field_name2, attrib_name2, H5PART_FLOAT64,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_int64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttrib (
|
||||
filehandle, field_name2, attrib_name2, H5PART_INT64,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_string (
|
||||
h5part_int64_t *f,
|
||||
@@ -350,7 +216,7 @@ h5bl_writefieldattrib_string (
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 =_H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2=_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
@@ -373,7 +239,7 @@ h5bl_getnfieldattribs (
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
@@ -395,7 +261,7 @@ h5bl_getfieldattribinfo (
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
h5part_int64_t attrib_type;
|
||||
|
||||
@@ -424,7 +290,7 @@ h5bl_readfieldattrib_i8 (
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 =_H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2=_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
@@ -447,7 +313,7 @@ h5bl_readfieldattrib_r8 (
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 =_H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2=_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
@@ -471,7 +337,7 @@ h5bl_readfieldattrib_string (
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 =_H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2=_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
@@ -491,7 +357,7 @@ h5bl_has_fielddata (
|
||||
h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
return H5BlockHasFieldData ( filehandle );
|
||||
}
|
||||
@@ -506,7 +372,7 @@ h5b_3d_get_field_spacing (
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
@@ -527,7 +393,7 @@ h5b_3d_set_field_spacing (
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
@@ -548,7 +414,7 @@ h5b_3d_get_field_origin (
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
@@ -569,7 +435,7 @@ h5b_3d_set_field_origin (
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
INTERFACE
|
||||
INTEGER*8 FUNCTION h5bl_define3dlayout ( 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
|
||||
INTEGER*8, INTENT(IN) :: j_start
|
||||
INTEGER*8, INTENT(IN) :: j_end
|
||||
INTEGER*8, INTENT(IN) :: k_start
|
||||
INTEGER*8, INTENT(IN) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_get_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
|
||||
INTEGER*8, INTENT(OUT) :: j_end
|
||||
INTEGER*8, INTENT(OUT) :: k_start
|
||||
INTEGER*8, INTENT(OUT) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
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
|
||||
INTEGER*8, INTENT(OUT) :: j_end
|
||||
INTEGER*8, INTENT(OUT) :: k_start
|
||||
INTEGER*8, INTENT(OUT) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_get_proc_of ( 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
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(OUT) :: data(*)
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(IN) :: data(*)
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(OUT) :: x(*)
|
||||
REAL*8, INTENT(OUT) :: y(*)
|
||||
REAL*8, INTENT(OUT) :: z(*)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(IN) :: x(*)
|
||||
REAL*8, INTENT(IN) :: y(*)
|
||||
REAL*8, INTENT(IN) :: z(*)
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_getnumfields ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_getfieldinfo ( filehandle, idx, field_name, grid_rank, grid_dims, field_dims )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: idx
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: field_name
|
||||
INTEGER*8, INTENT(OUT) :: grid_rank
|
||||
INTEGER*8, INTENT(OUT) :: grid_dims(*)
|
||||
INTEGER*8, INTENT(OUT) :: field_dims
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
REAL*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_i8 (filehandle, field_name, attrib_name,attrib_value,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_string ( 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 ! The name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_getnfieldattribs ( filehandle, field_name )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_getfieldattribinfo ( filehandle, field_name, idx, attrib_name, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name ! The name of the field
|
||||
INTEGER*8, INTENT(IN) :: idx ! index of the attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(OUT):: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_string ( 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
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5bl_has_fielddata ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
END INTERFACE
|
||||
@@ -0,0 +1,224 @@
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWriteScalarFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: data(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dReadScalarFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: data(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWrite3dVectorFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_r8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
REAL*8, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
REAL*8, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dRead3dVectorFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_r8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
REAL*8, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
REAL*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWriteScalarFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(IN) :: data(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dReadScalarFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(OUT) :: data(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWrite3dVectorFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_r4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
REAL*4, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
REAL*4, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dRead3dVectorFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_r4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
REAL*4, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
REAL*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWriteScalarFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: data(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dReadScalarFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWrite3dVectorFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_i8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
INTEGER*8, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
INTEGER*8, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dRead3dVectorFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_i8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
INTEGER*8, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
INTEGER*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWriteScalarFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(IN) :: data(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dReadScalarFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dWrite3dVectorFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_3dvector_field_i4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
INTEGER*4, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
INTEGER*4, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_data
|
||||
!! See \ref H5Block3dRead3dVectorFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_3dvector_field_i4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
INTEGER*4, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
INTEGER*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockWriteFieldAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
REAL*8, INTENT(IN) :: attrib_value(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockWriteFieldAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_r4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
REAL*4, INTENT(IN) :: attrib_value(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockWriteFieldAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_i8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_value(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5blockf_attrib
|
||||
!! See \ref H5BlockWriteFieldAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_i4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
INTEGER*4, INTENT(IN) :: attrib_value(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
@@ -0,0 +1,555 @@
|
||||
|
||||
#include "H5Part.h"
|
||||
#include "H5PartPrivate.h"
|
||||
#include "H5Block.h"
|
||||
#include "H5BlockReadWrite.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77NAME(a,b) a
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
#define F77NAME(a,b) b
|
||||
#elif defined(F77_NO_UNDERSCORE)
|
||||
#else
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_r8 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_r8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_scalar_field_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const h5part_float64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat64 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_r8 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_r8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_scalar_field_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
h5part_float64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat64 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_3dvector_field_r8 F77NAME ( \
|
||||
h5bl_3d_write_3dvector_field_r8_, \
|
||||
H5BL_3D_WRITE_3DVECTOR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_3dvector_field_r8 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
const h5part_float64_t *xval, /*!< array of x component data */
|
||||
const h5part_float64_t *yval, /*!< array of y component data */
|
||||
const h5part_float64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWrite3dVectorFieldFloat64 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_3dvector_field_r8 F77NAME ( \
|
||||
h5bl_3d_read_3dvector_field_r8_, \
|
||||
H5BL_3D_READ_3DVECTOR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_3dvector_field_r8 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
h5part_float64_t *xval, /*!< array of x component data */
|
||||
h5part_float64_t *yval, /*!< array of y component data */
|
||||
h5part_float64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dRead3dVectorFieldFloat64 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_r4 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_r4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_scalar_field_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const h5part_float32_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat32 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_r4 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_r4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_scalar_field_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
h5part_float32_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldFloat32 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_3dvector_field_r4 F77NAME ( \
|
||||
h5bl_3d_write_3dvector_field_r4_, \
|
||||
H5BL_3D_WRITE_3DVECTOR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_3dvector_field_r4 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
const h5part_float32_t *xval, /*!< array of x component data */
|
||||
const h5part_float32_t *yval, /*!< array of y component data */
|
||||
const h5part_float32_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWrite3dVectorFieldFloat32 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_3dvector_field_r4 F77NAME ( \
|
||||
h5bl_3d_read_3dvector_field_r4_, \
|
||||
H5BL_3D_READ_3DVECTOR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_3dvector_field_r4 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
h5part_float32_t *xval, /*!< array of x component data */
|
||||
h5part_float32_t *yval, /*!< array of y component data */
|
||||
h5part_float32_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dRead3dVectorFieldFloat32 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_i8 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_i8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_scalar_field_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const h5part_int64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt64 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_i8 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_i8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_scalar_field_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
h5part_int64_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt64 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_3dvector_field_i8 F77NAME ( \
|
||||
h5bl_3d_write_3dvector_field_i8_, \
|
||||
H5BL_3D_WRITE_3DVECTOR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_3dvector_field_i8 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
const h5part_int64_t *xval, /*!< array of x component data */
|
||||
const h5part_int64_t *yval, /*!< array of y component data */
|
||||
const h5part_int64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWrite3dVectorFieldInt64 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_3dvector_field_i8 F77NAME ( \
|
||||
h5bl_3d_read_3dvector_field_i8_, \
|
||||
H5BL_3D_READ_3DVECTOR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_3dvector_field_i8 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
h5part_int64_t *xval, /*!< array of x component data */
|
||||
h5part_int64_t *yval, /*!< array of y component data */
|
||||
h5part_int64_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dRead3dVectorFieldInt64 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_i4 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_i4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_scalar_field_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const h5part_int32_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt32 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_i4 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_i4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_scalar_field_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
h5part_int32_t *data,
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWriteScalarFieldInt32 (
|
||||
filehandle, field_name2, data );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_3dvector_field_i4 F77NAME ( \
|
||||
h5bl_3d_write_3dvector_field_i4_, \
|
||||
H5BL_3D_WRITE_3DVECTOR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_write_3dvector_field_i4 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
const h5part_int32_t *xval, /*!< array of x component data */
|
||||
const h5part_int32_t *yval, /*!< array of y component data */
|
||||
const h5part_int32_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dWrite3dVectorFieldInt32 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_3dvector_field_i4 F77NAME ( \
|
||||
h5bl_3d_read_3dvector_field_i4_, \
|
||||
H5BL_3D_READ_3DVECTOR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_3d_read_3dvector_field_i4 (
|
||||
h5part_int64_t *f, /*!< file handle */
|
||||
const char *field_name, /*!< name of the data set */
|
||||
h5part_int32_t *xval, /*!< array of x component data */
|
||||
h5part_int32_t *yval, /*!< array of y component data */
|
||||
h5part_int32_t *zval, /*!< array of z component data */
|
||||
const int l_field_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
|
||||
h5part_int64_t herr = H5Block3dRead3dVectorFieldInt32 (
|
||||
filehandle, field_name2, xval, yval, zval );
|
||||
|
||||
free ( field_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_r8 F77NAME ( \
|
||||
h5bl_writefieldattrib_r8_, \
|
||||
H5BL_WRITEFIELDATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_float64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttribFloat64 (
|
||||
filehandle, field_name2, attrib_name2,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_r4 F77NAME ( \
|
||||
h5bl_writefieldattrib_r4_, \
|
||||
H5BL_WRITEFIELDATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_float32_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttribFloat32 (
|
||||
filehandle, field_name2, attrib_name2,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_i8 F77NAME ( \
|
||||
h5bl_writefieldattrib_i8_, \
|
||||
H5BL_WRITEFIELDATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_int64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttribInt64 (
|
||||
filehandle, field_name2, attrib_name2,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_i4 F77NAME ( \
|
||||
h5bl_writefieldattrib_i4_, \
|
||||
H5BL_WRITEFIELDATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5bl_writefieldattrib_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5part_int32_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 =_H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5BlockWriteFieldAttribInt32 (
|
||||
filehandle, field_name2, attrib_name2,
|
||||
attrib_value, *attrib_nelem );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
#include <string.h>
|
||||
#include <hdf5.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77NAME(a,b) a
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
#define F77NAME(a,b) b
|
||||
#elif defined(F77_NO_UNDERSCORE)
|
||||
#else
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
|
||||
#define h5_openr F77NAME ( \
|
||||
h5_openr_, \
|
||||
H5_OPENR )
|
||||
#define h5_openw F77NAME ( \
|
||||
h5_openw_, \
|
||||
H5_OPENW )
|
||||
#define h5_opena F77NAME ( \
|
||||
h5_opena_, \
|
||||
H5_OPENA )
|
||||
#define h5_openr_par F77NAME ( \
|
||||
h5_openr_par_, \
|
||||
H5_OPENR_PAR )
|
||||
#define h5_openw_par F77NAME ( \
|
||||
h5_openw_par_, \
|
||||
H5_OPENW_PAR )
|
||||
#define h5_opena_par F77NAME ( \
|
||||
h5_opena_par_, \
|
||||
H5_OPENA_PAR )
|
||||
#define h5_close F77NAME ( \
|
||||
h5_close_, \
|
||||
H5_CLOSE)
|
||||
#define h5_check F77NAME ( \
|
||||
h5_check_, \
|
||||
H5_CHECK)
|
||||
#define h5_setstep F77NAME ( \
|
||||
h5_setstep_, \
|
||||
H5_SETSTEP )
|
||||
#define h5_getnsteps F77NAME ( \
|
||||
h5_getnsteps_, \
|
||||
H5_GETNSTEPS )
|
||||
#define h5_set_verbosity_level F77NAME ( \
|
||||
h5_set_verbosity_level_, \
|
||||
H5_SET_VERBOSITY_LEVEL )
|
||||
|
||||
#endif
|
||||
|
||||
static char *
|
||||
_H5Part_strdupfor2c (
|
||||
const char *s,
|
||||
const ssize_t len
|
||||
) {
|
||||
|
||||
char *dup = (char*)malloc ( len + 1 );
|
||||
strncpy ( dup, s, len );
|
||||
char *p = dup + len;
|
||||
do {
|
||||
*p-- = '\0';
|
||||
} while ( *p == ' ' );
|
||||
return dup;
|
||||
}
|
||||
|
||||
static char *
|
||||
_H5Part_strc2for (
|
||||
char * const str,
|
||||
const ssize_t l_str
|
||||
) {
|
||||
|
||||
size_t len = strlen ( str );
|
||||
memset ( str+len, ' ', l_str-len );
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static h5_int32_t
|
||||
_H5Part_flagsfor2c (
|
||||
char * flags
|
||||
) {
|
||||
|
||||
h5_int32_t fbits = 0x00;
|
||||
|
||||
flags = strtok ( flags, "," );
|
||||
while ( flags != NULL ) {
|
||||
if ( strcmp ( flags, "vfd_mpiposix" ) == 0 )
|
||||
fbits |= H5_VFD_MPIPOSIX;
|
||||
else if ( strcmp ( flags, "vfd_independent" ) == 0 )
|
||||
fbits |= H5_VFD_INDEPENDENT;
|
||||
flags = strtok ( NULL, "," );
|
||||
}
|
||||
|
||||
return fbits;
|
||||
}
|
||||
|
||||
/* open/close interface */
|
||||
h5_int64_t
|
||||
h5_openr (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5_O_RDONLY, 0 );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5_openw (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5_O_WRONLY, 0 );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_opena (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5_O_APPEND, 0 );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
h5_int64_t
|
||||
h5_openr_par (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
h5_int32_t fbits = H5_O_RDONLY | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFile ( file_name2, ccomm, fbits );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5_openw_par (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
h5_int32_t fbits = H5_O_WRONLY | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFile ( file_name2, fbits, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_opena_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
h5_int32_t fbits = H5_O_APPEND | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFile( file_name2, fbits, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_close (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5CloseFile ( filehandle );
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5_setstep (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *step ) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5SetStep ( filehandle, (*step)-1 );
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5_getnsteps (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5GetNumSteps ( filehandle );
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5_set_verbosity_level (
|
||||
const h5_int64_t *level
|
||||
) {
|
||||
return H5SetVerbosityLevel ( *level );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,469 @@
|
||||
! Declaration of subroutines for Fortran Bindings
|
||||
|
||||
!> \defgroup h5part_f90_api H5Part F90 API
|
||||
|
||||
!> \ingroup h5part_f90_api
|
||||
!! \defgroup h5partf_open File Opening and Closing
|
||||
!<
|
||||
|
||||
!> \ingroup h5part_f90_api
|
||||
!! \defgroup h5partf_model Setting up the Data Model
|
||||
!<
|
||||
|
||||
!> \ingroup h5part_f90_api
|
||||
!! \defgroup h5partf_data Reading and Writing Datasets
|
||||
!<
|
||||
|
||||
!> \ingroup h5part_f90_api
|
||||
!! \defgroup h5partf_attrib Reading and Writing Attributes
|
||||
!<
|
||||
|
||||
|
||||
!!!!!!!! File Opening and Closing !!!!!!!!
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for reading. See \ref H5PartOpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openr ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for writing in truncate mode. See \ref H5PartOpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openw ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for writing in append mode. See \ref H5PartOpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_opena ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for reading.
|
||||
!! See \ref H5PartOpenFileParallel
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openr_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for writing in truncate mode.
|
||||
!! See \ref H5PartOpenFileParallel
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openw_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for writing in append mode.
|
||||
!! See \ref H5PartOpenFileParallel
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_opena_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for reading and specifies an HDF5 alignment.
|
||||
!! See \ref H5PartOpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openr_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for writing in truncate mode and specifies an HDF5 alignment.
|
||||
!! See \ref H5PartOpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openw_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a file for writing in append mode and specifies an HDF5 alignment.
|
||||
!! See \ref H5PartOpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_opena_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for reading and specifies an HDF5 alignment.
|
||||
!! See \ref H5PartOpenFileParallelAlign
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openr_par_align ( filename, mpi_communicator, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for writing in truncate mode and specifies
|
||||
!! an HDF5 alignment.
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! See \ref H5PartOpenFileParallelAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_openw_par_align ( filename, mpi_communicator, align, flags )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Opens a parallel file for writing in append mode and specifies
|
||||
!! an HDF5 alignment.
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! See \ref H5PartOpenFileParallelAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_opena_par_align ( filename, mpi_communicator, align, flags )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! Closes a file. See \ref H5PartCloseFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_close ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_open
|
||||
!! See \ref H5PartSetVerbosityLevel
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_set_verbosity_level ( level )
|
||||
INTEGER*8, INTENT(IN) :: level !< the level from 0 (no output) to 5 (most detailed)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!!!!!!!! Setting up the Data Model !!!!!!!!
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetNumParticles
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setnpoints ( filehandle, npoints )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: npoints !< the number of particles on *this* processor
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetNumParticlesStrided
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setnpoints_strided ( filehandle, npoints, stride )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: npoints !< the number of particles on *this* processor
|
||||
INTEGER*8, INTENT(IN) :: stride !< the stride value (e.g. the number of fields in the particle data array)
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetStep
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setstep (filehandle,step)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: step !< a timestep value >= 1
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartGetNumSteps
|
||||
!! \return the number of steps or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getnsteps (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartGetNumDatasets
|
||||
!! \return the number of datasets or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getndatasets (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartGetNumParticles
|
||||
!! \return the number of particles or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getnpoints (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartGetDatasetName
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getdatasetname (filehandle,index,name)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: index !< index of dataset to query (starting from 0)
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the dataset name into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: start !< offset of the first particle in the view
|
||||
INTEGER*8, INTENT(IN) :: end !< offset of the last particle in the view (inclusive)
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetViewIndices
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setview_indices (filehandle,indices,nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: indices(*) !< list of indicies to select in this view
|
||||
INTEGER*8, INTENT(IN) :: nelem !< number of particles in the list
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartSetViewEmpty
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setview_empty (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartResetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_resetview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartResetView
|
||||
!! \return 1 if true, 0 if false, or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_hasview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_model
|
||||
!! See \ref H5PartGetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(OUT) :: start !< buffer to store the offset of the first particle in the view
|
||||
INTEGER*8, INTENT(OUT) :: end !< buffer to store the offset of the last particle in the view (inclusive)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!!!!!!!! Reading and Writing Datasets !!!!!!!!
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartWriteDataFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writedata_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: data(*) !< the array of float64 data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartWriteDataFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writedata_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL, INTENT(IN) :: data(*) !< the array of float32 data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartWriteDataInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writedata_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: data(*) !< the array of int64 data to write
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartWriteDataInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writedata_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER, INTENT(IN) :: data(*) !< the array of int32 data to write
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartReadDataFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readdata_r8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: data(*) !< array to read float64 data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartReadDataFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readdata_r4 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL, INTENT(OUT) :: data(*) !< array to read float32 data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartReadDataInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readdata_i8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: data(*) !< array to read int64 data into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_data
|
||||
!! See \ref H5PartReadDataInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readdata_i4 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER, INTENT(OUT) :: data(*) !< array to read int32 data into
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!!!!!!!! Reading and Writing Attributes !!!!!!!!
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWriteFileAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWriteStepAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! Reads the attribute \c name in the file root ("/")
|
||||
!! into the string buffer \c value.
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! Reads the attribute \c name in the current step
|
||||
!! into the string buffer \c value.
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartGetNumStepAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getnstepattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartGetNumFileAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getnfileattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartGetStepAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getstepattribinfo (filehandle,idx,attrib_name,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: index !< index of the attribute to query (starting from 0)
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the attribute name into
|
||||
INTEGER*8, INTENT(OUT) :: nelem !< number of elements in the attribute's array
|
||||
END FUNCTION
|
||||
|
||||
!> \ingroup h5partf_attrib
|
||||
!! See \ref H5PartGetFileAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getfileattribinfo (filehandle,idx,attrib_name,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: index !< index of the attribute to query (starting from 0)
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the attribute name into
|
||||
INTEGER*8, INTENT(OUT) :: nelem !< number of elements in the attribute's array
|
||||
END FUNCTION
|
||||
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritefileAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritefileAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_r4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritefileAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_i8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritefileAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_i4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritestepAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritestepAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_r4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritestepAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_i8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! See \ref H5PartWritestepAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_i4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array
|
||||
END FUNCTION
|
||||
|
||||
!< \ingroup h5partf_attrib
|
||||
!! Read the attribute \c name into the buffer \c data.
|
||||
!! \return 0 on success or error code
|
||||
!>
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute
|
||||
INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into
|
||||
END FUNCTION
|
||||
@@ -0,0 +1,600 @@
|
||||
#include "H5hut.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77NAME(a,b) a
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
#define F77NAME(a,b) b
|
||||
#elif defined(F77_NO_UNDERSCORE)
|
||||
#else
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
/* Writing attributes */
|
||||
#define h5_writefileattrib_string F77NAME ( \
|
||||
h5pt_writefileattrib_string_, \
|
||||
H5PT_writefileattrib_string )
|
||||
#define h5_writestepattrib_string F77NAME ( \
|
||||
h5pt_writestepattrib_string_, \
|
||||
H5PT_WRITESTEPATTRIB_STRING )
|
||||
|
||||
h5_int64_t
|
||||
h5pt_writefileattrib_string (
|
||||
const h5_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const char *attrib_value,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
char *attrib_value2= _H5Part_strdupfor2c (attrib_value,l_attrib_value);
|
||||
|
||||
h5_int64_t herr = H5PartWriteFileAttribString (
|
||||
filehandle, attrib_name2, attrib_value2 );
|
||||
|
||||
free ( attrib_name2 );
|
||||
free ( attrib_value2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_writestepattrib_string (
|
||||
const h5_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const char *attrib_value,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
char *attrib_value2= _H5Part_strdupfor2c (attrib_value,l_attrib_value);
|
||||
|
||||
h5_int64_t herr = H5PartWriteStepAttribString (
|
||||
filehandle, attrib_name2, attrib_value2 );
|
||||
|
||||
free ( attrib_name2 );
|
||||
free ( attrib_value2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Reading attributes */
|
||||
#define h5pt_getnstepattribs F77NAME ( \
|
||||
h5pt_getnstepattribs_, \
|
||||
H5PT_GETNSTEPATTRIBS )
|
||||
#define h5pt_getnfileattribs F77NAME ( \
|
||||
h5pt_getnfileattribs_, \
|
||||
H5PT_GETNFILEATTRIBS )
|
||||
#define h5pt_getstepattribinfo F77NAME ( \
|
||||
h5pt_getstepattribinfo_, \
|
||||
H5PT_GETSTEPATTRIBINFO )
|
||||
#define h5pt_getfileattribinfo F77NAME ( \
|
||||
h5pt_getfileattribinfo_, \
|
||||
H5PT_GETFILEATTRIBINFO )
|
||||
#define h5pt_readstepattrib_string F77NAME ( \
|
||||
h5pt_readstepattrib_string_, \
|
||||
H5PT_READSTEPATTRIB_STRING )
|
||||
#define h5pt_readfileattrib_string F77NAME ( \
|
||||
h5pt_readfileattrib_string_, \
|
||||
H5PT_READFILEATTRIB_STRING )
|
||||
|
||||
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_r8 F77NAME ( \
|
||||
h5pt_writefileattrib_r8_, \
|
||||
H5PT_WRITEFILEATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_int64_t
|
||||
h5pt_readstepattrib_string (
|
||||
const h5_int64_t *f,
|
||||
const char *attrib_name,
|
||||
char *attrib_value,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char * attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, attrib_name2, attrib_value );
|
||||
|
||||
_H5Part_strc2for ( attrib_value, l_attrib_value );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_readfileattrib_string (
|
||||
const h5_int64_t *f,
|
||||
const char *attrib_name,
|
||||
char *attrib_value,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char * attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, attrib_name2, attrib_value );
|
||||
|
||||
_H5Part_strc2for ( attrib_value, l_attrib_value );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float64_t *data,
|
||||
const h5part_float64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle, name2, H5PART_FLOAT64, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_r8 F77NAME ( \
|
||||
h5pt_writefileattrib_r8_, \
|
||||
H5PT_WRITEFILEATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_r4 F77NAME ( \
|
||||
h5pt_writefileattrib_r4_, \
|
||||
H5PT_WRITEFILEATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float32_t *data,
|
||||
const h5part_float32_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle, name2, H5PART_FLOAT32, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_r4 F77NAME ( \
|
||||
h5pt_writefileattrib_r4_, \
|
||||
H5PT_WRITEFILEATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_i8 F77NAME ( \
|
||||
h5pt_writefileattrib_i8_, \
|
||||
H5PT_WRITEFILEATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int64_t *data,
|
||||
const h5part_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle, name2, H5PART_INT64, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_i8 F77NAME ( \
|
||||
h5pt_writefileattrib_i8_, \
|
||||
H5PT_WRITEFILEATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_i4 F77NAME ( \
|
||||
h5pt_writefileattrib_i4_, \
|
||||
H5PT_WRITEFILEATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int32_t *data,
|
||||
const h5part_int32_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle, name2, H5PART_INT32, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writefileattrib_i4 F77NAME ( \
|
||||
h5pt_writefileattrib_i4_, \
|
||||
H5PT_WRITEFILEATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_r8 F77NAME ( \
|
||||
h5pt_writestepattrib_r8_, \
|
||||
H5PT_WRITESTEPATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float64_t *data,
|
||||
const h5part_float64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle, name2, H5PART_FLOAT64, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_r8 F77NAME ( \
|
||||
h5pt_writestepattrib_r8_, \
|
||||
H5PT_WRITESTEPATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_r8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_r4 F77NAME ( \
|
||||
h5pt_writestepattrib_r4_, \
|
||||
H5PT_WRITESTEPATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float32_t *data,
|
||||
const h5part_float32_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle, name2, H5PART_FLOAT32, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_r4 F77NAME ( \
|
||||
h5pt_writestepattrib_r4_, \
|
||||
H5PT_WRITESTEPATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_r4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_i8 F77NAME ( \
|
||||
h5pt_writestepattrib_i8_, \
|
||||
H5PT_WRITESTEPATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int64_t *data,
|
||||
const h5part_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle, name2, H5PART_INT64, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_i8 F77NAME ( \
|
||||
h5pt_writestepattrib_i8_, \
|
||||
H5PT_WRITESTEPATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_i8 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_i4 F77NAME ( \
|
||||
h5pt_writestepattrib_i4_, \
|
||||
H5PT_WRITESTEPATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int32_t *data,
|
||||
const h5part_int32_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle, name2, H5PART_INT32, data, *nelem);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5pt_writestepattrib_i4 F77NAME ( \
|
||||
h5pt_writestepattrib_i4_, \
|
||||
H5PT_WRITESTEPATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_i4 (
|
||||
h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||
|
||||
char *name2 =_H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, name2, (void*)data);
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
/*** QUERY ***/
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getnstepattribs (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumStepAttribs ( filehandle );
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getnfileattribs (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumFileAttribs ( filehandle );
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getstepattribinfo (
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *idx,
|
||||
char *name,
|
||||
h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
h5_int64_t type;
|
||||
|
||||
h5_int64_t herr = H5PartGetStepAttribInfo (
|
||||
filehandle, *idx, name, l_name, &type, nelem);
|
||||
|
||||
_H5Part_strc2for( name, l_name );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getfileattribinfo (
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *idx,
|
||||
char *name,
|
||||
h5_int64_t *nelem,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
h5_int64_t type;
|
||||
|
||||
h5_int64_t herr = H5PartGetFileAttribInfo (
|
||||
filehandle, *idx, name, l_name, &type, nelem);
|
||||
|
||||
_H5Part_strc2for( name, l_name );
|
||||
return herr;
|
||||
}
|
||||
|
||||
|
||||
+347
-259
@@ -1,7 +1,9 @@
|
||||
#include "H5Part.h"
|
||||
#include "Underscore.h"
|
||||
#include <string.h>
|
||||
#include <hdf5.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77NAME(a,b) a
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
@@ -32,6 +34,25 @@
|
||||
#define h5pt_opena_par F77NAME ( \
|
||||
h5pt_opena_par_, \
|
||||
H5PT_OPENA_PAR )
|
||||
#define h5pt_openr_align F77NAME ( \
|
||||
h5pt_openr_align_, \
|
||||
H5PT_OPENR_ALIGN )
|
||||
#define h5pt_openw_align F77NAME ( \
|
||||
h5pt_openw_align_, \
|
||||
H5PT_OPENW_ALIGN )
|
||||
#define h5pt_opena_align F77NAME ( \
|
||||
h5pt_opena_align_, \
|
||||
H5PT_OPENA_ALIGN )
|
||||
#define h5pt_openr_par_align F77NAME ( \
|
||||
h5pt_openr_par_align_, \
|
||||
H5PT_OPENR_PAR_ALIGN )
|
||||
#define h5pt_openw_par_align F77NAME ( \
|
||||
h5pt_openw_par_align_, \
|
||||
H5PT_OPENW_PAR_ALIGN )
|
||||
#define h5pt_opena_par_align F77NAME ( \
|
||||
h5pt_opena_par_align_, \
|
||||
H5PT_OPENA_PAR_ALIGN )
|
||||
|
||||
#define h5pt_close F77NAME ( \
|
||||
h5pt_close_, \
|
||||
H5PT_CLOSE)
|
||||
@@ -40,15 +61,24 @@
|
||||
#define h5pt_setnpoints F77NAME ( \
|
||||
h5pt_setnpoints_, \
|
||||
H5PT_SETNPOINTS )
|
||||
#define h5pt_setnpoints_strided F77NAME ( \
|
||||
h5pt_setnpoints_strided_, \
|
||||
H5PT_SETNPOINTS_STRIDED )
|
||||
#define h5pt_setstep F77NAME ( \
|
||||
h5pt_setstep_, \
|
||||
H5PT_SETSTEP )
|
||||
#define h5pt_writedata_r8 F77NAME ( \
|
||||
h5pt_writedata_r8_, \
|
||||
H5PT_WRITEDATA_R8 )
|
||||
#define h5pt_writedata_r4 F77NAME ( \
|
||||
h5pt_writedata_r4_, \
|
||||
H5PT_WRITEDATA_R4 )
|
||||
#define h5pt_writedata_i8 F77NAME ( \
|
||||
h5pt_writedata_i8_, \
|
||||
H5PT_WRITEDATA_I8 )
|
||||
#define h5pt_writedata_i4 F77NAME ( \
|
||||
h5pt_writedata_i4_, \
|
||||
H5PT_WRITEDATA_I4 )
|
||||
|
||||
/* Reading interface (define dataset, step, particles, attributes) */
|
||||
#define h5pt_getnsteps F77NAME ( \
|
||||
@@ -63,14 +93,17 @@
|
||||
#define h5pt_getdatasetname F77NAME ( \
|
||||
h5pt_getdatasetname_, \
|
||||
H5PT_GETDATASETNAME )
|
||||
#define h5pt_getnumpoints F77NAME ( \
|
||||
h5pt_getnumpoints_, \
|
||||
H5PT_GETNUMPOINTS )
|
||||
|
||||
/* Views and parallelism */
|
||||
#define h5pt_setview F77NAME ( \
|
||||
h5pt_setview_, \
|
||||
H5PT_SETVIEW )
|
||||
#define h5pt_setview_indices F77NAME ( \
|
||||
h5pt_setview_indices_, \
|
||||
H5PT_SETVIEW_INDICES )
|
||||
#define h5pt_setview_empty F77NAME ( \
|
||||
h5pt_setview_empty_, \
|
||||
H5PT_SETVIEW_EMPTY )
|
||||
#define h5pt_resetview F77NAME ( \
|
||||
h5pt_resetview_, \
|
||||
H5PT_RESETVIEW )
|
||||
@@ -85,29 +118,20 @@
|
||||
#define h5pt_readdata_r8 F77NAME ( \
|
||||
h5pt_readdata_r8_, \
|
||||
H5PT_READDATA_R8 )
|
||||
#define h5pt_readdata_r4 F77NAME ( \
|
||||
h5pt_readdata_r4_, \
|
||||
H5PT_READDATA_R4 )
|
||||
#define h5pt_readdata_i8 F77NAME ( \
|
||||
h5pt_readdata_i8_, \
|
||||
H5PT_READDATA_I8 )
|
||||
#define h5pt_readdata F77NAME ( \
|
||||
h5pt_readdata_, \
|
||||
H5PT_READDATA )
|
||||
#define h5pt_readdata_i4 F77NAME ( \
|
||||
h5pt_readdata_i4_, \
|
||||
H5PT_READDATA_I4 )
|
||||
|
||||
/* Writing attributes */
|
||||
#define h5pt_writefileattrib_r8 F77NAME ( \
|
||||
h5pt_writefileattrib_r8_, \
|
||||
H5PT_WRITEFILEATTRIB_R8 )
|
||||
#define h5pt_writefileattrib_i8 F77NAME ( \
|
||||
h5pt_writefileattrib_i8_, \
|
||||
H5PT_WRITEFILEATTRIB_I8 )
|
||||
#define h5pt_writefileattrib_string F77NAME ( \
|
||||
h5pt_writefileattrib_string_, \
|
||||
H5PT_writefileattrib_string )
|
||||
#define h5pt_writestepattrib_r8 F77NAME ( \
|
||||
h5pt_writestepattrib_r8_, \
|
||||
H5PT_WRITESTEPATTRIB_R8 )
|
||||
#define h5pt_writestepattrib_i8 F77NAME ( \
|
||||
h5pt_writestepattrib_i8_, \
|
||||
H5PT_WRITESTEPATTRIB_I8 )
|
||||
#define h5pt_writestepattrib_string F77NAME ( \
|
||||
h5pt_writestepattrib_string_, \
|
||||
H5PT_WRITESTEPATTRIB_STRING )
|
||||
@@ -125,27 +149,9 @@
|
||||
#define h5pt_getfileattribinfo F77NAME ( \
|
||||
h5pt_getfileattribinfo_, \
|
||||
H5PT_GETFILEATTRIBINFO )
|
||||
#define h5pt_readstepattrib F77NAME ( \
|
||||
h5pt_readstepattrib_, \
|
||||
H5PT_READSTEPATTRIB )
|
||||
#define h5pt_readstepattrib_r8 F77NAME ( \
|
||||
h5pt_readstepattrib_r8_, \
|
||||
H5PT_READSTEPATTRIB_R8 )
|
||||
#define h5pt_readstepattrib_i8 F77NAME ( \
|
||||
h5pt_readstepattrib_i8_, \
|
||||
H5PT_READSTEPATTRIB_I8 )
|
||||
#define h5pt_readstepattrib_string F77NAME ( \
|
||||
h5pt_readstepattrib_string_, \
|
||||
H5PT_READSTEPATTRIB_STRING )
|
||||
#define h5pt_readfileattrib F77NAME ( \
|
||||
h5pt_readfileattrib_, \
|
||||
H5PT_READFILEATTRIB )
|
||||
#define h5pt_readfileattrib_r8 F77NAME ( \
|
||||
h5pt_readfileattrib_r8_, \
|
||||
H5PT_READFILEATTRIB_R8 )
|
||||
#define h5pt_readfileattrib_i8 F77NAME ( \
|
||||
h5pt_readfileattrib_i8_, \
|
||||
H5PT_READFILEATTRIB_I8 )
|
||||
#define h5pt_readfileattrib_string F77NAME ( \
|
||||
h5pt_readfileattrib_string_, \
|
||||
H5PT_READFILEATTRIB_STRING )
|
||||
@@ -157,7 +163,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
char *
|
||||
static char *
|
||||
_H5Part_strdupfor2c (
|
||||
const char *s,
|
||||
const ssize_t len
|
||||
@@ -172,7 +178,7 @@ _H5Part_strdupfor2c (
|
||||
return dup;
|
||||
}
|
||||
|
||||
char *
|
||||
static char *
|
||||
_H5Part_strc2for (
|
||||
char * const str,
|
||||
const ssize_t l_str
|
||||
@@ -184,8 +190,27 @@ _H5Part_strc2for (
|
||||
return str;
|
||||
}
|
||||
|
||||
static char
|
||||
_H5Part_flagsfor2c (
|
||||
char * flags
|
||||
) {
|
||||
|
||||
char fbits = 0x00;
|
||||
|
||||
flags = strtok ( flags, "," );
|
||||
while ( flags != NULL ) {
|
||||
if ( strcmp ( flags, "vfd_mpiposix" ) == 0 )
|
||||
fbits |= H5_VFD_MPIPOSIX;
|
||||
else if ( strcmp ( flags, "vfd_independent" ) == 0 )
|
||||
fbits |= H5_VFD_INDEPENDENT;
|
||||
flags = strtok ( NULL, "," );
|
||||
}
|
||||
|
||||
return fbits;
|
||||
}
|
||||
|
||||
/* open/close interface */
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5pt_openr (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
@@ -193,13 +218,13 @@ h5pt_openr (
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFile ( file_name2, H5PART_READ );
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5PART_READ );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5pt_openw (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
@@ -207,7 +232,7 @@ h5pt_openw (
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFile ( file_name2, H5PART_WRITE );
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5PART_WRITE );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
@@ -221,7 +246,52 @@ h5pt_opena (
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFile ( file_name2, H5PART_APPEND );
|
||||
h5_file_t* f = H5OpenFile ( file_name2, H5PART_APPEND );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_openr_align (
|
||||
const char *file_name,
|
||||
const h5part_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFileAlign ( file_name2, H5PART_READ, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_openw_align (
|
||||
const char *file_name,
|
||||
const h5part_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFileAlign ( file_name2, H5PART_WRITE, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_opena_align (
|
||||
const char *file_name,
|
||||
const h5part_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file_t* f = H5OpenFileAlign ( file_name2, H5PART_APPEND, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
@@ -231,14 +301,16 @@ h5pt_opena (
|
||||
h5part_int64_t
|
||||
h5pt_openr_par (
|
||||
const char *file_name,
|
||||
MPI_Comm *comm,
|
||||
MPI_Fint *fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFileParallel (
|
||||
file_name2, H5PART_READ, *comm );
|
||||
h5_file_t* f = H5OpenFileParallel (
|
||||
file_name2, H5PART_READ, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
@@ -247,14 +319,15 @@ h5pt_openr_par (
|
||||
h5part_int64_t
|
||||
h5pt_openw_par (
|
||||
const char *file_name,
|
||||
MPI_Comm *comm,
|
||||
MPI_Fint *fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFileParallel (
|
||||
file_name2, H5PART_WRITE, *comm );
|
||||
h5_file_t* f = H5OpenFileParallel (
|
||||
file_name2, H5PART_WRITE, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
@@ -263,17 +336,90 @@ h5pt_openw_par (
|
||||
h5part_int64_t
|
||||
h5pt_opena_par (
|
||||
const char *file_name,
|
||||
MPI_Comm *comm,
|
||||
MPI_Fint *fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
|
||||
h5_file* f = H5PartOpenFileParallel (
|
||||
file_name2, H5PART_APPEND, *comm );
|
||||
h5_file_t* f = H5OpenFileParallel (
|
||||
file_name2, H5PART_APPEND, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
free ( file_name2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_openr_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5part_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
char fbits = H5PART_READ | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFileParallelAlign (
|
||||
file_name2, fbits, ccomm, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_openw_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5part_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
char fbits = H5PART_WRITE | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFileParallelAlign (
|
||||
file_name2, fbits, ccomm, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_opena_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5part_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||
|
||||
char fbits = H5PART_APPEND | _H5Part_flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = H5OpenFileParallelAlign (
|
||||
file_name2, fbits, ccomm, *align );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
return (h5part_int64_t)(size_t)f;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -281,7 +427,7 @@ h5part_int64_t
|
||||
h5pt_close (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartCloseFile ( filehandle );
|
||||
}
|
||||
@@ -301,7 +447,7 @@ h5pt_readstep (
|
||||
h5part_int64_t *id
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartReadParticleStep (
|
||||
filehandle,(*step)-1,x,y,z,px,py,pz,id);
|
||||
@@ -314,17 +460,29 @@ h5pt_setnpoints (
|
||||
h5part_int64_t *np
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetNumParticles ( filehandle, *np );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_setnpoints_strided (
|
||||
const h5part_int64_t *f,
|
||||
h5part_int64_t *np,
|
||||
h5part_int64_t *stride
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetNumParticlesStrided ( filehandle, *np, *stride );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_setstep (
|
||||
const h5part_int64_t *f,
|
||||
h5part_int64_t *step ) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetStep ( filehandle, (*step)-1 );
|
||||
}
|
||||
@@ -336,7 +494,7 @@ h5pt_writedata_r8 (
|
||||
const h5part_float64_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
@@ -348,6 +506,25 @@ h5pt_writedata_r8 (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writedata_r4 (
|
||||
const h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_float32_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteDataFloat32 (
|
||||
filehandle, name2, data );
|
||||
|
||||
free ( name2 );
|
||||
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writedata_i8 (
|
||||
const h5part_int64_t *f,
|
||||
@@ -355,7 +532,7 @@ h5pt_writedata_i8 (
|
||||
const h5part_int64_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
@@ -367,6 +544,25 @@ h5pt_writedata_i8 (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writedata_i4 (
|
||||
const h5part_int64_t *f,
|
||||
const char *name,
|
||||
const h5part_int32_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteDataInt32 (
|
||||
filehandle, name2, data );
|
||||
|
||||
free ( name2 );
|
||||
|
||||
return herr;
|
||||
}
|
||||
|
||||
/*==============Reading Data Characteristics============*/
|
||||
|
||||
h5part_int64_t
|
||||
@@ -374,7 +570,7 @@ h5pt_getnsteps (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumSteps ( filehandle );
|
||||
}
|
||||
@@ -384,7 +580,7 @@ h5pt_getndatasets (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumDatasets ( filehandle );
|
||||
}
|
||||
@@ -394,7 +590,7 @@ h5pt_getnpoints (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumParticles ( filehandle );
|
||||
}
|
||||
@@ -407,7 +603,7 @@ h5pt_getdatasetname (
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
h5part_int64_t herr = H5PartGetDatasetName (
|
||||
filehandle, *index, name, l_name );
|
||||
@@ -416,16 +612,6 @@ h5pt_getdatasetname (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_getnumpoints (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumParticles( filehandle );
|
||||
}
|
||||
|
||||
/*=============Setting and getting views================*/
|
||||
|
||||
h5part_int64_t
|
||||
@@ -435,17 +621,39 @@ h5pt_setview (
|
||||
const h5part_int64_t *end
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetView ( filehandle, *start, *end );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_setview_indices (
|
||||
const h5part_int64_t *f,
|
||||
const h5part_int64_t *indices,
|
||||
const h5part_int64_t *nelem
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetViewIndices ( filehandle, indices, *nelem );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_setview_empty (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartSetViewEmpty ( filehandle );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_resetview (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartResetView ( filehandle );
|
||||
}
|
||||
@@ -455,7 +663,7 @@ h5pt_hasview (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartHasView ( filehandle );
|
||||
}
|
||||
@@ -467,7 +675,7 @@ h5pt_getview (
|
||||
h5part_int64_t *end
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetView ( filehandle, start, end);
|
||||
}
|
||||
@@ -480,7 +688,7 @@ h5pt_readdata_r8 (
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
@@ -491,6 +699,25 @@ h5pt_readdata_r8 (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readdata_r4 (
|
||||
const h5part_int64_t *f,
|
||||
const char *name,
|
||||
h5part_float32_t *array,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadDataFloat32 (
|
||||
filehandle, name2, array );
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readdata_i8 (
|
||||
const h5part_int64_t *f,
|
||||
@@ -499,7 +726,7 @@ h5pt_readdata_i8 (
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
@@ -510,51 +737,27 @@ h5pt_readdata_i8 (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readdata_i4 (
|
||||
const h5part_int64_t *f,
|
||||
const char *name,
|
||||
h5part_int32_t *array,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *name2 = _H5Part_strdupfor2c ( name, l_name );
|
||||
|
||||
h5part_int64_t herr = H5PartReadDataInt32 (
|
||||
filehandle, name2, array );
|
||||
|
||||
free ( name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
/*=================== Attributes ================*/
|
||||
|
||||
/* Writeing attributes */
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_r8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const h5part_float64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle,
|
||||
attrib_name2, H5T_NATIVE_DOUBLE, attrib_value, *attrib_nelem );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_i8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const h5part_int64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5part_int64_t herr = H5PartWriteFileAttrib (
|
||||
filehandle,
|
||||
attrib_name2, H5T_NATIVE_INT64, attrib_value, *attrib_nelem );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writefileattrib_string (
|
||||
const h5part_int64_t *f,
|
||||
@@ -564,7 +767,7 @@ h5pt_writefileattrib_string (
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
char *attrib_value2= _H5Part_strdupfor2c (attrib_value,l_attrib_value);
|
||||
@@ -577,48 +780,6 @@ h5pt_writefileattrib_string (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_r8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const h5part_float64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle,
|
||||
attrib_name2, H5T_NATIVE_DOUBLE, attrib_value, *attrib_nelem );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_i8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
const h5part_int64_t *attrib_value,
|
||||
const h5part_int64_t *attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
|
||||
h5part_int64_t herr = H5PartWriteStepAttrib (
|
||||
filehandle,
|
||||
attrib_name2, H5T_NATIVE_INT64, attrib_value, *attrib_nelem );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_writestepattrib_string (
|
||||
const h5part_int64_t *f,
|
||||
@@ -628,7 +789,7 @@ h5pt_writestepattrib_string (
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char *attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
char *attrib_value2= _H5Part_strdupfor2c (attrib_value,l_attrib_value);
|
||||
@@ -648,7 +809,7 @@ h5pt_getnstepattribs (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumStepAttribs ( filehandle );
|
||||
}
|
||||
@@ -658,7 +819,7 @@ h5pt_getnfileattribs (
|
||||
const h5part_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
return H5PartGetNumFileAttribs ( filehandle );
|
||||
}
|
||||
@@ -672,7 +833,7 @@ h5pt_getstepattribinfo (
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
h5part_int64_t type;
|
||||
|
||||
h5part_int64_t herr = H5PartGetStepAttribInfo (
|
||||
@@ -690,7 +851,7 @@ h5pt_getfileattribinfo (
|
||||
h5part_int64_t *nelem,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
h5part_int64_t type;
|
||||
|
||||
h5part_int64_t herr = H5PartGetFileAttribInfo (
|
||||
@@ -700,49 +861,6 @@ h5pt_getfileattribinfo (
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
void *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
|
||||
char * attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, attrib_name2, attrib_value );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_r8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
h5part_float64_t *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
return h5pt_readstepattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_i8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
h5part_int64_t *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
return h5pt_readstepattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readstepattrib_string (
|
||||
const h5part_int64_t *f,
|
||||
@@ -751,56 +869,20 @@ h5pt_readstepattrib_string (
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5part_int64_t herr = h5pt_readstepattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
|
||||
_H5Part_strc2for ( attrib_value, l_attrib_value );
|
||||
return herr;
|
||||
}
|
||||
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
void *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file *filehandle = (h5_file*)(size_t)*f;
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char * attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
h5part_int64_t herr = H5PartReadStepAttrib (
|
||||
filehandle, attrib_name2, attrib_value );
|
||||
|
||||
_H5Part_strc2for ( attrib_value, l_attrib_value );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_r8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
h5part_float64_t *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
return h5pt_readfileattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_i8 (
|
||||
const h5part_int64_t *f,
|
||||
const char *attrib_name,
|
||||
h5part_int64_t *attrib_value,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
return h5pt_readfileattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5pt_readfileattrib_string (
|
||||
const h5part_int64_t *f,
|
||||
@@ -809,11 +891,17 @@ h5pt_readfileattrib_string (
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
|
||||
h5part_int64_t herr = h5pt_readfileattrib (
|
||||
f, attrib_name, attrib_value, l_attrib_name );
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
|
||||
char * attrib_name2 = _H5Part_strdupfor2c (attrib_name,l_attrib_name);
|
||||
|
||||
h5part_int64_t herr = H5PartReadFileAttrib (
|
||||
filehandle, attrib_name2, attrib_value );
|
||||
|
||||
_H5Part_strc2for ( attrib_value, l_attrib_value );
|
||||
|
||||
free ( attrib_name2 );
|
||||
return herr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
! Declaration of subroutines for Fortran Bindings
|
||||
! open/close interface
|
||||
|
||||
INTERFACE
|
||||
INTEGER*8 FUNCTION h5pt_openr ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for reading
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_openw ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for writing
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_opena ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for appending
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_openr_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for reading
|
||||
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_openw_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for writing
|
||||
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_opena_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for appending
|
||||
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_close ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle ! close this open filehandle
|
||||
END FUNCTION
|
||||
|
||||
!==============Writing and Setting Dataset info========
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_setnpoints ( filehandle, npoints )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: npoints ! The number of particles on *this* processor
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_setstep (filehandle,step)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: step ! Set the current timestep in the file to this
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writedata_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! The name of the data we are writing
|
||||
REAL*8, INTENT(IN) :: data(*) ! The dataarray to write. The number of
|
||||
! elements is presumably set earlier with
|
||||
! h5pt_setnpoints(f,npoints)
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writedata_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! The name of the data we are writing
|
||||
INTEGER*8, INTENT(IN) :: data(*)
|
||||
END FUNCTION
|
||||
|
||||
!==============Reading Data Characteristics============
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getnsteps (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getndatasets (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
! returns total number of points in this timestep
|
||||
! If a "view" has been set using h5pt_setview()
|
||||
! then it returns the number of points that are
|
||||
! in the current view.
|
||||
INTEGER*8 FUNCTION h5pt_getnpoints (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getdatasetname (filehandle,index,name)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: index ! Index for a given dataset name
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name ! returns the name of the dataset at that index
|
||||
END FUNCTION
|
||||
|
||||
!=============Setting and getting views================
|
||||
INTEGER*8 FUNCTION h5pt_setview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: start ! offset of the first particle in the view
|
||||
INTEGER*8, INTENT(IN) :: end ! offset of the first particle after the end of the view
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_resetview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle ! reset the view on this filehandle to default
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_hasview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(OUT) :: start ! offset of first particle in the view
|
||||
INTEGER*8, INTENT(OUT) :: end ! offset of first particle beyond the current view
|
||||
END FUNCTION
|
||||
|
||||
!==============Reading Data=========================
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readdata_r8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! The name of the data we are writing
|
||||
REAL*8, INTENT(OUT) :: data(*) ! The dataarray to read. Number of points
|
||||
! read is either the number within the view set
|
||||
! by h5pt_setview() or the default (the total
|
||||
! number of particles in the file.
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readdata_i8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! The name of the data we are writing
|
||||
INTEGER*8, INTENT(OUT) :: data(*) ! The dataarray to read. Number of points
|
||||
! read is either the number within the view set
|
||||
! by h5pt_setview() or the default (the total
|
||||
! number of particles in the file.
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!=================== Attributes ================
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_r8 (filehandle,attrib_name,attrib_value,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
REAL*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_i8 (filehandle,attrib_name,attrib_value,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writefileattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_r8 (filehandle,attrib_name,attrib_value,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
REAL*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_i8 (filehandle,attrib_name,attrib_value,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_value(*) ! The array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_writestepattrib_string (filehandle,attrib_name,attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name ! The name of the attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value ! The array of data to write into the attribute
|
||||
END FUNCTION
|
||||
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getnstepattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getnfileattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getstepattribinfo (filehandle,idx,attrib_name,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: idx ! index of the attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(OUT) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_getfileattribinfo (filehandle,idx,attrib_name,attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: idx ! index of the attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: attrib_name ! The name of the attribute
|
||||
INTEGER*8, INTENT(OUT) :: attrib_nelem ! Number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_i8 ( filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
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
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readstepattrib_r8 ( filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
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
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_i8 (filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
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
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_readfileattrib_r8 (filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
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
|
||||
|
||||
|
||||
INTEGER*8 FUNCTION h5pt_set_verbosity_level ( level )
|
||||
INTEGER*8, INTENT(IN) :: level
|
||||
END FUNCTION
|
||||
|
||||
END INTERFACE
|
||||
@@ -0,0 +1,60 @@
|
||||
# src/Fortran level Makefile.am
|
||||
|
||||
OBJEXT=o
|
||||
|
||||
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
|
||||
LIBS = $(HDFLIB) @MPILIB@
|
||||
|
||||
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
|
||||
|
||||
INCLUDES = -I@HDF5ROOT@/include @MPIINC@
|
||||
|
||||
EXTRA_HEADERS = H5PartPrivate.h \
|
||||
H5BlockPrivate.h \
|
||||
H5MultiBlockPrivate.h \
|
||||
H5PartAttrib.h
|
||||
|
||||
# Extra files that I wish to include in the dist tar ball.
|
||||
EXTRA_DIST = TestUnderscoreC.c \
|
||||
TestUnderscore.f \
|
||||
H5Part.f90 \
|
||||
H5PartAttrib.f90 \
|
||||
H5Block.f90 \
|
||||
H5BlockReadWrite.f90 \
|
||||
$(EXTRA_HEADERS)
|
||||
|
||||
# Files that I don't want to include in the dist tar ball
|
||||
nodist_include_HEADERS = ../include/H5PartF.h @UNDERSCORE_H@
|
||||
|
||||
# What to build... Will be determined by configure script.
|
||||
lib_LIBRARIES = @FORTRAN_LIB@
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LIBRARIES = libH5hutF.a
|
||||
|
||||
# Header files that I wish to install in $(prefix)/include
|
||||
include_HEADERS = \
|
||||
../include/H5hut.h \
|
||||
../include/H5.h \
|
||||
../include/H5_inquiry.h \
|
||||
../include/H5_attribs.h \
|
||||
../include/H5Block.h \
|
||||
../include/H5Fed.h \
|
||||
../include/H5Fed_store.h \
|
||||
../include/H5Fed_tags.h \
|
||||
../include/H5Part.h
|
||||
|
||||
libH5hutF_a_SOURCES = $(libH5Part_a_SOURCES) \
|
||||
H5PartF.c \
|
||||
H5PartAttribF.c \
|
||||
H5BlockF.c \
|
||||
H5BlockReadWriteF.c
|
||||
|
||||
all: ../include/H5PartF.h ./lib/libH5hutF.a
|
||||
|
||||
../include/H5PartF.h: H5Part.f90 H5PartAttrib.f90 H5Block.f90 H5BlockReadWrite.f90
|
||||
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >$@
|
||||
|
||||
../lib/libH5hutF.a: libH5hutF.a
|
||||
-cp $^ $@
|
||||
|
||||
+18
-19
@@ -1,10 +1,11 @@
|
||||
# src level Makefile.am
|
||||
|
||||
# COMPILERS
|
||||
CC = @CC@
|
||||
OBJEXT=o
|
||||
|
||||
AM_CPPFLAGS = -I@HDF5ROOT@/include @MPIINC@ -I. -I../include -I../include/h5core
|
||||
AM_CFLAGS = @CFLAGS@
|
||||
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
|
||||
LIBS = $(HDFLIB) @MPILIB@
|
||||
|
||||
INCLUDES = -I../include -I@HDF5ROOT@/include @MPIINC@
|
||||
|
||||
EXTRA_HEADERS = \
|
||||
../include/h5core/h5_attribs.h \
|
||||
@@ -15,6 +16,10 @@ EXTRA_HEADERS = \
|
||||
../include/h5core/h5_openclose.h \
|
||||
../include/h5core/h5_readwrite.h \
|
||||
../include/h5core/h5_types.h \
|
||||
../include/h5core/h5u_readwrite.h \
|
||||
../include/h5core/h5u_model.h \
|
||||
../include/h5core/h5b_model.h \
|
||||
../include/h5core/h5b_attribs.h \
|
||||
../include/h5core/h5t_adjacencies.h \
|
||||
../include/h5core/h5t_inquiry.h \
|
||||
../include/h5core/h5t_map.h \
|
||||
@@ -24,7 +29,6 @@ EXTRA_HEADERS = \
|
||||
../include/h5core/h5t_retrieve.h \
|
||||
../include/h5core/h5t_storemesh.h \
|
||||
../include/h5core/h5t_tags.h \
|
||||
../include/h5core/h5u_readwrite.h \
|
||||
h5_errorhandling_private.h \
|
||||
h5_fcmp_private.h \
|
||||
h5_hdf5_private.h \
|
||||
@@ -33,7 +37,9 @@ EXTRA_HEADERS = \
|
||||
h5_qsort_private.h \
|
||||
h5_readwrite_private.h \
|
||||
h5_syscall_private.h \
|
||||
h5u_errorhandling_private.h \
|
||||
h5b_errorhandling_private.h \
|
||||
h5b_model_private.h \
|
||||
h5t_adjacencies_tetm_private.h \
|
||||
h5t_adjacencies_trim_private.h \
|
||||
h5t_consts_private.h \
|
||||
@@ -47,8 +53,7 @@ EXTRA_HEADERS = \
|
||||
h5t_store_private.h \
|
||||
h5t_store_tetm_private.h \
|
||||
h5t_store_trim_private.h \
|
||||
h5t_tags_private.h \
|
||||
h5u_errorhandling_private.h
|
||||
h5t_tags_private.h
|
||||
|
||||
# Extra files that I wish to include in the dist tar ball.
|
||||
EXTRA_DIST = $(EXTRA_HEADERS)
|
||||
@@ -56,7 +61,7 @@ EXTRA_DIST = $(EXTRA_HEADERS)
|
||||
# Files that I don't want to include in the dist tar ball
|
||||
nodist_include_HEADERS =
|
||||
|
||||
OBJEXT = o
|
||||
#OBJEXT = o
|
||||
# What to build... Will be determined by configure script.
|
||||
lib_LIBRARIES = libH5Core.a
|
||||
|
||||
@@ -80,6 +85,10 @@ libH5Core_a_SOURCES = \
|
||||
h5_qsort_r.c \
|
||||
h5_readwrite.c \
|
||||
h5_syscall.c \
|
||||
h5u_readwrite.c \
|
||||
h5u_model.c \
|
||||
h5b_model.c \
|
||||
h5b_attribs.c \
|
||||
h5t_adjacencies.c \
|
||||
h5t_adjacencies_tetm.c \
|
||||
h5t_adjacencies_trim.c \
|
||||
@@ -97,9 +106,7 @@ libH5Core_a_SOURCES = \
|
||||
h5t_store.c \
|
||||
h5t_store_tetm.c \
|
||||
h5t_store_trim.c \
|
||||
h5t_tags.c \
|
||||
h5u_model.c \
|
||||
h5u_readwrite.c
|
||||
h5t_tags.c
|
||||
|
||||
libH5Core_a_DEPENDENCIES = $(EXTRA_HEADERS)
|
||||
|
||||
@@ -110,11 +117,3 @@ all: ../lib/libH5Core.a
|
||||
|
||||
$(libH5Core_a_OBJECTS): $(libH5Core_a_DEPENDENCIES)
|
||||
|
||||
clean:
|
||||
$(RM) -f *~ *.o *.a *.so
|
||||
|
||||
distclean: clean
|
||||
$(RM) -f *.a
|
||||
$(RM) -rf .deps
|
||||
$(RM) -rf .libs
|
||||
$(RM) -f Makefile
|
||||
|
||||
+50
-25
@@ -1,14 +1,15 @@
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
static h5_err_t
|
||||
_get_hdf5_obj_id(
|
||||
h5_file_t *const f,
|
||||
const char type,
|
||||
const char mode,
|
||||
hid_t *id
|
||||
) {
|
||||
if (type == H5_ATTRIB_FILE) *id = f->root_gid;
|
||||
else if (type == H5_ATTRIB_STEP) *id = f->step_gid;
|
||||
if (mode == H5_ATTRIB_FILE) *id = f->root_gid;
|
||||
else if (mode == H5_ATTRIB_STEP) *id = f->step_gid;
|
||||
else if (mode == H5_ATTRIB_FIELD) *id = f->b->field_gid;
|
||||
else h5_error(f, H5_ERR_INVAL, "Attibute flag not recognized");
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
@@ -25,24 +26,34 @@ _get_hdf5_obj_id(
|
||||
h5_err_t
|
||||
h5_read_attrib (
|
||||
h5_file_t* const f, /*!< handle to open file */
|
||||
const char type, /*!< FILE or STEP flag */
|
||||
const char mode, /*!< FILE or STEP flag */
|
||||
const char* attrib_name, /*!< name of HDF5 attribute to read */
|
||||
const hid_t attrib_type, /*!< HDF5 type of attribute */
|
||||
void* const attrib_value /*!< OUT: attribute value */
|
||||
) {
|
||||
hid_t attrib_id;
|
||||
hid_t space_id;
|
||||
hid_t type_id;
|
||||
hid_t mytype;
|
||||
hsize_t nelem;
|
||||
|
||||
hid_t id;
|
||||
TRY( _get_hdf5_obj_id(f, type, &id) );
|
||||
TRY( _get_hdf5_obj_id(f, mode, &id) );
|
||||
|
||||
TRY( attrib_id = h5priv_open_hdf5_attribute (f, id, attrib_name) );
|
||||
TRY( mytype = h5priv_get_hdf5_attribute_type (f, attrib_id) );
|
||||
TRY( type_id = h5priv_get_hdf5_attribute_type (f, attrib_id) );
|
||||
|
||||
hid_t h5type_id;
|
||||
TRY( h5type_id = h5_normalize_h5_type(f, type_id) );
|
||||
if ( h5type_id != attrib_type )
|
||||
return h5_error (
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Attribute '%s' has type '%s' but was requested as '%s'.",
|
||||
attrib_name,
|
||||
h5priv_get_base_type_name(f, h5type_id),
|
||||
h5priv_get_base_type_name(f, attrib_type) );
|
||||
|
||||
TRY( space_id = h5priv_get_hdf5_attribute_dataspace (f, attrib_id) );
|
||||
TRY( nelem = h5priv_get_npoints_of_hdf5_dataspace (f, space_id) );
|
||||
TRY( type_id = h5_normalize_h5_type (f, mytype) );
|
||||
TRY( h5priv_read_hdf5_attribute (f, attrib_id, type_id, attrib_value) );
|
||||
TRY( h5priv_close_hdf5_dataspace(f, space_id) );
|
||||
TRY( h5priv_close_hdf5_type(f, mytype) );
|
||||
@@ -61,7 +72,7 @@ h5_read_attrib (
|
||||
h5_err_t
|
||||
h5_write_attrib (
|
||||
h5_file_t* const f, /*!< handle to open file */
|
||||
const char type, /*!< FILE or STEP flag */
|
||||
const char mode, /*!< FILE or STEP flag */
|
||||
const char* attrib_name, /*!< name of HDF5 attribute to write */
|
||||
const hid_t attrib_type, /*!< HDF5 type of attribute */
|
||||
const void* attrib_value, /*!< value of attribute */
|
||||
@@ -69,23 +80,37 @@ h5_write_attrib (
|
||||
) {
|
||||
hid_t space_id;
|
||||
hid_t attrib_id;
|
||||
hid_t type_id;
|
||||
|
||||
hid_t id;
|
||||
TRY( _get_hdf5_obj_id(f, type, &id) );
|
||||
TRY( _get_hdf5_obj_id(f, mode, &id) );
|
||||
|
||||
if ( attrib_type == H5T_NATIVE_CHAR ) {
|
||||
TRY( type_id = h5priv_create_hdf5_string_type(f,
|
||||
attrib_nelem) );
|
||||
TRY( space_id = h5priv_create_hdf5_dataspace_scalar(f) );
|
||||
} else {
|
||||
type_id = attrib_type;
|
||||
TRY( space_id = h5priv_create_hdf5_dataspace (f,
|
||||
1, &attrib_nelem, NULL) );
|
||||
}
|
||||
|
||||
TRY( space_id = h5priv_create_hdf5_dataspace (f, 1, &attrib_nelem, NULL) );
|
||||
TRY( attrib_id = h5priv_create_hdf5_attribute (
|
||||
f,
|
||||
id,
|
||||
attrib_name,
|
||||
attrib_type,
|
||||
type_id,
|
||||
space_id,
|
||||
H5P_DEFAULT, H5P_DEFAULT) );
|
||||
|
||||
TRY( h5priv_write_hdf5_attribute (f, attrib_id, attrib_type, attrib_value) );
|
||||
TRY( h5priv_write_hdf5_attribute (f,
|
||||
attrib_id, type_id, attrib_value) );
|
||||
TRY( h5priv_close_hdf5_attribute (f, attrib_id) );
|
||||
TRY( h5priv_close_hdf5_dataspace (f, space_id) );
|
||||
|
||||
if ( attrib_type == H5T_NATIVE_CHAR )
|
||||
TRY( h5priv_close_hdf5_type(f, type_id) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -98,20 +123,20 @@ h5_write_attrib (
|
||||
*/
|
||||
h5_err_t
|
||||
h5_get_attrib_info (
|
||||
h5_file_t* const f, /*!< handle to open file */
|
||||
const char type, /*!< FILE or STEP flag */
|
||||
const h5_int64_t attrib_idx, /*!< index of attribute */
|
||||
char* attrib_name, /*!< OUT: name of attribute */
|
||||
const h5_int64_t len_attrib_name, /*!< buffer length */
|
||||
h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */
|
||||
h5_int64_t* attrib_nelem /*!< OUT: number of elements (dimension) */
|
||||
h5_file_t* const f, /*!< handle to open file */
|
||||
const char mode, /*!< FILE or STEP flag */
|
||||
const h5_size_t attrib_idx, /*!< index of attribute */
|
||||
char* attrib_name, /*!< OUT: name of attribute */
|
||||
const h5_size_t len_attrib_name, /*!< buffer length */
|
||||
h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */
|
||||
h5_size_t* attrib_nelem /*!< OUT: number of elements */
|
||||
) {
|
||||
hid_t attrib_id;
|
||||
hid_t mytype;
|
||||
hid_t space_id;
|
||||
|
||||
hid_t id;
|
||||
TRY( _get_hdf5_obj_id(f, type, &id) );
|
||||
TRY( _get_hdf5_obj_id(f, mode, &id) );
|
||||
|
||||
TRY( attrib_id = h5priv_open_hdf5_attribute_idx (
|
||||
f,
|
||||
@@ -151,11 +176,11 @@ h5_get_attrib_info (
|
||||
h5_ssize_t
|
||||
h5_get_num_attribs (
|
||||
h5_file_t *const f, /*!< handle to open file */
|
||||
const char type /*!< FILE or STEP flag */
|
||||
const char mode /*!< FILE or STEP flag */
|
||||
) {
|
||||
CHECK_FILEHANDLE (f);
|
||||
hid_t id;
|
||||
TRY( _get_hdf5_obj_id(f, type, &id) );
|
||||
TRY( _get_hdf5_obj_id(f, mode, &id) );
|
||||
return h5priv_get_num_hdf5_attribute (f, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define H5_STEPNAME "Step"
|
||||
#define H5_STEPWIDTH 1
|
||||
#define H5_BLOCKNAME "Block"
|
||||
#define H5_BLOCKNAME_X "0"
|
||||
#define H5_BLOCKNAME_Y "0"
|
||||
#define H5_BLOCKNAME_Z "0"
|
||||
|
||||
#include "h5_types_private.h"
|
||||
|
||||
@@ -22,6 +25,7 @@
|
||||
#include "h5u_types_private.h"
|
||||
|
||||
#include "h5b_errorhandling_private.h"
|
||||
#include "h5b_model_private.h"
|
||||
|
||||
#include "h5t_core_private.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdarg.h> /* va_arg - System dependent ?! */
|
||||
#include <string.h>
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
static h5_errorhandler_t h5priv_errhandler = h5_report_errorhandler;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
|
||||
/*!
|
||||
Compare two floating point numbers using integers. See
|
||||
|
||||
+99
-26
@@ -116,7 +116,7 @@ h5priv_close_hdf5_group (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
hsize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_num_objs_in_hdf5_group (
|
||||
h5_file_t* const f,
|
||||
const hid_t group_id
|
||||
@@ -129,7 +129,7 @@ h5priv_get_num_objs_in_hdf5_group (
|
||||
"Cannot get number of objects in group %s.",
|
||||
h5_get_objname(group_id));
|
||||
}
|
||||
return group_info.nlinks;
|
||||
return (h5_ssize_t)group_info.nlinks;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ h5priv_get_num_objs_in_hdf5_group (
|
||||
Get name of object given by index \c idx in group \c loc_id. If name is \c NULL,
|
||||
return size of name.
|
||||
*/
|
||||
ssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_hdf5_objname_by_idx (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
@@ -244,7 +244,7 @@ h5priv_create_hdf5_dataset (
|
||||
\param[in] f file handle
|
||||
\param[in] dataset_id id of dataset to close
|
||||
*/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
const hid_t dset_id
|
||||
@@ -296,7 +296,7 @@ h5priv_get_hdf5_dataset_space (
|
||||
\param[in] buf buffer with date to write
|
||||
|
||||
*/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_write_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id,
|
||||
@@ -381,7 +381,7 @@ h5priv_get_hdf5_dataset_type (
|
||||
}
|
||||
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_dataset_extent (
|
||||
h5_file_t* const f,
|
||||
hid_t dset_id,
|
||||
@@ -397,7 +397,7 @@ h5priv_set_hdf5_dataset_extent (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
hid_t dset_id
|
||||
@@ -410,7 +410,7 @@ h5priv_get_npoints_of_hdf5_dataset (
|
||||
return size;
|
||||
}
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataset_by_name (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
@@ -452,7 +452,20 @@ h5priv_create_hdf5_dataspace (
|
||||
return dataspace_id;
|
||||
}
|
||||
|
||||
herr_t
|
||||
hid_t
|
||||
h5priv_create_hdf5_dataspace_scalar (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
hid_t dataspace_id = H5Screate (H5S_SCALAR);
|
||||
if (dataspace_id < 0)
|
||||
h5_error (
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Cannot create scalar dataspace.");
|
||||
return dataspace_id;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_select_hyperslab_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id,
|
||||
@@ -478,7 +491,7 @@ h5priv_select_hyperslab_of_hdf5_dataspace (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_select_elements_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id,
|
||||
@@ -505,7 +518,7 @@ h5priv_select_elements_of_hdf5_dataspace (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_selected_npoints_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id
|
||||
@@ -519,7 +532,7 @@ h5priv_get_selected_npoints_of_hdf5_dataspace (
|
||||
return size;
|
||||
}
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id
|
||||
@@ -556,7 +569,7 @@ h5priv_get_dims_of_hdf5_dataspace (
|
||||
\param[in] f file handle
|
||||
\param[in] dataspace_id id of space to close
|
||||
*/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataspace_id
|
||||
@@ -577,8 +590,8 @@ h5priv_close_hdf5_dataspace (
|
||||
|
||||
/****** D a t a t y p e ******************************************************/
|
||||
|
||||
static const char*
|
||||
get_base_type_name (
|
||||
const char*
|
||||
h5priv_get_base_type_name (
|
||||
h5_file_t* const f,
|
||||
hid_t base_type_id
|
||||
) {
|
||||
@@ -586,6 +599,7 @@ get_base_type_name (
|
||||
if (base_type_id == H5_INT64_T) return "H5_INT64_T";
|
||||
if (base_type_id == H5_FLOAT32_T) return "H5_FLOAT32_T";
|
||||
if (base_type_id == H5_FLOAT64_T) return "H5_FLOAT64_T";
|
||||
if (base_type_id == H5_STRING_T) return "H5_STRING_T";
|
||||
|
||||
return "[unknown]";
|
||||
}
|
||||
@@ -622,7 +636,7 @@ h5priv_create_hdf5_array_type (
|
||||
H5_ERR_HDF5,
|
||||
"Can't create array datatype object with base "
|
||||
"type %s and rank %d",
|
||||
get_base_type_name (f, base_type_id),
|
||||
h5priv_get_base_type_name (f, base_type_id),
|
||||
rank);
|
||||
}
|
||||
return type_id;
|
||||
@@ -646,7 +660,28 @@ h5priv_create_hdf5_type (
|
||||
return type_id;
|
||||
}
|
||||
|
||||
herr_t
|
||||
hid_t
|
||||
h5priv_create_hdf5_string_type(
|
||||
h5_file_t *const f,
|
||||
const hsize_t len
|
||||
) {
|
||||
hid_t type_id = H5Tcopy ( H5T_C_S1 );
|
||||
if (type_id < 0)
|
||||
return h5_error(
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Can't duplicate C string type.");
|
||||
|
||||
herr_t herr = H5Tset_size ( type_id, len );
|
||||
if (herr < 0)
|
||||
return h5_error(
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Can't set length of C string type.");
|
||||
return type_id;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_insert_hdf5_type (
|
||||
h5_file_t* const f,
|
||||
hid_t dtype_id,
|
||||
@@ -664,7 +699,7 @@ h5priv_insert_hdf5_type (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_type (
|
||||
h5_file_t* const f,
|
||||
hid_t dtype_id
|
||||
@@ -694,7 +729,29 @@ h5priv_create_hdf5_property (
|
||||
return prop_id;
|
||||
}
|
||||
|
||||
herr_t
|
||||
/*!
|
||||
Get create properties of existing dataset
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] dataset_id id of dataset
|
||||
|
||||
*/
|
||||
hid_t
|
||||
h5priv_get_hdf5_dataset_create_plist (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id
|
||||
) {
|
||||
hid_t plist_id = H5Dget_create_plist (dataset_id);
|
||||
if (plist_id < 0)
|
||||
return h5_error (
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Cannot get create properties for dataset \"%s\".",
|
||||
h5_get_objname (dataset_id) );
|
||||
return plist_id;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_chunk_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
@@ -710,7 +767,23 @@ h5priv_set_hdf5_chunk_property (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_get_hdf5_chunk_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
int rank,
|
||||
hsize_t* dims
|
||||
) {
|
||||
if (H5Pget_chunk (plist, rank, dims) < 0)
|
||||
return h5_error (
|
||||
f,
|
||||
H5_ERR_HDF5,
|
||||
"Cannot get chunking property from list.");
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_layout_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
@@ -858,7 +931,7 @@ h5priv_close_hdf5_property (
|
||||
|
||||
/****** F i l e **************************************************************/
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_file (
|
||||
h5_file_t* const f,
|
||||
hid_t fileid
|
||||
@@ -874,7 +947,7 @@ h5priv_close_hdf5_file (
|
||||
|
||||
/****** E r r o r h a n d l i n g ********************************************/
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_errorhandler (
|
||||
h5_file_t* const f,
|
||||
hid_t estack_id,
|
||||
@@ -975,7 +1048,7 @@ h5priv_create_hdf5_attribute (
|
||||
return attr_id;
|
||||
}
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_read_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id,
|
||||
@@ -996,7 +1069,7 @@ h5priv_read_hdf5_attribute (
|
||||
/*
|
||||
Wrapper for H5Awrite.
|
||||
*/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_write_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id,
|
||||
@@ -1076,7 +1149,7 @@ h5priv_get_num_hdf5_attribute (
|
||||
}
|
||||
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id
|
||||
@@ -1093,7 +1166,7 @@ h5priv_close_hdf5_attribute (
|
||||
}
|
||||
|
||||
/****** L i n k **************************************************************/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_delete_hdf5_link (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
|
||||
@@ -29,13 +29,13 @@ h5priv_close_hdf5_group (
|
||||
const hid_t group_id
|
||||
);
|
||||
|
||||
hsize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_num_objs_in_hdf5_group (
|
||||
h5_file_t* const f,
|
||||
const hid_t group_id
|
||||
);
|
||||
|
||||
ssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_hdf5_objname_by_idx (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
@@ -62,14 +62,14 @@ h5priv_create_hdf5_dataset (
|
||||
const hid_t create_proplist
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id
|
||||
);
|
||||
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_write_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id,
|
||||
@@ -96,20 +96,20 @@ h5priv_get_hdf5_dataset_type (
|
||||
const hid_t dataset_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_dataset_extent (
|
||||
h5_file_t* const f,
|
||||
hid_t dset_id,
|
||||
const hsize_t* size
|
||||
);
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataset (
|
||||
h5_file_t* const f,
|
||||
hid_t dset_id
|
||||
);
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataset_by_name (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
@@ -125,13 +125,18 @@ h5priv_create_hdf5_dataspace (
|
||||
const hsize_t* maxdims
|
||||
);
|
||||
|
||||
hid_t
|
||||
h5priv_create_hdf5_dataspace_scalar (
|
||||
h5_file_t* const f
|
||||
);
|
||||
|
||||
hid_t
|
||||
h5priv_get_hdf5_dataset_space (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_select_hyperslab_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id,
|
||||
@@ -142,7 +147,7 @@ h5priv_select_hyperslab_of_hdf5_dataspace (
|
||||
const hsize_t* block
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_select_elements_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id,
|
||||
@@ -151,19 +156,19 @@ h5priv_select_elements_of_hdf5_dataspace (
|
||||
const hsize_t* indices
|
||||
);
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_selected_npoints_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id
|
||||
);
|
||||
|
||||
hssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_npoints_of_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
hid_t space_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_dataspace (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataspace_id
|
||||
@@ -193,7 +198,13 @@ h5priv_create_hdf5_type (
|
||||
const size_t size
|
||||
);
|
||||
|
||||
herr_t
|
||||
hid_t
|
||||
h5priv_create_hdf5_string_type(
|
||||
h5_file_t *const f,
|
||||
const hsize_t len
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_insert_hdf5_type (
|
||||
h5_file_t* const f,
|
||||
hid_t dtype_id,
|
||||
@@ -202,7 +213,7 @@ h5priv_insert_hdf5_type (
|
||||
hid_t field_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_type (
|
||||
h5_file_t* const f,
|
||||
hid_t dtype_id
|
||||
@@ -215,15 +226,29 @@ h5priv_create_hdf5_property (
|
||||
hid_t cls_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
hid_t
|
||||
h5priv_get_hdf5_dataset_create_plist (
|
||||
h5_file_t* const f,
|
||||
const hid_t dataset_id
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_chunk_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
int ndims,
|
||||
hsize_t* dim
|
||||
int rank,
|
||||
hsize_t* dims
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_get_hdf5_chunk_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
int rank,
|
||||
hsize_t* dims
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_layout_property (
|
||||
h5_file_t* const f,
|
||||
hid_t plist,
|
||||
@@ -291,14 +316,14 @@ h5priv_close_hdf5_property (
|
||||
);
|
||||
|
||||
/*** file ***/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_file (
|
||||
h5_file_t* const f,
|
||||
hid_t fileid
|
||||
);
|
||||
|
||||
/*** error handling ***/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_set_hdf5_errorhandler (
|
||||
h5_file_t* const f,
|
||||
hid_t estack_id,
|
||||
@@ -340,7 +365,7 @@ h5priv_create_hdf5_attribute (
|
||||
hid_t aapl_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_read_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id,
|
||||
@@ -348,7 +373,7 @@ h5priv_read_hdf5_attribute (
|
||||
void* buf
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_write_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id,
|
||||
@@ -356,7 +381,7 @@ h5priv_write_hdf5_attribute (
|
||||
const void* buf
|
||||
);
|
||||
|
||||
ssize_t
|
||||
h5_ssize_t
|
||||
h5priv_get_hdf5_attribute_name (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id,
|
||||
@@ -382,14 +407,20 @@ h5priv_get_num_hdf5_attribute (
|
||||
hid_t loc_id
|
||||
);
|
||||
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_close_hdf5_attribute (
|
||||
h5_file_t* const f,
|
||||
hid_t attr_id
|
||||
);
|
||||
|
||||
const char*
|
||||
h5priv_get_base_type_name (
|
||||
h5_file_t* const f,
|
||||
hid_t base_type_id
|
||||
);
|
||||
|
||||
/*** link ***/
|
||||
herr_t
|
||||
h5_err_t
|
||||
h5priv_delete_hdf5_link (
|
||||
h5_file_t* const f,
|
||||
hid_t loc_id,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -143,5 +143,33 @@ h5priv_mpi_comm_rank (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_mpi_type_contiguous (
|
||||
h5_file_t* const f,
|
||||
const size_t nelems,
|
||||
const MPI_Datatype oldtype,
|
||||
MPI_Datatype *const newtype
|
||||
) {
|
||||
int err;
|
||||
err = MPI_Type_contiguous ( nelems, oldtype, newtype );
|
||||
if (err != MPI_SUCCESS)
|
||||
return h5_error (f, H5_ERR_MPI, "Cannot create new MPI type");
|
||||
err = MPI_Type_commit ( newtype );
|
||||
if (err != MPI_SUCCESS)
|
||||
return h5_error (f, H5_ERR_MPI, "Cannot commit new MPI type");
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_mpi_type_free (
|
||||
h5_file_t* const f,
|
||||
MPI_Datatype *type
|
||||
) {
|
||||
int err = MPI_Type_free ( type );
|
||||
if (err != MPI_SUCCESS)
|
||||
return h5_error (f, H5_ERR_MPI, "Cannot free MPI type");
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
#endif // PARALLEL_IO
|
||||
|
||||
|
||||
@@ -69,5 +69,20 @@ h5priv_mpi_comm_rank (
|
||||
MPI_Comm comm,
|
||||
int* rank
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_mpi_type_contiguous (
|
||||
h5_file_t* const f,
|
||||
const size_t nelems,
|
||||
const MPI_Datatype oldtype,
|
||||
MPI_Datatype *newtype
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_mpi_type_free (
|
||||
h5_file_t* const f,
|
||||
MPI_Datatype *type
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <lustre/liblustreapi.h>
|
||||
#endif
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
/*!
|
||||
@@ -27,7 +27,7 @@ h5_check_filehandle (
|
||||
h5_file_t* const f /*!< filehandle to check validity of */
|
||||
) {
|
||||
|
||||
if (f == NULL || f->file == 0) {
|
||||
if (f == NULL || f->file == 0 || f->u == NULL || f->b == NULL || f->t == NULL) {
|
||||
return h5_error (
|
||||
f,
|
||||
H5_ERR_BADFD,
|
||||
@@ -70,7 +70,7 @@ h5upriv_open_file (
|
||||
u->memshape = H5S_ALL;
|
||||
u->viewstart = -1;
|
||||
u->viewend = -1;
|
||||
u->viewindexed = 0;
|
||||
u->viewindexed = 0;
|
||||
|
||||
TRY( u->dcreate_prop = h5priv_create_hdf5_property(f, H5P_DATASET_CREATE) );
|
||||
|
||||
@@ -104,14 +104,19 @@ h5bpriv_open_file (
|
||||
size = f->nprocs * sizeof (b->write_layout[0]);
|
||||
TRY( b->write_layout = h5priv_alloc (f, NULL, size) );
|
||||
|
||||
b->step_idx = -1;
|
||||
b->blockgroup = -1;
|
||||
size_t n = sizeof (struct h5b_partition) / sizeof (h5_int64_t);
|
||||
TRY( h5priv_mpi_type_contiguous(f,
|
||||
n, MPI_LONG_LONG, &b->partition_mpi_t) );
|
||||
|
||||
b->shape = -1;
|
||||
b->diskshape = -1;
|
||||
b->memshape = -1;
|
||||
b->field_group_id = -1;
|
||||
b->block_gid = -1;
|
||||
b->field_gid = -1;
|
||||
b->have_layout = 0;
|
||||
|
||||
TRY( b->dcreate_prop = h5priv_create_hdf5_property(f, H5P_DATASET_CREATE) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -315,6 +320,9 @@ h5upriv_close_file (
|
||||
u->memshape = 0;
|
||||
}
|
||||
TRY( h5priv_close_hdf5_property (f, u->dcreate_prop) );
|
||||
free (f->u);
|
||||
f->u = NULL;
|
||||
|
||||
return f->__errno;
|
||||
}
|
||||
|
||||
@@ -329,15 +337,17 @@ h5upriv_close_file (
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
static h5_int64_t
|
||||
h5bpriv_close_block (
|
||||
h5bpriv_close_file (
|
||||
h5_file_t* const f /*!< IN: file handle */
|
||||
) {
|
||||
struct h5b_fdata* b = f->b;
|
||||
|
||||
TRY( h5priv_close_hdf5_group (f, b->blockgroup) );
|
||||
TRY( h5priv_close_hdf5_group (f, b->block_gid) );
|
||||
TRY( h5priv_close_hdf5_dataspace (f, b->shape) );
|
||||
TRY( h5priv_close_hdf5_dataspace (f, b->diskshape) );
|
||||
TRY( h5priv_close_hdf5_dataspace (f, b->memshape) );
|
||||
TRY( h5priv_close_hdf5_property (f, b->dcreate_prop) );
|
||||
TRY( h5priv_mpi_type_free (f, b->partition_mpi_t) );
|
||||
free (f->b);
|
||||
f->b = NULL;
|
||||
|
||||
@@ -363,7 +373,7 @@ h5_close_file (
|
||||
|
||||
TRY( h5priv_close_step (f) );
|
||||
TRY( h5upriv_close_file (f) );
|
||||
TRY( h5bpriv_close_block (f) );
|
||||
TRY( h5bpriv_close_file (f) );
|
||||
TRY( h5tpriv_close_file (f) );
|
||||
TRY( h5priv_close_hdf5_group (f, f->step_gid) );
|
||||
TRY( h5priv_close_hdf5_property (f, f->xfer_prop) );
|
||||
@@ -449,6 +459,20 @@ h5_get_num_procs (
|
||||
return f->nprocs;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_core_filehandling
|
||||
|
||||
Provides access to the underlying HDF5 file handle.
|
||||
|
||||
\return Number of steps or error code
|
||||
*/
|
||||
hid_t
|
||||
h5_get_hdf5_file(
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
return f->file;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_core_filehandling
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <string.h>
|
||||
#include "h5_core.h"
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
/*
|
||||
@@ -234,7 +235,7 @@ h5_set_step (
|
||||
/*!
|
||||
Normalize HDF5 type
|
||||
*/
|
||||
hid_t
|
||||
h5_int64_t
|
||||
h5_normalize_h5_type (
|
||||
h5_file_t* const f,
|
||||
hid_t type
|
||||
@@ -245,14 +246,22 @@ h5_normalize_h5_type (
|
||||
switch (tclass){
|
||||
case H5T_INTEGER:
|
||||
if (size==8) {
|
||||
return H5T_NATIVE_INT64;
|
||||
return H5_INT64_T;
|
||||
}
|
||||
else if (size==1) {
|
||||
return H5T_NATIVE_CHAR;
|
||||
else if (size==4) {
|
||||
return H5_INT32_T;
|
||||
}
|
||||
break;
|
||||
case H5T_FLOAT:
|
||||
return H5T_NATIVE_DOUBLE;
|
||||
if ( size==8 ) {
|
||||
return H5_FLOAT64_T;
|
||||
}
|
||||
else if ( size==4 ) {
|
||||
return H5_FLOAT32_T;
|
||||
}
|
||||
break;
|
||||
case H5T_STRING:
|
||||
return H5_STRING_T;
|
||||
default:
|
||||
; /* NOP */
|
||||
}
|
||||
@@ -273,7 +282,7 @@ h5_get_dataset_type(
|
||||
|
||||
TRY( dset_id = h5priv_open_hdf5_dataset (f, group_id, dset_name) );
|
||||
TRY( hdf5_type = h5priv_get_hdf5_dataset_type (f, dset_id) );
|
||||
h5_int64_t type = (h5_int64_t)h5_normalize_h5_type (f, hdf5_type);
|
||||
h5_int64_t type = h5_normalize_h5_type (f, hdf5_type);
|
||||
TRY( h5priv_close_hdf5_type (f, hdf5_type) );
|
||||
TRY( h5priv_close_hdf5_dataset (f, dset_id) );
|
||||
|
||||
@@ -294,6 +303,7 @@ h5_has_index (
|
||||
|
||||
h5_err_t
|
||||
h5_normalize_dataset_name (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
char *name2
|
||||
) {
|
||||
@@ -305,6 +315,14 @@ h5_normalize_dataset_name (
|
||||
strcpy ( name2, name );
|
||||
}
|
||||
|
||||
if ( strcmp( name2, H5_BLOCKNAME ) == 0 ) {
|
||||
h5_error (f,
|
||||
H5_ERR_INVAL,
|
||||
"Can't create dataset or field with name '%s' because it is "
|
||||
"reserved by H5Block.",
|
||||
H5_BLOCKNAME);
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <search.h>
|
||||
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
void*
|
||||
@@ -10,7 +10,7 @@ h5priv_alloc (
|
||||
void* ptr,
|
||||
const size_t size
|
||||
) {
|
||||
h5_debug (f, "Allocating %ld bytes.", size);
|
||||
h5_debug (f, "Allocating %lu bytes.", size);
|
||||
ptr = realloc (ptr, size);
|
||||
if (ptr == NULL) {
|
||||
h5_error (f, H5_ERR_NOMEM, "Out of memory.");
|
||||
@@ -25,7 +25,7 @@ h5priv_calloc (
|
||||
const size_t count,
|
||||
const size_t size
|
||||
) {
|
||||
h5_debug (f, "Allocating %ld * %ld bytes.", count, size);
|
||||
h5_debug (f, "Allocating %lu * %lu bytes.", count, size);
|
||||
void* ptr = calloc (count, size);
|
||||
if (ptr == NULL) {
|
||||
h5_error (f, H5_ERR_NOMEM, "Out of memory.");
|
||||
@@ -42,7 +42,7 @@ h5priv_free (
|
||||
if (ptr) free (ptr);
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void*
|
||||
h5priv_tsearch (
|
||||
h5_file_t* const f,
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
h5_err_t
|
||||
h5_write_field_attrib (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const hid_t attrib_type, /*!< IN: attribute type */
|
||||
const void *attrib_value, /*!< IN: attribute value */
|
||||
const h5_int64_t attrib_nelem /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
TRY( h5bpriv_open_field_group(f, field_name) );
|
||||
|
||||
TRY( h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FIELD,
|
||||
attrib_name,
|
||||
attrib_type,
|
||||
attrib_value,
|
||||
attrib_nelem) );
|
||||
|
||||
return h5bpriv_close_field_group(f);
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
h5b_get_num_field_attribs (
|
||||
h5_file_t *const f, /*<! IN: file handle */
|
||||
const char *field_name /*<! IN: field name */
|
||||
) {
|
||||
|
||||
h5_ssize_t n;
|
||||
|
||||
TRY( h5bpriv_open_field_group(f, field_name) );
|
||||
TRY( n = h5priv_get_num_hdf5_attribute(f, f->b->field_gid ) );
|
||||
TRY( h5bpriv_close_field_group(f) );
|
||||
|
||||
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 */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_size_t attrib_idx, /*!< IN: attribute index */
|
||||
char *attrib_name, /*!< OUT: attribute name */
|
||||
const h5_size_t len_attrib_name, /*!< IN: buffer size */
|
||||
h5_int64_t *attrib_type, /*!< OUT: attribute type */
|
||||
h5_size_t *attrib_nelem /*!< OUT: number of elements */
|
||||
) {
|
||||
|
||||
TRY( h5bpriv_open_field_group(f, field_name) );
|
||||
|
||||
return h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_FIELD,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,781 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
/*!
|
||||
\note
|
||||
A partition must not be part of another partition.
|
||||
|
||||
A partition must not divide another partition into two pieces.
|
||||
|
||||
After handling the ghost zones, the partition must not be empty
|
||||
|
||||
We must track the overall size somewhere. This is a good place to do it. (?)
|
||||
*/
|
||||
|
||||
static void
|
||||
_normalize_partition (
|
||||
struct h5b_partition *p /*!< IN/OUT: partition */
|
||||
) {
|
||||
h5_int64_t x;
|
||||
|
||||
if ( p->i_start > p->i_end ) {
|
||||
x = p->i_start;
|
||||
p->i_start = p->i_end;
|
||||
p->i_end = x;
|
||||
}
|
||||
if ( p->j_start > p->j_end ) {
|
||||
x = p->j_start;
|
||||
p->j_start = p->j_end;
|
||||
p->j_end = x;
|
||||
}
|
||||
if ( p->k_start > p->k_end ) {
|
||||
x = p->k_start;
|
||||
p->k_start = p->k_end;
|
||||
p->k_end = x;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Gather layout to all processors
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
static h5_err_t
|
||||
_allgather (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
#ifdef PARALLEL_IO
|
||||
struct h5b_partition *partition = &f->b->user_layout[f->myproc];
|
||||
struct h5b_partition *layout = f->b->user_layout;
|
||||
|
||||
TRY( h5priv_mpi_allgather(f,
|
||||
partition, 1, f->b->partition_mpi_t,
|
||||
layout, 1, f->b->partition_mpi_t, f->comm) );
|
||||
#endif
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Get dimension sizes of block. These informations are stored inside the
|
||||
block structure.
|
||||
*/
|
||||
static void
|
||||
_get_dimension_sizes (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
int proc;
|
||||
struct h5b_fdata *b = f->b;
|
||||
struct h5b_partition *partition = b->user_layout;
|
||||
|
||||
b->i_max = 0;
|
||||
b->j_max = 0;
|
||||
b->k_max = 0;
|
||||
|
||||
for ( proc = 0; proc < f->nprocs; proc++, partition++ ) {
|
||||
if ( partition->i_end > b->i_max ) b->i_max = partition->i_end;
|
||||
if ( partition->j_end > b->j_max ) b->j_max = partition->j_end;
|
||||
if ( partition->k_end > b->k_max ) b->k_max = partition->k_end;
|
||||
}
|
||||
}
|
||||
|
||||
#define _NO_GHOSTZONE(p,q) ( (p->i_end < q->i_start) \
|
||||
|| (p->j_end < q->j_start) \
|
||||
|| (p->k_end < q->k_start) )
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Check whether two partitions have a common ghost-zone.
|
||||
|
||||
\return value != \c 0 if yes otherwise \c 0
|
||||
*/
|
||||
static int
|
||||
_have_ghostzone (
|
||||
const struct h5b_partition *p, /*!< IN: partition \c p */
|
||||
const struct h5b_partition *q /*!< IN: partition \c q */
|
||||
) {
|
||||
return ( ! ( _NO_GHOSTZONE ( p, q ) || _NO_GHOSTZONE ( q, p ) ) );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Calculate volume of partition.
|
||||
|
||||
\return volume
|
||||
*/
|
||||
static h5_int64_t
|
||||
_volume_of_partition (
|
||||
const struct h5b_partition *p /*!< IN: partition */
|
||||
) {
|
||||
return (p->i_end - p->i_start)
|
||||
* (p->j_end - p->j_start)
|
||||
* (p->k_end - p->k_start);
|
||||
|
||||
}
|
||||
|
||||
#define MIN( x, y ) ( (x) <= (y) ? (x) : (y) )
|
||||
#define MAX( x, y ) ( (x) >= (y) ? (x) : (y) )
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Calc volume of ghost-zone.
|
||||
|
||||
\return volume
|
||||
*/
|
||||
static h5_int64_t
|
||||
_volume_of_ghostzone (
|
||||
const struct h5b_partition *p, /*!< IN: ptr to first partition */
|
||||
const struct h5b_partition *q /*!< IN: ptr to second partition */
|
||||
) {
|
||||
|
||||
h5_int64_t dx = MIN ( p->i_end, q->i_end )
|
||||
- MAX ( p->i_start, q->i_start ) + 1;
|
||||
h5_int64_t dy = MIN ( p->j_end, q->j_end )
|
||||
- MAX ( p->j_start, q->j_start ) + 1;
|
||||
h5_int64_t dz = MIN ( p->k_end, q->k_end )
|
||||
- MAX ( p->k_start, q->k_start ) + 1;
|
||||
|
||||
return dx * dy * dz;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Dissolve ghost-zone by moving the X coordinates. Nothing will be changed
|
||||
if \c { p->i_start <= q->i_end <= p->i_end }. In this case \c -1 will be
|
||||
returned.
|
||||
|
||||
\return H5_SUCCESS or -1
|
||||
*/
|
||||
static h5_int64_t
|
||||
_dissolve_X_ghostzone (
|
||||
struct h5b_partition *p, /*!< IN/OUT: ptr to first partition */
|
||||
struct h5b_partition *q /*!< IN/OUT: ptr to second partition */
|
||||
) {
|
||||
|
||||
if ( p->i_start > q->i_start )
|
||||
return _dissolve_X_ghostzone( q, p );
|
||||
|
||||
if ( q->i_end <= p->i_end ) /* no dissolving */
|
||||
return -1;
|
||||
|
||||
p->i_end = ( p->i_end + q->i_start ) >> 1;
|
||||
q->i_start = p->i_end + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Dissolve ghost-zone by moving the Y coordinates. Nothing will be changed
|
||||
if \c { p->j_start <= q->j_end <= p->j_end }. In this case \c -1 will be
|
||||
returned.
|
||||
|
||||
\return H5_SUCCESS or -1
|
||||
*/
|
||||
static h5_int64_t
|
||||
_dissolve_Y_ghostzone (
|
||||
struct h5b_partition *p, /*!< IN/OUT: ptr to first partition */
|
||||
struct h5b_partition *q /*!< IN/OUT: ptr to second partition */
|
||||
) {
|
||||
|
||||
if ( p->j_start > q->j_start )
|
||||
return _dissolve_Y_ghostzone( q, p );
|
||||
|
||||
if ( q->j_end <= p->j_end ) /* no dissolving */
|
||||
return -1;
|
||||
|
||||
p->j_end = ( p->j_end + q->j_start ) >> 1;
|
||||
q->j_start = p->j_end + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Dissolve ghost-zone by moving the Z coordinates. Nothing will be changed
|
||||
if \c { p->k_start <= q->k_end <= p->k_end }. In this case \c -1 will be
|
||||
returned.
|
||||
|
||||
\return H5_SUCCESS or -1
|
||||
*/
|
||||
static h5_int64_t
|
||||
_dissolve_Z_ghostzone (
|
||||
struct h5b_partition *p, /*!< IN/OUT: ptr to first partition */
|
||||
struct h5b_partition *q /*!< IN/OUT: ptr to second partition */
|
||||
) {
|
||||
|
||||
if ( p->k_start > q->k_start )
|
||||
return _dissolve_Z_ghostzone( q, p );
|
||||
|
||||
if ( q->k_end <= p->k_end ) /* no dissolving */
|
||||
return -1;
|
||||
|
||||
p->k_end = ( p->k_end + q->k_start ) >> 1;
|
||||
q->k_start = p->k_end + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Dissolve ghost-zone for partitions \p and \q.
|
||||
|
||||
Dissolving is done by moving either the X, Y or Z plane. We never move
|
||||
more than one plane per partition. Thus we always have three possibilities
|
||||
to dissolve the ghost-zone. The "best" is the one with the largest
|
||||
remaining volume of the partitions.
|
||||
|
||||
\return H5_SUCCESS or error code.
|
||||
*/
|
||||
static h5_int64_t
|
||||
_dissolve_ghostzone (
|
||||
h5_file_t *const f,
|
||||
struct h5b_partition *p, /*!< IN/OUT: ptr to first partition */
|
||||
struct h5b_partition *q /*!< IN/OUT: ptr to second partition */
|
||||
) {
|
||||
|
||||
struct h5b_partition p_;
|
||||
struct h5b_partition q_;
|
||||
struct h5b_partition p_best;
|
||||
struct h5b_partition q_best;
|
||||
h5_int64_t vol;
|
||||
h5_int64_t max_vol = 0;
|
||||
|
||||
p_ = *p;
|
||||
q_ = *q;
|
||||
if ( _dissolve_X_ghostzone ( &p_, &q_ ) == 0 ) {
|
||||
vol = _volume_of_partition ( &p_ )
|
||||
+ _volume_of_partition ( &q_ );
|
||||
if ( vol > max_vol ) {
|
||||
max_vol = vol;
|
||||
p_best = p_;
|
||||
q_best = q_;
|
||||
}
|
||||
}
|
||||
|
||||
p_ = *p;
|
||||
q_ = *q;
|
||||
if ( _dissolve_Y_ghostzone ( &p_, &q_ ) == 0 ) {
|
||||
vol = _volume_of_partition ( &p_ )
|
||||
+ _volume_of_partition ( &q_ );
|
||||
if ( vol > max_vol ) {
|
||||
max_vol = vol;
|
||||
p_best = p_;
|
||||
q_best = q_;
|
||||
}
|
||||
}
|
||||
p_ = *p;
|
||||
q_ = *q;
|
||||
|
||||
if ( _dissolve_Z_ghostzone ( &p_, &q_ ) == 0 ) {
|
||||
vol = _volume_of_partition ( &p_ )
|
||||
+ _volume_of_partition ( &q_ );
|
||||
if ( vol > max_vol ) {
|
||||
max_vol = vol;
|
||||
p_best = p_;
|
||||
q_best = q_;
|
||||
}
|
||||
}
|
||||
if ( max_vol <= 0 ) {
|
||||
return h5_error (f,
|
||||
H5_ERR_LAYOUT,
|
||||
"Cannot dissolve ghostzones in specified layout!" );
|
||||
}
|
||||
*p = p_best;
|
||||
*q = q_best;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
Dissolve all ghost-zones.
|
||||
|
||||
Ghost-zone are dissolved in the order of their magnitude, largest first.
|
||||
|
||||
\note
|
||||
Dissolving ghost-zones automaticaly is not trivial! The implemented
|
||||
algorithmn garanties, that there are no ghost-zones left and that we
|
||||
have the same result on all processors.
|
||||
But there may be zones which are not assigned to a partition any more.
|
||||
May be we should check this and return an error in this case. Then
|
||||
the user have to decide to continue or to abort.
|
||||
|
||||
\b {Error Codes}
|
||||
\b H5PART_NOMEM_ERR
|
||||
|
||||
\return H5_SUCCESS or error code.
|
||||
*/
|
||||
static h5_int64_t
|
||||
_dissolve_ghostzones (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
|
||||
struct h5b_fdata *b = f->b;
|
||||
struct h5b_partition *p;
|
||||
struct h5b_partition *q;
|
||||
int proc_p, proc_q;
|
||||
|
||||
struct list {
|
||||
struct list *prev;
|
||||
struct list *next;
|
||||
struct h5b_partition *p;
|
||||
struct h5b_partition *q;
|
||||
h5_int64_t vol;
|
||||
} *p_begin, *p_el, *p_max, *p_end, *p_save;
|
||||
|
||||
memcpy ( b->write_layout, b->user_layout,
|
||||
f->nprocs * sizeof (*f->b->user_layout) );
|
||||
|
||||
TRY( p_begin = (struct list*)h5priv_alloc(f, NULL, sizeof(*p_begin)) );
|
||||
p_max = p_end = p_begin;
|
||||
|
||||
memset ( p_begin, 0, sizeof ( *p_begin ) );
|
||||
|
||||
for ( proc_p = 0, p = b->write_layout;
|
||||
proc_p < f->nprocs-1;
|
||||
proc_p++, p++ ) {
|
||||
for ( proc_q = proc_p+1, q = &b->write_layout[proc_q];
|
||||
proc_q < f->nprocs;
|
||||
proc_q++, q++ ) {
|
||||
|
||||
if ( _have_ghostzone ( p, q ) ) {
|
||||
TRY( p_el = (struct list*)h5priv_alloc(f, NULL, sizeof(*p_el)) );
|
||||
|
||||
p_el->p = p;
|
||||
p_el->q = q;
|
||||
p_el->vol = _volume_of_ghostzone ( p, q );
|
||||
p_el->prev = p_end;
|
||||
p_el->next = NULL;
|
||||
|
||||
if ( p_el->vol > p_max->vol )
|
||||
p_max = p_el;
|
||||
|
||||
p_end->next = p_el;
|
||||
p_end = p_el;
|
||||
}
|
||||
}
|
||||
}
|
||||
while ( p_begin->next ) {
|
||||
if ( p_max->next ) p_max->next->prev = p_max->prev;
|
||||
p_max->prev->next = p_max->next;
|
||||
|
||||
_dissolve_ghostzone ( f, p_max->p, p_max->q );
|
||||
|
||||
free ( p_max );
|
||||
p_el = p_max = p_begin->next;
|
||||
|
||||
while ( p_el ) {
|
||||
if ( _have_ghostzone ( p_el->p, p_el->q ) ) {
|
||||
p_el->vol = _volume_of_ghostzone ( p_el->p, p_el->q );
|
||||
if ( p_el->vol > p_max->vol )
|
||||
p_max = p_el;
|
||||
p_el = p_el->next;
|
||||
} else {
|
||||
if ( p_el->next )
|
||||
p_el->next->prev = p_el->prev;
|
||||
p_el->prev->next = p_el->next;
|
||||
p_save = p_el->next;
|
||||
free ( p_el );
|
||||
p_el = p_save;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
free ( p_begin );
|
||||
|
||||
p = &b->user_layout[f->myproc];
|
||||
h5_debug (f,
|
||||
"PROC[%d]: User layout: %lld:%lld, %lld:%lld, %lld:%lld",
|
||||
f->myproc,
|
||||
(long long)p->i_start, (long long)p->i_end,
|
||||
(long long)p->j_start, (long long)p->j_end,
|
||||
(long long)p->k_start, (long long)p->k_end );
|
||||
/* more detailed debug output: all procs report their view
|
||||
of all other procs */
|
||||
for ( proc_p = 0, p = b->user_layout;
|
||||
proc_p < f->nprocs;
|
||||
proc_p++, p++ ) {
|
||||
h5_debug (f,
|
||||
"PROC[%d]: proc[%d]: User layout: %lld:%lld, %lld:%lld, %lld:%lld ",
|
||||
f->myproc, proc_p,
|
||||
(long long)p->i_start, (long long)p->i_end,
|
||||
(long long)p->j_start, (long long)p->j_end,
|
||||
(long long)p->k_start, (long long)p->k_end );
|
||||
}
|
||||
|
||||
p = &b->write_layout[f->myproc];
|
||||
h5_debug (f,
|
||||
"PROC[%d]: Ghost-zone layout: %lld:%lld, %lld:%lld, %lld:%lld",
|
||||
f->myproc,
|
||||
(long long)p->i_start, (long long)p->i_end,
|
||||
(long long)p->j_start, (long long)p->j_end,
|
||||
(long long)p->k_start, (long long)p->k_end );
|
||||
/* more detailed debug output: all procs report their view
|
||||
of all other procs */
|
||||
for ( proc_p = 0, p = b->write_layout;
|
||||
proc_p < f->nprocs;
|
||||
proc_p++, p++ ) {
|
||||
h5_debug (f,
|
||||
"PROC[%d]: proc[%d]: Ghost-zone layout: %lld:%lld, %lld:%lld, %lld:%lld ",
|
||||
f->myproc, proc_p,
|
||||
(long long)p->i_start, (long long)p->i_end,
|
||||
(long long)p->j_start, (long long)p->j_end,
|
||||
(long long)p->k_start, (long long)p->k_end );
|
||||
}
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
*/
|
||||
static h5_err_t
|
||||
_release_hyperslab (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
if ( f->b->shape > 0 ) {
|
||||
TRY( h5priv_close_hdf5_dataspace(f, f->b->shape) );
|
||||
f->b->shape = -1;
|
||||
}
|
||||
if ( f->b->diskshape > 0 ) {
|
||||
TRY( h5priv_close_hdf5_dataspace(f, f->b->diskshape) );
|
||||
f->b->diskshape = -1;
|
||||
}
|
||||
if ( f->b->memshape > 0 ) {
|
||||
TRY( h5priv_close_hdf5_dataspace(f, f->b->memshape) );
|
||||
f->b->memshape = -1;
|
||||
}
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
_open_block_group (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
if ( b->block_gid >= 0) {
|
||||
TRY( h5priv_close_hdf5_group(f, b->block_gid) );
|
||||
b->block_gid = -1;
|
||||
}
|
||||
|
||||
if ( b->block_gid < 0 ) {
|
||||
TRY( b->block_gid = h5priv_open_hdf5_group(f,
|
||||
f->step_gid, H5_BLOCKNAME) );
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_open_field_group (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name
|
||||
) {
|
||||
|
||||
char name2[H5_DATANAME_LEN];
|
||||
h5_normalize_dataset_name(f, name, name2);
|
||||
|
||||
TRY( _open_block_group ( f ) );
|
||||
TRY( f->b->field_gid = h5priv_open_hdf5_group(f, f->b->block_gid, name2) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_close_field_group (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
|
||||
if ( f->b->field_gid >= 0 ) {
|
||||
TRY( h5priv_close_hdf5_group(f, f->b->field_gid) );
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
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 k_start, /*!< IN: start index of \c k */
|
||||
const h5_size_t k_end /*!< IN: end index of \c k */
|
||||
) {
|
||||
|
||||
struct h5b_fdata *b = f->b;
|
||||
struct h5b_partition *p = &b->user_layout[f->myproc];
|
||||
p->i_start = i_start;
|
||||
p->i_end = i_end;
|
||||
p->j_start = j_start;
|
||||
p->j_end = j_end;
|
||||
p->k_start = k_start;
|
||||
p->k_end = k_end;
|
||||
|
||||
_normalize_partition ( p );
|
||||
TRY( _allgather( f ) );
|
||||
_get_dimension_sizes ( f );
|
||||
TRY( _dissolve_ghostzones ( f ) );
|
||||
TRY( _release_hyperslab ( f ) );
|
||||
b->have_layout = 1;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5b_3d_set_chunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: size of \c i */
|
||||
const h5_size_t j, /*!< IN: size of \c j */
|
||||
const h5_size_t k /*!< IN: size of \c k */
|
||||
) {
|
||||
|
||||
if ( i == 0 || j == 0 || k == 0 )
|
||||
{
|
||||
h5_info(f, "Disabling chunking" );
|
||||
TRY( h5priv_set_hdf5_layout_property(f,
|
||||
f->b->dcreate_prop, H5D_CONTIGUOUS) );
|
||||
} else
|
||||
{
|
||||
h5_info(f, "Setting chunk to (%lld,%lld,%lld)",
|
||||
(long long)i, (long long)j, (long long)k);
|
||||
hsize_t dims[3] = { k, j, i };
|
||||
TRY( h5priv_set_hdf5_chunk_property(f,
|
||||
f->b->dcreate_prop, 1, dims) );
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
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 */
|
||||
) {
|
||||
|
||||
CHECK_TIMEGROUP ( f );
|
||||
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
TRY( h5bpriv_open_field_group ( f, field_name ) );
|
||||
|
||||
hid_t dataset_id;
|
||||
hid_t plist_id;
|
||||
hsize_t hdims[3];
|
||||
|
||||
TRY( dataset_id = h5priv_open_hdf5_dataset(f, b->field_gid, H5_BLOCKNAME_X) );
|
||||
TRY( plist_id = h5priv_get_hdf5_dataset_create_plist(f, dataset_id) );
|
||||
TRY( h5priv_get_hdf5_chunk_property(f, plist_id, 3, hdims) );
|
||||
TRY( h5priv_close_hdf5_property(f, plist_id) );
|
||||
TRY( h5priv_close_hdf5_dataset(f, dataset_id) );
|
||||
|
||||
dims[0] = hdims[2];
|
||||
dims[1] = hdims[1];
|
||||
dims[2] = hdims[0];
|
||||
|
||||
h5_info(f,
|
||||
"Found chunk dimensions (%lld,%lld,%lld)",
|
||||
(long long)dims[0],
|
||||
(long long)dims[1],
|
||||
(long long)dims[2] );
|
||||
|
||||
TRY( h5bpriv_close_field_group( f ) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
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 */
|
||||
) {
|
||||
|
||||
if ( ( proc < 0 ) || ( proc >= f->nprocs ) )
|
||||
return h5_error(f, H5_ERR_INVAL, "Invalid processor id %d!", proc);
|
||||
|
||||
struct h5b_partition *p = &f->b->user_layout[(size_t)proc];
|
||||
|
||||
*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 */
|
||||
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 */
|
||||
) {
|
||||
|
||||
if ( ( proc < 0 ) || ( proc >= f->nprocs ) )
|
||||
return h5_error(f, H5_ERR_INVAL, "Invalid processor id %d!", proc);
|
||||
|
||||
struct h5b_partition *p = &f->b->write_layout[(size_t)proc];
|
||||
|
||||
*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;
|
||||
}
|
||||
|
||||
int
|
||||
h5b_3d_get_proc (
|
||||
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 */
|
||||
) {
|
||||
|
||||
struct h5b_partition *layout = f->b->write_layout;
|
||||
int proc;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
h5b_get_num_fields (
|
||||
h5_file_t *const f /*!< IN: File handle */
|
||||
) {
|
||||
|
||||
TRY( _open_block_group(f) );
|
||||
return h5priv_get_num_objs_in_hdf5_group( f, f->b->block_gid );
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5b_get_field_info_by_name (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< OUT: field name */
|
||||
h5_size_t *grid_rank, /*!< OUT: grid rank */
|
||||
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
|
||||
hsize_t dims[16]; /* give it plenty of space even though we don't expect rank > 3 */
|
||||
hsize_t _grid_rank, _field_rank;
|
||||
h5_size_t i, j;
|
||||
|
||||
TRY( h5bpriv_open_field_group(f, name) );
|
||||
|
||||
hid_t dataset_id;
|
||||
hid_t dataspace_id;
|
||||
|
||||
TRY( dataset_id = h5priv_open_hdf5_dataset(f,
|
||||
f->b->field_gid, H5_BLOCKNAME_X) );
|
||||
TRY( dataspace_id = h5priv_get_hdf5_dataset_space(f, dataset_id) );
|
||||
|
||||
TRY( _grid_rank = h5priv_get_dims_of_hdf5_dataspace(f,
|
||||
dataspace_id, dims, NULL) );
|
||||
if ( grid_rank ) *grid_rank = (h5_size_t) _grid_rank;
|
||||
|
||||
if ( grid_dims ) {
|
||||
for ( i = 0, j = _grid_rank-1; i < _grid_rank; i++, j-- )
|
||||
grid_dims[i] = (h5_size_t)dims[j];
|
||||
}
|
||||
|
||||
TRY( _field_rank = h5priv_get_num_objs_in_hdf5_group(f,
|
||||
f->b->block_gid) );
|
||||
if ( field_rank ) *field_rank = (h5_size_t) _field_rank;
|
||||
|
||||
hid_t h5type;
|
||||
TRY( h5type = h5priv_get_hdf5_dataset_type(f, dataset_id) );
|
||||
|
||||
if ( type )
|
||||
TRY( *type = h5_normalize_h5_type(f, h5type) );
|
||||
|
||||
TRY( h5priv_close_hdf5_dataspace(f, dataspace_id) );
|
||||
TRY( h5priv_close_hdf5_dataset(f, dataset_id) );
|
||||
|
||||
return h5bpriv_close_field_group(f);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5b_get_field_info (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const h5_size_t idx, /*!< IN: index of field */
|
||||
char *name, /*!< OUT: field name */
|
||||
const h5_size_t len_name, /*!< IN: buffer size */
|
||||
h5_size_t *grid_rank, /*!< OUT: grid rank */
|
||||
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
|
||||
TRY( _open_block_group(f) );
|
||||
TRY( h5priv_get_hdf5_objname_by_idx(
|
||||
f,
|
||||
f->b->block_gid,
|
||||
(hsize_t)idx,
|
||||
name,
|
||||
(size_t)len_name) );
|
||||
|
||||
return h5b_get_field_info_by_name(f,
|
||||
name, grid_rank, grid_dims, field_rank, type);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef __H5B_MODEL_PRIVATE_H
|
||||
#define __H5B_MODEL_PRIVATE_H
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_open_field_group (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_close_field_group (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,394 @@
|
||||
static h5_err_t
|
||||
_create_block_group (
|
||||
const h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
|
||||
herr_t herr;
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
if ( b->blockgroup > 0 ) {
|
||||
herr = H5Gclose ( b->blockgroup );
|
||||
if ( herr < 0 ) return HANDLE_H5G_CLOSE_ERR;
|
||||
f->b->blockgroup = -1;
|
||||
}
|
||||
|
||||
herr = H5Gcreate (
|
||||
f->timegroup,
|
||||
H5BLOCK_GROUPNAME_BLOCK,
|
||||
#ifndef H5_USE_16_API
|
||||
H5P_DEFAULT,
|
||||
H5P_DEFAULT,
|
||||
H5P_DEFAULT
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
);
|
||||
if ( herr < 0 ) return HANDLE_H5G_CREATE_ERR ( H5BLOCK_GROUPNAME_BLOCK );
|
||||
|
||||
f->b->blockgroup = herr;
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_int64_t
|
||||
_H5Block_create_field_group (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name /*!< IN: name of field group to create */
|
||||
) {
|
||||
|
||||
h5_int64_t h5err;
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
|
||||
if ( ! _H5Part_have_group ( f->timegroup, H5BLOCK_GROUPNAME_BLOCK ) ) {
|
||||
h5err = _create_block_group ( f );
|
||||
} else {
|
||||
h5err = _open_block_group ( f );
|
||||
}
|
||||
if ( h5err < 0 ) return h5err;
|
||||
|
||||
h5err = _select_hyperslab_for_writing ( f );
|
||||
if ( h5err < 0 ) return h5err;
|
||||
|
||||
if ( _H5Part_have_group ( b->blockgroup, name ) )
|
||||
return HANDLE_H5PART_GROUP_EXISTS_ERR ( name );
|
||||
|
||||
herr_t herr = H5Gcreate (
|
||||
b->blockgroup,
|
||||
name,
|
||||
#ifndef H5_USE_16_API
|
||||
H5P_DEFAULT,
|
||||
H5P_DEFAULT,
|
||||
H5P_DEFAULT
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
);
|
||||
if ( herr < 0 ) return HANDLE_H5G_CREATE_ERR ( name );
|
||||
b->field_group_id = herr;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
h5_int64_t
|
||||
_H5Block_select_hyperslab_for_reading (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
hid_t dataset
|
||||
) {
|
||||
|
||||
struct h5b_fdata *b = f->b;
|
||||
struct h5b_partition *p = &b->user_layout[f->myproc];
|
||||
int rank;
|
||||
hsize_t field_dims[3];
|
||||
hsize_t start[3] = {
|
||||
p->k_start,
|
||||
p->j_start,
|
||||
p->i_start };
|
||||
hsize_t stride[3] = { 1, 1, 1 };
|
||||
hsize_t part_dims[3] = {
|
||||
p->k_end - p->k_start + 1,
|
||||
p->j_end - p->j_start + 1,
|
||||
p->i_end - p->i_start + 1 };
|
||||
|
||||
h5_int64_t herr = _release_hyperslab ( f );
|
||||
if ( herr < 0 ) return HANDLE_H5S_CLOSE_ERR;
|
||||
|
||||
b->diskshape = H5Dget_space ( dataset );
|
||||
if ( b->diskshape < 0 ) return HANDLE_H5D_GET_SPACE_ERR;
|
||||
|
||||
rank = H5Sget_simple_extent_dims ( b->diskshape, NULL, NULL );
|
||||
if ( rank < 0 ) return HANDLE_H5S_GET_SIMPLE_EXTENT_DIMS_ERR;
|
||||
if ( rank != 3 ) return HANDLE_H5PART_DATASET_RANK_ERR ( rank, 3 );
|
||||
|
||||
rank = H5Sget_simple_extent_dims ( b->diskshape, field_dims, NULL );
|
||||
if ( rank < 0 ) return HANDLE_H5S_GET_SIMPLE_EXTENT_DIMS_ERR;
|
||||
|
||||
if ( (field_dims[0] < (hsize_t)b->k_max) ||
|
||||
(field_dims[1] < (hsize_t)b->j_max) ||
|
||||
(field_dims[2] < (hsize_t)b->i_max) ) return HANDLE_H5PART_LAYOUT_ERR;
|
||||
|
||||
_H5Part_print_debug (
|
||||
"PROC[%d]: field_dims: (%lld,%lld,%lld)",
|
||||
f->myproc,
|
||||
(long long)field_dims[2],
|
||||
(long long)field_dims[1],
|
||||
(long long)field_dims[0] );
|
||||
|
||||
b->diskshape = H5Screate_simple ( rank, field_dims,field_dims );
|
||||
if ( b->diskshape < 0 )
|
||||
return HANDLE_H5S_CREATE_SIMPLE_3D_ERR ( field_dims );
|
||||
|
||||
f->b->memshape = H5Screate_simple ( rank, part_dims, part_dims );
|
||||
if ( b->memshape < 0 )
|
||||
return HANDLE_H5S_CREATE_SIMPLE_3D_ERR ( part_dims );
|
||||
|
||||
herr = H5Sselect_hyperslab (
|
||||
b->diskshape,
|
||||
H5S_SELECT_SET,
|
||||
start,
|
||||
stride,
|
||||
part_dims,
|
||||
NULL );
|
||||
if ( herr < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||
|
||||
_H5Part_print_debug (
|
||||
"PROC[%d]: Select hyperslab: \n"
|
||||
"\tstart: (%lld,%lld,%lld)\n"
|
||||
"\tstride: (%lld,%lld,%lld)\n"
|
||||
"\tdims: (%lld,%lld,%lld)",
|
||||
f->myproc,
|
||||
(long long)start[2],
|
||||
(long long)start[1],
|
||||
(long long)start[0],
|
||||
(long long)stride[2],
|
||||
(long long)stride[1],
|
||||
(long long)stride[0],
|
||||
(long long)part_dims[2],
|
||||
(long long)part_dims[1],
|
||||
(long long)part_dims[0] );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_int64_t
|
||||
_H5Block_read_data (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
void *data, /*!< OUT: ptr to read buffer */
|
||||
hid_t type /*!< IN: data type */
|
||||
) {
|
||||
|
||||
h5_int64_t herr;
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
hid_t dataset_id = H5Dopen ( b->field_group_id, name
|
||||
#ifndef H5_USE_16_API
|
||||
, H5P_DEFAULT
|
||||
#endif
|
||||
);
|
||||
if ( dataset_id < 0 ) return HANDLE_H5D_OPEN_ERR ( name );
|
||||
|
||||
herr = _H5Block_select_hyperslab_for_reading ( f, dataset_id );
|
||||
if ( herr < 0 ) return herr;
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
herr = _H5Part_start_throttle ( f );
|
||||
if ( herr < 0 ) return herr;
|
||||
#endif
|
||||
|
||||
herr = H5Dread (
|
||||
dataset_id,
|
||||
type,
|
||||
f->b->memshape,
|
||||
f->b->diskshape,
|
||||
f->xfer_prop,
|
||||
data );
|
||||
if ( herr < 0 ) return HANDLE_H5D_READ_ERR ( name, f->timestep );
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
herr = _H5Part_end_throttle ( f );
|
||||
if ( herr < 0 ) return herr;
|
||||
#endif
|
||||
|
||||
herr = H5Dclose ( dataset_id );
|
||||
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/********************** functions for writing ********************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static h5_int64_t
|
||||
_select_hyperslab_for_writing (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
|
||||
/*
|
||||
re-use existing hyperslab
|
||||
*/
|
||||
if ( f->b->shape >= 0 ) return H5_SUCCESS;
|
||||
|
||||
herr_t herr;
|
||||
struct h5b_fdata *b = f->b;
|
||||
struct h5b_partition *p = &b->write_layout[f->myproc];
|
||||
struct h5b_partition *q = &b->user_layout[f->myproc];
|
||||
|
||||
int rank = 3;
|
||||
|
||||
hsize_t field_dims[3] = {
|
||||
b->k_max+1,
|
||||
b->j_max+1,
|
||||
b->i_max+1
|
||||
};
|
||||
|
||||
hsize_t start[3] = {
|
||||
p->k_start,
|
||||
p->j_start,
|
||||
p->i_start
|
||||
};
|
||||
hsize_t stride[3] = { 1, 1, 1 };
|
||||
hsize_t part_dims[3] = {
|
||||
p->k_end - p->k_start + 1,
|
||||
p->j_end - p->j_start + 1,
|
||||
p->i_end - p->i_start + 1
|
||||
};
|
||||
|
||||
|
||||
b->shape = H5Screate_simple ( rank, field_dims, field_dims );
|
||||
if ( b->shape < 0 )
|
||||
return HANDLE_H5S_CREATE_SIMPLE_3D_ERR ( field_dims );
|
||||
|
||||
b->diskshape = H5Screate_simple ( rank, field_dims,field_dims );
|
||||
if ( b->diskshape < 0 )
|
||||
return HANDLE_H5S_CREATE_SIMPLE_3D_ERR ( field_dims );
|
||||
|
||||
_H5Part_print_debug (
|
||||
"PROC[%d]: Select hyperslab on diskshape: \n"
|
||||
"\tstart: (%lld,%lld,%lld)\n"
|
||||
"\tstride: (%lld,%lld,%lld)\n"
|
||||
"\tdims: (%lld,%lld,%lld)",
|
||||
f->myproc,
|
||||
(long long)start[2],
|
||||
(long long)start[1],
|
||||
(long long)start[0],
|
||||
(long long)stride[2],
|
||||
(long long)stride[1],
|
||||
(long long)stride[0],
|
||||
(long long)part_dims[2],
|
||||
(long long)part_dims[1],
|
||||
(long long)part_dims[0] );
|
||||
|
||||
herr = H5Sselect_hyperslab (
|
||||
b->diskshape,
|
||||
H5S_SELECT_SET,
|
||||
start,
|
||||
stride,
|
||||
part_dims,
|
||||
NULL );
|
||||
if ( herr < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||
|
||||
field_dims[0] = q->k_end - q->k_start + 1;
|
||||
field_dims[1] = q->j_end - q->j_start + 1;
|
||||
field_dims[2] = q->i_end - q->i_start + 1;
|
||||
|
||||
f->b->memshape = H5Screate_simple ( rank, field_dims, field_dims );
|
||||
if ( b->memshape < 0 )
|
||||
return HANDLE_H5S_CREATE_SIMPLE_3D_ERR ( part_dims );
|
||||
|
||||
start[0] = p->k_start - q->k_start;
|
||||
start[1] = p->j_start - q->j_start;
|
||||
start[2] = p->i_start - q->i_start;
|
||||
|
||||
_H5Part_print_debug (
|
||||
"PROC[%d]: Select hyperslab on memshape: \n"
|
||||
"\tstart: (%lld,%lld,%lld)\n"
|
||||
"\tstride: (%lld,%lld,%lld)\n"
|
||||
"\tdims: (%lld,%lld,%lld)",
|
||||
f->myproc,
|
||||
(long long)start[2],
|
||||
(long long)start[1],
|
||||
(long long)start[0],
|
||||
(long long)stride[2],
|
||||
(long long)stride[1],
|
||||
(long long)stride[0],
|
||||
(long long)part_dims[2],
|
||||
(long long)part_dims[1],
|
||||
(long long)part_dims[0] );
|
||||
|
||||
herr = H5Sselect_hyperslab (
|
||||
b->memshape,
|
||||
H5S_SELECT_SET,
|
||||
start,
|
||||
stride,
|
||||
part_dims,
|
||||
NULL );
|
||||
if ( herr < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_private
|
||||
|
||||
\internal
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_int64_t
|
||||
_H5Block_write_data (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const void *data, /*!< IN: data to write */
|
||||
const hid_t type /*!< IN: data type */
|
||||
) {
|
||||
|
||||
herr_t herr;
|
||||
hid_t dataset;
|
||||
struct h5b_fdata *b = f->b;
|
||||
|
||||
#ifndef H5_USE_16_API
|
||||
htri_t exists = H5Lexists ( b->field_group_id, name, H5P_DEFAULT );
|
||||
if ( exists > 0 ) return HANDLE_H5D_EXISTS_ERR ( name, f->timestep );
|
||||
#endif
|
||||
|
||||
dataset = H5Dcreate (
|
||||
b->field_group_id,
|
||||
name,
|
||||
type,
|
||||
b->shape,
|
||||
#ifndef H5_USE_16_API
|
||||
H5P_DEFAULT,
|
||||
b->create_prop,
|
||||
H5P_DEFAULT
|
||||
#else
|
||||
b->create_prop
|
||||
#endif
|
||||
);
|
||||
if ( dataset < 0 ) return HANDLE_H5D_CREATE_ERR ( name, f->timestep );
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
herr = _H5Part_start_throttle ( f );
|
||||
if ( herr < 0 ) return herr;
|
||||
#endif
|
||||
|
||||
herr = H5Dwrite (
|
||||
dataset,
|
||||
type,
|
||||
b->memshape,
|
||||
b->diskshape,
|
||||
f->xfer_prop,
|
||||
data );
|
||||
if ( herr < 0 ) return HANDLE_H5D_WRITE_ERR ( name, f->timestep );
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
herr = _H5Part_end_throttle ( f );
|
||||
if ( herr < 0 ) return herr;
|
||||
#endif
|
||||
|
||||
herr = H5Dclose ( dataset );
|
||||
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
#define __H5B_TYPES_PRIVATE_H
|
||||
|
||||
struct h5b_partition {
|
||||
h5_int64_t i_start;
|
||||
h5_int64_t i_end;
|
||||
h5_int64_t j_start;
|
||||
h5_int64_t j_end;
|
||||
h5_int64_t k_start;
|
||||
h5_int64_t k_end;
|
||||
h5_size_t i_start;
|
||||
h5_size_t i_end;
|
||||
h5_size_t j_start;
|
||||
h5_size_t j_end;
|
||||
h5_size_t k_start;
|
||||
h5_size_t k_end;
|
||||
};
|
||||
|
||||
struct h5b_fdata {
|
||||
@@ -18,13 +18,15 @@ struct h5b_fdata {
|
||||
struct h5b_partition* user_layout;
|
||||
struct h5b_partition* write_layout;
|
||||
int have_layout;
|
||||
h5_size_t chunk[3];
|
||||
|
||||
hid_t shape;
|
||||
hid_t memshape;
|
||||
hid_t diskshape;
|
||||
hid_t blockgroup;
|
||||
hid_t field_group_id;
|
||||
hid_t block_gid;
|
||||
hid_t field_gid;
|
||||
hid_t dcreate_prop;
|
||||
|
||||
MPI_Datatype partition_mpi_t;
|
||||
};
|
||||
typedef struct h5b_fdata h5b_fdata_t;
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
const char*
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h> /* va_arg - System dependent ?! */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "h5_core.h"
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
const char* ERR_ELEM_NEXIST = "Element with local vertex IDs (%s) doesn't exist!";
|
||||
@@ -31,4 +29,4 @@ h5tpriv_error_local_elem_nexist (
|
||||
|
||||
return h5_error (f, H5_ERR_NOENTRY, ERR_ELEM_NEXIST, s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "h5_core.h"
|
||||
#include "h5core/h5_core.h"
|
||||
|
||||
const h5t_ref_element_t h5t_tri_ref_element = {
|
||||
2,
|
||||
|
||||
+24
-5
@@ -495,11 +495,6 @@ h5u_set_chunk (
|
||||
const h5_size_t size
|
||||
) {
|
||||
|
||||
if ( f->u->dcreate_prop == H5P_DEFAULT ) {
|
||||
TRY( f->u->dcreate_prop = h5priv_create_hdf5_property(f,
|
||||
H5P_DATASET_CREATE) );
|
||||
}
|
||||
|
||||
if ( size == 0 )
|
||||
{
|
||||
h5_info(f, "Disabling chunking" );
|
||||
@@ -515,3 +510,27 @@ h5u_set_chunk (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5u_get_chunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const char *name, /*!< IN: name of dataset */
|
||||
h5_size_t *size /*!< OUT: chunk size in particles */
|
||||
) {
|
||||
|
||||
hid_t dataset_id;
|
||||
hid_t plist_id;
|
||||
hsize_t hsize;
|
||||
|
||||
TRY( dataset_id = h5priv_open_hdf5_dataset(f, f->step_gid, name) );
|
||||
TRY( plist_id = h5priv_get_hdf5_dataset_create_plist(f, dataset_id) );
|
||||
TRY( h5priv_get_hdf5_chunk_property(f, plist_id, 1, &hsize) );
|
||||
TRY( h5priv_close_hdf5_property(f, plist_id) );
|
||||
TRY( h5priv_close_hdf5_dataset(f, dataset_id) );
|
||||
|
||||
*size = (h5_size_t)hsize;
|
||||
|
||||
h5_info(f, "Found chunk size of %lld particles", (long long)*size);
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ h5u_read_data (
|
||||
}
|
||||
|
||||
char name2[H5_DATANAME_LEN];
|
||||
TRY ( h5_normalize_dataset_name ( name, name2 ) );
|
||||
TRY ( h5_normalize_dataset_name (f, name, name2) );
|
||||
|
||||
TRY( (dataset_id = h5priv_open_hdf5_dataset ( f, f->step_gid, name2 ) ) );
|
||||
|
||||
@@ -114,7 +114,7 @@ h5u_write_data (
|
||||
hid_t dset_id;
|
||||
|
||||
char name2[H5_DATANAME_LEN];
|
||||
TRY ( h5_normalize_dataset_name ( name, name2 ) );
|
||||
TRY ( h5_normalize_dataset_name (f, name, name2) );
|
||||
|
||||
if ( u->shape == H5S_ALL )
|
||||
h5_warn(f, "The view is unset or invalid.");
|
||||
|
||||
+5
-2
@@ -16,8 +16,6 @@
|
||||
#ifndef __H5_H
|
||||
#define __H5_H
|
||||
|
||||
#include "H5_inquiry.h"
|
||||
|
||||
h5_file_t *
|
||||
H5OpenFile (
|
||||
const char * filename,
|
||||
@@ -30,6 +28,11 @@ H5CloseFile (
|
||||
h5_file_t * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5CheckFile (
|
||||
h5_file_t * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5SetStepNameFormat (
|
||||
h5_file_t *f,
|
||||
|
||||
+110
-133
@@ -1,172 +1,149 @@
|
||||
/*
|
||||
Header file for declaring the H5Fed application programming
|
||||
interface (API) in the C language.
|
||||
|
||||
Copyright 2006-2007
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
#ifndef __H5Part_H
|
||||
#define __H5Part_H
|
||||
#ifndef __H5PART_H
|
||||
#define __H5PART_H
|
||||
|
||||
#include <hdf5.h>
|
||||
h5_err_t
|
||||
H5PartSetNumParticles (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t nparticles /*!< [in] Number of particles */
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
h5_err_t
|
||||
H5PartSetNumParticlesStrided (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t nparticles, /*!< [in] Number of particles */
|
||||
h5_int64_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
);
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5.h"
|
||||
#ifdef PARALLEL_IO
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
// #define H5PART_SUCCESS H5_SUCCESS
|
||||
#define H5PART_ERR_NOMEM H5_ERR_NOMEM
|
||||
#define H5PART_ERR_INVAL H5_ERR_INVAL
|
||||
#define H5PART_ERR_BADFD H5_ERR_BADFD
|
||||
#define H5PART_ERR_LAYOUT H5_ERR_LAYOUT
|
||||
#define H5PART_ERR_NOENT H5_ERR_NOENT
|
||||
#define H5PART_ERR_NOENTRY H5_ERR_NOENTRY
|
||||
|
||||
#define H5PART_ERR_MPI H5_ERR_MPI
|
||||
#define H5PART_ERR_HDF5 H5_ERR_HDF5
|
||||
|
||||
#define H5PART_READ H5_O_RDONLY
|
||||
#define H5PART_WRITE H5_O_WRONLY
|
||||
#define H5PART_APPEND H5_O_APPEND
|
||||
|
||||
#define H5PART_INT64 ((h5_int64_t)H5T_NATIVE_INT64)
|
||||
#define H5PART_FLOAT64 ((h5_int64_t)H5T_NATIVE_DOUBLE)
|
||||
#define H5PART_CHAR ((h5_int64_t)H5T_NATIVE_CHAR)
|
||||
|
||||
|
||||
/*============== File Writing Functions ==================== */
|
||||
h5_int64_t
|
||||
H5PartDefineStepName (
|
||||
h5_err_t
|
||||
H5PartSetChunkSize (
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
const h5_int64_t width
|
||||
h5_int64_t size
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartSetNumParticles (
|
||||
h5_file_t *f,
|
||||
const h5_int64_t nparticles
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartWriteDataFloat64 (
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
const h5_float64_t *array
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float64_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartWriteDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float32_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartWriteDataInt64 (
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
const h5_int64_t *array
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int64_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartWriteDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int32_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartReadDataFloat64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float64_t *data /*!< [out] Array of data */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartReadDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float32_t *data /*!< [out] Array of data */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartReadDataInt64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int64_t *data /*!< [out] Array of data */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartReadDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int32_t *data /*!< [out] Array of data */
|
||||
);
|
||||
|
||||
/*================== File Reading Routines =================*/
|
||||
h5_int64_t
|
||||
H5PartGetNumDatasets (
|
||||
h5_file_t *f
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartGetDatasetName (
|
||||
h5_file_t *f,
|
||||
const h5_int64_t idx,
|
||||
char *name,
|
||||
const h5_int64_t maxlen
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t idx, /*!< [in] Index of the dataset */
|
||||
char *name, /*!< [out] Name of dataset */
|
||||
const h5_int64_t len /*!< [in] Size of buffer \c name */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartGetDatasetInfo (
|
||||
h5_file_t *f,
|
||||
const h5_int64_t idx,
|
||||
char *name,
|
||||
const h5_int64_t maxlen,
|
||||
h5_int64_t *type,
|
||||
h5_int64_t *nelem);
|
||||
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t idx,/*!< [in] Index of the dataset */
|
||||
char *dataset_name, /*!< [out] Name of dataset */
|
||||
const h5_int64_t len_dataset_name,
|
||||
/*!< [in] Size of buffer \c dataset_name */
|
||||
h5_int64_t *type, /*!< [out] Type of data in dataset */
|
||||
h5_int64_t *nelem /*!< [out] Number of elements. */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartGetNumParticles (
|
||||
h5_file_t *f
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartSetView (
|
||||
h5_file_t *f,
|
||||
const h5_int64_t start,
|
||||
const h5_int64_t end
|
||||
);
|
||||
|
||||
|
||||
h5_int64_t
|
||||
H5PartGetView (
|
||||
h5_file_t *f,
|
||||
h5_int64_t *start,
|
||||
h5_int64_t *end
|
||||
h5_err_t
|
||||
H5PartResetView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartHasView (
|
||||
h5_file_t *f
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartResetView (
|
||||
h5_file_t *f
|
||||
h5_err_t
|
||||
H5PartSetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t start, /*!< [in] Start particle */
|
||||
h5_int64_t end /*!< [in] End particle */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartSetViewIndices (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t *indices, /*!< [in] List of indices */
|
||||
h5_int64_t nelems /*!< [in] Size of list */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartSetViewEmpty (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartGetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t *start, /*!< [out] Start particle */
|
||||
h5_int64_t *end /*!< [out] End particle */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5PartSetCanonicalView (
|
||||
h5_file_t *f
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartReadDataFloat64(
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
h5_float64_t *array
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartReadDataInt64 (
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
h5_int64_t *array
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5PartReadParticleStep (
|
||||
h5_file_t *f,
|
||||
const h5_int64_t step,
|
||||
h5_float64_t *x, /* particle positions */
|
||||
h5_float64_t *y,
|
||||
h5_float64_t *z,
|
||||
h5_float64_t *px, /* particle momenta */
|
||||
h5_float64_t *py,
|
||||
h5_float64_t *pz,
|
||||
h5_int64_t *id /* and phase */
|
||||
);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+145
-6
@@ -1,3 +1,6 @@
|
||||
#ifndef __H5_ATTRIBS_H
|
||||
#define __H5_ATTRIBS_H
|
||||
|
||||
h5_err_t
|
||||
H5WriteFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
@@ -12,6 +15,140 @@ H5WriteStepAttribString (
|
||||
const char *value /*!< [in] Value of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5GetNumFileAttribs (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
@@ -25,24 +162,26 @@ H5GetNumStepAttribs (
|
||||
h5_int64_t
|
||||
H5GetFileAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
infos about */
|
||||
char *attrib_name, /*!< [out] Name of attribute */
|
||||
const h5_int64_t len_of_attrib_name,
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_int64_t *attrib_nelem /*!< [out] Number of elements */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
H5GetStepAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_int64_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 */
|
||||
const h5_int64_t len_of_attrib_name,
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_int64_t *attrib_nelem /*!< [out] Number of elements */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,4 +16,6 @@ H5HasStep (
|
||||
h5_file_t * const f,
|
||||
h5_id_t step
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
#ifndef __H5HUT_H
|
||||
#define __H5HUT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5.h"
|
||||
#include "H5_inquiry.h"
|
||||
#include "H5_attribs.h"
|
||||
#include "H5Part.h"
|
||||
#include "H5Block.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "#ifndef __H5_H"
|
||||
echo "#define __H5_H"
|
||||
echo ""
|
||||
grep -P "(?s)^\w+\n[Hh]5\w+\s*\(.*?\)" $1 | sed 's/ {/;\n/'
|
||||
echo ""
|
||||
echo "#endif"
|
||||
@@ -3,40 +3,42 @@
|
||||
|
||||
#define H5_ATTRIB_FILE 0
|
||||
#define H5_ATTRIB_STEP 1
|
||||
#define H5_ATTRIB_FIELD 2
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
h5_read_attrib (
|
||||
h5_file_t * const f,
|
||||
const char type,
|
||||
const char mode,
|
||||
const char *attrib_name,
|
||||
const hid_t attrib_type,
|
||||
void *attrib_value
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
h5_write_attrib (
|
||||
h5_file_t * const f,
|
||||
const char type,
|
||||
const char mode,
|
||||
const char *attrib_name,
|
||||
const hid_t attrib_type,
|
||||
const void *attrib_value,
|
||||
const hsize_t attrib_nelem
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
h5_get_attrib_info (
|
||||
h5_file_t *const f,
|
||||
const char type,
|
||||
const h5_int64_t attrib_idx,
|
||||
const char mode,
|
||||
const h5_size_t attrib_idx,
|
||||
char *attrib_name,
|
||||
const h5_int64_t len_attrib_name,
|
||||
const h5_size_t len_attrib_name,
|
||||
h5_int64_t *attrib_type,
|
||||
h5_int64_t *attrib_nelem
|
||||
h5_size_t *attrib_nelem
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5_get_num_attribs (
|
||||
h5_file_t *const f,
|
||||
const char type
|
||||
const char mode
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
#include "h5_maps.h"
|
||||
#include "h5_openclose.h"
|
||||
#include "h5_readwrite.h"
|
||||
|
||||
#include "h5u_readwrite.h"
|
||||
#include "h5u_model.h"
|
||||
|
||||
#include "h5b_model.h"
|
||||
#include "h5b_attribs.h"
|
||||
|
||||
#include "h5t_core.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,6 +44,11 @@ h5_get_num_procs (
|
||||
h5_file_t* const f
|
||||
);
|
||||
|
||||
hid_t
|
||||
h5_get_hdf5_file(
|
||||
h5_file_t* const f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
h5_get_num_steps (
|
||||
h5_file_t* const f
|
||||
|
||||
@@ -18,7 +18,7 @@ h5_set_step (
|
||||
const h5_int64_t step /*!< [in] Time-step to set. */
|
||||
);
|
||||
|
||||
hid_t
|
||||
h5_int64_t
|
||||
h5_normalize_h5_type (
|
||||
h5_file_t * const f,
|
||||
hid_t type
|
||||
@@ -39,6 +39,7 @@ h5_has_index (
|
||||
|
||||
h5_err_t
|
||||
h5_normalize_dataset_name (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
char *name2
|
||||
);
|
||||
|
||||
@@ -25,8 +25,11 @@
|
||||
#define H5_FLOAT32_T H5T_NATIVE_FLOAT
|
||||
#define H5_INT64_T H5T_NATIVE_INT64
|
||||
#define H5_INT32_T H5T_NATIVE_INT32
|
||||
#define H5_STRING_T H5T_NATIVE_CHAR
|
||||
#define H5_COMPOUND_T H5T_COMPOUND
|
||||
|
||||
#define H5_VER_STRING "2.0.0"
|
||||
|
||||
extern const char * const H5_O_MODES[];
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef __H5B_ATTRIBS_H
|
||||
#define __H5B_ATTRIBS_H
|
||||
|
||||
h5_err_t
|
||||
h5_write_field_attrib (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const hid_t attrib_type, /*!< IN: attribute type */
|
||||
const void *attrib_value, /*!< IN: attribute value */
|
||||
const h5_int64_t attrib_nelem /*!< IN: number of elements */
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5b_get_num_field_attribs (
|
||||
h5_file_t *const f, /*<! IN: file handle */
|
||||
const char *field_name /*<! IN: field name */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5b_get_field_attrib_info (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_size_t attrib_idx, /*!< IN: attribute index */
|
||||
char *attrib_name, /*!< OUT: attribute name */
|
||||
const h5_size_t len_attrib_name, /*!< IN: buffer size */
|
||||
h5_int64_t *attrib_type, /*!< OUT: attribute type */
|
||||
h5_size_t *attrib_nelem /*!< OUT: number of elements */
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
#ifndef __H5B_MODEL_H
|
||||
#define __H5B_MODEL_H
|
||||
|
||||
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 k_start, /*!< IN: start index of \c k */
|
||||
const h5_size_t k_end /*!< IN: end index of \c k */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5b_3d_set_chunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: size of \c i */
|
||||
const h5_size_t j, /*!< IN: size of \c j */
|
||||
const h5_size_t k /*!< IN: size of \c k */
|
||||
);
|
||||
|
||||
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_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 (
|
||||
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 */
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5b_get_num_fields (
|
||||
h5_file_t *const f /*!< IN: File handle */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5b_get_field_info_by_name (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< OUT: field name */
|
||||
h5_size_t *grid_rank, /*!< OUT: grid rank */
|
||||
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5b_get_field_info (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const h5_size_t idx, /*!< IN: index of field */
|
||||
char *name, /*!< OUT: field name */
|
||||
const h5_size_t len_name, /*!< IN: buffer size */
|
||||
h5_size_t *grid_rank, /*!< OUT: grid rank */
|
||||
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -70,5 +70,12 @@ h5u_set_chunk (
|
||||
const h5_size_t size
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5u_get_chunk (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_size_t *size
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user