HDF5 C ++,带有第三方过滤器 [英] HDF5 C++ with third party filters

查看:150
本文介绍了HDF5 C ++,带有第三方过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写C ++代码来创建具有此处列出的第三方过滤器的HDF5数据集:" https://support.hdfgroup.org/services/contributions.html ".我创建了一个快照过滤器函数,该函数可以使用快照库函数对数据进行压缩和解压缩.我能够用活泼的过滤器编写和读取它,没有任何问题.但是,当我尝试通过h5dump读取数据时,即使我使用了正确的过滤器ID(快照为32003),也没有得到任何输出.

I am trying to write C++ code to create an HDF5 dataset with third-party filters listed here: "https://support.hdfgroup.org/services/contributions.html". I created a snappy filter function that can compress as well as decompress the data using the snappy library functions. I was able to write with snappy filter and read from it without any problem. However, when I try to read the data through h5dump, I am not getting any output even though I am using the correct filter ID (32003 for snappy).

我猜测问题是h5dump无法访问我的过滤器功能.有什么办法解决吗?我可以以某种方式创建一个库并告诉h5dump从中获取功能吗?另外,由于过滤器已经在hdfgroup中注册,我想我可以假设h5dump可以读取的过滤器功能已经存在.我可以在我的C ++代码中使用它来保持一致性吗?

I am guessing the problem is that h5dump doesn't have access to my filter function. Is there any way around it? Can I somehow create a library and tell h5dump to get the function from it? Alternatively, since the filter is already registered with the hdfgroup, I guess I can assume there is already an existing implementation of the filter function that h5dump can read. Can I use that in my C++ code for consistency?

推荐答案

是的,自HDF5版本1.8.11开始,您可以使用[动态加载的过滤器] ( https://support.hdfgroup.org/HDF5/doc/Advanced/DynamicallyLoadedFilters/HDF5DynamicallyLoadedFilters.pdf ).
基本上,您需要创建一个过滤器功能的共享库,并将其放置在特定的文件夹(/usr/local/hdf5/lib/plugin)中或通过HDF5_PLUGIN_PATH指定该文件夹,以使其可用于HDF5库.

Yes, since HDF5 version 1.8.11 you can make use of [dynamically loaded filters] (https://support.hdfgroup.org/HDF5/doc/Advanced/DynamicallyLoadedFilters/HDF5DynamicallyLoadedFilters.pdf).
You basically need to create a shared library of your filter function and make it available to the HDF5 library by puting it in a specific folder (/usr/local/hdf5/lib/plugin) or specifying the folder via HDF5_PLUGIN_PATH.

以示例为例,您可以在其中查看 lzf过滤器 h5py回购.

As an example you can take a look at the lzf filter in the h5py repo.

还可以查看 Blosc ,它是适用于各种压缩算法(包括snappy)的元压缩器.

Also take a look at Blosc which is a meta-compressor for various compression algorithms including snappy.

这篇关于HDF5 C ++,带有第三方过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆