* 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
This commit is contained in:
+1
-1
@@ -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 ( \
|
||||
|
||||
+19
-17
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user