Introduction to Parallel Computing

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Parallel Computing Introduction to Parallel Computing Elwin Chan © 2015 The MathWorks, Inc.1 Who Uses Parallel Computing? Optimizing JIT Steel Manufacturing Schedule Cut simulation time from 1 hour to 5 minutes Heart Transplant Studies 3-4 weeks reduced to 5 days Flight Test Data Analysis 16x Faster Mobile Communications Technology Simulation time reduced from weeks to hours, 5x more scenarios Hedge Fund Portfolio Management Simulation time reduced from 6 hours to 1.2 hours 2 Demo: Getting Data from a Web API 3 Demo: Getting Data from a Web API using parfor 4 Demo: Getting Data from a Web API using parfeval 5 Going Parallel: Multicore Multicore Desktop MATLAB workers MATLAB client 6 Going Parallel: Clusters Computer Cluster MATLAB client 7 Going Parallel: Cloud Cloud Cluster MATLAB client 8 Going Parallel: GPUs NVIDIA GPUs GPU Cores MATLAB client Device Memory 9 Explicit Parallelism: Independent Tasks or Iterations parfor, parfeval, jobs and tasks . Examples: parameter sweeps, Monte Carlo simulations . No dependencies or communications between tasks MATLAB client MATLAB workers Time Time 10 Speed-up using NVIDIA GPUs Ideal Problems • Massively Parallel and/or Vectorized operations • Computationally Intensive • Algorithm consists of supported functions GPU Cores 300+ GPU-enabled MATLAB functions Additional GPU-enabled Toolboxes Device Memory • Neural Networks • Image Processing • Communications • Signal Processing ..... Learn More 11 Too Much Data for One Machine? Use Distributed Memory Using More Computers (RAM) MATLAB client RAM RAM 12 Distributed Arrays . Distributed Arrays hold data remotely on workers running on a cluster . Manipulate directly from client MATLAB (desktop) . 200+ MATLAB functions overloaded for distributed arrays Supported functions for Distributed Arrays 13 Too Much Data for Your Cluster? Use Datastore Datastore HDFS Node Data Node Data Node Data Datastore access data stored in HDFS from MATLAB Hadoop 14 Too Much Data for Your Cluster? Use Datastore, MapReduce and tall MATLAB Distributed Computing Datastore Server HDFS Node Data Map Reduce Node Data Map Reduce Node Data Map Reduce map.m reduce.m Hadoop 15 Offload and Scale Computations with batch Work Worker MATLAB Desktop (Client) Worker Worker Result Worker batch(…) 16 Going Parallel: Other MATLAB® Toolboxes Enable parallel computing support by setting a flag or preference Image Processing Statistics and Machine Learning Neural Networks Batch Image Processor, Block Resampling Methods, k-Means Deep Learning, Neural Network Processing, GPU-enabled functions clustering, GPU-enabled functions training and simulation Signal Processing and Computer Vision Optimization Communications Parallel-enabled functions Parallel estimation of GPU-enabled FFT filtering, in bag-of-words workflow gradients cross correlation, BER simulations Other Parallel-enabled Toolboxes 17 Going Parallel: Simulink® Enable parallel computing support by setting a flag or preference Simulink Design Optimization Simulink Control Design Response optimization, sensitivity Frequency response estimation analysis, parameter estimation Communication Systems Toolbox Simulink/Embedded Coder GPU-based System objects for Generating and building code Simulation Acceleration Other Parallel-enabled Toolboxes 18 Why use Parallel Computing Toolbox? . Reduce computation time by GPU Cores – Using more cores Device Memory – Accessing Graphical Processing Units . Overcome memory limitations by – Distributing data to available hardware – Using datastore and mapreduce RAM RAM . Offload computations to a cluster and – Free up your desktop – Access better computer hardware 19.
Recommended publications
  • 2.5 Classification of Parallel Computers
    52 // Architectures 2.5 Classification of Parallel Computers 2.5 Classification of Parallel Computers 2.5.1 Granularity In parallel computing, granularity means the amount of computation in relation to communication or synchronisation Periods of computation are typically separated from periods of communication by synchronization events. • fine level (same operations with different data) ◦ vector processors ◦ instruction level parallelism ◦ fine-grain parallelism: – Relatively small amounts of computational work are done between communication events – Low computation to communication ratio – Facilitates load balancing 53 // Architectures 2.5 Classification of Parallel Computers – Implies high communication overhead and less opportunity for per- formance enhancement – If granularity is too fine it is possible that the overhead required for communications and synchronization between tasks takes longer than the computation. • operation level (different operations simultaneously) • problem level (independent subtasks) ◦ coarse-grain parallelism: – Relatively large amounts of computational work are done between communication/synchronization events – High computation to communication ratio – Implies more opportunity for performance increase – Harder to load balance efficiently 54 // Architectures 2.5 Classification of Parallel Computers 2.5.2 Hardware: Pipelining (was used in supercomputers, e.g. Cray-1) In N elements in pipeline and for 8 element L clock cycles =) for calculation it would take L + N cycles; without pipeline L ∗ N cycles Example of good code for pipelineing: §doi =1 ,k ¤ z ( i ) =x ( i ) +y ( i ) end do ¦ 55 // Architectures 2.5 Classification of Parallel Computers Vector processors, fast vector operations (operations on arrays). Previous example good also for vector processor (vector addition) , but, e.g. recursion – hard to optimise for vector processors Example: IntelMMX – simple vector processor.
    [Show full text]
  • Massively Parallel Computing with CUDA
    Massively Parallel Computing with CUDA Antonino Tumeo Politecnico di Milano 1 GPUs have evolved to the point where many real world applications are easily implemented on them and run significantly faster than on multi-core systems. Future computing architectures will be hybrid systems with parallel-core GPUs working in tandem with multi-core CPUs. Jack Dongarra Professor, University of Tennessee; Author of “Linpack” Why Use the GPU? • The GPU has evolved into a very flexible and powerful processor: • It’s programmable using high-level languages • It supports 32-bit and 64-bit floating point IEEE-754 precision • It offers lots of GFLOPS: • GPU in every PC and workstation What is behind such an Evolution? • The GPU is specialized for compute-intensive, highly parallel computation (exactly what graphics rendering is about) • So, more transistors can be devoted to data processing rather than data caching and flow control ALU ALU Control ALU ALU Cache DRAM DRAM CPU GPU • The fast-growing video game industry exerts strong economic pressure that forces constant innovation GPUs • Each NVIDIA GPU has 240 parallel cores NVIDIA GPU • Within each core 1.4 Billion Transistors • Floating point unit • Logic unit (add, sub, mul, madd) • Move, compare unit • Branch unit • Cores managed by thread manager • Thread manager can spawn and manage 12,000+ threads per core 1 Teraflop of processing power • Zero overhead thread switching Heterogeneous Computing Domains Graphics Massive Data GPU Parallelism (Parallel Computing) Instruction CPU Level (Sequential
    [Show full text]
  • Parallel Computer Architecture
    Parallel Computer Architecture Introduction to Parallel Computing CIS 410/510 Department of Computer and Information Science Lecture 2 – Parallel Architecture Outline q Parallel architecture types q Instruction-level parallelism q Vector processing q SIMD q Shared memory ❍ Memory organization: UMA, NUMA ❍ Coherency: CC-UMA, CC-NUMA q Interconnection networks q Distributed memory q Clusters q Clusters of SMPs q Heterogeneous clusters of SMPs Introduction to Parallel Computing, University of Oregon, IPCC Lecture 2 – Parallel Architecture 2 Parallel Architecture Types • Uniprocessor • Shared Memory – Scalar processor Multiprocessor (SMP) processor – Shared memory address space – Bus-based memory system memory processor … processor – Vector processor bus processor vector memory memory – Interconnection network – Single Instruction Multiple processor … processor Data (SIMD) network processor … … memory memory Introduction to Parallel Computing, University of Oregon, IPCC Lecture 2 – Parallel Architecture 3 Parallel Architecture Types (2) • Distributed Memory • Cluster of SMPs Multiprocessor – Shared memory addressing – Message passing within SMP node between nodes – Message passing between SMP memory memory nodes … M M processor processor … … P … P P P interconnec2on network network interface interconnec2on network processor processor … P … P P … P memory memory … M M – Massively Parallel Processor (MPP) – Can also be regarded as MPP if • Many, many processors processor number is large Introduction to Parallel Computing, University of Oregon,
    [Show full text]
  • A Review of Multicore Processors with Parallel Programming
    International Journal of Engineering Technology, Management and Applied Sciences www.ijetmas.com September 2015, Volume 3, Issue 9, ISSN 2349-4476 A Review of Multicore Processors with Parallel Programming Anchal Thakur Ravinder Thakur Research Scholar, CSE Department Assistant Professor, CSE L.R Institute of Engineering and Department Technology, Solan , India. L.R Institute of Engineering and Technology, Solan, India ABSTRACT When the computers first introduced in the market, they came with single processors which limited the performance and efficiency of the computers. The classic way of overcoming the performance issue was to use bigger processors for executing the data with higher speed. Big processor did improve the performance to certain extent but these processors consumed a lot of power which started over heating the internal circuits. To achieve the efficiency and the speed simultaneously the CPU architectures developed multicore processors units in which two or more processors were used to execute the task. The multicore technology offered better response-time while running big applications, better power management and faster execution time. Multicore processors also gave developer an opportunity to parallel programming to execute the task in parallel. These days parallel programming is used to execute a task by distributing it in smaller instructions and executing them on different cores. By using parallel programming the complex tasks that are carried out in a multicore environment can be executed with higher efficiency and performance. Keywords: Multicore Processing, Multicore Utilization, Parallel Processing. INTRODUCTION From the day computers have been invented a great importance has been given to its efficiency for executing the task.
    [Show full text]
  • Vector Vs. Scalar Processors: a Performance Comparison Using a Set of Computational Science Benchmarks
    Vector vs. Scalar Processors: A Performance Comparison Using a Set of Computational Science Benchmarks Mike Ashworth, Ian J. Bush and Martyn F. Guest, Computational Science & Engineering Department, CCLRC Daresbury Laboratory ABSTRACT: Despite a significant decline in their popularity in the last decade vector processors are still with us, and manufacturers such as Cray and NEC are bringing new products to market. We have carried out a performance comparison of three full-scale applications, the first, SBLI, a Direct Numerical Simulation code from Computational Fluid Dynamics, the second, DL_POLY, a molecular dynamics code and the third, POLCOMS, a coastal-ocean model. Comparing the performance of the Cray X1 vector system with two massively parallel (MPP) micro-processor-based systems we find three rather different results. The SBLI PCHAN benchmark performs excellently on the Cray X1 with no code modification, showing 100% vectorisation and significantly outperforming the MPP systems. The performance of DL_POLY was initially poor, but we were able to make significant improvements through a few simple optimisations. The POLCOMS code has been substantially restructured for cache-based MPP systems and now does not vectorise at all well on the Cray X1 leading to poor performance. We conclude that both vector and MPP systems can deliver high performance levels but that, depending on the algorithm, careful software design may be necessary if the same code is to achieve high performance on different architectures. KEYWORDS: vector processor, scalar processor, benchmarking, parallel computing, CFD, molecular dynamics, coastal ocean modelling All of the key computational science groups in the 1. Introduction UK made use of vector supercomputers during their halcyon days of the 1970s, 1980s and into the early 1990s Vector computers entered the scene at a very early [1]-[3].
    [Show full text]
  • Parallel Processing! 1! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 2! Suggested Readings! •! Readings! –! H&P: Chapter 7! •! (Over Next 2 Weeks)!
    CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 1! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 2! Suggested Readings! •! Readings! –! H&P: Chapter 7! •! (Over next 2 weeks)! Lecture 23" Introduction to Parallel Processing! University of Notre Dame! University of Notre Dame! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 3! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 4! Processor components! Multicore processors and programming! Processor comparison! vs.! Goal: Explain and articulate why modern microprocessors now have more than one core andCSE how software 30321 must! adapt to accommodate the now prevalent multi- core approach to computing. " Introduction and Overview! Writing more ! efficient code! The right HW for the HLL code translation! right application! University of Notre Dame! University of Notre Dame! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! 6! Pipelining and “Parallelism”! ! Load! Mem! Reg! DM! Reg! ALU ! Instruction 1! Mem! Reg! DM! Reg! ALU ! Instruction 2! Mem! Reg! DM! Reg! ALU ! Instruction 3! Mem! Reg! DM! Reg! ALU ! Instruction 4! Mem! Reg! DM! Reg! ALU Time! Instructions execution overlaps (psuedo-parallel)" but instructions in program issued sequentially." University of Notre Dame! University of Notre Dame! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! CSE 30321 – Lecture 23 – Introduction to Parallel Processing! Multiprocessing (Parallel) Machines! Flynn#s
    [Show full text]
  • Challenges for the Message Passing Interface in the Petaflops Era
    Challenges for the Message Passing Interface in the Petaflops Era William D. Gropp Mathematics and Computer Science www.mcs.anl.gov/~gropp What this Talk is About The title talks about MPI – Because MPI is the dominant parallel programming model in computational science But the issue is really – What are the needs of the parallel software ecosystem? – How does MPI fit into that ecosystem? – What are the missing parts (not just from MPI)? – How can MPI adapt or be replaced in the parallel software ecosystem? – Short version of this talk: • The problem with MPI is not with what it has but with what it is missing Lets start with some history … Argonne National Laboratory 2 Quotes from “System Software and Tools for High Performance Computing Environments” (1993) “The strongest desire expressed by these users was simply to satisfy the urgent need to get applications codes running on parallel machines as quickly as possible” In a list of enabling technologies for mathematical software, “Parallel prefix for arbitrary user-defined associative operations should be supported. Conflicts between system and library (e.g., in message types) should be automatically avoided.” – Note that MPI-1 provided both Immediate Goals for Computing Environments: – Parallel computer support environment – Standards for same – Standard for parallel I/O – Standard for message passing on distributed memory machines “The single greatest hindrance to significant penetration of MPP technology in scientific computing is the absence of common programming interfaces across various parallel computing systems” Argonne National Laboratory 3 Quotes from “Enabling Technologies for Petaflops Computing” (1995): “The software for the current generation of 100 GF machines is not adequate to be scaled to a TF…” “The Petaflops computer is achievable at reasonable cost with technology available in about 20 years [2014].” – (estimated clock speed in 2004 — 700MHz)* “Software technology for MPP’s must evolve new ways to design software that is portable across a wide variety of computer architectures.
    [Show full text]
  • A Survey on Parallel Multicore Computing: Performance & Improvement
    Advances in Science, Technology and Engineering Systems Journal Vol. 3, No. 3, 152-160 (2018) ASTESJ www.astesj.com ISSN: 2415-6698 A Survey on Parallel Multicore Computing: Performance & Improvement Ola Surakhi*, Mohammad Khanafseh, Sami Sarhan University of Jordan, King Abdullah II School for Information Technology, Computer Science Department, 11942, Jordan A R T I C L E I N F O A B S T R A C T Article history: Multicore processor combines two or more independent cores onto one integrated circuit. Received: 18 May, 2018 Although it offers a good performance in terms of the execution time, there are still many Accepted: 11 June, 2018 metrics such as number of cores, power, memory and more that effect on multicore Online: 26 June, 2018 performance and reduce it. This paper gives an overview about the evolution of the Keywords: multicore architecture with a comparison between single, Dual and Quad. Then we Distributed System summarized some of the recent related works implemented using multicore architecture and Dual core show the factors that have an effect on the performance of multicore parallel architecture Multicore based on their results. Finally, we covered some of the distributed parallel system concepts Quad core and present a comparison between them and the multiprocessor system characteristics. 1. Introduction [6]. The heterogenous cores have more than one type of cores, they are not identical, each core can handle different application. Multicore is one of the parallel computing architectures which The later has better performance in terms of less power consists of two or more individual units (cores) that read and write consumption as will be shown later [2].
    [Show full text]
  • Analysis of Multithreaded Architectures for Parallel Computing
    Analysis of Multithreaded Architectures for Parallel Computing Rafael H. Saavedra-Barrera David E. Culler Thorsten von Eicken Computer Science Division University of California Berkeley, California 94720 Abstract The latency avoidance strategy embodied in caches is Multithreading has been proposed as an architectural stra- attractive for multiprocessors because local copies of shared data tegy for tolerating latency in multiprocessors and, through lim- are produced on demand. However, this replication leads to a ited empirical studies, shown to offer promise. This paper thorny problem of maintaining a coherent image of the memory develops an analytical model of multithreaded processor [Good83, Arga88]. Concrete solutions exist for small bus-based behavior based on a small set of architectural and program multiprocessors, but even these involve considerable complexity parameters. The model gives rise to a large Markov chain, and observed miss rates on shared data are fairly high [Egge88]. which is solved to obtain a formula for processor efficiency in Approaches that do not provide automatic replication can be terms of the number of threads per processor, the remote refer- expected to make a larger number of long-latency requests. ence rate, the latency, and the cost of switching between threads. Several recent architectures adopt the alternative strategy It is shown that a multithreaded processor exhibits three operat- of tolerating latency. These can be loosely classified as mul- ing regimes: linear (efficiency is proportional to the number of tithreaded architectures, because each processor supports several threads), transition, and saturation (efficiency depends only on active threads of computation. While some threads are the remote reference rate and switch cost).
    [Show full text]
  • Vector Processors
    VECTOR PROCESSORS Computer Science Department CS 566 – Fall 2012 1 Eman Aldakheel Ganesh Chandrasekaran Prof. Ajay Kshemkalyani OUTLINE What is Vector Processors Vector Processing & Parallel Processing Basic Vector Architecture Vector Instruction Vector Performance Advantages Disadvantages Applications Conclusion 2 VECTOR PROCESSORS A processor can operate on an entire vector in one instruction Work done automatically in parallel (simultaneously) The operand to the instructions are complete vectors instead of one element Reduce the fetch and decode bandwidth Data parallelism Tasks usually consist of: Large active data sets Poor locality Long run times 3 VECTOR PROCESSORS (CONT’D) Each result independent of previous result Long pipeline Compiler ensures no dependencies High clock rate Vector instructions access memory with known pattern Reduces branches and branch problems in pipelines Single vector instruction implies lots of work Example: for(i=0; i<n; i++) c(i) = a(i) + b(i); 4 5 VECTOR PROCESSORS (CONT’D) vadd // C code b[15]+=a[15] for(i=0;i<16; i++) b[i]+=a[i] b[14]+=a[14] b[13]+=a[13] b[12]+=a[12] // Vectorized code b[11]+=a[11] set vl,16 b[10]+=a[10] vload vr0,b b[9]+=a[9] vload vr1,a b[8]+=a[8] vadd vr0,vr0,vr1 b[7]+=a[7] vstore vr0,b b[6]+=a[6] b[5]+=a[5] b[4]+=a[4] Each vector instruction b[3]+=a[3] holds many units of b[2]+=a[2] independent operations b[1]+=a[1] 6 b[0]+=a[0] 1 Vector Lane VECTOR PROCESSORS (CONT’D) vadd // C code b[15]+=a[15] 16 Vector Lanes for(i=0;i<16; i++) b[14]+=a[14] b[i]+=a[i]
    [Show full text]
  • Introduction to Parallel Computing
    INTRODUCTION TO PARALLEL COMPUTING Plamen Krastev Office: 38 Oxford, Room 117 Email: [email protected] FAS Research Computing Harvard University OBJECTIVES: To introduce you to the basic concepts and ideas in parallel computing To familiarize you with the major programming models in parallel computing To provide you with with guidance for designing efficient parallel programs 2 OUTLINE: Introduction to Parallel Computing / High Performance Computing (HPC) Concepts and terminology Parallel programming models Parallelizing your programs Parallel examples 3 What is High Performance Computing? Pravetz 82 and 8M, Bulgarian Apple clones Image credit: flickr 4 What is High Performance Computing? Pravetz 82 and 8M, Bulgarian Apple clones Image credit: flickr 4 What is High Performance Computing? Odyssey supercomputer is the major computational resource of FAS RC: • 2,140 nodes / 60,000 cores • 14 petabytes of storage 5 What is High Performance Computing? Odyssey supercomputer is the major computational resource of FAS RC: • 2,140 nodes / 60,000 cores • 14 petabytes of storage Using the world’s fastest and largest computers to solve large and complex problems. 5 Serial Computation: Traditionally software has been written for serial computations: To be run on a single computer having a single Central Processing Unit (CPU) A problem is broken into a discrete set of instructions Instructions are executed one after another Only one instruction can be executed at any moment in time 6 Parallel Computing: In the simplest sense, parallel
    [Show full text]
  • Parallel Processing: Past, Present and Future
    What is a Supercomputer? Parallel Processing: Let us run a contest. Who gives the Past, Present and Future most updated explanation? Dr. G. Young CS 370 Dr. Young 1 CS 370 Dr. Young 2 Supercomputer Supercomputer (AllWords.com) (M-W.com, Merriam-Webster's Collegiate Dictionary) A very fast, powerful mainframe computer, used in advanced military A large very fast mainframe used and scientific applications. especially for scientific computations CS 370 Dr. Young 3 CS 370 Dr. Young 4 1 Supercomputer Supercomputer (Dictionary.com) (FOLDOC.doc.ic.ac.uk) A broad term for one of the fastest computers currently available. Such computers are typically used for number crunching including scientific simulations, (animated) graphics, analysis of A mainframe computer that is geological data (e.g. in petrochemical prospecting), structural analysis, computational fluid dynamics, physics, chemistry, among the largest, fastest, or electronic design, nuclear energy research and meteorology. most powerful of those Perhaps the best known supercomputer manufacturer is Cray Research. available at a given time. A less serious definition, reported from about 1990 at The University Of New South Wales states that a supercomputer is any computer that can outperform IBM's current fastest, thus making it impossible for IBM to ever produce a supercomputer. CS 370 Dr. Young 5 CS 370 Dr. Young 6 Supercomputer Supercomputer (ComputerUser.com) (PCWebopaedia.com) The fastest type of computer. Supercomputers are very A very fast and powerful computer, expensive and are employed for specialized outperforming most mainframes, and used applications that require immense amounts of mathematical calculations. for intensive calculation, scientific For example, weather forecasting requires a supercomputer.
    [Show full text]