Menu

/ or . designators of root group position?

dpakilgo
2017-01-13
2017-01-14
  • dpakilgo

    dpakilgo - 2017-01-13

    Hi Martijn,

    This is the new issue I have found - as promised. I am reading an hdf5 file format developed by someone else. All the datasets in that format are in the root of the hdf5 file. They were using the / (in a string constant) to indicate the group location for the datasets. The issue is that it doesn't matter if you use "/" or "." in the development environment as the designator for the root group in H5GOpen.vi - both will work. But, in the built executable, it seems that you have to use "." as using "/" generates a 60001 error.

    Kind regards,

    David

     

    Last edit: dpakilgo 2017-01-13
  • Martijn Jasperse

    Hi David,
    This is very surpirsing to me. Firstly, "/" and "." are not equivalent, unless the input reference is already the root node. "/" means root node and "." means this node. I am alarmed that you observe different behaviour in dev env vs built exe, and also that it's error 60001. I will have to run some tests.

    What LabVIEW/OS are you running? What reference are you feeding into H5Gopen? A file/group/dataset reference?

    Also, is there any particular reason you're trying to H5Gopen the root group? The file reference is also a reference to the root group so it should never be necessary to open root, unless you only have a reference to a subgroup and you need to traverse back up (not recommended since you should have the file reference open anyway to H5Fclose later).

    I'll look into it when I have some time and see if I can reproduce the behaviour. The only thing that springs to mind is different DLL instances trying to access the same data ID, which causes error 60001, but it could be something else.

    Cheers,
    Martijn

     
  • Martijn Jasperse

    I can't reproduce this issue. I've attached an example program that does H5Gopen on "/" correctly in the built application. Perhaps it's related to the ref ID you're passing in.

     
  • dpakilgo

    dpakilgo - 2017-01-25

    Hi Martin,

    My impression is that the authors of the file format did not fully understand how an HDF5 file should be structured. They also provided the labview vi's that they use to read and write their file - but they have only used these in the development environment. They wanted me to add some functionality and then provide them with an installable exe.

    Their vi's had several nested levels where the various file refs were being passed - it was a bit confusing at times to track down what went where. But it may be that the H5Gopen was not needed where it was.

    At least we do have it working with the . now. I might try taking the H5Gopen out and see if it still works.

    David

     
  • Martijn Jasperse

    Hi David,
    Hope you managed to figure it out! I noticed that references do seem to be abused a bit, which causes very hard-to-find problems down the line with memory leaks that are insignificant at first but grow over the course of days.

    In principle, only the file reference itself should be retained; all other references should be closed as close as possible to where they are opened, to make book-keeping easier and prevent memory leaks.

    Cheers,
    Martijn

     

Log in to post a comment.

MongoDB Logo MongoDB