From 2ae76250e686568510bdcf8d85af6e83d3ea7f52 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 19 Nov 2018 17:01:08 +0100 Subject: [PATCH] src/h5core/h5u_model.c: bug fixed in h5_set_view() In h5_set_view() u->shape was created two times. --- src/h5core/h5u_model.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/h5core/h5u_model.c b/src/h5core/h5u_model.c index b239e03..27c8bbf 100644 --- a/src/h5core/h5u_model.c +++ b/src/h5core/h5u_model.c @@ -286,6 +286,8 @@ h5u_set_view ( if (f->u->shape > 0) { TRY (total = hdf5_get_npoints_of_dataspace (f->u->shape) ); } else { + // if iteration does not contain a dataset, next function + // returns -1 TRY (total = h5u_get_totalnum_particles_by_idx (fh, 0)); } h5_debug ("Total = %lld", (long long) total); @@ -293,11 +295,8 @@ h5u_set_view ( /* iteration does not contain a dataset yet! */ - TRY (hdf5_close_dataspace (u->shape)); - TRY (u->shape = hdf5_create_dataspace(1, &total, NULL) ); /* :FIXME: Should 'total == 0' be considered valid or not? - :FIXME: why not gather total size? */ #if H5_HAVE_PARALLEL TRY (