MPI Calls Among Threads
![Illustration comparing single-threaded messaging between MPI tasks with multithreaded messaging between MPI tasks](mpithreadsstampede64pct.png)
Rank-to-rank vs. thread-to-thread
Single-threaded messaging |
|
Multithreaded messaging |
|
In the figure, each node in a pair of nodes is assumed to be occupied by a single MPI task, identified by its rank. Two different situations are shown. At the top, a single thread on one of the MPI ranks exchanges messages with a single thread on the other rank—perhaps even in circumstances where multiple threads are running. At the bottom, some or all the threads on one MPI rank are able to exchange messages simultaneously with partner threads on another MPI rank. The messages in the second situation will likely need to be identified by thread ID as well as rank.
You'll want to keep the above picture in mind as you make your way through this topic. Remember, only in the bottom part of the figure are the MPI messages being sent in parallel among multiple threads on two (or more) MPI ranks.