Frustrated with MPI+Threads? Try MPIxThreads!

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhou, Hui, Raffenetti, Ken, Zhang, Junchao, Guo, Yanfei, Thakur, Rajeev
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914658824224768
author Zhou, Hui
Raffenetti, Ken
Zhang, Junchao
Guo, Yanfei
Thakur, Rajeev
author_facet Zhou, Hui
Raffenetti, Ken
Zhang, Junchao
Guo, Yanfei
Thakur, Rajeev
contents MPI+Threads, embodied by the MPI/OpenMP hybrid programming model, is a parallel programming paradigm where threads are used for on-node shared-memory parallelization and MPI is used for multi-node distributed-memory parallelization. OpenMP provides an incremental approach to parallelize code, while MPI, with its isolated address space and explicit messaging API, affords straightforward paths to obtain good parallel performance. However, MPI+Threads is not an ideal solution. Since MPI is unaware of the thread context, it cannot be used for interthread communication. This results in duplicated efforts to create separate and sometimes nested solutions for similar parallel tasks. In addition, because the MPI library is required to obey message-ordering semantics, mixing threads and MPI via MPI_THREAD_MULTIPLE can easily result in miserable performance due to accidental serializations. We propose a new MPI extension, MPIX Thread Communicator (threadcomm), that allows threads to be assigned distinct MPI ranks within thread parallel regions. The threadcomm extension combines both MPI processes and OpenMP threads to form a unified parallel environment. We show that this MPIxThreads (MPI Multiply Threads) paradigm allows OpenMP and MPI to work together in a complementary way to achieve both cleaner codes and better performance.
format Preprint
id arxiv_https___arxiv_org_abs_2401_16551
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Frustrated with MPI+Threads? Try MPIxThreads!
Zhou, Hui
Raffenetti, Ken
Zhang, Junchao
Guo, Yanfei
Thakur, Rajeev
Distributed, Parallel, and Cluster Computing
MPI+Threads, embodied by the MPI/OpenMP hybrid programming model, is a parallel programming paradigm where threads are used for on-node shared-memory parallelization and MPI is used for multi-node distributed-memory parallelization. OpenMP provides an incremental approach to parallelize code, while MPI, with its isolated address space and explicit messaging API, affords straightforward paths to obtain good parallel performance. However, MPI+Threads is not an ideal solution. Since MPI is unaware of the thread context, it cannot be used for interthread communication. This results in duplicated efforts to create separate and sometimes nested solutions for similar parallel tasks. In addition, because the MPI library is required to obey message-ordering semantics, mixing threads and MPI via MPI_THREAD_MULTIPLE can easily result in miserable performance due to accidental serializations. We propose a new MPI extension, MPIX Thread Communicator (threadcomm), that allows threads to be assigned distinct MPI ranks within thread parallel regions. The threadcomm extension combines both MPI processes and OpenMP threads to form a unified parallel environment. We show that this MPIxThreads (MPI Multiply Threads) paradigm allows OpenMP and MPI to work together in a complementary way to achieve both cleaner codes and better performance.
title Frustrated with MPI+Threads? Try MPIxThreads!
topic Distributed, Parallel, and Cluster Computing
url https://arxiv.org/abs/2401.16551