[Nexus] Changes in HDF 5: H5<x>iterate?

Tim Kelley tkelley at caltech.edu
Tue Jul 29 00:57:08 BST 2003


Hello all,

Just a heads-up regarding HDF5. I installed the latest version of the HDF 5 library* and hit some problems running napi5_test. 

The problems come from the return value of H5Aiterate and H5GIterate, and affect NX5getattrinfo, NX5getnextattr and NX5getnextentry. The nexus API seems to expect them to return 1 while iteration is valid, 0 at the end of the traversal, and -1 otherwise. However, these functions now seem to skip the 0 and go straight to -1. The state NX_EOD never seems to be reached; instead one gets immediately to the state NX_ERROR. This means functions like NX5getnextattr and NX5getnextentry fail with "ERROR: iteration was not successful", and NX5getattrinfo goes into infinite loops.

Simple hacks get past this. If one replaces the line in NX5getnextentry( ):

else if (iRet == 0)

with 

else if (iRet == 0 || iRet == -1),

and changes a few similar lines in NX5getattrinfo & NX5getnextattr (changing lines like while(iRet != 0) to while( iRet > 0) eliminates infinite loops),  then napi5_test runs successfully.

But this solution might hide a problem: the HDF5 behavior that supported the distinction between NX_EOD and NX_ERROR may have changed. Anyone relying on that distinction would want to know about this. 

Regards,
Tim Kelley
tkelley at caltech.edu


* version 1.6.0, precompiled for linux with gcc 3.2.2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nexusformat.org/pipermail/nexus/attachments/20030728/f45665a9/attachment.html 


More information about the NeXus mailing list