MPI创建的进程的共享内存访问控制机制 [英] Shared memory access control mechanism for processes created by MPI
问题描述
我有一个供多个进程使用的共享内存,这些进程是使用MPI
创建的.
I have a shared memory used by multiple processes, these processes are created using MPI
.
现在,我需要一种机制来控制对共享内存的访问.
Now I need a mechanism to control the access of this shared memory.
我知道可以使用named semaphore
和flock
机制来执行此操作,但是只是想知道MPI是否为共享内存使用提供了任何特殊的锁定机制?
I know that named semaphore
and flock
mechanisms can be used to do this but just wanted to know if MPI provides any special locking mechanism for shared memory usage ?
我正在Linux下使用C.
I am working on C under Linux.
推荐答案
MPI现在确实为共享内存提供了支持(从3.0版开始).您可以尝试查看单面交流一章( http://www.mpi-forum.org/docs/mpi-3.0/mpi30-report.pdf ),以MPI_WIN_ALLOCATE_SHARED(11.2.3)开头.要使用此功能,必须确保您有一个支持它的实现.我知道MPICH和Open MPI的最新版本都可以.
MPI actually does provide support for shared memory now (as of version 3.0). You might try looking at the One-sided communication chapter (http://www.mpi-forum.org/docs/mpi-3.0/mpi30-report.pdf) starting with MPI_WIN_ALLOCATE_SHARED (11.2.3). To use this, you'll have to make sure you have an implementation that supports it. I know that the most recent versions of both MPICH and Open MPI work.
这篇关于MPI创建的进程的共享内存访问控制机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!