The communication patterns that comply with the thread-split model must not allow cross-thread access to MPI objects to avoid thread synchronization and must disambiguate message matching, so that threads could be separately addressed and not more than one thread could match the message at the same time. Provided that, the user must notify the Intel MPI Library that the program complies with thread-split model, that is, it is safe to apply the high performance optimization.
Each MPI_THREAD_SPLIT-compliant program can be executed correctly with a thread-compliant MPI implementation under MPI_THREAD_MULTIPLE, but not every MPI_THREAD_MULTIPLE-compliant program follows the MPI_THREAD_SPLIT model.
This model allows MPI to apply optimizations that would not be possible otherwise, such as binding specific hardware resources to concurrently communicating threads and providing lockless access to MPI objects.
Since MPI_THREAD_SPLIT is a non-standard programming model, it is disabled by default and can be enabled by setting the environment variable I_MPI_THREAD_SPLIT. If enabled, the threading runtime control must also be enabled to enable the programming model optimizations (see Threading Runtimes Support).
Setting the I_MPI_THREAD_SPLIT variable does not affect behavior at other threading levels such as SINGLE and FUNNELED. To make this extension effective, request the MPI_THREAD_MULTIPLE level of support at MPI_Init_thread().
NOTE: Thread-split model has support for MPI point-to-point operations and blocking collectives.
As mentioned above, an MPI_THREAD_SPLIT-compliant program must be at least a thread-compliant MPI program (supporting the MPI_THREAD_MULTIPLE threading level). In addition to that, the following rules apply:
The model implies that each process thread has a distinct logical thread number thread_id. thread_id must be set to a number in the range 0 to NT-1, where NT is the number of threads that can be run concurrently. thread_id can be set implicitly, or your application can assign it to a thread. Depending on the assignment method, there are two usage submodels:
The I_MPI_THREAD_ID_KEY variable sets the MPI info object key that is used to explicitly define the thread_id for a thread (thread_id by default).
Within the model, only threads with the same thread_id can communicate. To illustrate it, the following communication pattern complies to the MPI_THREAD_SPLIT model: Suppose Comm A and Comm B are two distinct communicators, aggregating the same ranks. The system of these two communicators will fit the MPI_THREAD_SPLIT model only if all threads with thread_id #0 use Comm A, while all threads with thread_id #1 use Comm B.