Hi Jed, Let's see what comes of this... I forked petsc/petsc and created a pull request. There are probably loads of unneeded casts and at least one "+1" just to make sure I'm not rounding a float down into an integer under any circumstances.
> Thanks, the logic looks reasonable. Unfortunately, I don't think we can > have comprehensive tests because the large file sizes won't work in many > test environments. That said, we could have a configurable parameter > instead of hard-coding 4 GiB, in which case we could set it to 1 MiB (or > less) for testing. I'll leave the parameter for others to implement: I don't have a good idea of how to do that. I believe I can provide a testing environment (but no access to it, I'm afraid) for those big files, just let me know what kind of test suite I should create. Not that the old chunking seems to have had much testing considering how seriously broken it is. ;) > > + // just in case some libraries do not empty memory for local variables: > We have to use C89-style comments because of Microsoft. What is this, Microsoft's compiler cannot do C99? Is it too new a standard, at 14 years old? > > + > > + // some requirements for the chunks (assuming no split along time-step) > > + int ranks; > Declarations cannot be mixed with statements in C89. Microsoft again? I've reverted these *standard* pieces of code into an obsolete, old standard. I really had no idea there are STILL compilers around which cannot do C99. > PetscObjectComm((PetscObject)xin). And please name the variable "size" > or "comm_size". Done. > One reasonable thing is to write > > hsize_t Ki = 1024; > > and then > > Gi = Ki*Ki*Ki; Done. > I would prefer to move all the logic below into a function > VecGetHDF5ChunkSize(). Note that almost the same logic appears in Done. > Please use PetscMax() and PetscMin(). You can define the 3-way versions > at the top of the file if need be. Done. I also removed the 3-way versions. > You mixed tabs and spaces here. Please use all spaces. Probably forgot. =) I mostly write python, so I'm very surprised I managed to mix tabs and spaces, considering how nice side-effects that often has in python. I hope this works and can get to the next release. Cheers, Juha
signature.asc
Description: This is a digitally signed message part.
