Integrated H5Part regression test and fixed numerous errors that it discovered.
Finished integrating H5Block and the Fortran interface (untested). Started adding an H5Block regression test with a few simple tests (all pass). Added automatic detection of stripe information on lustre, and config option to compile against lustre API. Moved buffers for H5Block ghost zone disolving out of the file handle and into the h5b_3d_set_view function. Fixed bug with pointers in the H5Fed file data not being initialized to NULL.
This commit is contained in:
+65
-3
@@ -94,13 +94,13 @@ H5CheckFile (
|
||||
|
||||
Define format of the step names.
|
||||
|
||||
Example: ==H5FedDefineStepNameFormat( f, "Step", 6 )== defines step names
|
||||
Example: ==H5SetStepNameFormat( f, "Step", 6 )== defines step names
|
||||
like ==Step#000042==.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5DefineStepNameFormat (
|
||||
H5SetStepNameFormat (
|
||||
h5_file_t* const f, /*!< Handle to file */
|
||||
const char* name, /*!< Prefix */
|
||||
const h5_int64_t width /*!< Width of the number */
|
||||
@@ -140,7 +140,7 @@ H5GetStepNameFormat (
|
||||
h5_err_t
|
||||
H5SetStep (
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t step /*!< [in] Step to set. */
|
||||
const h5_id_t step /*!< [in] Step to set. */
|
||||
) {
|
||||
|
||||
SET_FNAME (f, __func__);
|
||||
@@ -163,6 +163,68 @@ H5GetStep (
|
||||
return h5_get_step (f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Get the number of processors.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of processors.
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
int
|
||||
H5GetNumProcs (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
SET_FNAME (f, __func__);
|
||||
return h5_get_num_procs(f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_c_api_read
|
||||
|
||||
Get the number of time-steps that are currently stored in the file
|
||||
\c f.
|
||||
|
||||
It works for both reading and writing of files, but is probably
|
||||
only typically used when you are reading.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return number of time-steps or error code
|
||||
*/
|
||||
h5_size_t
|
||||
H5GetNumSteps (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
|
||||
SET_FNAME (f, __func__);
|
||||
|
||||
return h5_get_num_steps(f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Query whether a particular step already exists in the file.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] stepno Step number to query for existence
|
||||
|
||||
\return true or false
|
||||
*/
|
||||
h5_err_t
|
||||
H5HasStep (
|
||||
h5_file_t* const f,
|
||||
h5_id_t stepno
|
||||
) {
|
||||
|
||||
SET_FNAME (f, __func__);
|
||||
|
||||
return h5_has_step (f, stepno);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_c_api_general
|
||||
|
||||
|
||||
+13
-9
@@ -226,6 +226,9 @@ H5BlockGetNumFields (
|
||||
Get the name, rank and dimensions of the field specified by the
|
||||
index \c idx.
|
||||
|
||||
\c elem_rank reports the rank of the elements in the field
|
||||
(e.g. scalar or vector).
|
||||
|
||||
This function can be used to retrieve all fields bound to the
|
||||
current time-step by looping from \c 0 to the number of fields
|
||||
minus one. The number of fields bound to the current time-step
|
||||
@@ -239,22 +242,23 @@ H5BlockGetFieldInfo (
|
||||
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_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5b_get_field_info (
|
||||
f, idx, name, len_name, grid_rank, grid_dims, field_rank, type);
|
||||
return h5b_get_field_info (f,
|
||||
idx, name, len_name, field_rank, field_dims, elem_rank, type);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Get the rank and dimensions of the field specified by its name.
|
||||
See \ref H5BlockGetFieldInfo.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
@@ -262,16 +266,16 @@ h5_err_t
|
||||
H5BlockGetFieldInfoByName (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: 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_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
return h5b_get_field_info_by_name (
|
||||
f, name, grid_rank, grid_dims, field_rank, type );
|
||||
return h5b_get_field_info_by_name (f,
|
||||
name, field_rank, field_dims, elem_rank, type );
|
||||
}
|
||||
|
||||
/********************** reading and writing attribute ************************/
|
||||
|
||||
+38
-44
@@ -109,12 +109,12 @@ 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_int64_t nparticles /*!< [in] Number of particles */
|
||||
h5_size_t nparticles /*!< [in] Number of particles */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
h5_int64_t stride = 1;
|
||||
h5_size_t stride = 1;
|
||||
return h5u_set_num_particles( f, nparticles, stride );
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ H5PartSetNumParticles (
|
||||
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) */
|
||||
h5_size_t nparticles, /*!< [in] Number of particles */
|
||||
h5_size_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
@@ -171,9 +171,9 @@ H5PartSetNumParticlesStrided (
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetChunkSize (
|
||||
H5PartSetChunk (
|
||||
h5_file_t *f,
|
||||
h5_int64_t size
|
||||
h5_size_t size
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
@@ -437,15 +437,13 @@ H5PartReadDataInt32 (
|
||||
\return number of datasets in current timestep or error code
|
||||
*/
|
||||
|
||||
h5_int64_t
|
||||
h5_ssize_t
|
||||
H5PartGetNumDatasets (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
CHECK_FILEHANDLE( f );
|
||||
|
||||
return h5u_get_num_datasets(f);
|
||||
}
|
||||
|
||||
@@ -459,19 +457,16 @@ H5PartGetNumDatasets (
|
||||
|
||||
\result \c H5_SUCCESS
|
||||
*/
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartGetDatasetName (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t idx, /*!< [in] Index of the dataset */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
char *name, /*!< [out] Name of dataset */
|
||||
const h5_int64_t len /*!< [in] Size of buffer \c name */
|
||||
const h5_size_t len /*!< [in] Size of buffer \c name */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
CHECK_FILEHANDLE ( f );
|
||||
//CHECK_TIMEGROUP ( f );
|
||||
|
||||
return h5u_get_dataset_info(f, idx, name, len, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -481,54 +476,53 @@ H5PartGetDatasetName (
|
||||
Gets the name, type and number of elements of a dataset based on its
|
||||
index in the current timestep.
|
||||
|
||||
Type is one of the following macros:
|
||||
Type is one of the following values:
|
||||
|
||||
- \c h5_float64 (for \c h5part_float64_t)
|
||||
- \c h5_float32 (for \c h5part_float32_t)
|
||||
- \c h5_int64 (for \c h5part_int64_t)
|
||||
- \c h5_int32 (for \c h5part_int32_t)
|
||||
- \c H5PART_CHAR (for \c char)
|
||||
- \c H5PART_STRING (for \c char*)
|
||||
- \c H5_FLOAT64_T (for \c h5_float64_t)
|
||||
- \c H5_FLOAT32_T (for \c h5_float32_t)
|
||||
- \c H5_INT64_T (for \c h5_int64_t)
|
||||
- \c H5_INT32_T (for \c h5_int32_t)
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartGetDatasetInfo (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_int64_t idx,/*!< [in] Index of the dataset */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
char *dataset_name, /*!< [out] Name of dataset */
|
||||
const h5_int64_t len_dataset_name,
|
||||
const h5_size_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_size_t *nelem /*!< [out] Number of elements. */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
CHECK_FILEHANDLE ( f );
|
||||
//CHECK_TIMEGROUP ( f );
|
||||
|
||||
return h5u_get_dataset_info(f, idx, dataset_name, len_dataset_name, type, nelem);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
This function returns the number of particles in the first dataset of
|
||||
the current timestep (or in the first timestep if none has been set).
|
||||
This function returns the number of particles in this processor's view,
|
||||
if a view has been set.
|
||||
|
||||
If you have neither set the number of particles (read or write)
|
||||
nor set a view (read-only), then this returns the total number of
|
||||
elements on disk of the first dataset if is exists. Otherwise,
|
||||
it returns 0.
|
||||
If not, it returns the total number of particles across all processors
|
||||
from the last \ref H5PartSetNumParticles call.
|
||||
|
||||
If you have set a view, this return the number of particles
|
||||
in the view.
|
||||
If you have neither set the number of particles
|
||||
nor set a view, then this returns the total number of
|
||||
particles in the first data set of the current time step.
|
||||
Note that H5Part assumes that all data sets within a given time step
|
||||
have the same number of particles (although the number particles can
|
||||
vary across time steps).
|
||||
|
||||
If none of these conditions are met, an error is thrown.
|
||||
|
||||
\return number of particles in current timestep or an error
|
||||
code.
|
||||
*/
|
||||
h5_int64_t
|
||||
h5_ssize_t
|
||||
H5PartGetNumParticles (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
@@ -556,7 +550,7 @@ H5PartResetView (
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
*/
|
||||
h5_int64_t
|
||||
h5_err_t
|
||||
H5PartHasView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
@@ -569,15 +563,15 @@ H5PartHasView (
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
For parallel I/O or for subsetting operations on the datafile, the
|
||||
\c H5PartSetView() function allows you to define a subset of the total
|
||||
For parallel I/O or for subsetting operations on the datafile,
|
||||
this function allows you to define a subset of the total
|
||||
particle dataset to operate on.
|
||||
The concept of "view" works for both serial
|
||||
and for parallel I/O. The "view" will remain in effect until a new view
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetView(file,-1,-1);
|
||||
|
||||
Before you set a view, the \c H5PartGetNumParticles() will return the
|
||||
Before you set a view, \ref H5PartGetNumParticles will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
particles contained in the view.
|
||||
@@ -620,8 +614,8 @@ H5PartSetView (
|
||||
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 */
|
||||
const h5_id_t *indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
) {
|
||||
|
||||
SET_FNAME( f, __func__ );
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ H5WriteStepAttribFloat64 (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems );
|
||||
}
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5f_c_api
|
||||
\defgroup h5_inquiry
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Get the number of compute nodes.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of compute notes.
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
int
|
||||
H5GetNumNodes (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
SET_FNAME (f, __func__);
|
||||
CHECK_FILEHANDLE (f);
|
||||
return h5_get_num_procs(f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_c_api_read
|
||||
|
||||
Get the number of time-steps that are currently stored in the file
|
||||
\c f.
|
||||
|
||||
It works for both reading and writing of files, but is probably
|
||||
only typically used when you are reading.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return number of time-steps or error code
|
||||
*/
|
||||
h5_size_t
|
||||
H5GetNumSteps (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
|
||||
SET_FNAME (f, __func__);
|
||||
CHECK_FILEHANDLE (f);
|
||||
|
||||
return h5_get_num_steps(f);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Query whether a particular step already exists in the file.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] stepno Step number to query for existence
|
||||
|
||||
\return true or false
|
||||
*/
|
||||
h5_err_t
|
||||
H5HasStep (
|
||||
h5_file_t* const f,
|
||||
h5_id_t stepno
|
||||
) {
|
||||
|
||||
SET_FNAME (f, __func__);
|
||||
CHECK_FILEHANDLE (f);
|
||||
|
||||
return h5_has_step (f, stepno);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ EXTRA_LIBRARIES = libH5hutC.a
|
||||
include_HEADERS = \
|
||||
../include/H5hut.h \
|
||||
../include/H5.h \
|
||||
../include/H5_inquiry.h \
|
||||
../include/H5_attribs.h \
|
||||
../include/H5Part.h \
|
||||
../include/H5Block.h \
|
||||
@@ -35,7 +34,6 @@ EXTRA_HEADERS =
|
||||
libH5hutC_a_SOURCES = \
|
||||
H5.c \
|
||||
H5_attribs.c \
|
||||
H5_inquiry.c \
|
||||
H5Part.c \
|
||||
H5Block.c \
|
||||
H5Block_readwrite.c \
|
||||
|
||||
@@ -14,6 +14,8 @@ h_tail = """
|
||||
"""
|
||||
|
||||
fc_head = """
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user