Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Thread safety in an MPI implementation : requirements and analysis.

Journal Article · · Parallel Comput.

The MPI-2 Standard has carefully specified the interaction between MPI and user-created threads. The goal of this specification is to allow users to write multithreaded MPI programs while also allowing MPI implementations to deliver high performance. However, a simple reading of the thread-safety specification does not reveal what its implications are for an implementation and what implementers must be aware (and careful) of. In this paper, we describe and analyze what the MPI Standard says about thread-safety and what it implies for an implementation. We classify the MPI functions based on their thread-safety requirements and discuss several issues to consider when implementing thread-safety in MPI. We use the example of generating new context ids (required for creating new communicators) to demonstrate how a simple solution for the single-threaded case does not naturally extend to the multithreaded case and how a naove thread-safe algorithm can be expensive. We then present an algorithm for generating context ids that works efficiently in both single-threaded and multithreaded cases.

Research Organization:
Argonne National Laboratory (ANL)
Sponsoring Organization:
SC
DOE Contract Number:
AC02-06CH11357
OSTI ID:
920216
Report Number(s):
ANL/MCS/JA-59091
Journal Information:
Parallel Comput., Journal Name: Parallel Comput. Journal Issue: 9 ; Sep. 2007 Vol. 33; ISSN PACOEJ; ISSN 0167-8191
Country of Publication:
United States
Language:
ENGLISH

Similar Records

Test suite for evaluating performance of MPI implementations that support MPI_THREAD_MULTIPLE.
Conference · Wed Dec 31 23:00:00 EST 2008 · Parallel Comput. · OSTI ID:971467

Test suite for evaluating performance of multithreaded MPI communication.
Journal Article · Mon Nov 30 23:00:00 EST 2009 · Parallel Comput. · OSTI ID:977356

Logically Parallel Communication for Fast MPI+Threads Applications
Journal Article · Thu Apr 22 00:00:00 EDT 2021 · IEEE Transactions on Parallel and Distributed Systems · OSTI ID:1846741