并行读取C结构的HDF5单维复合数据集

发布于 2024-11-30 04:17:17 字数 391 浏览 8 评论 0原文

我有一个非常简单的复合数据集,大约有 100 万行复合数据类型:

1 个长整型,3 个双精度型。

我想使用集体调用与 MPI 并行读取它,均匀分布在所有处理器上。

HDF5 低级接口使用起来非常复杂,对于如此简单的数据集,我想知道是否可以使用高级 API 之一,例如 Lite 或 Table。 文档中尚不清楚这些 API 是否支持 MPI 集体读取。

有人可以使用 HDF5 1.8 编写可以读取这个简单数据集到 C 结构中的最简单代码片段吗?

我相信对于专家来说这应该是微不足道的,但对于初学者来说,HDF5(及其文档)的复杂性使其确实是一项艰巨的任务。

谢谢。

I have a very simple compound dataset, about 1 million rows of a compound datatype:

1 long, 3 doubles.

I would like to read it in parallel with MPI using a collective call, equally distributed on all the processors.

HDF5 low-level interface is very complex to use, and for such a simple dataset I wonder if I can use one of the high level API, like Lite or Table.
What is not clear from the documentation is if these APIs support MPI collective read.

Could somebody write the simplest code snippet that can read this simple dataset into a C structure using HDF5 1.8?

I believe for an expert this should be trivial, but for a beginner the complexity of HDF5 (and its docs) makes it really a daunting task.

thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぽ尐不点ル 2024-12-07 04:17:18

你找到HDF5并行I/O教程了吗?

http://www.hdfgroup.org/HDF5/Tutor/parallel.html

听起来您还需要学习如何构建 HDF5 数据类型:

http://www.hdfgroup.org/HDF5/Tutor/datatypes.html

为了进行并行集体调用,您必须做一些事情。首先,您需要跨处理器分解数据集。一点算术就可以为您提供所需的开始和计数参数。您需要使用 HDF5 属性列表启用并行 I/O,并行 I/O 教程中有详细记录。启用集体 I/O 的标志记录较少:

xfer_plist = H5Pcreate (H5P_DATASET_XFER);
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);

本页末尾有一个很好的示例:

http://www.hdfgroup.org/Parallel_HDF/PHDF5/ph5design.html

Have you found the HDF5 parallel I/O tutorial?

http://www.hdfgroup.org/HDF5/Tutor/parallel.html

Sounds like you will also need to learn how to construct HDF5 datatypes:

http://www.hdfgroup.org/HDF5/Tutor/datatypes.html

In order to do a parallel collective call you've got to do a few things. First, you need to decompose your dataset across the processors. A little arithmatic gives you the start and count parameters you'll need. You will need to enable parallel I/O with an HDF5 property list, which is well documented in the parallel I/O tutorial. Less well documented is the flag for enabling collective I/O:

xfer_plist = H5Pcreate (H5P_DATASET_XFER);
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);

There's a great example at the end of this page:

http://www.hdfgroup.org/Parallel_HDF/PHDF5/ph5design.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文