It would seem this functionality could be implemented via a user-specified filter, similar to data conversion and compression of datasets, but in this case just passing-through all numbers except NaN's, which may then employ even a platform-specific isnan() function or some bit test; throwing a C++ exception from such a filter might not be a good idea since that would bypass cleaning up HDF5-internal objects during data writing, but at least it could lead to a "write error" or similar, and create an application-specific error stack with locations where NaN's have been detected.

         Werner


On Wed, 20 Feb 2013 04:41:53 +0100, Izaak Beekman <[email protected]> wrote:

I think adding a flag to specify the NaN behavior is a great idea. I also think that, h5diff might not be the most efficient and useful tool to find NaNs. 

IMO, it might be better to create a specific tool to search an h5 file for NaNs or maybe add the ability of the library to throw an error if a NaN is written. (A diff will necessitate a bit-wise comparison of every element, whereas if you are only looking for NaNs then there's no need to read in an element twice and then perform a bitwise comparison. It may be faster to read each element in once, and then only NaNs will need to have all their bits checked--vectorization and optimization considerations neglected.) 

It is ultimately the burden of the developer/application to ensure that one is not chugging along computing NaNs and burning precious CPU hours, but the whole point of HDF5 is to make data manipulation easier, and data sets self descriptive. In this regard, the ability to optionally throw an exception when a NaN is written, or perhaps track NaNs and their locations would likely be useful to many users.

Izaak Beekman
===================================
(301)244-9367
UMD-CP Visiting Graduate Student
Aerospace Engineering
[email protected]
[email protected]



--
___________________________________________________________________________
Dr. Werner Benger Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
211 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to