From d9daf9f0c797a47a8119cca6047461f54e24f1f5 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 23 Jul 2015 14:54:23 +0200 Subject: [PATCH] src/h5core/h5u_module.c: - bugfix in h5u_set_canonical_view() --- src/h5core/h5u_model.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/h5core/h5u_model.c b/src/h5core/h5u_model.c index 173447c..6b9c5fe 100644 --- a/src/h5core/h5u_model.c +++ b/src/h5core/h5u_model.c @@ -499,10 +499,10 @@ h5u_set_canonical_view ( TRY (total = h5u_get_num_particles (fh)); + u->nparticles = total / f->nprocs; + #ifdef PARALLEL_IO h5_int64_t remainder = 0; - - u->nparticles = total / f->nprocs; remainder = total % f->nprocs; start = f->myproc * u->nparticles; @@ -510,14 +510,13 @@ h5u_set_canonical_view ( if ( f->myproc < remainder ) u->nparticles++; /* adjust the offset */ - if ( f->myproc < remainder ) start += f->myproc; - else start += remainder; + if ( f->myproc < remainder ) + start += f->myproc; + else + start += remainder; +#endif // PARALLEL_IO h5_int64_t length = u->nparticles; -#else - u->nparticles = total; - h5_int64_t length = total - 1; -#endif // PARALLEL_IO H5_CORE_API_RETURN (h5u_set_view_length (fh, start, length)); }