The Library
OP2-Clang : a source-to-source translator using Clang/LLVM LibTooling
Tools
Balogh, G. D., Mudalige, Gihan R., Reguly, I. Z. , Antao, S. F. and Bertolli, C. (2019) OP2-Clang : a source-to-source translator using Clang/LLVM LibTooling. In: The Fifth Workshop on the LLVM Compiler Infrastructure in HPC Workshop, The International Conference for High Performance Computing, Networking, Storage and Analysis, November 2018, Dallas, Texas, USA , 12 Nov 2018. Published in: 2018 IEEE/ACM 5th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) ISBN 9781728101880. doi:10.1109/LLVM-HPC.2018.8639205
|
PDF
WRAP-OP2-Clang-source-source-translator-tooling-Bertoli-2018.pdf - Accepted Version - Requires a PDF viewer. Download (577Kb) | Preview |
Official URL: https://doi.org/10.1109/LLVM-HPC.2018.8639205
Abstract
Domain Specific Languages or Active Library frameworks have recently emerged as an important method for gaining performance portability, where an application can be efficiently executed on a wide range of HPC architectures without significant manual modifications. Embedded DSLs such as OP2, provides an API embedded in general purpose languages such as C/C++/Fortran. They rely on source-to-source translation and code refactorization to translate the higher-level API calls to platform specific parallel implementations. OP2 targets the solution of unstructured-mesh computations, where it can generate a variety of parallel implementations for execution on architectures such as CPUs, GPUs, distributed memory clusters and heterogeneous processors making use of a wide range of platform specific optimizations. Compiler tool-chains supporting source-to-source translation of code written in mainstream languages currently lack the capabilities to carry out such wide-ranging code transformations. Clang/LLVM’s Tooling library (LibTooling) has long been touted as having such capabilities but have only demonstrated its use in simple source refactoring tasks.
In this paper we introduce OP2-Clang, a source-to-source translator based on LibTooling, for OP2’s C/C++ API, capable of generating target parallel code based on SIMD, OpenMP, CUDA and their combinations with MPI. OP2-Clang is designed to significantly reduce maintenance, particularly making it easy to be extended to generate new parallelizations and optimizations for hardware platforms. In this research, we demonstrate its capabilities including (1) the use of LibTooling’s AST matchers together with a simple strategy that use parallelization templates or skeletons to significantly reduce the complexity of generating radically different and transformed target code and (2) chart the challenges and solution to generating optimized parallelizations for OpenMP, SIMD and CUDA. Results indicate that OP2-Clang produces near-identical parallel code to that of OP2’s current source-to-source translator. We believe that the lessons learnt in OP2-Clang can be readily applied to developing other similar source-to-source translators, particularly for DSLs.
Item Type: | Conference Item (Paper) | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Subjects: | Q Science > QA Mathematics > QA76 Electronic computers. Computer science. Computer software | ||||||||||||||||||||||||
Divisions: | Faculty of Science, Engineering and Medicine > Science > Computer Science | ||||||||||||||||||||||||
Library of Congress Subject Headings (LCSH): | Domain-specific programming languages, Parallel processing (Electronic computers), Compilers (Computer programs), Parallel programming (Computer science) | ||||||||||||||||||||||||
Journal or Publication Title: | 2018 IEEE/ACM 5th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) | ||||||||||||||||||||||||
Publisher: | IEEE | ||||||||||||||||||||||||
ISBN: | 9781728101880 | ||||||||||||||||||||||||
Official Date: | 14 February 2019 | ||||||||||||||||||||||||
Dates: |
|
||||||||||||||||||||||||
DOI: | 10.1109/LLVM-HPC.2018.8639205 | ||||||||||||||||||||||||
Status: | Peer Reviewed | ||||||||||||||||||||||||
Publication Status: | Published | ||||||||||||||||||||||||
Re-use Statement: | © 2018 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works. | ||||||||||||||||||||||||
Access rights to Published version: | Restricted or Subscription Access | ||||||||||||||||||||||||
Date of first compliant deposit: | 3 November 2018 | ||||||||||||||||||||||||
Date of first compliant Open Access: | 5 November 2018 | ||||||||||||||||||||||||
RIOXX Funder/Project Grant: |
|
||||||||||||||||||||||||
Conference Paper Type: | Paper | ||||||||||||||||||||||||
Title of Event: | The Fifth Workshop on the LLVM Compiler Infrastructure in HPC Workshop | ||||||||||||||||||||||||
Type of Event: | Workshop | ||||||||||||||||||||||||
Location of Event: | The International Conference for High Performance Computing, Networking, Storage and Analysis, November 2018, Dallas, Texas, USA | ||||||||||||||||||||||||
Date(s) of Event: | 12 Nov 2018 | ||||||||||||||||||||||||
Open Access Version: |
Request changes or add full text files to a record
Repository staff actions (login required)
View Item |
Downloads
Downloads per month over past year