[Mpi-22] Dynamic thread levels
Pavan Balaji
balaji at [hidden]
Thu Sep 4 03:30:23 CDT 2008
Hi all,
I would like to propose an addition of a function call to dynamically
modify the thread level required by the application, instead of at
MPI_Init_thread() time. I'm sending this over email for comments
(attached with this email); I'll upload it on the wiki this evening.
-- Pavan
--
Pavan Balaji
http://www.mcs.anl.gov/~balaji
Dynamic Thread Levels
Author: Pavan Balaji, Argonne National Laboratory
Background:
MPI 2.1 standard allows users to set thread level only at
MPI_Init_thread time. This means that for applications that
dynamically create threads (e.g., hybrid MPI + OpenMP applications),
even non-threaded portions of the application have to rely on the
maximum thread level used in the application (e.g., MULTIPLE).
Proposal:
Add an additional function call to dynamically set thread-level during
the application.
int MPI_Set_thread_level(int required, int * provided);
Rational:
The requirement to specify the thread-level at MPI_Init_thread time is
too restrictive for applications that perform a small amount of
communication requiring a high-level of thread support. For
correctness, the standard requires all of the code to follow the same
thread-level, and provides the applications with no way to give the
MPI library more information about their behavior.
Impact on MPI implementations:
Most MPI implementations already provide runtime support for
thread-level, i.e., locks are compiled in, but whether they are
invoked or not is decided at runtime. For implementations that choose
not to respect this option, MPI_Set_thread_level() can just set the
provided level to the current level, by ignoring the required level
specified by the user.
Impact on MPI applications:
Existing MPI applications do not need to be modified at all. But newer
applications can benefit from this additional functionality.
More information about the Mpi-22
mailing list