共享内存将相同的数据(numpy 数组)加载到多个 MPI 进程?

发布于 2025-01-15 12:08:17 字数 215 浏览 5 评论 0原文

我有一个很长的瘦numpy数组(dim=(4096*4096,1)),需要由多个MPI进程(使用mpi4py)读取,并且它们独立地对它们执行一些操作。但是,每个进程加载这么大的数组都会占用大量内存。有没有办法拥有/使用共享内存(也许它是最初分配的并且之后不被触及,除了只有 MPI 进程将从同一位置读取,即只读访问)?也许可以使用 python-multiprocessing 但 mpi4py 怎么样(提前感谢)?

I have a long skinny numpy array (dim=(4096*4096,1)) which needs to be read by multiple MPI processes (using mpi4py) and they do some operations on them independently. But while loading such large array by each process should be heavy on memory. Is there a way to have/use shared memory (maybe be it is allocated initially and not touched afterwards other than only the MPI processes will read from the same location, i.e. read-only access)? It maybe be possible with python-multiprocessing but what about mpi4py (thanks in advance)?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文