OP2-Clang: A Source-to-Source Translator Using Clang/LLVM LibTooling

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...

Full description

Saved in:
Bibliographic Details
Published in2018 IEEE/ACM 5th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) pp. 59 - 70
Main Authors Balogh, G.D., Mudalige, G.R., Reguly, I.Z., Antao, S.F., Bertolli, C.
Format Conference Proceeding
LanguageEnglish
Published IEEE 01.11.2018
Subjects
Online AccessGet full text
DOI10.1109/LLVM-HPC.2018.8639205

Cover

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 *The following names are subject to trademark: LLVM™, CLANG™, NVIDIA™, P100™, CUDA™, INTEL™, 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.
AbstractList 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 *The following names are subject to trademark: LLVM™, CLANG™, NVIDIA™, P100™, CUDA™, INTEL™, 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.
Author Antao, S.F.
Reguly, I.Z.
Bertolli, C.
Balogh, G.D.
Mudalige, G.R.
Author_xml – sequence: 1
  givenname: G.D.
  surname: Balogh
  fullname: Balogh, G.D.
  organization: Pázmány Péter Catholic University, Faculty of Information Technology and Bionics, Hungary
– sequence: 2
  givenname: G.R.
  surname: Mudalige
  fullname: Mudalige, G.R.
  organization: University of Warwick, Department of Computer Science, UK
– sequence: 3
  givenname: I.Z.
  surname: Reguly
  fullname: Reguly, I.Z.
  organization: Pázmány Péter Catholic University, Faculty of Information Technology and Bionics, Hungary
– sequence: 4
  givenname: S.F.
  surname: Antao
  fullname: Antao, S.F.
  organization: IBM T.J. Watson Research Center, USA
– sequence: 5
  givenname: C.
  surname: Bertolli
  fullname: Bertolli, C.
  organization: IBM T.J. Watson Research Center, USA
BookMark eNotj89KAzEYxCPoQWufQIS8QNb82ybxVlZthZQWunot367flsCaSHY9-PYubU_zYxiGmTtyHVNEQh4FL4Tg7sn7zw1b76pCcmELu1BO8vKKzJ2xwkgrJtfyW_Ky3UlW9RCPz3RJ9-k3t8jGxM5E6wxx6GFMmX4MIR7pKXoqpz40dUr95N6Tmw76AecXnZH67bWu1sxvV-_V0rPg-MiMsaVuuHLQSoVamqZxuHCo9bRNtTCRLK0V0nWAQrWiA83Nl9aI4Epl1Yw8nGsDIh5-cviG_He4XFP_r_pGtA
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1109/LLVM-HPC.2018.8639205
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Xplore POP ALL
IEEE Xplore All Conference Proceedings
IEEE Electronic Library (IEL)
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: Consulter via IEEE Xplore
  url: https://proxy.k.utb.cz/login?url=https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
EISBN 9781728101880
1728101883
EndPage 70
ExternalDocumentID 8639205
Genre orig-research
GroupedDBID 6IE
6IL
CBEJK
RIE
RIL
ID FETCH-LOGICAL-i90t-77854b039ac23e427bb9e69e443923ca9e42588129fae13c1fa407d44eea95383
IEDL.DBID RIE
IngestDate Thu Jun 29 18:39:31 EDT 2023
IsPeerReviewed false
IsScholarly false
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-i90t-77854b039ac23e427bb9e69e443923ca9e42588129fae13c1fa407d44eea95383
PageCount 12
ParticipantIDs ieee_primary_8639205
PublicationCentury 2000
PublicationDate 2018-Nov.
PublicationDateYYYYMMDD 2018-11-01
PublicationDate_xml – month: 11
  year: 2018
  text: 2018-Nov.
PublicationDecade 2010
PublicationTitle 2018 IEEE/ACM 5th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC)
PublicationTitleAbbrev LLVM-HPC
PublicationYear 2018
Publisher IEEE
Publisher_xml – name: IEEE
Score 1.7638085
Snippet Domain Specific Languages or Active Library frameworks have recently emerged as an important method for gaining performance portability, where an application...
SourceID ieee
SourceType Publisher
StartPage 59
SubjectTerms automatic parallelization
Clang
Computer architecture
CUDA
DSL
Graphics processing units
Libraries
LibTooling
OP2
OpenMP
Optimization
Source-to-source translation
unstructured-mesh
Title OP2-Clang: A Source-to-Source Translator Using Clang/LLVM LibTooling
URI https://ieeexplore.ieee.org/document/8639205
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV1LSwMxEA61J08qrfgmB49mm02yu4k3qZYirRas0ltJNrNSlF2R7cVfb5JdK4oHb5MwkBfky0zmm0Ho3KTGcGEtYQDUGShcE81i15SFVtQIk1DPRp7epeNHcbtIFh10seHCAEAIPoPIi-Ev31b52rvKBtLBKfMJS7cymTZcrZaUE1M1mEyepmQ8G_p4LRm1uj-KpgTMGO2g6ddoTajIS7SuTZR__ErE-N_p7KL-NzsPzza4s4c6UPbQ9f2MkaH3Pl7iK_wQXPKkrkgj4QBJr97AxiFIAAfVsBg8WZl55Wv3PPfRfHQzH45JWyGBrBSt3ctYJsJQrnTOOAiWGaMgVSDcK4PxXDuJJdJBuCo0xDyPC-3sNysEgFbupuP7qFtWJRwgrH3SF51ZqotMyETrRFErjc1iw1Op4kPU8xuwfGtyYCzbtR_93X2Mtv0hNJy9E9St39dw6sC7Nmfh1D4Bxc2Z9Q
linkProvider IEEE
linkToHtml http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV07T8MwELaqMsAEqEW88cCIU8ePxGZDhapAUioRULfKThxUgRqE0oVfj-0EEIiB7Wyd5Jfkz3e-7w6AUx1pTVlRIGIMtgYKVUiR0DZFqSTWTHPs2MjpJBo_sJsZn3XA2RcXxhjjg89M4ET_l19U-cq5ygbCwilxCUvXOGOMN2ytlpYTYjlIkscUjadDF7Elglb7R9kUjxqjTZB-jtcEizwHq1oH-fuvVIz_ndAW6H_z8-D0C3m2Qccse-DybkrQ0Pkfz-EFvPdOeVRXqJGgB6UXZ2JDHyYAvapfDEwWOqtc9Z6nPshGV9lwjNoaCWghcW3fxoIzjalUOaGGkVhraSJpmH1nEJorKxEuLIjLUpmQ5mGprAVXMGaMkvauozugu6yWZhdA5dK-qLjAqoyZ4EpxiQuhizjUNBIy3AM9twHz1yYLxrxd-_7f3SdgfZylyTy5ntwegA13IA2D7xB067eVObJQXutjf4IfCbWdQg
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=2018+IEEE%2FACM+5th+Workshop+on+the+LLVM+Compiler+Infrastructure+in+HPC+%28LLVM-HPC%29&rft.atitle=OP2-Clang%3A+A+Source-to-Source+Translator+Using+Clang%2FLLVM+LibTooling&rft.au=Balogh%2C+G.D.&rft.au=Mudalige%2C+G.R.&rft.au=Reguly%2C+I.Z.&rft.au=Antao%2C+S.F.&rft.date=2018-11-01&rft.pub=IEEE&rft.spage=59&rft.epage=70&rft_id=info:doi/10.1109%2FLLVM-HPC.2018.8639205&rft.externalDocID=8639205