Gdura, Youssef Omran (2012) a New Parallelisation Technique for Heterogeneous Cpus

Total Page:16

File Type:pdf, Size:1020Kb

Gdura, Youssef Omran (2012) a New Parallelisation Technique for Heterogeneous Cpus Gdura, Youssef Omran (2012) A new parallelisation technique for heterogeneous CPUs. PhD thesis http://theses.gla.ac.uk/3406/ Copyright and moral rights for this thesis are retained by the author A copy can be downloaded for personal non-commercial research or study, without prior permission or charge This thesis cannot be reproduced or quoted extensively from without first obtaining permission in writing from the Author The content must not be changed in any way or sold commercially in any format or medium without the formal permission of the Author When referring to this work, full bibliographic details including the author, title, awarding institution and date of the thesis must be given Glasgow Theses Service http://theses.gla.ac.uk/ [email protected] . A New Parallelisation Technique for Heterogeneous CPUs by Youssef Omran Gdura A Thesis presented for the degree of Doctor of Philosophy to the School of Computing Science, College of Science and Engineering, University of Glasgow May 2012 . Copyright © Youssef Omran Gdura, 2012. Abstract Parallelization has moved in recent years into the mainstream compilers, and the demand for parallelizing tools that can do a better job of automatic parallelization is higher than ever. During the last decade considerable attention has been focused on developing pro- gramming tools that support both explicit and implicit parallelism to keep up with the power of the new multiple core technology. Yet the success to develop automatic paral- lelising compilers has been limited mainly due to the complexity of the analytic process required to exploit available parallelism and manage other parallelisation measures such as data partitioning, alignment and synchronization. This dissertation investigates developing a programming tool that automatically paral- lelises large data structures on a heterogeneous architecture and whether a high-level pro- gramming language compiler can use this tool to exploit implicit parallelism and make use of the performance potential of the modern multicore technology. The work involved the development of a fully automatic parallelisation tool, called VSM, that completely hides the underlying details of general purpose heterogeneous architectures. The VSM imple- mentation provides direct and simple access for users to parallelise array operations on the Cell’s accelerators without the need for any annotations or process directives. This work also involved the extension of the Glasgow Vector Pascal compiler to work with the VSM implementation as a one compiler system. The developed compiler system, which is called VP-Cell, takes a single source code and parallelises array expressions automatically. Several experiments were conducted using Vector Pascal benchmarks to show the validity of the VSM approach. The VP-Cell system achieved significant runtime performance on one accelerator as compared to the master processor’s performance and near-linear speedups over code runs on the Cell’s accelerators. Though VSM was mainly designed for developing parallelising compilers it also showed a considerable performance by running C code over the Cell’s accelerators. i Declaration This thesis presented a work that was carried at the University of Glasgow under the super- vision of Dr. William Cockshott and Dr. John O’Donnell , School of Computing Science, during the period between March 2007 to January 2012. I declare that the work is entirely my own work and it has not been previously submitted for any other degree or qualification in any university. Youssef Omran Gdura Glasgow, May 2012 ii Acknowledgments I would like to express my grateful acknowledgment to my supervisors Dr. William Paul Cockshott for his guidance, enthusiasm and assistance during the course of this PhD and to my second supervisor Dr. John O’Donnell for his support. I also wish to express my sincere thanks to the School of Computing Science, University of Glasgow for creating an environment that has been fabulous for research and fun. Also this work would not have been possible without the financial support from the Ministry of Education in Libya, I am grateful to them for this opportunity. To my external and internal examiners, Prof Sven-Bodo Scholz and Dr Wim Vander- bauwhede, for their interest in this work and for taking the time to study this thesis ex- tensively. I would like also to take this opportunity to express my sincere appreciation to all the staff at University of Glasgow for their support and valuable assistance during the Libyan crisis in 2011. I dedicate this work for the soul of my father and mother, who passed away while I was doing my Master degree and to the soul of my oldest brother and oldest sister, who passed away while I am doing my PhD. Special thanks to my beloved wife, Nadia, for her patience and providing me comfort and to the five parallel accelerators in my life my daughters, Raian, Raihan and Jeanan and my sons, Omran and Abdalrahman, for giving me their love, support and all the joy. I am most appreciative of my brothers and sisters for their continuing support, as without their supports and wishes, I couldn’t achieve what I have achieved today. Above all, I thank Allah almighty for his unlimited blessings. Youssef Glasgow, May 2012 iii Contents Abstract i List of Figures v List of Tables viii List of Publications ix 1 Introduction 1 1.1 Thesis Statement . .3 1.2 Motivations . .4 1.3 Objectives . .5 1.4 Contributions . .6 1.5 Outline . .7 2 Background 10 2.1 Overview of Parallel Processors . 10 2.2 Parallel Memory Architectures . 12 2.3 Parallel Computing . 13 2.4 Parallel Programming Paradigms . 22 2.5 Virtual Machines . 33 2.6 Genetic Algorithms . 34 3 The Cell Processor & Vector Pascal 37 3.1 Introduction to PowerPC Architectures . 37 3.2 The Cell Broadband Engine Processor . 47 3.3 Glasgow Vector Pascal . 60 3.4 Assembly Language Directives . 67 4 Related work 68 4.1 Compute Unified Device Architecture (CUDA) . 68 4.2 Open Computing Language (Open CL) . 71 4.3 Programming the Cell BE Architecture . 75 iv Contents 5 Virtual SIMD Machine 96 5.1 Introduction . 96 5.2 Virtual SIMD Registers . 98 5.3 Virtual SIMD Instructions . 100 5.4 VSM Messaging Protocol . 102 5.5 PPE Interpreter . 104 5.6 SPE Interpreter . 109 5.7 Using VSM . 123 5.8 Experimental Results . 125 6 Host Compiler Development 135 6.1 PowerPC Machine Description . 136 6.2 Machine-dependent Routines . 140 6.3 Assembly Macros . 142 6.4 Stack Frame Operations . 144 6.5 Compiler Building Process . 145 6.6 PowerPC Compiler Extension . 146 6.7 Building the VP-Cell Compiler System . 152 6.8 Coding . 154 7 Code Generator Optimiser 155 7.1 Introduction . 155 7.2 Previous Work . 156 7.3 Permutation Technique . 157 7.4 Why Instructions Ordering is a Problem . 158 7.5 Genetic Algorithm Approach to the Problem . 161 7.6 Key Design Aspects . 162 7.7 Implementation . 167 7.8 Experimental Results . 171 8 Evaluating VP-Cell Compiler 179 8.1 Machine Configuration . 179 8.2 Testing Developed Tools . 180 8.3 Performance Tuning . 181 8.4 Experimental Results . 182 9 Conclusion and Future Work 206 9.1 Contribution . 207 9.2 Future Work . 208 v List of Figures 2.1 Arrays Alignment . 17 2.2 Sample of APL’s Character Set . 22 2.3 ZPL Directions Operators . 25 2.4 Defining Arrays in SaC . 28 2.5 SaC WITH loop . 29 3.1 Pascal Code and CISC Assembly Instruction . 38 3.2 Pascal Code and RISC Assembly Instruction . 38 3.3 PowerPC Instruction Format . 39 3.4 PowerPC ABI registers conventions . 40 3.5 The Cell BE Schematic Diagram . 49 3.6 SPE Hardware Diagram . 50 3.7 SPE_CONTROL_AREA Structure . 56 3.8 SPE Hardware Diagram . 60 3.9 Pascal Code Segment . 62 3.10 A Simple VP Pure function . 65 4.1 OpenCL Functions . 74 4.2 Scalar C Function . 74 4.3 Parallel OpenCL Kernel . 74 4.4 OpenMP Program Execution . 79 4.5 Sieve Function Prototype . 81 4.6 Sieve Block . 81 4.7 SieveC++ Implementation . 82 4.8 Sieve C++ Code . 83 4.9 Offload Function Prototype . 85 4.10 Offload C++ Code . 86 4.11 C++ Class . 93 4.12 C++ Code Segment Using TBB libraries . 93 5.1 Splitting a VSM Register on 4 SPEs . 98 5.2 Message Formats . 103 vi List of Figures 5.3 Broadcasing PPE Messages to SPES . 105 5.4 SPE Thread Creation . 106 5.5 Launching SPE Thread Using POSIX Threads . 106 5.6 Barrier Synchronisation Routine . 107 5.7 Store Virtual SIMD Instruction . 109 5.8 Load Virtual SIMD Instruction . 110 5.9 SPE Interpreter Structure . 111 5.10 Messaging Pulling Code Segment . 112 5.11 Loading Unaligned Data to SPE’s Local Memory . 114 5.12 Splitting an SPE Block into 3 DMAs for Storing Process . 116 5.13 Synchronise Shared-Block . 118 5.14 Storing Middle Block . ..
Recommended publications
  • A Type Inference on Executables
    A Type Inference on Executables Juan Caballero, IMDEA Software Institute Zhiqiang Lin, University of Texas at Dallas In many applications source code and debugging symbols of a target program are not available, and what we can only access is the program executable. A fundamental challenge with executables is that during compilation critical information such as variables and types is lost. Given that typed variables provide fundamental semantics of a program, for the last 16 years a large amount of research has been carried out on binary code type inference, a challenging task that aims to infer typed variables from executables (also referred to as binary code). In this article we systematize the area of binary code type inference according to its most important dimensions: the applications that motivate its importance, the approaches used, the types that those approaches infer, the implementation of those approaches, and how the inference results are evaluated. We also discuss limitations, point to underdeveloped problems and open challenges, and propose further applications. Categories and Subject Descriptors: D.3.3 [Language Constructs and Features]: Data types and struc- tures; D.4.6 [Operating Systems]: Security and Protection General Terms: Languages, Security Additional Key Words and Phrases: type inference, program executables, binary code analysis ACM Reference Format: Juan Caballero and Zhiqiang Lin, 2015. Type Inference on Executables. ACM Comput. Surv. V, N, Article A (January YYYY), 35 pages. DOI:http://dx.doi.org/10.1145/0000000.0000000 1. INTRODUCTION Being the final deliverable of software, executables (or binary code, as we use both terms interchangeably) are everywhere. They contain the final code that runs on a system and truly represent the program behavior.
    [Show full text]
  • Targeting Embedded Powerpc
    Freescale Semiconductor, Inc. EPPC.book Page 1 Monday, March 28, 2005 9:22 AM CodeWarrior™ Development Studio PowerPC™ ISA Communications Processors Edition Targeting Manual Revised: 28 March 2005 For More Information: www.freescale.com Freescale Semiconductor, Inc. EPPC.book Page 2 Monday, March 28, 2005 9:22 AM Metrowerks, the Metrowerks logo, and CodeWarrior are trademarks or registered trademarks of Metrowerks Corpora- tion in the United States and/or other countries. All other trade names and trademarks are the property of their respective owners. Copyright © 2005 by Metrowerks, a Freescale Semiconductor company. All rights reserved. No portion of this document may be reproduced or transmitted in any form or by any means, electronic or me- chanical, without prior written permission from Metrowerks. Use of this document and related materials are governed by the license agreement that accompanied the product to which this manual pertains. This document may be printed for non-commercial personal use only in accordance with the aforementioned license agreement. If you do not have a copy of the license agreement, contact your Metrowerks representative or call 1-800-377- 5416 (if outside the U.S., call +1-512-996-5300). Metrowerks reserves the right to make changes to any product described or referred to in this document without further notice. Metrowerks makes no warranty, representation or guarantee regarding the merchantability or fitness of its prod- ucts for any particular purpose, nor does Metrowerks assume any liability arising
    [Show full text]
  • Pathscale ENZO GTC12 S0631 – Programming Heterogeneous Many-Cores Using Directives C
    PathScale ENZO GTC12 S0631 – Programming Heterogeneous Many-Cores Using Directives C. Bergström | May 14th, 2012 Brief Introduction to ENZO 2 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 ENZO Overview & Goals Speed transition to GPU & many-core systems • Simplify the task of migrating software written in C, C++ & Fortran • Uses OpenHMPP Standard (easy migration) • CAPS HMPP compatible Performance & HPC focused • Fully exploits NVIDIA GPU features • Generates native instructions optimized for NVIDIA GPU 3 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 Project Schedule & Status 4 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 Project Schedule . ENZO Production release June 2012 – OpenHMPP 2.5 C, C++ and Fortran . Next ENZO Production release October 2012 – More tools and better support for libraries – x8664 OpenHMPP task parallelism (similar to OMP3 tasks) – More optimizations (IPA / CG2 / textures) – OpenHMPP 3.0 – CUDA 4.x – Kepler 5 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 Project Status . OpenHMPP 2.5 – Running CAPS C & Fortran Labs – PathScale written HMPP test suite – Customer code . New C++ compiler – Perennial C++VS and CVSA regression free – Corner case compile time issues – Corner case runtime issues . Ongoing effort – Performance tuning & benchmarking – Compiler robustness – Nightly compiler builds to address issues 6 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 Performance 7 | PathScale GTC12 S0631 Tutorial | May 14th, 2012 Performance . NVIDIA Tesla 2050 - “Lab2” SGEMM – ENZO – /opt/enzo/bin/pathcc -hmpp
    [Show full text]
  • Interprocedural Analysis of Low-Level Code
    TECHNISCHE UNIVERSITAT¨ MUNCHEN¨ Institut fur¨ Informatik Lehrstuhl Informatik II Interprocedural Analysis of Low-Level Code Andrea Flexeder Vollstandiger¨ Abdruck der von der Fakultat¨ fur¨ Informatik der Technischen Universitat¨ Munchen¨ zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften (Dr. rer. nat.) genehmigten Dissertation. Vorsitzender: Univ.-Prof. Dr. H. M. Gerndt Prufer¨ der Dissertation: 1. Univ.-Prof. Dr. H. Seidl 2. Dr. A. King, University of Kent at Canterbury / UK Die Dissertation wurde am 14.12.2010 bei der Technischen Universitat¨ Munchen¨ eingereicht und durch die Fakultat¨ fur¨ Informatik am 9.6.2011 angenommen. ii Contents 1 Analysis of Low-Level Code 1 1.1 Source versus Binary . 1 1.2 Application Areas . 6 1.3 Executable and Linkable Format (ELF) .................. 12 1.4 Application Binary Interface (ABI)..................... 18 1.5 Assumptions . 24 1.6 Contributions . 24 2 Control Flow Reconstruction 27 2.1 The Concrete Semantics . 31 2.2 Interprocedural Control Flow Reconstruction . 33 2.3 Practical Issues . 39 2.4 Implementation . 43 2.5 Programming Model . 44 3 Classification of Memory Locations 49 3.1 Semantics . 51 3.2 Interprocedural Variable Differences . 58 3.3 Application to Assembly Analysis . 73 4 Reasoning about Array Index Expressions 81 4.1 Linear Two-Variable Equalities . 81 4.2 Application to Assembly Analysis . 88 4.3 Register Coalescing and Locking . 89 5 Tools 91 5.1 Combination of Abstract Domains . 91 5.2 VoTUM . 96 6 Side-Effect Analysis 101 6.1 Semantics . 105 6.2 Analysis of Side-Effects . 108 6.3 Enhancements . 115 6.4 Experimental Results . 118 iii iv CONTENTS 7 Exploiting Alignment for WCET and Data Structures 123 7.1 Alignment Analysis .
    [Show full text]
  • Locality-Aware Automatic Parallelization for GPGPU with Openhmpp Directives
    Locality-Aware Automatic Parallelization for GPGPU with OpenHMPP Directives José M. Andión, Manuel Arenaz, François Bodin, Gabriel Rodríguez and Juan Touriño 7th International Symposium on High-Level Parallel Programming and Applications (HLPP 2014) July 3-4, 2014 — Amsterdam, Netherlands Outline • Motivation: General Purpose Computation with GPUs • GPGPU with CUDA & OpenHMPP • The KIR: an IR for the Detection of Parallelism • Locality-Aware Generation of Efficient GPGPU Code • Case Studies: CONV3D & SGEMM • Performance Evaluation • Conclusions & Future Work J.M. Andión et al. Locality-Aware Automatic Parallelization for GPGPU with OpenHMPP Directives. HLPP 2014. Outline • Motivation: General Purpose Computation with GPUs • GPGPU with CUDA & OpenHMPP • The KIR: an IR for the Detection of Parallelism • Locality-Aware Generation of Efficient GPGPU Code • Case Studies: CONV3D & SGEMM • Performance Evaluation • Conclusions & Future Work J.M. Andión et al. Locality-Aware Automatic Parallelization for GPGPU with OpenHMPP Directives. HLPP 2014. 100,000 Intel Xeon 6 cores, 3.3 GHz (boost to 3.6 GHz) Intel Xeon 4 cores, 3.3 GHz (boost to 3.6 GHz) Intel Core i7 Extreme 4 cores 3.2 GHz (boost to 3.5 GHz) 24,129 Intel Core Duo Extreme 2 cores, 3.0 GHz 21,871 Intel Core 2 Extreme 2 cores, 2.9 GHz 19,484 10,000 AMD Athlon 64, 2.8 GHz 14,387 AMD Athlon, 2.6 GHz 11,865 Intel Xeon EE 3.2 GHz 7,108 Intel D850EMVR motherboard (3.06 GHz, Pentium 4 processor with Hyper-Threading Technology) 6,043 6,681 IBM Power4, 1.3 GHz 4,195 3,016 Intel VC820 motherboard, 1.0 GHz Pentium III processor 1,779 Professional Workstation XP1000, 667 MHz 21264A Digital AlphaServer 8400 6/575, 575 MHz 21264 1,267 1000 993 AlphaServer 4000 5/600, 600 MHz 21164 649 Digital Alphastation 5/500, 500 MHz 481 Digital Alphastation 5/300, 300 MHz 280 22%/year Digital Alphastation 4/266, 266 MHz 183 IBM POWERstation 100, 150 MHz 117 100 Digital 3000 AXP/500, 150 MHz 80 HP 9000/750, 66 MHz 51 IBM RS6000/540, 30 MHz 24 52%/year Performance (vs.
    [Show full text]
  • How to Write Code That Will Survive
    Programming Heterogeneous Many-cores Using Directives HMPP - OpenAcc F. Bodin, CAPS CTO Introduction • Programming many-core systems faces the following dilemma o Achieve "portable" performance • Multiple forms of parallelism cohabiting – Multiple devices (e.g. GPUs) with their own address space – Multiple threads inside a device – Vector/SIMD parallelism inside a thread • Massive parallelism – Tens of thousands of threads needed o The constraint of keeping a unique version of codes, preferably mono- language • Reduces maintenance cost • Preserves code assets • Less sensitive to fast moving hardware targets • Codes last several generations of hardware architecture • For legacy codes, directive-based approach may be an alternative o And may benefit from auto-tuning techniques CC 2012 www.caps-entreprise.com 2 Profile of a Legacy Application • Written in C/C++/Fortran • Mix of user code and while(many){ library calls ... mylib1(A,B); ... • Hotspots may or may not be myuserfunc1(B,A); parallel ... mylib2(A,B); ... • Lifetime in 10s of years myuserfunc2(B,A); ... • Cannot be fully re-written } • Migration can be risky and mandatory CC 2012 www.caps-entreprise.com 3 Overview of the Presentation • Many-core architectures o Definition and forecast o Why usual parallel programming techniques won't work per se • Directive-based programming o OpenACC sets of directives o HMPP directives o Library integration issue • Toward a portable infrastructure for auto-tuning o Current auto-tuning directives in HMPP 3.0 o CodeletFinder for offline auto-tuning o Toward a standard auto-tuning interface CC 2012 www.caps-entreprise.com 4 Many-Core Architectures Heterogeneous Many-Cores • Many general purposes cores coupled with a massively parallel accelerator (HWA) Data/stream/vector CPU and HWA linked with a parallelism to be PCIx bus exploited by HWA e.g.
    [Show full text]
  • Mac OS X ABI Function Call Guide
    Mac OS X ABI Function Call Guide 2005-12-06 PowerPC and and the PowerPC logo are Apple Computer, Inc. trademarks of International Business © 2005 Apple Computer, Inc. Machines Corporation, used under license All rights reserved. therefrom. Simultaneously published in the United No part of this publication may be States and Canada. reproduced, stored in a retrieval system, or Even though Apple has reviewed this document, transmitted, in any form or by any means, APPLE MAKES NO WARRANTY OR mechanical, electronic, photocopying, REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS recording, or otherwise, without prior DOCUMENT, ITS QUALITY, ACCURACY, written permission of Apple Computer, Inc., MERCHANTABILITY, OR FITNESS FOR A with the following exceptions: Any person PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND is hereby authorized to store documentation YOU, THE READER, ARE ASSUMING THE on a single computer for personal use only ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. and to print copies of documentation for IN NO EVENT WILL APPLE BE LIABLE FOR personal use provided that the DIRECT, INDIRECT, SPECIAL, INCIDENTAL, documentation contains Apple’s copyright OR CONSEQUENTIAL DAMAGES notice. RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if The Apple logo is a trademark of Apple advised of the possibility of such damages. Computer, Inc. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN Use of the “keyboard” Apple logo LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, (Option-Shift-K) for commercial purposes or employee is authorized to make any without the prior written consent of Apple modification, extension, or addition to this may constitute trademark infringement and warranty.
    [Show full text]
  • CAPS Openacc Compiler
    CAPS OpenACC Compiler HMPP Workbench 3.2 IDDN.FR.001.490007.000.S.P.2008.000.10600 This information is the property of CAPS entreprise and cannot be used, reproduced or transmitted without authorization. Headquarters – France CAPS – USA CAPS – CHINA Immeuble CAP Nord 4701 Patrick Drive Bldg 12 Suite E2, 30/F 4A Allée Marie Berhaut Santa Clara JuneYao International Plaza 35000 Rennes CA 95054 789, Zhaojiabang Road, France Shanghai 200032 Tel.: +33 (0)2 22 51 16 00 Tel.: +1 408 550 2887 x70 Tel.: +86 21 3363 0057 Fax: +33 (0)2 23 20 16 43 Fax: +86 21 3363 0067 [email protected] [email protected] [email protected] N° d’agrément formation : 53 35 08397 35 Visit our website: http://www.caps-entreprise.com CAPS OpenACC Compiler SUMMARY 1. Introduction 5 1.1. Revisions history .................................................................................................................................... 5 1.2. Introduction ............................................................................................................................................ 6 1.3. What is HMPP Workbench? What is the CAPS OpenACC Compiler? ................................................. 6 1.4. Execution Model .................................................................................................................................... 8 1.5. Memory Model ....................................................................................................................................... 8 2. OpenACC Directives 9 2.1. kernels
    [Show full text]
  • Using CAPS Compiler on NVIDIA Kepler and CARMA Systems
    Using CAPS Compiler on NVIDIA Kepler and CARMA Systems F. Bodin CTO – CAPS entreprise Introduction • CAPS develops programming tools to help writing a unique source code that can be executed on existing accelerator technologies o C / C++ / Fortran • Fast moving hardware systems require two directives sets o OpenHMPP - easy to extend – integrate new HW features o OpenACC - standardized – longer term view but moving slowly • Generates CUDA or OpenCL codes o Portable on AMD GPU and APU, Intel MIC, Nvidia Kepler-Carma, … nvidia SC 2012 www.caps-entreprise.com 2 CAPS Technology • Provide OpenACC and OpenHMPP directives o OpenHMPP codelet based o OpenACC code region based #pragma hmpp myfunc codelet, … void saxpy(int n, float alpha, float x[n], float y[n]){ #pragma hmppcg gridify(i) for(int i = 0; i<n; ++i) y[i] = alpha*x[i] + y[i]; } #pragma acc kernels … { for(int i = 0; i<n; ++i) y[i] = alpha*x[i] + y[i]; } nvidia SC 2012 www.caps-entreprise.com 3 Compilation Process • Source-to-source technology C++ C Fortran Frontend Frontend Frontend Extraction module codelets Host Fun#1 Fun #2 code Fun #3 Instrumentation OpenCL/Cuda module Generation CPU compiler Native (gcc, ifort, …) compilers Executable CAPS HWA Code (mybin.exe) Runtime (Dyn. library) www.caps-entreprise.com nvidia SC 2012 4 A Few Typical Situations 1. Simple nested loops 6. Dealing with accelerated library 2. Data transfer optimization 7. Dealing with dynamic accelerated tasks scheduling 3. Complex loop nests 8. Using multiple accelerators 4. Code tuning 9. Nested parallelism using native 5. Integrating auto-tuning techniques nvidia SC 2012 www.caps-entreprise.com 5 Simple nested loops - 1 Host • The simple construct is to CPU declare a parallel loop to be code Accelerator compiled and executed on an accelerator send A,B,C o Iterations of the loop nests are converted into threads execute kern.
    [Show full text]
  • This Is the GPU Based ANUGA
    This is the GPU based ANUGA Documentation Documentation is under doc directory, and the html version generated by Sphinx under the directory doc/sphinx/build/html/ Install Guide 1. Original ANUGA is required 2. For CUDA version, PyCUDA is required 3. For OpenHMPP version, current implementation is based on the CAPS OpenHMPP Compiler When compiling the code with Makefile, the NVIDIA device architecture and compute capability need to be specified For example, GTX480 with 2.0 compute capability HMPP_FLAGS13 = -e --nvcc-options -Xptxas=-v,-arch=sm_20 -c --force For GTX680 with 3.0 compute capability HMPP_FLAGS13 = -e --nvcc-options -Xptxas=-v,-arch=sm_30 -c --force Also the path for python, numpy, and ANUGA/utilities packages need to be specified Defining the macro USING_MIRROR_DATA in hmpp_fun.h #define USING_MIRROR_DATA will enable the advanced version, which uses OpenHMPP Mirrored Data technology so that data transmission costs can be effectively cut down, otherwise basic version is enabled. Environment Vars Please add following vars to you .bashrc or .bash_profile file export ANUGA_CUDA=/where_the_anuga-cuda/src export $PYTHONPATH=$PYTHONPATH:$ANUGA_CUDA Basic Code Structure README Evolve workflow.pdf device_spe/ docs/ profiling/ CUDA/ source/ sphinx/ build/ html/ config.py anuga_cuda/ gpu_domain_advanced.py gpu_domain_basic.py Makefile anuga-cuda/ hmpp_domain.py hmpp_python_glue.c src/ anuga_HMPP/ sw_domain.h sw_domain_fun.h hmpp_fun.h evolve.c scripts/ utilities/ CUDA/ merimbula/ merimbula.py tests/ HMPP/ merimbula.py README (What you are
    [Show full text]
  • Downloads Parallel Code and GPU So That the Program Can Execute Output Data from the HWA to the Host
    IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 9 OMP2HMPP: Compiler Framework for Energy-Performance Trade-off Analysis of Automatically Generated Codes Albert Saà-Garriga1, David Castells-Rufas2 and Jordi Carrabina3 1 Dept. Microelectronics and Electronic Systems, Universitat Autònoma de Barcelona Bellaterra, Barcelona 08193, Spain. general purpose CPUs and parallel programming models Abstract such as OpenMP [22]. In this paper we present automatic We present OMP2HMPP, a tool that, in a first step, transformation tool on the source code oriented to work automatically translates OpenMP code into various possible with General Propose Units for Graphic transformations of HMPP. In a second step OMP2HMPP Processing(GPGPUs). This new tool (OMP2HMPP) is in executes all variants to obtain the performance and power the category of source-to-source code transformations and consumption of each transformation. The resulting trade-off can be used to choose the more convenient version. seek to facilitate the generation of code for GPGPUs. After running the tool on a set of codes from the Polybench OMP2HMPP is able to run specific sections on benchmark we show that the best automatic transformation is accelerators, so that the program executes more efficiently equivalent to a manual one done by an expert. Compared on heterogeneous platform. OMP2HMPP was initially with original OpenMP code running in 2 quad-core processors developed for the systematic exploration of the large set of we obtain an average speed-up of 31× and 5.86× factor in possible transformations to determine the optimal one in operations per watt.
    [Show full text]
  • Program Sequentially, Carefully, and Benefit from Compiler Advances For
    Program Sequentially, Carefully, and Benefit from Compiler Advances for Parallel Heterogeneous Computing Mehdi Amini, Corinne Ancourt, Béatrice Creusillet, François Irigoin, Ronan Keryell To cite this version: Mehdi Amini, Corinne Ancourt, Béatrice Creusillet, François Irigoin, Ronan Keryell. Program Se- quentially, Carefully, and Benefit from Compiler Advances for Parallel Heterogeneous Computing. Magoulès Frédéric. Patterns for Parallel Programming on GPUs, Saxe-Coburg Publications, pp. 149- 169, 2012, 978-1-874672-57-9 10.4203/csets.34.6. hal-01526469 HAL Id: hal-01526469 https://hal-mines-paristech.archives-ouvertes.fr/hal-01526469 Submitted on 30 May 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Program Sequentially, Carefully, and Benefit from Compiler Advances for Parallel Heterogeneous Computing Mehdi Amini1;2 Corinne Ancourt1 B´eatriceCreusillet2 Fran¸coisIrigoin1 Ronan Keryell2 | 1MINES ParisTech/CRI, firstname.lastname @mines-paristech.fr 2SILKAN, firstname.lastname @silkan.com September 26th 2012 Abstract The current microarchitecture trend leads toward heterogeneity. This evolution is driven by the end of Moore's law and the frequency wall due to the power wall. Moreover, with the spreading of smartphone, some constraints from the mobile world drive the design of most new architectures.
    [Show full text]