开发者

MPI with thread support and Bcast calls

开发者 https://www.devze.com 2023-03-20 06:59 出处:网络
I was wondering if in an MPI program where you specify that there is thread support, all the开发者_运维技巧 threads make an MPI::Bcast call (making shure that in the call, the sender process only poss

I was wondering if in an MPI program where you specify that there is thread support, all the开发者_运维技巧 threads make an MPI::Bcast call (making shure that in the call, the sender process only possesses one thread), is this received by all the other threads or just for one thread from each process (the fastest)?


Common MPI implementations deal with communication among processes. Implementations supporting threads simply allow multiple threads to make some or all MPI calls, rather than just one. Every one of T threads in a process calling MPI_Bcast means that the process has called MPI_Bcast T times, and expects that all of the other ranks on the communicator will do the same.


Depending on the level of thread support in your implementation of MPI, (please check, threading support in MPI is very sketchy), MPI call is made only once per process.


To add to the answer given by Novelocrat:

The basic unit of computation in MPI is the "rank." In most (all?) interesting implementations of MPI, a rank IS a process. All of the threads within a process share the same Rank ID.

The MPI Standard supports multiple levels of thread parallelism: MPI_THREAD_SINGLE, MPI_THREAD_FUNNELED, MPI_THREAD_SERIALIZED, and MPI_THREAD_MULTIPLE.

Of these, only MPI_THREAD_MULTILE actually has multiple threads making overlapping calls into the MPI library. The other three cases are an assertion from the application that the Rank can be treated as if it were "single threaded." For more, see the MPI Standard entry on MPI_INIT_THREAD.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号