diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-05-09 14:53:22 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-05-09 14:53:22 (GMT) |
commit | 1b313aa2f65a5f35de6bf820f08de5045fd3c232 (patch) | |
tree | de7522a948aa2a7734709cca056f91519855a0fb /tools/lib/h5tools.c | |
parent | bbe03d73613afbcdeca14c045c8b90fac37e0fe8 (diff) | |
download | hdf5-1b313aa2f65a5f35de6bf820f08de5045fd3c232.zip hdf5-1b313aa2f65a5f35de6bf820f08de5045fd3c232.tar.gz hdf5-1b313aa2f65a5f35de6bf820f08de5045fd3c232.tar.bz2 |
[svn-r10738] Purpose:
bug fix 366
Description:
the printing of the array indices was done relatively to the stripmine data (data read
by hyperslabs when its memory requiremnts are too large)
this was causing an incorrect numbering of the array indices (the next read would initialize
the indices to zero)
Solution:
added a field to the print context that keeps track of the stripmine position
and pass to the rendering function the total element position
Platforms tested:
Linux
Misc. update:
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3a23059..ddf476d 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -541,6 +541,7 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, size_t ncols = 80; /*available output width */ h5tools_str_t buffer; /*string into which to render */ int multiline; /*datum was multiline */ + hsize_t curr_pos; /* total data element position */ int elmt_counter = 0;/*counts the # elements printed. *I (ptl?) needed something that *isn't going to get reset when a new @@ -659,7 +660,12 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, if (secnum) multiline++; - h5tools_simple_prefix(stream, info, ctx, i, secnum); + /* pass to the prefix the total position instead of the current + stripmine position i; this is necessary to print the array + indices */ + curr_pos = ctx->sm_pos + i; + + h5tools_simple_prefix(stream, info, ctx, curr_pos, secnum); } else if ((i || ctx->continuation) && secnum == 0) { fputs(OPT(info->elmt_suf2, " "), stream); ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); @@ -994,6 +1000,11 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, /* Print the data */ flags = (elmtno == 0) ? START_OF_DATA : 0; flags |= ((elmtno + hs_nelmts) >= p_nelmts) ? END_OF_DATA : 0; + + /* initialize the current stripmine position i; this is necessary to print the array + indices */ + ctx.sm_pos = elmtno; + h5tools_dump_simple_data(stream, info, dset, &ctx, flags, hs_nelmts, p_type, sm_buf); |