Automatic Handling of Global Variables for Multi-threaded MPI Programs
Automatic Handling of Global Variables for Multi-threaded MPI Programs
复制标题
多线程 MPI 程序的全局变量的自动处理
DOI:
10.1109/icpads.2011.33
复制
发表时间:
2011
期刊:
影响因子:
--
通讯作者:
E. Rodrigues
中科院分区:
文献类型:
--
作者:
G. Zheng;Stas Negara;C. Mendes;L. Kalé;E. Rodrigues
Conventional implementations of the MPI standard tend to associate one MPI process per processor, which limits their support for modern multi-core platforms. An increasingly popular approach is to combine MPI with threads where MPI "processes" are light-weight threads. Global variables in legacy MPI applications, however, present a challenge because they may be accessed by multiple MPI threads simultaneously. Thus, transforming legacy MPI applications to become thread-safe in such MPI execution environments requires proper handling of global variables. In this paper, we present three approaches to automatically eliminate global variables to ensure thread-safety for an MPI program. These approaches include: (a) a compiler-based refactoring technique, using a Photran-based tool as an example, which automates the source-to-source transformation for programs written in Fortran, (b) a technique based on a global offset table (GOT); and (c) a technique based on thread local storage (TLS). The second and third methods automatically detect global variables and privatize them for each thread at runtime. We discuss the advantages and disadvantages of these approaches and compare their performance using both synthetic benchmarks, such as the NAS Benchmarks, and a real scientific application, the FLASH code.