refactoring

This commit is contained in:
2008-06-19 15:04:07 +00:00
parent f671df975d
commit dddb0f8c2b
2 changed files with 29 additions and 29 deletions
+16 -16
View File
@@ -33,15 +33,15 @@ _open_group (
parent_gid, grpname, 1, NULL );
if ( herr >= 0 ) {
H5_info (
h5_info (
"Opening group %s/%s.",
H5_get_objname(parent_gid),
h5_get_objname(parent_gid),
grpname );
gid = H5Gopen ( parent_gid, grpname );
} else {
H5_info (
h5_info (
"Creating group %s/%s.",
H5_get_objname(parent_gid),
h5_get_objname(parent_gid),
grpname );
gid = H5Gcreate ( parent_gid, grpname, 0 );
}
@@ -124,7 +124,7 @@ _write_obj (
);
if ( sid < 0 ) return HANDLE_H5S_CREATE_SIMPLE_ERR ( 1 );
h5_err_t h5err = (h5_err_t)H5_write_data (
h5_err_t h5err = (h5_err_t)h5_write_data (
f,
dsname,
object,
@@ -346,7 +346,7 @@ h5_size_t
H5t_get_num_meshes (
h5_file * f
) {
return (h5_size_t)H5_get_num_objects (
return (h5_size_t)h5_get_num_objects (
f->root_gid,
H5T_CONTAINER_GRPNAME,
H5G_GROUP );
@@ -497,7 +497,7 @@ H5t_add_num_vertices (
t->num_vertices[t->cur_level-1] + num : num);
t->num_vertices[t->cur_level] = num_elems;
ssize_t num_bytes = num_elems*sizeof ( t->vertices[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->vertices = realloc ( t->vertices, num_bytes );
if ( t->vertices == NULL ) {
return HANDLE_H5_NOMEM_ERR;
@@ -535,7 +535,7 @@ _read_dataset (
f->xfer_prop,
data );
if ( herr < 0 )
return HANDLE_H5D_READ_ERR ( H5_get_objname ( dataset_id ) );
return HANDLE_H5D_READ_ERR ( h5_get_objname ( dataset_id ) );
if ( file_space_id != H5S_ALL ) {
herr = H5Sclose ( file_space_id );
@@ -591,7 +591,7 @@ _read_num_vertices (
if ( h5err < 0 ) return h5err;
}
ssize_t num_bytes = t->num_levels*sizeof ( t->num_vertices[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->num_vertices = realloc ( t->num_vertices, num_bytes );
if ( t->num_vertices == NULL )
return HANDLE_H5_NOMEM_ERR;
@@ -630,7 +630,7 @@ _read_vertices (
ssize_t num_elems = t->num_vertices[t->num_levels-1];
ssize_t num_bytes = num_elems*sizeof ( t->vertices[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->vertices = realloc ( t->vertices, num_bytes );
if ( t->vertices == NULL )
return HANDLE_H5_NOMEM_ERR;
@@ -729,7 +729,7 @@ H5t_get_vertex (
if ( h5err < 0 ) return h5err;
}
if ( t->last_retrieved_vertex_id+1 >= t->num_vertices[t->cur_level] ) {
H5_warn ( "Trying to read more tets than available!" );
h5_warn ( "Trying to read more tets than available!" );
return -1;
}
h5_vertex *vertex = &t->vertices[++t->last_retrieved_vertex_id];
@@ -754,7 +754,7 @@ H5t_add_num_tets (
num + t->num_tets_on_level[t->cur_level-1] : num;
ssize_t num_bytes = num_tets*sizeof ( t->tets[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->tets = realloc ( t->tets, num_bytes );
if ( t->tets == NULL ) {
return H5_ERR_NOMEM;
@@ -852,7 +852,7 @@ _read_num_tets (
if ( h5err < 0 ) return h5err;
}
ssize_t num_bytes = t->num_levels*sizeof ( t->num_tets[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->num_tets = realloc ( t->num_tets, num_bytes );
if ( t->num_tets == NULL )
return HANDLE_H5_NOMEM_ERR;
@@ -885,7 +885,7 @@ _read_num_tets_on_level (
if ( h5err < 0 ) return h5err;
}
ssize_t num_bytes = t->num_levels*sizeof ( t->num_tets_on_level[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->num_tets_on_level = realloc ( t->num_tets_on_level, num_bytes );
if ( t->num_tets_on_level == NULL )
return HANDLE_H5_NOMEM_ERR;
@@ -940,7 +940,7 @@ _read_tets (
ssize_t num_elems = t->num_tets[t->num_levels-1];
ssize_t num_bytes = num_elems*sizeof ( t->tets[0] );
H5_debug ( "Allocating %ld bytes.", num_bytes );
h5_debug ( "Allocating %ld bytes.", num_bytes );
t->tets = realloc ( t->tets, num_bytes );
if ( t->tets == NULL )
return HANDLE_H5_NOMEM_ERR;
@@ -991,7 +991,7 @@ H5t_get_tet (
if ( h5err < 0 ) return h5err;
}
if ( t->last_retrieved_tet_id+1 >= t->num_tets[t->cur_level] ) {
H5_warn ( "Trying to read more tets than available!" );
h5_warn ( "Trying to read more tets than available!" );
return -1;
}
h5_tetrahedron *tet = &t->tets[++t->last_retrieved_tet_id];
+13 -13
View File
@@ -52,7 +52,7 @@ _get_diskshape_for_reading (
&start, &stride, &count, NULL );
if ( r < 0 ) return (hid_t)HANDLE_H5S_SELECT_HYPERSLAB_ERR;
H5_print_debug (
h5_print_debug (
"Selection: range=%d:%d, npoints=%d s=%d",
(int)f->viewstart,(int)f->viewend,
(int)H5Sget_simple_extent_npoints(space),
@@ -97,7 +97,7 @@ H5U_get_num_elems (
"%s#%0*lld",
f->prefix_step_name, f->width_step_idx, (long long) f->step_idx );
herr = H5_get_object_name (
herr = h5_get_object_name (
f->file,
step_name,
H5G_DATASET,
@@ -145,7 +145,7 @@ H5U_read_elems (
hid_t memspace_id;
if ( f->step_gid < 0 ) {
h5part_int64_t h5err = H5_set_step ( f, f->step_idx );
h5part_int64_t h5err = h5_set_step ( f, f->step_idx );
if ( h5err < 0 ) return h5err;
}
dataset_id = H5Dopen ( f->step_gid, name );
@@ -257,9 +257,9 @@ H5U_set_num_elements (
return HANDLE_MPI_ALLGATHER_ERR;
}
if ( f->myproc == 0 ) {
H5_print_debug ( "Particle offsets:" );
h5_print_debug ( "Particle offsets:" );
for(i=0;i<f->nprocs;i++)
H5_print_debug ( "\tnp=%lld",
h5_print_debug ( "\tnp=%lld",
(long long) f->pnparticles[i] );
}
/* should I create a selection here? */
@@ -301,7 +301,7 @@ H5U_set_num_elements (
if ( r < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
if ( f->step_gid < 0 ) {
r = H5_set_step ( f, 0 );
r = h5_set_step ( f, 0 );
if ( r < 0 ) return r;
}
@@ -321,7 +321,7 @@ H5U_write_data (
CHECK_WRITABLE_MODE( f );
CHECK_TIMEGROUP( f );
return H5_write_data(
return h5_write_data(
f,
name,
array,
@@ -371,7 +371,7 @@ H5U_set_view (
hsize_t stride = 1;
hsize_t dmax = H5S_UNLIMITED;
H5_print_debug (
h5_print_debug (
"Set view (%lld,%lld).",
(long long)start,(long long)end);
@@ -393,13 +393,13 @@ H5U_set_view (
if ( start == -1 ) start = 0;
if ( end == -1 ) end = total;
H5_print_debug ( "Total nparticles=%lld", (long long)total );
h5_print_debug ( "Total nparticles=%lld", (long long)total );
/* so, is this selection inclusive or exclusive?
it appears to be inclusive for both ends of the range.
*/
if ( end < start ) {
H5_print_warn (
h5_print_warn (
"Nonfatal error. "
"End of view (%lld) is less than start (%lld).",
(long long)end, (long long)start );
@@ -485,7 +485,7 @@ H5U_set_canonical_view (
is a 'pnparticles' group that contains the offsets for the
processors.
*/
if ( H5_read_attrib (
if ( h5_read_attrib (
f->step_gid,
"pnparticles", f->pnparticles ) < 0) {
/*
@@ -525,7 +525,7 @@ H5U_get_dataset_info (
h5part_int64_t *nelem /*!< [out] Number of elements. */
) {
h5part_int64_t herr = H5_get_object_name (
h5part_int64_t herr = h5_get_object_name (
f->file,
f->step_name,
H5G_DATASET,
@@ -540,7 +540,7 @@ H5U_get_dataset_info (
}
if ( type ) {
*type = H5_get_dataset_type( f->step_gid, dataset_name );
*type = h5_get_dataset_type( f->step_gid, dataset_name );
if ( *type < 0 ) return *type;
}