Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading hyperslabs fails #55

Closed
joshua-gould opened this issue Feb 26, 2018 · 13 comments
Closed

Reading hyperslabs fails #55

joshua-gould opened this issue Feb 26, 2018 · 13 comments

Comments

@joshua-gould
Copy link

Example:
Prerequisites: Download hdf5 file from http://pklab.med.harvard.edu/velocyto/hgForebrainGlut/hgForebrainGlut.loom

var hdf5 = require('hdf5').hdf5;
var h5lt = require('hdf5').h5lt;
var Access = require('hdf5/lib/globals').Access;
var file = new hdf5.File('hgForebrainGlut.loom', Access.ACC_RDONLY);
var dim = file.getDatasetDimensions('matrix');
for (var i = 0; i < dim[0]; i++) {
  var buffer = h5lt.readDatasetAsBuffer(file.id, 'matrix', {
    start: [i, 0],
    stride: [1, 1],
    count: [1, dim[1]]
  });
}

Error:
HDF5-DIAG: Error detected in HDF5 (1.8.20) thread 0:
#000: H5S.c line 1382 in H5Screate_simple(): maxdims is smaller than dims
major: Invalid arguments to routine
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (1.8.20) thread 0:
#000: H5Dio.c line 147 in H5Dread(): not a data space
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.20) thread 0:
#000: H5S.c line 390 in H5Sclose(): not a dataspace
major: Invalid arguments to routine
minor: Inappropriate type
SyntaxError: failed to read dataset

@rimmartin
Copy link
Collaborator

Hi, I'll test with the example you provided and let you know. I'm able to catch up in the next couple of evenings(was away for the weekend)

@joshua-gould
Copy link
Author

Thanks.

@rimmartin
Copy link
Collaborator

This is a compressed dataset. I've been working on getting compression capability.

I haven't tried a compressed dataset with hyperslabbing yet. Studying this some more...

@rimmartin
Copy link
Collaborator

hdf5 forum tells me this is doable.
https://forum.hdfgroup.org/t/are-hyperslabs-and-compression-compatible/860

Looking for a c example. it may have to do with access property list for the reading step. Looking...

@joshua-gould
Copy link
Author

joshua-gould commented Feb 28, 2018 via email

@joshua-gould
Copy link
Author

Any updates on how to fix this issue? Thanks.

@rimmartin
Copy link
Collaborator

I'm getting back to things. Had a software release at work that consumed a lot of time

I'll make a small c/c++ app to test this out a bit; it really should be no different

@NINI1988
Copy link
Contributor

File h5_lt.hpp Line(1417)
Maybe this memspace_id = H5Screate_simple(rank, count.get(), NULL);

Or
const hsize_t maxsize = H5S_UNLIMITED;
should be
std::unique_ptr<hsize_t[]> maxsize(new hsize_t[rank]);

Maybe the dimensions are multiple time wrong in the code?

@rimmartin
Copy link
Collaborator

rimmartin commented May 16, 2018

in some versions of hdf5 H5S_UNLIMITED didn't work. You're making my recaller kick in:-) Will test some things looking at your other fix for dimensions

@rimmartin
Copy link
Collaborator

I think that was it! Must reveal itself when it is a compressed h5. Survey for more places an array should be used

@rimmartin
Copy link
Collaborator

All other H5Screate_simple's have the maximum_dims NULL. Will need to see if any should be filed in to allow H5S_UNLIMITED

@rimmartin
Copy link
Collaborator

@joshua-gould I committed changes after applying @NINI1988 's fix to this one as well.

@joshua-gould
Copy link
Author

It works now! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants