Commit ed85fb32 authored by gsell's avatar gsell

changes merged from upstrean

parents 1985a0a2 72365540
2018-09-14 Gsell Achim <achi.gsell@psi.ch>
* C-API
- H5PartSetNumPoints() renamed to H5PartSetNumItems()
- H5PartGetNumPoints() renamed to H5PartGetNumItems()
- Dataset names longer then 64 bytes are handled as error.
- Same for step/iteration names.
* core API
- we use the term 'iteration' instead of 'step'
- we use the term 'item' instead of 'point'
- re-factor function and variable names
- in printing messages/debug output fixed
- do not flush (sync to disk) after writing a dataset by default,
can be controlled by a property
......@@ -7,6 +7,8 @@
License: see file COPYING in top level of source distribution.
*/
#include <stdlib.h>
#include "H5hut.h"
#include "examples.h"
......@@ -15,16 +17,51 @@ const char* fname = "example_setview.h5";
// H5hut verbosity level
const h5_int64_t h5_verbosity = H5_VERBOSE_DEFAULT;
const h5_int64_t h5_debug_mask = 0;
// we are going to write multiple consecutive blocks
const h5_int64_t num_blocks = 4;
const h5_int64_t num_particles_per_block = 32;
//const h5_int64_t num_blocks = 32;
//const h5_int64_t num_particles_per_block = 1048576*8;
int
main (
int argc,
char* argv[]
){
if (argc < 3) {
fprintf (stderr, "Usage: %s <number_of_blocks> <sizeof_block>\n", argv[0]);
exit (1);
}
char* endptr = NULL;
long long n = strtoll (argv[1], &endptr, 10);
if (*endptr != 0) {
fprintf (stderr, "first argument (number of blocks) is not a unsigned integer!\n");
exit (1);
}
if (n < 1) {
fprintf (stderr, "first argument (number of block) must be >= 1!\n");
exit (1);
}
if (n == LLONG_MAX) {
fprintf (stderr, "first argument (number of block) to large!\n");
exit (1);
}
h5_int64_t num_blocks = (h5_int64_t)n;
n = strtoll (argv[2], &endptr, 10);
if (*endptr != 0) {
fprintf (stderr, "second argument (sizeof blocks) is not a unsigned integer!\n");
exit (1);
}
if (n < 1024) {
fprintf (stderr, "second argument (sizeof block) must be >= 1024!\n");
exit (1);
}
if (n == LLONG_MAX) {
fprintf (stderr, "second argument (sizeof block) to large!\n");
exit (1);
}
h5_int64_t num_particles_per_block = (h5_int64_t)n;
// initialize MPI & H5hut
MPI_Init (&argc, &argv);
......@@ -33,9 +70,16 @@ main (
MPI_Comm_rank (comm, &comm_rank);
H5AbortOnError ();
H5SetVerbosityLevel (h5_verbosity);
H5SetDebugMask (h5_debug_mask);
h5_prop_t prop = H5CreateFileProp ();
H5SetPropFileAlign (prop, 1048576*8);
H5SetPropFileMPIOIndependent (prop, &comm);
//H5SetPropFileMPIOCollective (prop, &comm);
// open file and create first step
h5_file_t file = H5OpenFile (fname, H5_O_WRONLY, H5_PROP_DEFAULT);
h5_file_t file = H5OpenFile (fname, H5_O_WRONLY, prop);
//H5PartSetChunkSize (file, 1048576*1);
H5SetStep (file, 0);
/*
......@@ -52,7 +96,9 @@ main (
// write multiple consecutive blocks
for (int i = 0; i < num_blocks; i++) {
// create fake data
h5_int32_t data[num_particles_per_block];
//h5_int32_t data[num_particles_per_block];
h5_int64_t *data;
data = calloc (num_particles_per_block, sizeof(*data));
for (int j = 0; j < num_particles_per_block; j++) {
data[j] = j + i*num_particles_per_block + offset;
}
......@@ -63,7 +109,7 @@ main (
offset + i*num_particles_per_block,
offset + (i+1)*num_particles_per_block - 1);
// write data
H5PartWriteDataInt32 (file, "data", data);
H5PartWriteDataInt64 (file, "data", data);
}
// done
......
/*
Copyright (c) 2006-2015, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of any
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
Institut (Switzerland). All rights reserved.
License: see file COPYING in top level of source distribution.
*/
#include <stdlib.h>
#include <mpi.h>
#include "H5hut.h"
#include "examples.h"
// name of output file
const char* fname = "example_setview.h5";
// H5hut verbosity level
const h5_int64_t h5_verbosity = H5_VERBOSE_DEFAULT;
const h5_int64_t h5_debug_mask = 0;
// we are going to write multiple consecutive blocks
//const h5_int64_t num_blocks = 32;
//const h5_int64_t num_particles_per_block = 1048576*8;
int
main (
int argc,
char* argv[]
){
if (argc < 3) {
fprintf (stderr, "Usage: %s <number_of_blocks> <sizeof_block>\n", argv[0]);
exit (1);
}
char* endptr = NULL;
long long n = strtoll (argv[1], &endptr, 10);
if (*endptr != 0) {
fprintf (stderr, "first argument (number of blocks) is not a unsigned integer!\n");
exit (1);
}
if (n < 1) {
fprintf (stderr, "first argument (number of block) must be >= 1!\n");
exit (1);
}
if (n == LLONG_MAX) {
fprintf (stderr, "first argument (number of block) to large!\n");
exit (1);
}
h5_int64_t num_blocks = (h5_int64_t)n;
n = strtoll (argv[2], &endptr, 10);
if (*endptr != 0) {
fprintf (stderr, "second argument (sizeof blocks) is not a unsigned integer!\n");
exit (1);
}
if (n < 1024) {
fprintf (stderr, "second argument (sizeof block) must be >= 1024!\n");
exit (1);
}
if (n == LLONG_MAX) {
fprintf (stderr, "second argument (sizeof block) to large!\n");
exit (1);
}
h5_int64_t num_particles_per_block = (h5_int64_t)n;
// initialize MPI & H5hut
MPI_Init (&argc, &argv);
MPI_Comm comm = MPI_COMM_WORLD;
int comm_rank = 0;
MPI_Comm_rank (comm, &comm_rank);
H5AbortOnError ();
H5SetVerbosityLevel (h5_verbosity);
H5SetDebugMask (h5_debug_mask);
h5_prop_t prop = H5CreateFileProp ();
H5SetPropFileAlign (prop, 1048576*8);
H5SetPropFileMPIOIndependent (prop, &comm);
//H5SetPropFileMPIOCollective (prop, &comm);
// open file and create first step
h5_file_t file = H5OpenFile (fname, H5_O_WRONLY, prop);
//H5PartSetChunkSize (file, 1048576*1);
H5SetStep (file, 0);
/*
If we want to write consecutive blocks, the 'view' can be defined
with H5PartSetview(). Otherwise we have to define the total number
of particles with H5PartSetNumParticles().
*/
const h5_int64_t offset = comm_rank * num_blocks * num_particles_per_block;
H5PartSetView (
file,
offset,
offset + num_blocks*num_particles_per_block -1);
dataset_id = H5PartCreateDataSet (file, "data");
// write multiple consecutive blocks
for (int i = 0; i < num_blocks; i++) {
// create fake data
//h5_int32_t data[num_particles_per_block];
h5_int64_t *data;
data = calloc (num_particles_per_block, sizeof(*data));
for (int j = 0; j < num_particles_per_block; j++) {
data[j] = j + i*num_particles_per_block + offset;
}
// set the "view" to select a subset of the dataset
H5PartSetViewOnDataset (
file,
offset + i*num_particles_per_block,
offset + (i+1)*num_particles_per_block - 1);
// write data
H5PartWriteDatasetInt64 (dataset_id, data);
}
H5CloseDataset (dataset_id);
// done
H5CloseFile(file);
MPI_Finalize();
return 0;
}
......@@ -222,7 +222,7 @@ h5_flushstep (
) {
h5_file_t fh = h5_filehandlefor2c(f);
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
H5_API_RETURN (h5_flush_step (fh));
H5_API_RETURN (h5_flush_iteration (fh));
}
#define h5_finalize FC_MANGLING( \
......
......@@ -28,7 +28,7 @@ h5pt_writedata_r8 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_write_data (
h5_int64_t herr = h5u_write_dataset (
f, name2, (void*)data, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -49,7 +49,7 @@ h5pt_writedata_r4 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_write_data (
h5_int64_t herr = h5u_write_dataset (
f, name2, (void*)data, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -70,7 +70,7 @@ h5pt_writedata_i8 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_write_data (
h5_int64_t herr = h5u_write_dataset (
f, name2, (void*)data, H5_INT64_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -91,7 +91,7 @@ h5pt_writedata_i4 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_write_data (
h5_int64_t herr = h5u_write_dataset (
f, name2, (void*)data, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -114,7 +114,7 @@ h5pt_readdata_r8 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_read_data (
h5_int64_t herr = h5u_read_dataset (
f, name2, data, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -135,7 +135,7 @@ h5pt_readdata_r4 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_read_data (
h5_int64_t herr = h5u_read_dataset (
f, name2, data, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN(herr);
......@@ -156,7 +156,7 @@ h5pt_readdata_i8 (
"fh=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_read_data (
h5_int64_t herr = h5u_read_dataset (
f, name2, data, H5_INT64_T );
free ( name2 );
......@@ -178,7 +178,7 @@ h5pt_readdata_i4 (
"hf=%p, name='%s', data=%p, l_name=%d",
(h5_file_p)f, name, data, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5u_read_data (
h5_int64_t herr = h5u_read_dataset (
f, name2, data, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
......
......@@ -22,13 +22,13 @@
h5_int64_t
h5pt_setnpoints (
const h5_int64_t* const fh,
const h5_int64_t* const npoints
const h5_int64_t* const num_items
) {
h5_file_t f = h5_filehandlefor2c (fh);
H5_API_ENTER (h5_int64_t,
"fh=%p, npoints=%lld",
(h5_file_p)f, (long long)*npoints);
H5_API_RETURN (h5u_set_num_points (f, *npoints, 1));
(h5_file_p)f, (long long)*num_items);
H5_API_RETURN (h5u_set_num_items (f, *num_items, 1));
}
#define h5pt_setnpoints_strided FC_MANGLING ( \
......@@ -37,14 +37,14 @@ h5pt_setnpoints (
h5_int64_t
h5pt_setnpoints_strided (
const h5_int64_t* const fh,
const h5_int64_t* const npoints,
const h5_int64_t* const num_items,
const h5_int64_t* const stride
) {
h5_file_t f = h5_filehandlefor2c (fh);
H5_API_ENTER (h5_int64_t,
"fh=%p, npoints=%lld, stride=%lld",
(h5_file_p)f, (long long)*npoints, (long long)*stride);
H5_API_RETURN (h5u_set_num_points (f, *npoints, *stride));
(h5_file_p)f, (long long)*num_items, (long long)*stride);
H5_API_RETURN (h5u_set_num_items (f, *num_items, *stride));
}
......@@ -172,7 +172,7 @@ h5pt_getnpoints (
) {
h5_file_t f = h5_filehandlefor2c (fh);
H5_API_ENTER (h5_int64_t, "fh=%p", (h5_file_p)f);
H5_API_RETURN (h5u_get_num_points (f));
H5_API_RETURN (h5u_get_num_items (f));
}
#define h5pt_getdatasetname FC_MANGLING ( \
......
......@@ -380,7 +380,7 @@ h5_getnstepattribs (
H5_API_ENTER (h5_int64_t,
"fh=%p",
(h5_file_p)f);
H5_API_RETURN (h5_get_num_step_attribs (f));
H5_API_RETURN (h5_get_num_iteration_attribs (f));
}
#define h5_getstepattribinfo FC_MANGLING( \
......@@ -405,7 +405,7 @@ h5_getstepattribinfo (
(h5_file_p)f,
(long long)*attrib_idx,
attrib_name, attrib_type, attrib_nelem);
h5_int64_t h5err = h5_get_step_attrib_info_by_idx (
h5_int64_t h5err = h5_get_iteration_attrib_info_by_idx (
f,
*attrib_idx - 1,
attrib_name, l_attrib_name,
......@@ -435,7 +435,7 @@ h5_getstepattribinfo_by_name (
(h5_file_p)fh,
l_name, _name, _type, _nelem);
char* name = h5_strdupfor2c (_name, l_name);
h5_int64_t h5err = h5_get_step_attrib_info_by_name (
h5_int64_t h5err = h5_get_iteration_attrib_info_by_name (
f,
name,
_type,
......@@ -459,7 +459,7 @@ h5_getstepattribinfo_by_name (
*/
static inline h5_int64_t
write_step_attrib (
write_iteration_attrib (
const h5_file_t fh,
const char* name,
const int l_name,
......@@ -468,13 +468,14 @@ write_step_attrib (
const hsize_t l_buffer
) {
char *name2 = h5_strdupfor2c (name, l_name);
h5_int64_t herr = h5_write_step_attrib (fh, name2, type, buffer, l_buffer );
h5_int64_t herr = h5_write_iteration_attrib (
fh, name2, type, buffer, l_buffer );
free (name2);
return herr;
}
static inline h5_int64_t
read_step_attrib (
read_iteration_attrib (
const h5_file_t fh,
const char* name,
const int l_name,
......@@ -482,7 +483,7 @@ read_step_attrib (
void* const buffer
) {
char* name2 = h5_strdupfor2c ( name, l_name );
h5_int64_t herr = h5_read_step_attrib (fh, name2, type, buffer);
h5_int64_t herr = h5_read_iteration_attrib (fh, name2, type, buffer);
free (name2);
return herr;
}
......@@ -503,7 +504,7 @@ h5_writestepattrib_string (
"f=%p, name='%.*s', buffer='%.*s'",
(h5_file_p)f, l_name, name, l_buffer, buffer);
char *buffer2 = h5_strdupfor2c (buffer, l_buffer);
h5_int64_t herr = write_step_attrib (
h5_int64_t herr = write_iteration_attrib (
f, name, l_name, H5_STRING_T, buffer2, strlen(buffer2)+1 );
free (buffer2);
H5_API_RETURN (herr);
......@@ -524,7 +525,8 @@ h5_readstepattrib_string (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer='%.*s'",
(h5_file_p)f, l_name, name, l_buffer, buffer);
h5_int64_t herr = read_step_attrib (f, name, l_name, H5_STRING_T, buffer);
h5_int64_t herr = read_iteration_attrib (
f, name, l_name, H5_STRING_T, buffer);
h5_strc2for (buffer, l_buffer);
H5_API_RETURN (herr);
}
......@@ -544,7 +546,7 @@ h5_writestepattrib_r8 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
H5_API_RETURN (write_step_attrib(
H5_API_RETURN (write_iteration_attrib(
f,
name, l_name,
H5_FLOAT64_T,
......@@ -565,7 +567,7 @@ h5_readstepattrib_r8 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p",
(h5_file_p)f, l_name, name, buffer);
H5_API_RETURN (read_step_attrib(
H5_API_RETURN (read_iteration_attrib(
f,
name, l_name,
H5_FLOAT64_T,
......@@ -587,7 +589,7 @@ h5_writestepattrib_r4 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
H5_API_RETURN (write_step_attrib(
H5_API_RETURN (write_iteration_attrib(
f,
name, l_name,
H5_FLOAT32_T,
......@@ -608,7 +610,7 @@ h5_readstepattrib_r4 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p",
(h5_file_p)f, l_name, name, buffer);
H5_API_RETURN (read_step_attrib(
H5_API_RETURN (read_iteration_attrib(
f,
name, l_name,
H5_FLOAT32_T,
......@@ -630,7 +632,7 @@ h5_writestepattrib_i8 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
H5_API_RETURN (write_step_attrib(
H5_API_RETURN (write_iteration_attrib(
f,
name, l_name,
H5_INT64_T,
......@@ -651,7 +653,7 @@ h5_readstepattrib_i8 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p",
(h5_file_p)f, l_name, name, buffer);
H5_API_RETURN (read_step_attrib(
H5_API_RETURN (read_iteration_attrib(
f,
name, l_name,
H5_INT64_T,
......@@ -673,7 +675,7 @@ h5_writestepattrib_i4 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
H5_API_RETURN (write_step_attrib(
H5_API_RETURN (write_iteration_attrib(
f,
name, l_name,
H5_INT32_T,
......@@ -694,7 +696,7 @@ h5_readstepattrib_i4 (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer=%p",
(h5_file_p)f, l_name, name, buffer);
H5_API_RETURN (read_step_attrib(
H5_API_RETURN (read_iteration_attrib(
f,
name, l_name,
H5_INT32_T,
......
......@@ -28,7 +28,7 @@ h5_hasstep (
int,
"f=%p, stepno=%lld",
(h5_file_p)fh, (long long int)step);
H5_API_RETURN (h5_has_step (fh, (*step)-1));
H5_API_RETURN (h5_has_iteration (fh, (*step)-1));
}
#define h5_setstep FC_MANGLING( \
......@@ -41,7 +41,7 @@ h5_setstep (
h5_file_t fh = h5_filehandlefor2c(f);
H5_API_ENTER (h5_int64_t, "f=%p, step=%lld", (h5_file_p)fh, (long long)*step);
H5_API_RETURN (h5_set_step (fh, (*step)-1));
H5_API_RETURN (h5_set_iteration (fh, (*step)-1));
}
#define h5_getstep FC_MANGLING( \
......@@ -54,7 +54,7 @@ h5_getstep (
h5_file_t fh = h5_filehandlefor2c(f);
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
H5_API_RETURN (h5_get_step (fh) + 1);
H5_API_RETURN (h5_get_iteration (fh) + 1);
}
#define h5_getnsteps FC_MANGLING( \
......@@ -67,5 +67,5 @@ h5_getnsteps (
h5_file_t fh = h5_filehandlefor2c(f);
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
H5_API_RETURN (h5_get_num_steps (fh));
H5_API_RETURN (h5_get_num_iterations (fh));
}
......@@ -31,7 +31,7 @@ h5_has_file_attrib (
}
h5_err_t
h5_has_step_attrib (
h5_has_iteration_attrib (
const h5_file_t f_,
const char* const attrib_name
) {
......@@ -41,9 +41,8 @@ h5_has_step_attrib (
"attrib_name='%s'",
f,
attrib_name);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
TRY (ret_value = hdf5_attribute_exists (f->step_gid, attrib_name));
check_iteration_handle_is_valid (f);
TRY (ret_value = hdf5_attribute_exists (f->iteration_gid, attrib_name));
H5_RETURN (ret_value);
}
......@@ -59,14 +58,13 @@ h5_get_num_file_attribs (
}
h5_ssize_t
h5_get_num_step_attribs (
h5_get_num_iteration_attribs (
const h5_file_t f_ /*!< handle to open file */
) {
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
TRY (ret_value = hdf5_get_num_attribute (f->step_gid));
check_iteration_handle_is_valid (f);
TRY (ret_value = hdf5_get_num_attribute (f->iteration_gid));
H5_RETURN (ret_value);
}
......@@ -122,7 +120,7 @@ h5_get_file_attrib_info_by_name (
}
h5_err_t
h5_get_step_attrib_info_by_idx (
h5_get_iteration_attrib_info_by_idx (
const h5_file_t f_, /*!< handle to open file */
const h5_size_t attrib_idx, /*!< index of attribute */
char* attrib_name, /*!< OUT: name of attribute */
......@@ -140,10 +138,9 @@ h5_get_step_attrib_info_by_idx (
(long long unsigned)attrib_idx,
attrib_name, (long long unsigned)len_attrib_name,
attrib_type, attrib_nelem);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
check_iteration_handle_is_valid (f);
TRY (ret_value = h5priv_get_attrib_info_by_idx (
f->step_gid,
f->iteration_gid,
attrib_idx,
attrib_name, len_attrib_name,
attrib_type, attrib_nelem));
......@@ -151,7 +148,7 @@ h5_get_step_attrib_info_by_idx (
}
h5_err_t
h5_get_step_attrib_info_by_name (
h5_get_iteration_attrib_info_by_name (
const h5_file_t f_, /*!< handle to open file */
const char* const attrib_name, /*!< OUT: name of attribute */
h5_int64_t* const attrib_type, /*!< OUT: H5 type of attribute */
......@@ -165,10 +162,9 @@ h5_get_step_attrib_info_by_name (
f,
attrib_name,
attrib_type, attrib_nelem);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
check_iteration_handle_is_valid (f);
TRY (ret_value = h5priv_get_attrib_info_by_name (
f->step_gid,
f->iteration_gid,
attrib_name,
attrib_type, attrib_nelem));
H5_RETURN (ret_value);
......@@ -199,7 +195,7 @@ h5_read_file_attrib (
}
h5_err_t
h5_read_step_attrib (
h5_read_iteration_attrib (
const h5_file_t f_,
const char* const attrib_name,
const h5_types_t attrib_type,
......@@ -213,12 +209,10 @@ h5_read_step_attrib (
attrib_name,
(long long int)attrib_type,
attrib_value);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
CHECK_READABLE_MODE (f);
check_iteration_is_readable (f);
TRY (ret_value = h5priv_read_attrib (
f->step_gid,
f->iteration_gid,
attrib_name,
attrib_type,
attrib_value));
......@@ -263,7 +257,7 @@ h5_write_file_attrib (
}
h5_err_t
h5_write_step_attrib (
h5_write_iteration_attrib (
const h5_file_t f_,
const char* const attrib_name,
const h5_types_t attrib_type,
......@@ -279,19 +273,17 @@ h5_write_step_attrib (
(long long int)attrib_type,
attrib_value,
(long long)attrib_nelem);
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
CHECK_WRITABLE_MODE (f);
check_iteration_is_writable (f);
if (is_appendonly (f)) {
TRY (h5priv_append_attrib (
f->step_gid,
f->iteration_gid,
attrib_name,
attrib_type,
attrib_value,
attrib_nelem));
} else {
TRY (h5priv_write_attrib (
f->step_gid,
f->iteration_gid,
attrib_name,
attrib_type,
attrib_value,
......
......@@ -103,7 +103,7 @@ h5_verror (
const char* const fmt,
va_list ap
) {
if (h5_log_level == 0) return;
if (__h5_log_level == 0) return;
char fmt2[2048];
snprintf (fmt2,
sizeof(fmt2), "[proc %d] E: %s: %s\n",
......@@ -127,7 +127,7 @@ h5_report_errorhandler (
const char* const fmt,
va_list ap
) {
if (h5_log_level > 0) {
if (__h5_log_level > 0) {
h5_verror (fmt, ap);
}
return h5_errno;
......@@ -144,7 +144,7 @@ h5_abort_errorhandler (
const char* const fmt,
va_list ap
) {
if (h5_log_level > 0) {
if (__h5_log_level > 0) {
h5_verror (fmt, ap);
}
#ifdef H5_HAVE_PARALLEL
......
This diff is collapsed.
......@@ -13,8 +13,8 @@
extern int h5_myproc;
h5_int64_t h5_log_level = H5_VERBOSE_ERROR;
h5_int64_t h5_debug_mask = 0;
h5_int64_t __h5_log_level = H5_VERBOSE_ERROR;
h5_int64_t __h5_debug_mask = 0;
struct call_stack h5_call_stack;
......@@ -65,7 +65,7 @@ h5_err_t
h5_set_loglevel (
const h5_int64_t level /*!< log level */
) {
h5_log_level = level & 0x7;
__h5_log_level = level & 0x7;
return H5_SUCCESS;
}
......@@ -73,8 +73,7 @@ h5_err_t
h5_set_debug_mask (
const h5_int64_t mask /*!< debug level */
) {
h5_log_level = H5_VERBOSE_DEBUG;
h5_debug_mask = mask;