UPC: a Portable High Performance Dialect of C

Total Page:16

File Type:pdf, Size:1020Kb

UPC: a Portable High Performance Dialect of C UPC: A Portable High Performance Dialect of C Kathy Yelick Christian Bell, Dan Bonachea, Wei Chen, Jason Duell, Paul Hargrove, Parry Husbands, Costin Iancu, Wei Tu, Mike Welcome Unified Parallel C at LBNL/UCB Parallelism on the Rise 1000000.00001P Aggregate Systems Performance 100000.0000 100T Earth Simulator ASCI Q ASCI White 10000.0000 SXSX---66 10T VPP5000 SXSX---55 SR8000G1 VPP800 ASCI Blue Increasing 1000.00001T ASCI Red VPP700 ASCI Blue Mountain SX-SX-44 T3E SX-4 T3E SR8000 Paragon Parallelism VPP500 SR2201/2K NWT/166 100G100.0000 T3D CMCM---55 SXSX---3R3R T90 SS---38003800 SXSX---33 SR2201 10G10.0000 C90 Single CPU FLOPS FLOPS FLOPS FLOPS VP2600/1 CRAYCRAY---222YYY---MP8MP8 0 Performance SXSX---22 SS---820/80820/80 1.0000 10GHz 1G SS---810/20810/20 VPVP---400400 10GHz XX---MPMP VPVP- --200200 100M0.1000 1GHz CPU Frequencies 10M0.0100 100MHz 1M0.0010 10MHz 1980 1985 1990 1995 2000 2005 2010 • 1.8x annual performance increase Year - 1.4x from improved technology and on-chip parallelism - 1.3x in processor count for larger machines Unified Parallel C at LBNL/UCB Parallel Programming Models • Parallel software is still an unsolved problem ! • Most parallel programs are written using either: - Message passing with a SPMD model - for scientific applications; scales easily - Shared memory with threads in OpenMP, Threads, or Java - non-scientific applications; easier to program • Partitioned Global Address Space (PGAS) Languages - global address space like threads (programmability) - SPMD parallelism like MPI (performance) - local/global distinction, i.e., layout matters (performance) Unified Parallel C at LBNL/UCB Partitioned Global Address Space Languages • Explicitly-parallel programming model with SPMD parallelism - Fixed at program start-up, typically 1 thread per processor • Global address space model of memory - Allows programmer to directly represent distributed data structures • Address space is logically partitioned - Local vs. remote memory (two-level hierarchy) • Programmer control over performance critical decisions - Data layout and communication • Performance transparency and tunability are goals - Initial implementation can use fine-grained shared memory • Base languages differ: UPC (C), CAF (Fortran), Titanium (Java) Unified Parallel C at LBNL/UCB UPC Design Philosophy • Unified Parallel C (UPC) is: - An explicit parallel extension of ISO C - A partitioned global address space language - Sometimes called a GAS language • Similar to the C language philosophy - Concise and familiar syntax - Orthogonal extensions of semantics - Assume programmers are clever and careful - Given them control; possibly close to hardware - Even though they may get intro trouble • Based on ideas in Split-C, AC, and PCP Unified Parallel C at LBNL/UCB A Quick UPC Tutorial Unified Parallel C at LBNL/UCB Virtual Machine Model Thread0 Thread1 Threadn X[0] X[1] X[P] Shared Global Global ptr: ptr: ptr: Private address space • Global address space abstraction - Shared memory is partitioned over threads - Shared vs. private memory partition within each thread - Remote memory may stay remote: no automatic caching implied - One-sided communication through reads/writes of shared variables • Build data structures using - Distributed arrays - Two kinds of pointers: Local vs. global pointers (“pointers to shared”) Unified Parallel C at LBNL/UCB UPC Execution Model • Threads work independently in a SPMD fashion - Number of threads given by THREADS set as compile time or runtime flag - MYTHREAD specifies thread index (0..THREADS-1) - upc_barrier is a global synchronization: all wait • Any legal C program is also a legal UPC program #include <upc.h> /* needed for UPC extensions */ #include <stdio.h> main() { printf("Thread %d of %d: hello UPC world\n", MYTHREAD, THREADS); } Unified Parallel C at LBNL/UCB Private vs. Shared Variables in UPC • C variables and objects are allocated in the private memory space • Shared variables are allocated only once, in thread 0’s space shared int ours; int mine; • Shared arrays are spread across the threads shared int x[2*THREADS] /* cyclic, 1 element each, wrapped */ shared int [2] y [2*THREADS] /* blocked, with block size 2 */ • Shared variables may not occur in a function definition unless static Thread0 Thread1 Threadn ours: x[0,n+1] x[1,n+2] x[n,2n] Shared y[0,1] y[2,3] y[2n-1,2n] space Private mine: Global address Global address mine: mine: Unified Parallel C at LBNL/UCB Work Sharing with upc_forall() shared int v1[N], v2[N], sum[N]; void main() { cyclic layout int i; i would for(i=0;upc_forall i<N;(i=0; i++) i<N; i++; &v1[i]owner) also computes work ifsum[i]=v1[i]+v2[i]; (MYTHREAD = = i%THREADS) } sum[i]=v1[i]+v2[i]; } • This owner computes idiom is common, so UPC has upc_forall(init; test; loop; affinity) statement; • Programmer indicates the iterations are independent - Undefined if there are dependencies across threads - Affinity expression indicates which iterations to run - Integer: affinity%THREADS is MYTHREAD - Pointer: upc_threadof(affinity) is MYTHREAD Unified Parallel C at LBNL/UCB Memory Consistency in UPC • Shared accesses are strict or relaxed, designed by: - A pragma affects all otherwise unqualified accesses - #pragma upc relaxed - #pragma upc strict - Usually done by including standard .h files with these - A type qualifier in a declaration affects all accesses - int strict shared flag; - A strict or relaxed cast can be used to override the current pragma or declared qualifier. • Informal semantics - Relaxed accesses must obey dependencies, but non-dependent access may appear reordered by other threads - Strict accesses appear in order: sequentially consistent Unified Parallel C at LBNL/UCB Other Features of UPC • Synchronization constructs - Global barriers - Variant with labels to document matching of barriers - Split-phase variant (upc_notify and upc_wait) - Locks - upc_lock, upc_lock_attempt, upc_unlock • Collective communication library - Allows for asynchronous entry/exit shared [] int A[10]; shared [10] int B[10*THREADS]; // Initialize A. upc_all_broadcast(B, A, sizeof(int)*NELEMS, UPC_IN_MYSYNC | UPC_OUT_ALLSYNC ); • Parallel I/O library Unified Parallel C at LBNL/UCB The Berkeley UPC Compiler Unified Parallel C at LBNL/UCB Goals of the Berkeley UPC Project • Make UPC Ubiquitous on - Parallel machines - Workstations and PCs for development - A portable compiler: for future machines too • Components of research agenda: 1. Runtime work for Partitioned Global Address Space (PGAS) languages in general 2. Compiler optimizations for parallel languages 3. Application demonstrations of UPC Unified Parallel C at LBNL/UCB Berkeley UPC Compiler • Compiler based on Open64 UPC • Multiple front-ends, including gcc • Intermediate form called WHIRL Higher WHIRL • Current focus on C backend • IA64 possible in future Optimizing C + • UPC Runtime transformations Runtime • Pointer representation • Shared/distribute memory Lower WHIRL • Communication in GASNet • Portable Assembly: IA64, • Language-independent MIPS,… + Runtime Unified Parallel C at LBNL/UCB Optimizations • In Berkeley UPC compiler - Pointer representation - Generating optimizable single processor code - Message coalescing (aka vectorization) • Opportunities - forall loop optimizations (unnecessary iterations) - Irregular data set communication (Titanium) - Sharing inference - Automatic relaxation analysis and optimizations Unified Parallel C at LBNL/UCB Pointer-to-Shared Representation • UPC has three difference kinds of pointers: - Block-cyclic, cyclic, and indefinite (always local) • A pointer needs a “phase” to keep track of where it is in a block - Source of overhead for updating and de-referencing - Consumes space in the pointer Address Thread Phase • Our runtime has special cases for: - Phaseless (cyclic and indefinite) – skip phase update - Indefinite – skip thread id update - Some machine-specific special cases for some memory layouts • Pointer size/representation easily reconfigured - 64 bits on small machines, 128 on large, word or struct Unified Parallel C at LBNL/UCB Performance of Pointers to Shared Pointer-to-shared operations Cost of shared remote access 50 6000 45 ptr + int -- HP 5000 40 ptr + int -- Berkeley 35 ptr == ptr -- HP 4000 30 25 ptr == ptr-- Berkeley 3000 20 2000 15 ns/cycle) 10 1000 5 (1.5 cycles # of # of cycles (1.5 ns/cycle) (1.5 # of cycles 0 0 generic cyclic indefinite HP read Berkeley HP write Berkeley type of pointer read write • Phaseless pointers are an important optimization - Indefinite pointers almost as fast as regular C pointers - General blocked cyclic pointer 7x slower for addition • Competitive with HP compiler, which generates native code - Both compiler have improved since these were measured Unified Parallel C at LBNL/UCB Generating Optimizable (Vectorizable) Code Livermore Loops 1.15 1.1 1.05 1 0.95 C time/ UPC time C time/ 0.9 0.85 1 3 5 7 9 11 13 15 17 19 21 23 Kernel • Translator generated C code can be as efficient as original C code • Source-to-source translation a good strategy for portable PGAS language implementations Unified Parallel C at LBNL/UCB NAS CG: OpenMP style vs. MPI style NAS CG Performance 120 100 UPC (OpenMP style) 80 UPC (MPI Style) 60 second 40 MPI Fortran 20 MFLOPS per thread/ thread/ per MFLOPS 0 24812 Threads (SSP mode, two nodes) • GAS language outperforms MPI+Fortran (flat is good!) • Fine-grained (OpenMP style) version still slower • shared memory programming style leads to more overhead (redundant boundary computation) • GAS languages can support both programming
Recommended publications
  • L22: Parallel Programming Language Features (Chapel and Mapreduce)
    12/1/09 Administrative • Schedule for the rest of the semester - “Midterm Quiz” = long homework - Handed out over the holiday (Tuesday, Dec. 1) L22: Parallel - Return by Dec. 15 - Projects Programming - 1 page status report on Dec. 3 – handin cs4961 pdesc <file, ascii or PDF ok> Language Features - Poster session dry run (to see material) Dec. 8 (Chapel and - Poster details (next slide) MapReduce) • Mailing list: [email protected] December 1, 2009 12/01/09 Poster Details Outline • I am providing: • Global View Languages • Foam core, tape, push pins, easels • Chapel Programming Language • Plan on 2ft by 3ft or so of material (9-12 slides) • Map-Reduce (popularized by Google) • Content: • Reading: Ch. 8 and 9 in textbook - Problem description and why it is important • Sources for today’s lecture - Parallelization challenges - Brad Chamberlain, Cray - Parallel Algorithm - John Gilbert, UCSB - How are two programming models combined? - Performance results (speedup over sequential) 12/01/09 12/01/09 1 12/1/09 Shifting Gears Global View Versus Local View • What are some important features of parallel • P-Independence programming languages (Ch. 9)? - If and only if a program always produces the same output on - Correctness the same input regardless of number or arrangement of processors - Performance - Scalability • Global view - Portability • A language construct that preserves P-independence • Example (today’s lecture) • Local view - Does not preserve P-independent program behavior - Example from previous lecture? And what about ease
    [Show full text]
  • Parallel Programming
    Parallel Programming Libraries and implementations Outline • MPI – distributed memory de-facto standard • Using MPI • OpenMP – shared memory de-facto standard • Using OpenMP • CUDA – GPGPU de-facto standard • Using CUDA • Others • Hybrid programming • Xeon Phi Programming • SHMEM • PGAS MPI Library Distributed, message-passing programming Message-passing concepts Explicit Parallelism • In message-passing all the parallelism is explicit • The program includes specific instructions for each communication • What to send or receive • When to send or receive • Synchronisation • It is up to the developer to design the parallel decomposition and implement it • How will you divide up the problem? • When will you need to communicate between processes? Message Passing Interface (MPI) • MPI is a portable library used for writing parallel programs using the message passing model • You can expect MPI to be available on any HPC platform you use • Based on a number of processes running independently in parallel • HPC resource provides a command to launch multiple processes simultaneously (e.g. mpiexec, aprun) • There are a number of different implementations but all should support the MPI 2 standard • As with different compilers, there will be variations between implementations but all the features specified in the standard should work. • Examples: MPICH2, OpenMPI Point-to-point communications • A message sent by one process and received by another • Both processes are actively involved in the communication – not necessarily at the same time • Wide variety of semantics provided: • Blocking vs. non-blocking • Ready vs. synchronous vs. buffered • Tags, communicators, wild-cards • Built-in and custom data-types • Can be used to implement any communication pattern • Collective operations, if applicable, can be more efficient Collective communications • A communication that involves all processes • “all” within a communicator, i.e.
    [Show full text]
  • Outro to Parallel Computing
    Outro To Parallel Computing John Urbanic Pittsburgh Supercomputing Center Parallel Computing Scientist Purpose of this talk Now that you know how to do some real parallel programming, you may wonder how much you don’t know. With your newly informed perspective we will take a look at the parallel software landscape so that you can see how much of it you are equipped to traverse. How parallel is a code? ⚫ Parallel performance is defined in terms of scalability Strong Scalability Can we get faster for a given problem size? Weak Scalability Can we maintain runtime as we scale up the problem? Weak vs. Strong scaling More Processors Weak Scaling More accurate results More Processors Strong Scaling Faster results (Tornado on way!) Your Scaling Enemy: Amdahl’s Law How many processors can we really use? Let’s say we have a legacy code such that is it only feasible to convert half of the heavily used routines to parallel: Amdahl’s Law If we run this on a parallel machine with five processors: Our code now takes about 60s. We have sped it up by about 40%. Let’s say we use a thousand processors: We have now sped our code by about a factor of two. Is this a big enough win? Amdahl’s Law ⚫ If there is x% of serial component, speedup cannot be better than 100/x. ⚫ If you decompose a problem into many parts, then the parallel time cannot be less than the largest of the parts. ⚫ If the critical path through a computation is T, you cannot complete in less time than T, no matter how many processors you use .
    [Show full text]
  • The Continuing Renaissance in Parallel Programming Languages
    The continuing renaissance in parallel programming languages Simon McIntosh-Smith University of Bristol Microelectronics Research Group [email protected] © Simon McIntosh-Smith 1 Didn’t parallel computing use to be a niche? © Simon McIntosh-Smith 2 When I were a lad… © Simon McIntosh-Smith 3 But now parallelism is mainstream Samsung Exynos 5 Octa: • 4 fast ARM cores and 4 energy efficient ARM cores • Includes OpenCL programmable GPU from Imagination 4 HPC scaling to millions of cores Tianhe-2 at NUDT in China 33.86 PetaFLOPS (33.86x1015), 16,000 nodes Each node has 2 CPUs and 3 Xeon Phis 3.12 million cores, $390M, 17.6 MW, 720m2 © Simon McIntosh-Smith 5 A renaissance in parallel programming Metal C++11 OpenMP OpenCL Erlang Unified Parallel C Fortress XC Go Cilk HMPP CHARM++ CUDA Co-Array Fortran Chapel Linda X10 MPI Pthreads C++ AMP © Simon McIntosh-Smith 6 Groupings of || languages Partitioned Global Address Space GPU languages: (PGAS): • OpenCL • Fortress • CUDA • X10 • HMPP • Chapel • Metal • Co-array Fortran • Unified Parallel C Object oriented: • C++ AMP CSP: XC • CHARM++ Message passing: MPI Multi-threaded: • Cilk Shared memory: OpenMP • Go • C++11 © Simon McIntosh-Smith 7 Emerging GPGPU standards • OpenCL, DirectCompute, C++ AMP, … • Also OpenMP 4.0, OpenACC, CUDA… © Simon McIntosh-Smith 8 Apple's Metal • A "ground up" parallel programming language for GPUs • Designed for compute and graphics • Potential to replace OpenGL compute shaders, OpenCL/GL interop etc. • Close to the "metal" • Low overheads • "Shading" language based
    [Show full text]
  • C Language Extensions for Hybrid CPU/GPU Programming with Starpu
    C Language Extensions for Hybrid CPU/GPU Programming with StarPU Ludovic Courtès arXiv:1304.0878v2 [cs.MS] 10 Apr 2013 RESEARCH REPORT N° 8278 April 2013 Project-Team Runtime ISSN 0249-6399 ISRN INRIA/RR--8278--FR+ENG C Language Extensions for Hybrid CPU/GPU Programming with StarPU Ludovic Courtès Project-Team Runtime Research Report n° 8278 — April 2013 — 22 pages Abstract: Modern platforms used for high-performance computing (HPC) include machines with both general- purpose CPUs, and “accelerators”, often in the form of graphical processing units (GPUs). StarPU is a C library to exploit such platforms. It provides users with ways to define tasks to be executed on CPUs or GPUs, along with the dependencies among them, and by automatically scheduling them over all the available processing units. In doing so, it also relieves programmers from the need to know the underlying architecture details: it adapts to the available CPUs and GPUs, and automatically transfers data between main memory and GPUs as needed. While StarPU’s approach is successful at addressing run-time scheduling issues, being a C library makes for a poor and error-prone programming interface. This paper presents an effort started in 2011 to promote some of the concepts exported by the library as C language constructs, by means of an extension of the GCC compiler suite. Our main contribution is the design and implementation of language extensions that map to StarPU’s task programming paradigm. We argue that the proposed extensions make it easier to get started with StarPU, eliminate errors that can occur when using the C library, and help diagnose possible mistakes.
    [Show full text]
  • Unified Parallel C (UPC)
    Unified Parallel C (UPC) Vivek Sarkar Department of Computer Science Rice University [email protected] COMP 422 Lecture 21 March 27, 2008 Acknowledgments • Supercomputing 2007 tutorial on “Programming using the Partitioned Global Address Space (PGAS) Model” by Tarek El- Ghazawi and Vivek Sarkar —http://sc07.supercomputing.org/schedule/event_detail.php?evid=11029 2 Programming Models Process/Thread Address Space Message Passing Shared Memory DSM/PGAS MPI OpenMP UPC 3 The Partitioned Global Address Space (PGAS) Model • Aka the Distributed Shared Memory (DSM) model • Concurrent threads with a Th Th Th 0 … n-2 n-1 partitioned shared space —Memory partition Mi has affinity to thread Thi • (+)ive: x —Data movement is implicit —Data distribution simplified with M0 … Mn-2 Mn-1 global address space • (-)ive: —Computation distribution and Legend: synchronization still remain programmer’s responsibility Thread/Process Memory Access —Lack of performance transparency of local vs. remote Address Space accesses • UPC, CAF, Titanium, X10, … 4 What is Unified Parallel C (UPC)? • An explicit parallel extension of ISO C • Single global address space • Collection of threads —each thread bound to a processor —each thread has some private data —part of the shared data is co-located with each thread • Set of specs for a parallel C —v1.0 completed February of 2001 —v1.1.1 in October of 2003 —v1.2 in May of 2005 • Compiler implementations by industry and academia 5 UPC Execution Model • A number of threads working independently in a SPMD fashion —MYTHREAD specifies
    [Show full text]
  • IBM XL Unified Parallel C User's Guide
    IBM XL Unified Parallel C for AIX, V11.0 (Technology Preview) IBM XL Unified Parallel C User’s Guide Version 11.0 IBM XL Unified Parallel C for AIX, V11.0 (Technology Preview) IBM XL Unified Parallel C User’s Guide Version 11.0 Note Before using this information and the product it supports, read the information in “Notices” on page 97. © Copyright International Business Machines Corporation 2010. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Parallel programming and Declarations ..............39 Unified Parallel C...........1 Type qualifiers ............39 Parallel programming ...........1 Declarators .............41 Partitioned global address space programming model 1 Statements and blocks ...........42 Unified Parallel C introduction ........2 Synchronization statements ........42 Iteration statements...........46 Chapter 2. Unified Parallel C Predefined macros and directives .......47 Unified Parallel C directives ........47 programming model .........3 Predefined macros ...........48 Distributed shared memory programming ....3 Data affinity and data distribution .......3 Chapter 5. Unified Parallel C library Memory consistency ............5 functions..............49 Synchronization mechanism .........6 Utility functions .............49 Chapter 3. Using the XL Unified Parallel Program termination ..........49 Dynamic memory allocation ........50 C compiler .............9 Pointer-to-shared manipulation .......56 Compiler options .............9
    [Show full text]
  • Overview of the Global Arrays Parallel Software Development Toolkit: Introduction to Global Address Space Programming Models
    Overview of the Global Arrays Parallel Software Development Toolkit: Introduction to Global Address Space Programming Models P. Saddayappan2, Bruce Palmer1, Manojkumar Krishnan1, Sriram Krishnamoorthy1, Abhinav Vishnu1, Daniel Chavarría1, Patrick Nichols1, Jeff Daily1 1Pacific Northwest National Laboratory 2Ohio State University Outline of the Tutorial ! " Parallel programming models ! " Global Arrays (GA) programming model ! " GA Operations ! " Writing, compiling and running GA programs ! " Basic, intermediate, and advanced calls ! " With C and Fortran examples ! " GA Hands-on session 2 Performance vs. Abstraction and Generality Domain Specific “Holy Grail” Systems GA CAF MPI OpenMP Scalability Autoparallelized C/Fortran90 Generality 3 Parallel Programming Models ! " Single Threaded ! " Data Parallel, e.g. HPF ! " Multiple Processes ! " Partitioned-Local Data Access ! " MPI ! " Uniform-Global-Shared Data Access ! " OpenMP ! " Partitioned-Global-Shared Data Access ! " Co-Array Fortran ! " Uniform-Global-Shared + Partitioned Data Access ! " UPC, Global Arrays, X10 4 High Performance Fortran ! " Single-threaded view of computation ! " Data parallelism and parallel loops ! " User-specified data distributions for arrays ! " Compiler transforms HPF program to SPMD program ! " Communication optimization critical to performance ! " Programmer may not be conscious of communication implications of parallel program HPF$ Independent HPF$ Independent s=s+1 DO I = 1,N DO I = 1,N A(1:100) = B(0:99)+B(2:101) HPF$ Independent HPF$ Independent HPF$ Independent
    [Show full text]
  • Introduction to Parallel Programming Concepts
    Introduction to Parallel Programming Concepts Alan Scheinine, IT Consultant High Performance Computing Center for Computational Technology and Information Technology Services Louisiana State University E-mail: [email protected] Web: http://www.cct.lsu.edu/~scheinin/Parallel/ Contents 1 Introduction 1 2 Terminology 2 2.1 Hardware Architecture Terminology . 2 2.2 HPC Terminology . 3 2.3 Bandwidth and Latency Examples . 4 2.4 Amdahl’s Law . 4 3 Pipelining: From Cray to PC 5 3.1 Hardware Considerations . 5 3.2 An Entire Computer Pipelined . 6 3.3 The ALU Pipelined . 9 3.4 Vectorization Programming Considerations . 13 3.5 NEC, a Modern Vector Computer . 13 4 Instruction Execution Model 14 4.1 SIMD . 14 4.2 SMT . 14 4.3 MIMD and SPMD . 15 5 Hardware Complexity of Conventional CPUs 16 6 The Cost of a Context Switch 17 7 Tera Computer and Multithreading 18 8 Shared Memory and Distributed Memory 18 9 Beowulf Clusters 19 10 GP-GPU and Multithreading 20 11 IBM-Toshiba-Sony Cell Broadband Engine 23 12 ClearSpeed Coprocessor, Massively SIMD 25 13 Large Embarrassingly Parallel Tasks 26 14 OpenMP 27 14.1 Overview of OpenMP . 27 14.2 OpenMP Code Examples . 30 15 Message Passing 32 ii 15.1 Overview . 32 15.2 Examples . 34 15.3 Point-to-Point Communication . 35 15.4 Blocking Send . 35 15.5 Blocking Receive . 35 15.6 Buffered Communication . 36 15.7 Non-blocking Send and Recv . 37 15.8 Summary of Collective Communication . 38 15.9 Domain Decomposition and Ghost Vertices . 39 16 Other Parallel Languages 41 16.1 Unified Parallel C (UPC) .
    [Show full text]
  • Unified Parallel C for GPU Clusters: Language Extensions and Compiler Implementation
    Unified Parallel C for GPU Clusters: Language Extensions and Compiler Implementation Li Chen1, Lei Liu1, Shenglin Tang1, Lei Huang2, Zheng Jing1, Shixiong Xu1, Dingfei Zhang1, Baojiang Shou1 1 Key Laboratory of Computer System and Architecture, Institute of Computing Technology, Chinese Academy of Sciences, China {lchen,liulei2007,tangshenglin,jingzheng,xushixiong, zhangdingfei, shoubaojiang}@ict.ac.cn; 2 Department of Computer Science, University of Houston; Houston, TX, USA [email protected] 5 Abstract. Unified Parallel C (UPC), a parallel extension to ANSI C, is designed for high performance computing on large-scale parallel machines. With General-purpose graphics processing units (GPUs) becoming an increasingly important high performance computing platform, we propose new language extensions to UPC to take advantage of GPU clusters. We extend UPC with hierarchical data distribution, revise the execution model of UPC to mix SPMD with fork-join execution model, and modify the semantics of upc_forall to reflect the data-thread affinity on a thread hierarchy. We implement the compiling system, including affinity-aware loop tiling, GPU code generation, and several memory optimizations targeting NVIDIA CUDA. We also put forward unified data management for each UPC thread to optimize data transfer and memory layout for separate memory modules of CPUs and GPUs. The experimental results show that the UPC extension has better programmability than the mixed MPI/CUDA approach. We also demonstrate that the integrated compile-time and runtime optimization is effective to achieve good performance on GPU clusters. 1 Introduction Following closely behind the industry-wide move from uniprocessor to multi-core and many-core systems, HPC computing platforms are undergoing another major change: from homogeneous to heterogeneous platform.
    [Show full text]
  • The Resurgence of Parallel Programming Languages
    The resurgence of parallel programming languages Jamie Hanlon & Simon McIntosh-Smith University of Bristol Microelectronics Research Group [email protected] © Simon McIntosh-Smith, Jamie Hanlon 1 The Microelectronics Research Group at the University of Bristol www.cs.bris.ac.uk/Research/Micro © Simon McIntosh-Smith, Jamie Hanlon 2 The team Simon McIntosh-Smith Prof David May Prof Dhiraj Pradhan Head of Group Dr Jose Dr Kerstin Eder Dr Simon Hollis Dr Dinesh Nunez-Yanez Pamunuwa 7 tenured staff, 6 research assistants, 16 PhD students © Simon McIntosh-Smith, Jamie Hanlon 3 Group expertise Energy Aware COmputing (EACO): • Multi-core and many-core computer architectures • Inmos, XMOS, ClearSpeed, Pixelfusion, … • Algorithms for heterogeneous architectures (GPUs, OpenCL) • Electronic and Optical Network on Chip (NoC) • Reconfigurable architectures (FPGA) • Design verification (formal and simulation-based), formal specification and analysis • Silicon process variation • Fault tolerant design (hardware and software) • Design methodologies, modelling & simulation of MNT based structures and systems © Simon McIntosh-Smith, Jamie Hanlon 4 Overview • Parallelism in computing • Overview and discussion of two current parallel languages • Chapel (HPC) • OpenCL (desktop/embedded) • Moving forward • Heterogeneous System Architecture • Research into scalable general purpose parallel architectures © Simon McIntosh-Smith, Jamie Hanlon 5 Didn’t parallel computing use to be a niche? © Simon McIntosh-Smith, Jamie Hanlon 6 A long history in HPC… © Simon McIntosh-Smith,
    [Show full text]
  • Parallel Libraries
    Parallel Programming Libraries and implementations Partners Funding bioexcel.eu Reusing this material This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_US This means you are free to copy and redistribute the material and adapt and build on the material under the following terms: You must give appropriate credit, provide a link to the license and indicate if changes were made. If you adapt or build on the material you must distribute your work under the same license as the original. Note that this presentation contains images owned by others. Please seek their permission before reusing these images. bioexcel.eu Outline • MPI – distributed memory de-facto standard • OpenMP – shared memory de-facto standard • CUDA – GPGPU de-facto standard • Other approaches • Summary bioexcel.eu MPI Library Distributed, message-passing programming bioexcel.eu Message-passing concepts bioexcel.eu Explicit Parallelism • In message-passing all the parallelism is explicit • The program includes specific instructions for each communication • What to send or receive • When to send or receive • Synchronisation • It is up to the developer to design the parallel decomposition and implement it • How will you divide up the problem? • When will you need to communicate between processes? bioexcel.eu Message Passing Interface (MPI) • MPI is a portable library used for writing parallel programs using the message passing model • You can expect MPI to be available on any HPC platform you use • Based on a number of processes running independently in parallel • HPC resource provides a command to launch multiple processes simultaneously (e.g.
    [Show full text]