This commit is contained in:
2009-04-16 15:22:00 +00:00
parent 035ef4655c
commit 90b075b911
10 changed files with 124 additions and 132 deletions
+1 -4
View File
@@ -36,11 +36,11 @@
\defgroup h5_c_api_general
*/
#include <stdarg.h>
#include <hdf5.h>
#include "h5_core/h5_core.h"
#include "h5_core/h5_core_private.h"
#include "H5.h"
/****** General routines *****************************************************/
@@ -52,9 +52,6 @@
\return File handle.
\return NULL on error.
\note
File is always opened in read/writer mode!
*/
h5_file_t *
H5OpenFile (
+4 -1
View File
@@ -16,15 +16,18 @@
#ifndef __H5_H
#define __H5_H
#include "H5_inquiry.h"
h5_file_t *
H5OpenFile (
const char * filename,
const h5_int32_t oflag,
const MPI_Comm comm
);
h5_err_t
H5CloseFile (
h5_file_t * fh
h5_file_t * f
);
h5_err_t
+4 -2
View File
@@ -107,11 +107,12 @@ _normalize_partition (
\return H5_SUCCESS or error code
*/
#ifdef PARALLEL_IO
jfsdjk fjksdhf jkdsfjksdhfjkds kjf
static h5_err_t
_allgather (
const h5_file *f /*!< IN: file handle */
h5_file_t * const f /*!< IN: file handle */
) {
struct h5b_partition *partition = &f->block->user_layout[f->myproc];
struct h5b_partition *partition = &f->b->user_layout[f->myproc];
struct h5b_partition *layout = f->b->user_layout;
MPI_Datatype partition_m;
@@ -122,6 +123,7 @@ _allgather (
mpi_err = MPI_Type_commit ( &partition_m );
if ( mpi_err != MPI_SUCCESS ) return H5_ERR_MPI;
TRY ( _h5_mpi_allgather (
f,
partition,
1,
partition_m,
-5
View File
@@ -55,11 +55,6 @@ H5FedGetLevel (
h5_file_t * f
);
h5_size_t
H5GetNumNodes (
h5_file_t * f
);
h5_size_t
H5FedGetNumVertices (
h5_file_t * f
+37 -15
View File
@@ -57,24 +57,14 @@ H5FedAddLevel (
}
h5_err_t
H5FedAddNumVertices (
h5_file_t * f,
H5FedBeginStoreVertices (
h5_file_t * const f,
const h5_size_t num
) {
SET_FNAME ( f, __func__ );
return h5t_add_num_vertices ( f, num );
return h5t_begin_store_vertices ( f, num );
}
h5_err_t
H5FedAddNumElements (
h5_file_t * f,
const h5_size_t num
) {
SET_FNAME ( f, __func__ );
return h5t_add_num_elems ( f, num );
}
/*!
\ingroup h5fed_c_api
@@ -101,6 +91,22 @@ H5FedStoreVertex (
return h5t_store_vertex ( f, vertex_id, P );
}
h5_err_t
H5FedEndStoreVertices (
h5_file_t * const f
) {
return h5t_end_store_vertices ( f );
}
h5_err_t
H5FedBeginStoreElements (
h5_file_t * f,
const h5_size_t num
) {
SET_FNAME ( f, __func__ );
return h5t_begin_store_elems ( f, num );
}
/*!
\ingroup h5fed_c_api
@@ -131,12 +137,20 @@ H5FedStoreElement (
}
h5_err_t
H5FedRefineNumElements (
H5FedEndStoreElements (
h5_file_t * const f
) {
SET_FNAME ( f, __func__ );
return h5t_end_store_elems ( f );
}
h5_err_t
H5FedBeginRefineElements (
h5_file_t * const f,
const h5_size_t num
) {
SET_FNAME ( f, __func__ );
return h5t_refine_num_elems ( f, num );
return h5t_begin_refine_elems ( f, num );
}
h5_id_t
@@ -147,3 +161,11 @@ H5FedRefineElement (
SET_FNAME ( f, __func__ );
return h5t_refine_elem ( f, local_eid );
}
h5_err_t
H5FedEndRefineElements (
h5_file_t * const f
) {
SET_FNAME ( f, __func__ );
return H5_SUCCESS;
}
+29 -13
View File
@@ -27,37 +27,48 @@ H5FedAddMesh (
h5_id_t
H5FedAddLevel (
h5_file_t * f
h5_file_t * const f
);
h5_err_t
H5FedAddNumVertices (
h5_file_t * f,
const h5_size_t num
);
h5_err_t
H5FedAddNumElements (
h5_file_t * f,
H5FedBeginStoreVertices (
h5_file_t * const f,
const h5_size_t num
);
h5_id_t
H5FedStoreVertex (
h5_file_t * f,
h5_file_t * const f,
const h5_id_t id,
const h5_float64_t P[3]
);
h5_err_t
H5FedEndStoreVertices (
h5_file_t * const f
);
h5_err_t
H5FedBeginStoreElements (
h5_file_t * const f,
const h5_size_t num
);
h5_id_t
H5FedStoreElement (
h5_file_t * f,
h5_file_t * const f,
const h5_id_t local_vids[]
);
h5_err_t
H5FedRefineNumElements (
h5_file_t * f,
H5FedEndStoreElements (
h5_file_t * const f
);
h5_err_t
H5FedBeginRefineElements (
h5_file_t * const f,
const h5_size_t num
);
@@ -67,4 +78,9 @@ H5FedRefineElement (
const h5_id_t local_eid
);
h5_err_t
H5FedEndRefineElements (
h5_file_t * const f
);
#endif
+1 -57
View File
@@ -613,59 +613,6 @@ H5PartSetStep (
/********************** query file structure *********************************/
/*!
\ingroup h5part_c_api_read
Query whether a particular step already exists in the file
\c f.
It works for both reading and writing of files
\return true or false
*/
h5_int64_t
H5PartHasStep (
h5_file_t *f, /*!< [in] Handle to open file */
h5_int64_t step /*!< [in] Step number to query */
) {
SET_FNAME ( f, __func__ );
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
return h5_get_errno ( f );
return h5_has_step( f, step );
}
/*!
\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.
\return number of time-steps or error code
*/
h5_int64_t
H5PartGetNumSteps (
h5_file_t *f /*!< [in] Handle to open file */
) {
SET_FNAME ( f, __func__ );
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
return h5_get_errno ( f );
return hdf5_get_num_objects_matching_pattern (
f->file,
"/",
H5G_UNKNOWN,
f->prefix_step_name );
}
/*!
\ingroup h5part_c_api_read
@@ -680,9 +627,7 @@ H5PartGetNumDatasets (
) {
SET_FNAME ( f, __func__ );
if ( h5_check_filehandle ( f ) != H5_SUCCESS )
return h5_get_errno ( f );
CHECK_FILEHANDLE ( f );
return hdf5_get_num_objects ( f->file, f->step_name, H5G_DATASET );
}
@@ -960,7 +905,6 @@ H5PartReadDataInt64 (
) {
SET_FNAME ( f, __func__ );
CHECK_FILEHANDLE( f );
return h5u_read_elems ( f, name, array, H5T_NATIVE_INT64 );
+5 -15
View File
@@ -19,16 +19,17 @@
#define __H5Part_H
#include <hdf5.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "h5_core/h5_core.h"
#include "H5.h"
#ifdef PARALLEL_IO
#include <mpi.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
// #define H5PART_SUCCESS H5_SUCCESS
#define H5PART_ERR_NOMEM H5_ERR_NOMEM
#define H5PART_ERR_INVAL H5_ERR_INVAL
@@ -108,17 +109,6 @@ H5PartSetStep (
const h5_int64_t step
);
h5_int64_t
H5PartHasStep (
h5_file_t *f,
const h5_int64_t step
);
h5_int64_t
H5PartGetNumSteps (
h5_file_t *f
);
h5_int64_t
H5PartGetNumDatasets (
h5_file_t *f
+38 -18
View File
@@ -19,39 +19,55 @@
#include <stdarg.h>
#include <hdf5.h>
#include "h5/h5.h"
#include "h5/h5_private.h"
#include "H5Fed.h"
#include "h5_core/h5_core.h"
#include "h5_core/h5_core_private.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.
*/
h5_size_t
H5GetNumNodes (
h5_file_t * f /*!< file handle */
h5_file_t * const f
) {
SET_FNAME ( __func__ );
return (h5_size_t)fh->nprocs;
SET_FNAME ( f, __func__ );
CHECK_FILEHANDLE ( f );
return (h5_size_t)f->nprocs;
}
/*`
\ingroup h5_inquiry
/*!
\ingroup h5part_c_api_read
Get the number of steps that are currently stored in the file.
Get the number of time-steps that are currently stored in the file
\c f.
\return number of steps or error code
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_id_t
h5_size_t
H5GetNumSteps (
h5_file_t * fh /*!< file handle */
h5_file_t * const f
) {
SET_FNAME ( __func__ );
return h5_get_num_steps( fh );
SET_FNAME ( f, __func__ );
CHECK_FILEHANDLE ( f );
return hdf5_get_num_objects_matching_pattern (
f->file,
"/",
H5G_UNKNOWN,
f->prefix_step_name );
}
/*!
@@ -59,17 +75,21 @@ H5GetNumSteps (
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 *f, /*!< [in] Handle to open file */
h5part_int64_t step /*!< [in] Step number to query */
h5_file_t *f,
h5_id_t stepno
) {
SET_FNAME ( __func__ );
SET_FNAME ( f, __func__ );
CHECK_FILEHANDLE ( f );
return h5_has_step( f, step );
return h5_has_step( f, stepno );
}
+5 -2
View File
@@ -43,11 +43,13 @@ EXTRA_LIBRARIES = libH5.a
# Header files that I wish to install in $(prefix)/include
include_HEADERS = \
H5Part.h \
H5.h \
H5Block.h \
H5Fed.h \
H5Fed_boundaries.h \
H5Fed_map.h
H5Fed_map.h \
H5Fed_store.h \
H5Part.h
# Listing of all possible headers that I may include
EXTRA_HEADERS =
@@ -55,6 +57,7 @@ EXTRA_HEADERS =
# Listing of sources
libH5_a_SOURCES = \
H5.c \
H5_inquiry.c \
H5Block.c \
H5Fed.c \
H5Fed_adjacency.c \