Extending the LLVM/Clang Framework for OpenMP Metadirective Support

Alok Mishra, A. Malik, B. Chapman
{"title":"Extending the LLVM/Clang Framework for OpenMP Metadirective Support","authors":"Alok Mishra, A. Malik, B. Chapman","doi":"10.1109/LLVMHPCHiPar51896.2020.00009","DOIUrl":null,"url":null,"abstract":"OpenMP 5.0 introduces many new directives to meet the demand of emerging high performance computing systems. Among these new directives, the metadirective and declare variant directives are important to control the execution behavior of a given application by compile-time adaptation based on the OpenMP context. The metadirective directive allows the selection of OpenMP directives based on the enclosing OpenMP context as well as on user-defined conditions. The declare variant directive declares a specialized variant of a base function and specifies the context in which that specialized variant is used. Support for these directives are available in few compilers with some limitations. Support for metadirective is not available in Clang. This paper presents our implementation of the metadirective directive in Clang. In this paper, we present an implementation which supports the OpenMP 5.0 metadirective specification. However, in addition, this work also implements a dynamic extension to the user-specified conditions. A dynamic evaluation of user-defined conditions provides programmers more freedom to express a range of adaptive algorithms that improve overall performance of a given application. For example, a program can estimate the cost of execution, with respect to time taken or energy consumption, of a kernel based on some dynamic or static variables and decide whether or not to offload the kernel to GPU using the metadirective. Since there is a significant lack of knowledge about the usage and performance analysis of metadirective, the work also studies its impact on application characteristics. To achieve this, we have modified several benchmark codes in the Rodinia benchmark suite. The Rodinia benchmark includes applications and kernels which target multi-core CPU and GPU platforms which helps programmers study the emerging computing platforms. Our modification to the Rodinia benchmarks enables the application developer to study the behavior of metadirective. Our analysis reveal that the main advantage of the dynamic implementation of metadirective is that it adds minimal to no overhead to the user application, in addition to allowing flexibility to the programmers to introduce portability and adaptability to their code. Our modification of the Rodinia benchmark suite provides several guidelines for programmers to achieve better performance with metadirective.","PeriodicalId":335989,"journal":{"name":"2020 IEEE/ACM 6th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) and Workshop on Hierarchical Parallelism for Exascale Computing (HiPar)","volume":"20 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE/ACM 6th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) and Workshop on Hierarchical Parallelism for Exascale Computing (HiPar)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/LLVMHPCHiPar51896.2020.00009","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

OpenMP 5.0 introduces many new directives to meet the demand of emerging high performance computing systems. Among these new directives, the metadirective and declare variant directives are important to control the execution behavior of a given application by compile-time adaptation based on the OpenMP context. The metadirective directive allows the selection of OpenMP directives based on the enclosing OpenMP context as well as on user-defined conditions. The declare variant directive declares a specialized variant of a base function and specifies the context in which that specialized variant is used. Support for these directives are available in few compilers with some limitations. Support for metadirective is not available in Clang. This paper presents our implementation of the metadirective directive in Clang. In this paper, we present an implementation which supports the OpenMP 5.0 metadirective specification. However, in addition, this work also implements a dynamic extension to the user-specified conditions. A dynamic evaluation of user-defined conditions provides programmers more freedom to express a range of adaptive algorithms that improve overall performance of a given application. For example, a program can estimate the cost of execution, with respect to time taken or energy consumption, of a kernel based on some dynamic or static variables and decide whether or not to offload the kernel to GPU using the metadirective. Since there is a significant lack of knowledge about the usage and performance analysis of metadirective, the work also studies its impact on application characteristics. To achieve this, we have modified several benchmark codes in the Rodinia benchmark suite. The Rodinia benchmark includes applications and kernels which target multi-core CPU and GPU platforms which helps programmers study the emerging computing platforms. Our modification to the Rodinia benchmarks enables the application developer to study the behavior of metadirective. Our analysis reveal that the main advantage of the dynamic implementation of metadirective is that it adds minimal to no overhead to the user application, in addition to allowing flexibility to the programmers to introduce portability and adaptability to their code. Our modification of the Rodinia benchmark suite provides several guidelines for programmers to achieve better performance with metadirective.
扩展LLVM/Clang框架支持OpenMP元指令
OpenMP 5.0引入了许多新的指令,以满足新兴高性能计算系统的需求。在这些新指令中,元指令和声明变量指令对于通过基于OpenMP上下文的编译时调整来控制给定应用程序的执行行为非常重要。metadirective指令允许基于封闭的OpenMP上下文以及用户定义的条件选择OpenMP指令。declare variant指令声明基函数的专门化变体,并指定使用该专门化变体的上下文。对这些指令的支持在一些有限制的编译器中是可用的。在Clang中不支持元指令。本文介绍了我们在Clang中实现的metadirective指令。在本文中,我们提出了一个支持OpenMP 5.0元指令规范的实现。然而,除此之外,这项工作还实现了对用户指定条件的动态扩展。用户定义条件的动态评估为程序员提供了更多的自由来表达一系列自适应算法,从而提高给定应用程序的整体性能。例如,一个程序可以根据一些动态或静态变量来估计一个内核的执行成本(相对于所花费的时间或能量消耗),并决定是否使用元指令将内核卸载到GPU。由于缺乏关于元指令的使用和性能分析的知识,本工作还研究了它对应用程序特征的影响。为了实现这一点,我们修改了Rodinia基准套件中的几个基准代码。Rodinia基准包括针对多核CPU和GPU平台的应用程序和内核,可以帮助程序员研究新兴的计算平台。我们对Rodinia基准的修改使应用程序开发人员能够研究元指令的行为。我们的分析表明,动态实现元指令的主要优点是,除了允许程序员灵活地为他们的代码引入可移植性和适应性之外,它还为用户应用程序增加了最小甚至没有开销。我们对Rodinia基准套件的修改为程序员提供了一些指导方针,以实现更好的性能。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书