Skip to Content.
Sympa Menu

h5part - Re: [EXTERNAL] Re: [H5part] H5PartSetCanonicalView

h5part AT

Subject: H5Part development and discussion

List archive

Re: [EXTERNAL] Re: [H5part] H5PartSetCanonicalView

Chronological Thread 
  • From: "Matthew Bettencourt" <mbetten AT>
  • To: "Achim Gsell" <achim.gsell AT>
  • Cc: h5part AT
  • Subject: Re: [EXTERNAL] Re: [H5part] H5PartSetCanonicalView
  • Date: Mon, 5 Nov 2012 08:39:22 -0700
  • List-archive: <>
  • List-id: H5Part development and discussion <>

OK, So i tried that, however, there is still an issue.

So, i did this code where I set a start and end, and check, are there no parts. If there aren't any parts I call H5PartSetViewIndices
npart = e-s+1;
if ( npart > 0 ) {
if (H5PartSetView(file_, s, e) != 0 )
error_out("Cannot set file view for h5part file\n");
}else {
if (H5PartSetViewIndices (file_, NULL, 0) != 0 )
error_out("Cannot set file view for h5part file\n");

///Here I ask what does the code thing the number of parts are. All my ranks think it has all the particles, and the assert fails.
h5part_int64_t npart2 = H5PartGetNumParticles(file_); // view didn't take, bug in h5part
assert(npart == npart2);

On 11/05/2012 07:30 AM, Achim Gsell wrote:
On Oct 31, 2012, at 7:28 PM, Matthew Bettencourt wrote:

In the doc you say both start and end need to be -1,

"unset" by calling \c H5PartSetView(file,-1,-1);
Yes, there are more ways to reset the view:

H5PartSetView (file, -1, -1);
H5PartSetView (file, 0, -1);
H5PartResetView (file);

What I want is to be able to have one set of code which works in parallel for
both if we have more particles than processors and if we have less particles
than processor. Right now I tried both the H5PartSetCanonicalView and
setting by hand, it is impractical to set all the indices that I want to read
and read them in for a very large run.
My suggestion is to use

H5PartSetViewIndices (file, NULL, 0);

only in the special case where you want to select zero particles:

if (start <= end)
H5PartSetView (file, start, end);
H5PartSetViewIndices (file, NULL, 0);

Ideally one should have to have both start and end to -1, (which would most
likely fix the other bug)
Yes, but it may break some existing codes. So we shouldn't change this in
Version 1.


Archive powered by MHonArc 2.6.19.

Top of Page