netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

Check if HDF5 "file" is a DAOS object

Open brtnfld opened this issue 3 years ago • 22 comments

PR to skip the POXIS calls used in reading magic number. These POSIX calls can not be used for a DAOS object.

Intel DAOS team feedback is requested as we might be able to remove the HDF5 calls.

This solution assumes Unified Namespace and getfattr is available.

brtnfld avatar Jun 16 '21 15:06 brtnfld

We might refrain from using getfattr if we modify H5Fis_accessible to return the VOL access type instead. Investigating.

brtnfld avatar Jun 16 '21 17:06 brtnfld

I do not think this code is in the proper location. I think it should be part of the later file reading checks.

DennisHeimbigner avatar Jun 18 '21 16:06 DennisHeimbigner

I do not think this code is in the proper location. I think it should be part of the later file reading checks.

I think it has to be before phase 7 because that looks like the first place you start to read the magic number. Where do you suggest?

brtnfld avatar Jun 18 '21 16:06 brtnfld

I do not think this code is in the proper location. I think it should be part of the later file reading checks.

Wouldn't it be better to directly call getxattr(2) from sys/xattr.h here instead of calling a command which has to be in the path (sure, it is very likely the case) and could potentially do something else than returning file attributes? In the end, getfattr does same call to retrieve the attributes.... at least on a CentOS 7 installation.

Yes, that would be better.

brtnfld avatar Jun 18 '21 16:06 brtnfld

FYI, I am working on this again.

DennisHeimbigner avatar Aug 03 '21 21:08 DennisHeimbigner

If there is some way to modify this to avoid using popen, it would be appreciated.

DennisHeimbigner avatar Aug 03 '21 21:08 DennisHeimbigner

Let me see what I can do, the eventual plan is to have H5Fis_accessible return if it is a DAOS container.

brtnfld avatar Aug 04 '21 14:08 brtnfld

At the EGU I learned of some large data producers wanting to use DAOS for some of their very large data sets. I think it would be great of netCDF handled DAOS better.

I don't think this should hold up the long-awaited 4.9.0 release, but it would be great if this could be figured out for the 4.9.1 release...

edwardhartnett avatar May 29 '22 12:05 edwardhartnett

To date, we have no solution.

DennisHeimbigner avatar May 29 '22 23:05 DennisHeimbigner

@WardF can we get this merged? I'd love to test it, and I think it's an important feature. I note that it's scheduled for the 4.9.1 release, so if we can get it in I can test it in the next release candidate...

edwardhartnett avatar Nov 04 '22 14:11 edwardhartnett

Here is the response I received from Intel:

You can use the extended attribute, check for its existence: /** extended attribute name that will container the UNS info */ #define DUNS_XATTR_NAME "user.daos"

Ideally you would use that macro, or the duns and call duns_resolve_path(), but you can’t do that I assume in this case since you would need to build netcdf with daos, right? You can just call lgetxattr on the path with that name and I would think it should be OK. If we change the actual name, one would need to update netCDF but I don’t see that happening.

brtnfld avatar Nov 04 '22 14:11 brtnfld