Performance optimization of Numerical Simulation of Waves Propagation in Time Domain and in Harmonic Domain using OpenMP Tasks
|
|
- Linette Lucas
- 6 years ago
- Views:
Transcription
1 Performance optimization of Numerical Simulation of Waves Propagation in Time Domain and in Harmonic Domain using OpenMP Tasks Giannis Ashiotis Julien Diaz François Broquedis Jean-Francois Mehaut INRIA GRENOBLE UJF & LJK & LIG
2 Hou10ni Overview Implementation details OpenMP PARALLEL DO TASK KAAPI Changes to the program Data locality Array structure Data reordering Tasks acoustic Tasks elasto-acoustic Performance evaluation Overview Testing setup Acoustic Elasto-acoustic Epilogue
3 Hou10ni Overview It was developed by Julien Diaz Simulates the propagation of seismic waves Implemented using the Interior Penalty Discontinuous Galerkin Method (IPDGM) uses unstructured meshes of arbitrary-shaped elements facilitates the description of complex heterogeneous media.
4 Hou10ni Implementation details The application is written in Fortran 90 and it spans over around lines (together with some functionality that I will be not using) The input data that reside in 3 separate files contain all the information needed to define the mesh of the elements that make up the system. The mesh it self is generated by another tool provided together with the main program 2 versions of the code Acoustique - partially parallelized with OpenMP Elasto-acoustique Main workhorse is a double loop first level going over predefined number of time-steps second level going over the physical space of the problem.
5 Hou10ni Overview Implementation details OpenMP PARALLEL DO TASK KAAPI Changes to the program Data locality Array structure Data reordering Tasks acoustic Tasks elasto-acoustic Performance evaluation Overview Testing setup Acoustic Elasto-acoustic Epilogue
6 OpenMP Popular, easy to use API for parallelizing applications in C/C++ and FORTRAN. To be used on shared memory systems. Components compiler directives library routines environment variables Task parallelism added with version OpenMP 3.0
7 OpenMP PARALLEL DO Probably one of the easiest way to parallelize the execution of loops When a PARALLEL DO directive is encountered a number of threads is spawned, and a chunk of the iterations is assigned to each of them In FORTRAN parallel do is implemented like this:!$omp PARALLEL DO (clauses) (do-loop)!$omp END PARALLEL DO (the END statement is optional)
8 OpenMP PARALLEL DO Probably one of the easiest way to parallelize the execution of loops When a PARALLEL DO directive is encountered a number of threads is spawned, and a chunk of the iterations is assigned to each of them In FORTRAN parallel do is implemented like this: PRIVATE(list of variables) SHARED(list of variables) SCHEDULE(kind, chunk)!$omp PARALLEL DO (clauses) (do-loop)!$omp END PARALLEL DO (the END statement is optional)
9 OpenMP TASK Whenever a task directive is encountered, a task is spawned executed immediately passed to a conceptual task pool A task can be executed by any thread belonging to the group associated with the parallel region where the task was created In FORTRAN tasks are implemented like this:!$omp PARALLEL!$OMP TASK (clauses)!$omp END TASK!$OMP END PARALLEL
10 OpenMP TASK Whenever a task directive is encountered, a task is spawned executed immediately passed to a conceptual task pool A task can be executed by any thread belonging to the group associated with the parallel region where the task was created In FORTRAN tasks are implemented like this:!$omp PARALLEL!$OMP TASK (clauses)!$omp END TASK!$OMP END PARALLEL PRIVATE(list of variables) SHARED(list of variables) FIRSTPRIVATE(list of variables) DEFAULT(private shared none firstprivate)
11 OpenMP KAAPI C++ library that allows the multithreaded computation with data flow synchronization between threads developed by the MOAIS team High level interface, fully compatible with the OpenMP notation No chances to the code
12 Hou10ni Overview Implementation details OpenMP PARALLEL DO TASK KAAPI Changes to the program Data locality Array structure Data reordering Tasks acoustic Tasks elasto-acoustic Performance evaluation Overview Testing setup Acoustic Elasto-acoustic Epilogue
13 Changes to the program Data locality Data locality greatly affects the performance of the program in NUMA (Non-Uniform Memory Access) systems Remote accesses are costly! NUMA node 1 CPU 1 core core 1 2 core 3 memory controller memory core 4 NUMA node 2 CPU 2 core core 1 2 core 3 memory controller memory core 4
14 Changes to the program Data locality Data locality greatly affects the performance of the program in NUMA (Non-Uniform Memory Access) systems Remote accesses are costly! NUMA node 1 CPU 1 core core 1 2 core 3 memory controller memory core 4 NUMA node 2 CPU 2 core core 1 2 core 3 memory controller memory core 4 using the first touch memory allocation policy, initialize the arrays in a PARALLEL DO loop NUMA node 1 CPU 1 core core 1 2 core 3 memory controller memory core 4 NUMA node 2 CPU 2 core core 1 2 core 3 memory controller memory core 4
15 Changes to the program Array structure At each iteration of the inner loop 4 arrays come into play. U 1D array, holding the displacements U old 1D array, U from the previous time-step, saved with the use of an intermediate array A 3D array AU 1D array, contains the product of a chunk (depending on the order of the discretization) of U with a slice of A The copying taking place at each time-step can be avoided by using a 2 column array for U and U old, together with pointers that specify which column will be U and which U old A better cache behavior is achieved if consecutive iterations work on data that is contiguous in the memory
16 Changes to the program Array structure At each iteration of the inner loop 4 arrays come into play. U 1D array, holding the displacements U old 1D array, U from the previous time-step, saved with the use of an intermediate array A 3D array AU 1D array, contains the product of a chunk (depending on the order of the discretization) of U with a slice of A FORTRAN stores multidimensional arrays in column-major fashion Us holds the data of U and U old Us(i,j) A(i,j,k) j j i i k
17 Changes to the program Data reordering Furthermore at each iteration of the inner loop data from neighboring elements (which corresponds to other parts of U) is required The elements of U are arranged in a random fashion
18 Changes to the program Data reordering Furthermore at each iteration of the inner loop data from neighboring elements (which corresponds to other parts of U) The elements of U are arranged in a random fashion remote memory accesses!
19 Changes to the program Data reordering Using a space-filling curve we can reorder the elements My reordering tool was written in C++ as the Standard Container classes make this much easier For the acoustic version this can be done prior to execution For the elasto-acoustic version it has to be done during runtime, as some reordering takes place after the data is read Z curve Hilbert curve
20 Changes to the program Data reordering After the reordering the data look like this Now there is a much greater possibility that the neighboring elements will be in cache when they are needed
21 Changes to the program Data reordering At each iteration of the inner loop, 3 checks take place to decide if the element processed is part of the border or not A border elements is defined by a -1 in the array that holds the neighboring information The checks can be avoided if with cyclic permutations the -1 is brought to the first column and the border elements are processed separately from the inner elements. This functionality was added in the tool responsible for the reordering
22 Changes to the program Tasks acoustic Main loop OpenMP Tasks breaking the loop into smaller loops, assigning each to a task. The number of tasks is passed as input at runtime One thread creates tasks, passing them to the task pool. Before reaching the TASKWAIT directive all task must complete. Parallel region outside the time loop expecting reduction of overhead due to creation and destruction of threads start_i is declared FIRSTPRIVATE so that each tasks gets the correct value at the moment of creation DO N=0,ntfinal!TIME STEP!$OMP PARALLEL DO DO I=1,Ntri... END DO!$OMP END PARALLEL DO... END DO
23 Changes to the program Tasks acoustic Main loop OpenMP Tasks breaking the loop into smaller loops, assigning each to a task. The number of tasks is passed as input at runtime One thread creates tasks, passing them to the task pool. Before reaching the TASKWAIT directive all task must complete. Parallel region outside the time loop expecting reduction of overhead due to creation and destruction of threads start_i is declared FIRSTPRIVATE so that each tasks gets the correct value at the moment of creation iter_task = Ntri/num_of_tasks!$OMP PARALLEL!$OMP SINGLE DO N=0,ntfinal!TIME STEP ptr_u = 1+iand(N,1) ptr_uold = 1+iand(N+1,1) DO st_i=1,ntri,iter_task!$omp TASK PRIVATE(I) FIRSTPRIVATE(st_I) DO I=st_I,min(st_I+iter_task-1,Ntri)... END DO!$OMP END TASK END DO!$OMP TASKWAIT... END DO!$OMP END SINGLE!$OMP END PARALLEL
24 Changes to the program Tasks acoustic Another approach to the assigning of the work to tasks is using recursion One initial task divides the work to two equal parts, assigning a task to each of them The generated tasks go on repeating the same thing, until the desired amount of work is left to each task This approach exhibits good cache behavior for any platform 20 elements with a cutoff of 4
25 Changes to the program Tasks acoustic RECURSIVE SUBROUTINE Calc(low,high,cutoff,ptr_U,ptr_Uold)... IF (high-low > cutoff) THEN mid = low + (high - low)/2!$omp TASK call Calc(low,mid,cutoff,ptr_U,ptr_Uold)!$OMP END TASK call Calc(mid+1,high,cutoff,ptr_U,ptr_Uold)!$OMP TASKWAIT ELSE DO I = low,high... END DO END IF END SUBROUTINE Calc It should be noted that recursion comes with a considerable overhead. Combined with the overhead of task creation, this could lead to performance decrease KAAPI could be the solution to this problem as it has a much reduced cost of task spawning, together with some other features that can be of use
26 Changes to the program Tasks acoustic...!$omp PARALLEL!$OMP SINGLE DO N=0,ntfinal ptr_u = 1+iand(N,1) ptr_uold = 1+iand(N+1,1) call Calc(1,Ntri,cutoff,ptr_U,ptr_Uold)!$OMP TASKWAIT... END DO!$OMP END SINGLE!$OMP END PARALLEL... It should be noted that recursion comes with a considerable overhead. Combined with the overhead of task creation, this could lead to performance decrease KAAPI could be the solution to this problem as it has a much reduced cost of task spawning, together with some other features that can be of use
27 Changes to the program Tasks elasto-acoustic The same changes were applied to the elasto-acoustic version of the program, with some small modifications At runtime, the data is split to 4 parts, with one corresponding to the fluid domain, one to the solid domain and two for the respective interfaces. the Hilbert-curve reordering has to take place during execution, separately for each part The data in the equivalent of the acoustic version U old arrays (now three) are needed again after the current arrays are modified instead of a 2 column array, a 3 column array is used to hold the modified version of the arrays and a set of 3 pointers is used to refer to them: ptr_ = 3-MOD(N+2,3)! P,Ux,Uy ptr_old = 3-MOD(N+1,3)! Pold,Uxold,Uyold ptr_buff = 3-MOD(N,3)
28 Hou10ni Overview Implementation details OpenMP PARALLEL DO TASK KAAPI Changes to the program Data locality Array structure Data reordering Tasks acoustic Tasks elasto-acoustic Performance evaluation Overview Testing setup Acoustic Elasto-acoustic Epilogue
29 Performance Evaluation Overview Both versions of the program where compiled with GCC and ICC The GCC version was also ran with the KAAPI, overriding the GNU OpenMP API For all the runs a mask was used to bind threads to cores. For GCC is set by the environment variable GOMP_CPU_AFFINITY and for the ICC by the environment variable KMP_AFFINITY. Threads were bound using compact thread binding policy A PARALLEL DO version of the program, with all the optimizations mentioned before was tested as-well threads
30 Performance Evaluation Testing setup The machine used for the testing is IDROUILLE 4 NUMA nodes 8-core Nehalem architecture CPU 16 GB of RAM. L1 and L2 is private to each core L3 is shared over the cores of each CPU
31 Performance Evaluation Acoustic Gain plots show the performance increase over the original code at each thread configuration 70% 60% Gain acoustic GCC ICC compiled program constantly displays better gain that the GCC compiled counterpart Using the KAAPI gave more or less the same performance with the GCC openmp runtime environment 50% 40% 30% 20% 10% 0% Gain acoustic ICC acoustic tasks gcc acoustic do gcc acoustic recur gcc acoustic do kaapi acoustic recur kaapi 80% 70% 60% 50% 40% 30% 20% acoustic tasks icc acoustic do icc acoustic recur icc 10% 0%
32 Performance Evaluation Acoustic Speedup plots show the performance increase when using multiple threads compared to the single-threaded execution Speedup acoustic GCC acoustic gcc acoustic tasks gcc acoustic do gcc acoustic recur gcc acoustic do kaapi 1.00 acoustic recur kaapi Speedup acoustic ICC acoustic icc acoustic tasks icc acoustic do icc 5.00 acoustic recur icc
33 Performance Evaluation Acoustic A summary of the previous plots showing the versions with the best absolute performances and the best scaling It is apparent that the ICC compiled code performs and scales much better than their GCC counterparts Times acoustic acoustic do gcc acoustic recur kaapi acoustic do icc acoustic recur icc Speedup acoustic acoustic do gcc acoustic recur kaapi 10 acoustic do icc 5 acoustic recur icc
34 Performance Evaluation Elasto-acoustic Times elasto-acoustic GCC elasto-acoustic gcc elasto-acoustic tasks gcc elasto-acoustic do gcc elasto-acoustic recur gcc elasto-acoustic do kaapi Times elasto-acoustic ICC elasto-acoustic icc elasto-acoustic tasks icc elasto-acoustic do icc elasto-acoustic recur icc Gains plots are unavailable for the elasto-acoustic version as it was not parallelized Absolute times of execution are shown instead Again the ICC compiled version greatly outperforms the GCC compiled ones, while the performance is more or less the same within each of the sets compiled with the same compiler Note that for the ICC compiled version the TASKS and PARALLEL DO code, the single-threaded execution runs slower than the original one
35 Performance Evaluation Elasto-acoustic Speedup elasto-acoustic GCC elasto-acoustic tasks gcc elasto-acoustic do gcc elasto-acoustic recur gcc Speedup plots show that the elasto-acoustic version of the program exhibits the same behavior as the acoustic one, with the former scaling much better elasto-acoustic do kaapi elasto-acoustic recur kaapi Speedup elasto-acoustic ICC elasto-acoustic tasks icc elasto-acoustic do icc elasto-acoustic recur icc
36 Performance Evaluation Elasto-acoustic Times elasto-acoustic Speedup elasto-acoustic elasto-acoustic do gcc elasto-acoustic recur kaapi elasto-acoustic do icc elasto-acoustic recur icc The difference in the performance can be better seen in these summarization plots elasto-acoustic do gcc elasto-acoustic recur kaapi elasto-acoustic do icc elasto-acoustic recur icc
37 Hou10ni Overview Implementation details OpenMP PARALLEL DO TASK KAAPI Changes to the program Data locality Array structure Data reordering Tasks acoustic Tasks elasto-acoustic Performance evaluation Overview Testing setup Acoustic Elasto-acoustic Epilogue
38 Epilogue The goal of optimizing the Hou10ni program was achieved the acoustic version now performs nearly 3 times faster than the best performance given by the original code the performance gain in elasto-acoustic version is not that apparent as it was not initially parallelized. The scaling is not as good as in the acoustic version, due to the greater complexity of the code more code was serial due to data dependencies. Some promise lies in the recursive version once the KAAPI is completed These optimizations can be applied to any similar code
39 Epilogue The goal of optimizing the Hou10ni program was achieved the acoustic version now performs nearly 3 times faster than the best performance given by the original code the performance gain in elasto-acoustic version is not that apparent as it was not initially parallelized. The scaling is not as good as in the acoustic version, due to the greater complexity of the code more code was serial due to data dependencies. Some promise lies in the recursive version once the KAAPI is completed These optimizations can be applied to any similar code and one last tip use ICC when available
40 Epilogue The goal of optimizing the Hou10ni program was achieved the acoustic version now performs nearly 3 times faster than the best performance given by the original code the performance gain in elasto-acoustic version is not that apparent as it was not initially parallelized. The scaling is not as good as in the acoustic version, due to the greater complexity of the code more code was serial due to data dependencies. Some promise lies in the recursive version once the KAAPI is completed These optimizations can be applied to any similar code and one last tip use ICC when available at least on Intel machines
41 Thank you for your time
Shared Memory Programming with OpenMP
Shared Memory Programming with OpenMP (An UHeM Training) Süha Tuna Informatics Institute, Istanbul Technical University February 12th, 2016 2 Outline - I Shared Memory Systems Threaded Programming Model
More informationDepartment of Informatics V. HPC-Lab. Session 2: OpenMP M. Bader, A. Breuer. Alex Breuer
HPC-Lab Session 2: OpenMP M. Bader, A. Breuer Meetings Date Schedule 10/13/14 Kickoff 10/20/14 Q&A 10/27/14 Presentation 1 11/03/14 H. Bast, Intel 11/10/14 Presentation 2 12/01/14 Presentation 3 12/08/14
More informationModule 10: Open Multi-Processing Lecture 19: What is Parallelization? The Lecture Contains: What is Parallelization? Perfectly Load-Balanced Program
The Lecture Contains: What is Parallelization? Perfectly Load-Balanced Program Amdahl's Law About Data What is Data Race? Overview to OpenMP Components of OpenMP OpenMP Programming Model OpenMP Directives
More informationBinding Nested OpenMP Programs on Hierarchical Memory Architectures
Binding Nested OpenMP Programs on Hierarchical Memory Architectures Dirk Schmidl, Christian Terboven, Dieter an Mey, and Martin Bücker {schmidl, terboven, anmey}@rz.rwth-aachen.de buecker@sc.rwth-aachen.de
More informationPOSIX Threads and OpenMP tasks
POSIX Threads and OpenMP tasks Jimmy Aguilar Mena February 16, 2018 Introduction Pthreads Tasks Two simple schemas Independent functions # include # include void f u n c t i
More informationLab: Scientific Computing Tsunami-Simulation
Lab: Scientific Computing Tsunami-Simulation Session 4: Optimization and OMP Sebastian Rettenberger, Michael Bader 23.11.15 Session 4: Optimization and OMP, 23.11.15 1 Department of Informatics V Linux-Cluster
More informationA Short Introduction to OpenMP. Mark Bull, EPCC, University of Edinburgh
A Short Introduction to OpenMP Mark Bull, EPCC, University of Edinburgh Overview Shared memory systems Basic Concepts in Threaded Programming Basics of OpenMP Parallel regions Parallel loops 2 Shared memory
More informationOpenMP 4.0/4.5: New Features and Protocols. Jemmy Hu
OpenMP 4.0/4.5: New Features and Protocols Jemmy Hu SHARCNET HPC Consultant University of Waterloo May 10, 2017 General Interest Seminar Outline OpenMP overview Task constructs in OpenMP SIMP constructs
More informationIntroduction to OpenMP. OpenMP basics OpenMP directives, clauses, and library routines
Introduction to OpenMP Introduction OpenMP basics OpenMP directives, clauses, and library routines What is OpenMP? What does OpenMP stands for? What does OpenMP stands for? Open specifications for Multi
More informationIntroduction to OpenMP
Introduction to OpenMP p. 1/?? Introduction to OpenMP Tasks Nick Maclaren nmm1@cam.ac.uk September 2017 Introduction to OpenMP p. 2/?? OpenMP Tasks In OpenMP 3.0 with a slightly different model A form
More informationImplementation of Parallelization
Implementation of Parallelization OpenMP, PThreads and MPI Jascha Schewtschenko Institute of Cosmology and Gravitation, University of Portsmouth May 9, 2018 JAS (ICG, Portsmouth) Implementation of Parallelization
More informationA brief introduction to OpenMP
A brief introduction to OpenMP Alejandro Duran Barcelona Supercomputing Center Outline 1 Introduction 2 Writing OpenMP programs 3 Data-sharing attributes 4 Synchronization 5 Worksharings 6 Task parallelism
More informationOpenMP - Introduction
OpenMP - Introduction Süha TUNA Bilişim Enstitüsü UHeM Yaz Çalıştayı - 21.06.2012 Outline What is OpenMP? Introduction (Code Structure, Directives, Threads etc.) Limitations Data Scope Clauses Shared,
More informationOverview: The OpenMP Programming Model
Overview: The OpenMP Programming Model motivation and overview the parallel directive: clauses, equivalent pthread code, examples the for directive and scheduling of loop iterations Pi example in OpenMP
More informationTasking and OpenMP Success Stories
Tasking and OpenMP Success Stories Christian Terboven 23.03.2011 / Aachen, Germany Stand: 21.03.2011 Version 2.3 Rechen- und Kommunikationszentrum (RZ) Agenda OpenMP: Tasking
More informationDepartment of Informatics V. Tsunami-Lab. Session 4: Optimization and OMP Michael Bader, Alex Breuer. Alex Breuer
Tsunami-Lab Session 4: Optimization and OMP Michael Bader, MAC-Cluster: Overview Intel Sandy Bridge (snb) AMD Bulldozer (bdz) Product Name (base frequency) Xeon E5-2670 (2.6 GHz) AMD Opteron 6274 (2.2
More informationAdvanced C Programming Winter Term 2008/09. Guest Lecture by Markus Thiele
Advanced C Programming Winter Term 2008/09 Guest Lecture by Markus Thiele Lecture 14: Parallel Programming with OpenMP Motivation: Why parallelize? The free lunch is over. Herb
More informationSpeeding Up Reactive Transport Code Using OpenMP. OpenMP
Speeding Up Reactive Transport Code Using OpenMP By Jared McLaughlin OpenMP A standard for parallelizing Fortran and C/C++ on shared memory systems Minimal changes to sequential code required Incremental
More informationMasterpraktikum - High Performance Computing
Masterpraktikum - High Performance Computing OpenMP Michael Bader Alexander Heinecke Alexander Breuer Technische Universität München, Germany 2 #include ... #pragma omp parallel for for(i = 0; i
More informationIntroduction to OpenMP. Tasks. N.M. Maclaren September 2017
2 OpenMP Tasks 2.1 Introduction Introduction to OpenMP Tasks N.M. Maclaren nmm1@cam.ac.uk September 2017 These were introduced by OpenMP 3.0 and use a slightly different parallelism model from the previous
More informationParallel Computing Using OpenMP/MPI. Presented by - Jyotsna 29/01/2008
Parallel Computing Using OpenMP/MPI Presented by - Jyotsna 29/01/2008 Serial Computing Serially solving a problem Parallel Computing Parallelly solving a problem Parallel Computer Memory Architecture Shared
More informationOpenMP Overview. in 30 Minutes. Christian Terboven / Aachen, Germany Stand: Version 2.
OpenMP Overview in 30 Minutes Christian Terboven 06.12.2010 / Aachen, Germany Stand: 03.12.2010 Version 2.3 Rechen- und Kommunikationszentrum (RZ) Agenda OpenMP: Parallel Regions,
More informationOpenMP on Ranger and Stampede (with Labs)
OpenMP on Ranger and Stampede (with Labs) Steve Lantz Senior Research Associate Cornell CAC Parallel Computing at TACC: Ranger to Stampede Transition November 6, 2012 Based on materials developed by Kent
More information15-418, Spring 2008 OpenMP: A Short Introduction
15-418, Spring 2008 OpenMP: A Short Introduction This is a short introduction to OpenMP, an API (Application Program Interface) that supports multithreaded, shared address space (aka shared memory) parallelism.
More informationHigh Performance Computing: Tools and Applications
High Performance Computing: Tools and Applications Edmond Chow School of Computational Science and Engineering Georgia Institute of Technology Lecture 2 OpenMP Shared address space programming High-level
More informationShared memory programming model OpenMP TMA4280 Introduction to Supercomputing
Shared memory programming model OpenMP TMA4280 Introduction to Supercomputing NTNU, IMF February 16. 2018 1 Recap: Distributed memory programming model Parallelism with MPI. An MPI execution is started
More informationDistributed Systems + Middleware Concurrent Programming with OpenMP
Distributed Systems + Middleware Concurrent Programming with OpenMP Gianpaolo Cugola Dipartimento di Elettronica e Informazione Politecnico, Italy cugola@elet.polimi.it http://home.dei.polimi.it/cugola
More informationCOMP Parallel Computing. SMM (2) OpenMP Programming Model
COMP 633 - Parallel Computing Lecture 7 September 12, 2017 SMM (2) OpenMP Programming Model Reading for next time look through sections 7-9 of the Open MP tutorial Topics OpenMP shared-memory parallel
More informationPractical in Numerical Astronomy, SS 2012 LECTURE 12
Practical in Numerical Astronomy, SS 2012 LECTURE 12 Parallelization II. Open Multiprocessing (OpenMP) Lecturer Eduard Vorobyov. Email: eduard.vorobiev@univie.ac.at, raum 006.6 1 OpenMP is a shared memory
More informationCOMP4510 Introduction to Parallel Computation. Shared Memory and OpenMP. Outline (cont d) Shared Memory and OpenMP
COMP4510 Introduction to Parallel Computation Shared Memory and OpenMP Thanks to Jon Aronsson (UofM HPC consultant) for some of the material in these notes. Outline (cont d) Shared Memory and OpenMP Including
More informationTopics. Introduction. Shared Memory Parallelization. Example. Lecture 11. OpenMP Execution Model Fork-Join model 5/15/2012. Introduction OpenMP
Topics Lecture 11 Introduction OpenMP Some Examples Library functions Environment variables 1 2 Introduction Shared Memory Parallelization OpenMP is: a standard for parallel programming in C, C++, and
More informationParallel Numerical Algorithms
Parallel Numerical Algorithms http://sudalab.is.s.u-tokyo.ac.jp/~reiji/pna16/ [ 9 ] Shared Memory Performance Parallel Numerical Algorithms / IST / UTokyo 1 PNA16 Lecture Plan General Topics 1. Architecture
More informationEE/CSCI 451 Introduction to Parallel and Distributed Computation. Discussion #4 2/3/2017 University of Southern California
EE/CSCI 451 Introduction to Parallel and Distributed Computation Discussion #4 2/3/2017 University of Southern California 1 USC HPCC Access Compile Submit job OpenMP Today s topic What is OpenMP OpenMP
More informationIntroduction to OpenMP. Lecture 4: Work sharing directives
Introduction to OpenMP Lecture 4: Work sharing directives Work sharing directives Directives which appear inside a parallel region and indicate how work should be shared out between threads Parallel do/for
More informationEPL372 Lab Exercise 5: Introduction to OpenMP
EPL372 Lab Exercise 5: Introduction to OpenMP References: https://computing.llnl.gov/tutorials/openmp/ http://openmp.org/wp/openmp-specifications/ http://openmp.org/mp-documents/openmp-4.0-c.pdf http://openmp.org/mp-documents/openmp4.0.0.examples.pdf
More informationIntroduction to OpenMP
Introduction to OpenMP Le Yan Scientific computing consultant User services group High Performance Computing @ LSU Goals Acquaint users with the concept of shared memory parallelism Acquaint users with
More informationCS 470 Spring Mike Lam, Professor. Advanced OpenMP
CS 470 Spring 2018 Mike Lam, Professor Advanced OpenMP Atomics OpenMP provides access to highly-efficient hardware synchronization mechanisms Use the atomic pragma to annotate a single statement Statement
More informationHPCSE - II. «OpenMP Programming Model - Tasks» Panos Hadjidoukas
HPCSE - II «OpenMP Programming Model - Tasks» Panos Hadjidoukas 1 Recap of OpenMP nested loop parallelism functional parallelism OpenMP tasking model how to use how it works examples Outline Nested Loop
More informationShared Memory programming paradigm: openmp
IPM School of Physics Workshop on High Performance Computing - HPC08 Shared Memory programming paradigm: openmp Luca Heltai Stefano Cozzini SISSA - Democritos/INFM
More informationIntroduction to OpenMP
Christian Terboven, Dirk Schmidl IT Center, RWTH Aachen University Member of the HPC Group terboven,schmidl@itc.rwth-aachen.de IT Center der RWTH Aachen University History De-facto standard for Shared-Memory
More informationParallel Programming: OpenMP
Parallel Programming: OpenMP Xianyi Zeng xzeng@utep.edu Department of Mathematical Sciences The University of Texas at El Paso. November 10, 2016. An Overview of OpenMP OpenMP: Open Multi-Processing An
More informationCMSC 714 Lecture 4 OpenMP and UPC. Chau-Wen Tseng (from A. Sussman)
CMSC 714 Lecture 4 OpenMP and UPC Chau-Wen Tseng (from A. Sussman) Programming Model Overview Message passing (MPI, PVM) Separate address spaces Explicit messages to access shared data Send / receive (MPI
More informationParallel Programming. Exploring local computational resources OpenMP Parallel programming for multiprocessors for loops
Parallel Programming Exploring local computational resources OpenMP Parallel programming for multiprocessors for loops Single computers nowadays Several CPUs (cores) 4 to 8 cores on a single chip Hyper-threading
More informationHow to scale Nested OpenMP Applications on the ScaleMP vsmp Architecture
How to scale Nested OpenMP Applications on the ScaleMP vsmp Architecture Dirk Schmidl, Christian Terboven, Andreas Wolf, Dieter an Mey, Christian Bischof IEEE Cluster 2010 / Heraklion September 21, 2010
More informationOpenMP Algoritmi e Calcolo Parallelo. Daniele Loiacono
OpenMP Algoritmi e Calcolo Parallelo References Useful references Using OpenMP: Portable Shared Memory Parallel Programming, Barbara Chapman, Gabriele Jost and Ruud van der Pas OpenMP.org http://openmp.org/
More informationParallel Programming
Parallel Programming OpenMP Dr. Hyrum D. Carroll November 22, 2016 Parallel Programming in a Nutshell Load balancing vs Communication This is the eternal problem in parallel computing. The basic approaches
More informationAmdahl s Law. AMath 483/583 Lecture 13 April 25, Amdahl s Law. Amdahl s Law. Today: Amdahl s law Speed up, strong and weak scaling OpenMP
AMath 483/583 Lecture 13 April 25, 2011 Amdahl s Law Today: Amdahl s law Speed up, strong and weak scaling OpenMP Typically only part of a computation can be parallelized. Suppose 50% of the computation
More informationLecture 4: OpenMP Open Multi-Processing
CS 4230: Parallel Programming Lecture 4: OpenMP Open Multi-Processing January 23, 2017 01/23/2017 CS4230 1 Outline OpenMP another approach for thread parallel programming Fork-Join execution model OpenMP
More informationOpenMP Tutorial. Dirk Schmidl. IT Center, RWTH Aachen University. Member of the HPC Group Christian Terboven
OpenMP Tutorial Dirk Schmidl IT Center, RWTH Aachen University Member of the HPC Group schmidl@itc.rwth-aachen.de IT Center, RWTH Aachen University Head of the HPC Group terboven@itc.rwth-aachen.de 1 IWOMP
More informationOpenMP Lab on Nested Parallelism and Tasks
OpenMP Lab on Nested Parallelism and Tasks Nested Parallelism 2 Nested Parallelism Some OpenMP implementations support nested parallelism A thread within a team of threads may fork spawning a child team
More informationIntroduction to OpenMP
1 Introduction to OpenMP NTNU-IT HPC Section John Floan Notur: NTNU HPC http://www.notur.no/ www.hpc.ntnu.no/ Name, title of the presentation 2 Plan for the day Introduction to OpenMP and parallel programming
More informationWhy C? Because we can t in good conscience espouse Fortran.
C Tutorial Why C? Because we can t in good conscience espouse Fortran. C Hello World Code: Output: C For Loop Code: Output: C Functions Code: Output: Unlike Fortran, there is no distinction in C between
More informationECE 574 Cluster Computing Lecture 10
ECE 574 Cluster Computing Lecture 10 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 1 October 2015 Announcements Homework #4 will be posted eventually 1 HW#4 Notes How granular
More informationJukka Julku Multicore programming: Low-level libraries. Outline. Processes and threads TBB MPI UPC. Examples
Multicore Jukka Julku 19.2.2009 1 2 3 4 5 6 Disclaimer There are several low-level, languages and directive based approaches But no silver bullets This presentation only covers some examples of them is
More informationOS impact on performance
PhD student CEA, DAM, DIF, F-91297, Arpajon, France Advisor : William Jalby CEA supervisor : Marc Pérache 1 Plan Remind goal of OS Reproducibility Conclusion 2 OS : between applications and hardware 3
More informationParallel algorithm templates. Threads, tasks and parallel patterns Programming with. From parallel algorithms templates to tasks
COMP528 Task-based programming in OpenMP www.csc.liv.ac.uk/~alexei/comp528 Alexei Lisitsa Dept of Computer Science University of Liverpool a.lisitsa@.liverpool.ac.uk Parallel algorithm templates We have
More informationCS691/SC791: Parallel & Distributed Computing
CS691/SC791: Parallel & Distributed Computing Introduction to OpenMP 1 Contents Introduction OpenMP Programming Model and Examples OpenMP programming examples Task parallelism. Explicit thread synchronization.
More informationOpenMP. Application Program Interface. CINECA, 14 May 2012 OpenMP Marco Comparato
OpenMP Application Program Interface Introduction Shared-memory parallelism in C, C++ and Fortran compiler directives library routines environment variables Directives single program multiple data (SPMD)
More informationParallelising Scientific Codes Using OpenMP. Wadud Miah Research Computing Group
Parallelising Scientific Codes Using OpenMP Wadud Miah Research Computing Group Software Performance Lifecycle Scientific Programming Early scientific codes were mainly sequential and were executed on
More informationLast Assignment. My Version
Last Assignment My Version 1 Who are these people? What do they have to do with this class? 2 OpenMP an Overview Timothy H. Kaiser, Ph.D. tkaiser@mines.edu 3 OpenMP talk What is it? Why not? Why are people
More informationCS 470 Spring Mike Lam, Professor. Advanced OpenMP
CS 470 Spring 2017 Mike Lam, Professor Advanced OpenMP Atomics OpenMP provides access to highly-efficient hardware synchronization mechanisms Use the atomic pragma to annotate a single statement Statement
More informationA Uniform Programming Model for Petascale Computing
A Uniform Programming Model for Petascale Computing Barbara Chapman University of Houston WPSE 2009, Tsukuba March 25, 2009 High Performance Computing and Tools Group http://www.cs.uh.edu/~hpctools Agenda
More informationIntroduction to OpenMP
Introduction to OpenMP Lecture 9: Performance tuning Sources of overhead There are 6 main causes of poor performance in shared memory parallel programs: sequential code communication load imbalance synchronisation
More informationIntroduction to OpenMP
Introduction to OpenMP Christian Terboven 10.04.2013 / Darmstadt, Germany Stand: 06.03.2013 Version 2.3 Rechen- und Kommunikationszentrum (RZ) History De-facto standard for
More informationOpenMP 2. CSCI 4850/5850 High-Performance Computing Spring 2018
OpenMP 2 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives
More informationOpenMP: Open Multiprocessing
OpenMP: Open Multiprocessing Erik Schnetter June 7, 2012, IHPC 2012, Iowa City Outline 1. Basic concepts, hardware architectures 2. OpenMP Programming 3. How to parallelise an existing code 4. Advanced
More information[Potentially] Your first parallel application
[Potentially] Your first parallel application Compute the smallest element in an array as fast as possible small = array[0]; for( i = 0; i < N; i++) if( array[i] < small ) ) small = array[i] 64-bit Intel
More informationShared Memory Programming Model
Shared Memory Programming Model Ahmed El-Mahdy and Waleed Lotfy What is a shared memory system? Activity! Consider the board as a shared memory Consider a sheet of paper in front of you as a local cache
More informationIntroduction to Standard OpenMP 3.1
Introduction to Standard OpenMP 3.1 Massimiliano Culpo - m.culpo@cineca.it Gian Franco Marras - g.marras@cineca.it CINECA - SuperComputing Applications and Innovation Department 1 / 59 Outline 1 Introduction
More informationIntroduction to OpenMP
Introduction to OpenMP Le Yan Objectives of Training Acquaint users with the concept of shared memory parallelism Acquaint users with the basics of programming with OpenMP Memory System: Shared Memory
More informationECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management
ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program
More informationShared Memory Programming with OpenMP. Lecture 3: Parallel Regions
Shared Memory Programming with OpenMP Lecture 3: Parallel Regions Parallel region directive Code within a parallel region is executed by all threads. Syntax: Fortran:!$OMP PARALLEL! block!$omp END PARALLEL
More informationModule 11: The lastprivate Clause Lecture 21: Clause and Routines. The Lecture Contains: The lastprivate Clause. Data Scope Attribute Clauses
The Lecture Contains: The lastprivate Clause Data Scope Attribute Clauses Reduction Loop Work-sharing Construct: Schedule Clause Environment Variables List of Variables References: file:///d /...ary,%20dr.%20sanjeev%20k%20aggrwal%20&%20dr.%20rajat%20moona/multi-core_architecture/lecture%2021/21_1.htm[6/14/2012
More informationAnnales UMCS Informatica AI 2 (2004) UMCS. OpenMP parser for Ada
Annales Informatica AI 2 (2004) 125-133 OpenMP parser for Ada Annales Informatica Lublin-Polonia Sectio AI http://www.annales.umcs.lublin.pl/ Rafał Henryk Kartaszyński *, Przemysław Stpiczyński ** Department
More informationAn Introduction to OpenMP
An Introduction to OpenMP U N C L A S S I F I E D Slide 1 What Is OpenMP? OpenMP Is: An Application Program Interface (API) that may be used to explicitly direct multi-threaded, shared memory parallelism
More informationOPERATING SYSTEM. Chapter 4: Threads
OPERATING SYSTEM Chapter 4: Threads Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples Objectives To
More informationParallel Programming
Parallel Programming Lecture delivered by: Venkatanatha Sarma Y Assistant Professor MSRSAS-Bangalore 1 Session Objectives To understand the parallelization in terms of computational solutions. To understand
More informationLittle Motivation Outline Introduction OpenMP Architecture Working with OpenMP Future of OpenMP End. OpenMP. Amasis Brauch German University in Cairo
OpenMP Amasis Brauch German University in Cairo May 4, 2010 Simple Algorithm 1 void i n c r e m e n t e r ( short a r r a y ) 2 { 3 long i ; 4 5 for ( i = 0 ; i < 1000000; i ++) 6 { 7 a r r a y [ i ]++;
More informationThe Evaluation of Parallel Compilers and Trapezoidal Self- Scheduling
The Evaluation of Parallel Compilers and Trapezoidal Self- Scheduling Will Smith and Elizabeth Fehrmann May 23, 2006 Multiple Processor Systems Dr. Muhammad Shaaban Overview Serial Compilers Parallel Compilers
More informationAllows program to be incrementally parallelized
Basic OpenMP What is OpenMP An open standard for shared memory programming in C/C+ + and Fortran supported by Intel, Gnu, Microsoft, Apple, IBM, HP and others Compiler directives and library support OpenMP
More informationChapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues
Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues 4.2 Silberschatz, Galvin
More informationIntroduction to Multicore Programming
Introduction to Multicore Programming Minsoo Ryu Department of Computer Science and Engineering 2 1 Multithreaded Programming 2 Automatic Parallelization and OpenMP 3 GPGPU 2 Multithreaded Programming
More informationEE/CSCI 451: Parallel and Distributed Computation
EE/CSCI 451: Parallel and Distributed Computation Lecture #7 2/5/2017 Xuehai Qian Xuehai.qian@usc.edu http://alchem.usc.edu/portal/xuehaiq.html University of Southern California 1 Outline From last class
More informationIntroduction to OpenMP
Introduction to OpenMP Le Yan HPC Consultant User Services Goals Acquaint users with the concept of shared memory parallelism Acquaint users with the basics of programming with OpenMP Discuss briefly the
More informationMetaFork: A Compilation Framework for Concurrency Platforms Targeting Multicores
MetaFork: A Compilation Framework for Concurrency Platforms Targeting Multicores Xiaohui Chen, Marc Moreno Maza & Sushek Shekar University of Western Ontario, Canada IBM Toronto Lab February 11, 2015 Plan
More informationBarbara Chapman, Gabriele Jost, Ruud van der Pas
Using OpenMP Portable Shared Memory Parallel Programming Barbara Chapman, Gabriele Jost, Ruud van der Pas The MIT Press Cambridge, Massachusetts London, England c 2008 Massachusetts Institute of Technology
More informationOpenMP Shared Memory Programming
OpenMP Shared Memory Programming John Burkardt, Information Technology Department, Virginia Tech.... Mathematics Department, Ajou University, Suwon, Korea, 13 May 2009.... http://people.sc.fsu.edu/ jburkardt/presentations/
More informationParallel Programming. OpenMP Parallel programming for multiprocessors for loops
Parallel Programming OpenMP Parallel programming for multiprocessors for loops OpenMP OpenMP An application programming interface (API) for parallel programming on multiprocessors Assumes shared memory
More informationParticle-in-Cell Simulations on Modern Computing Platforms. Viktor K. Decyk and Tajendra V. Singh UCLA
Particle-in-Cell Simulations on Modern Computing Platforms Viktor K. Decyk and Tajendra V. Singh UCLA Outline of Presentation Abstraction of future computer hardware PIC on GPUs OpenCL and Cuda Fortran
More informationIntroduction to OpenMP
Introduction to OpenMP Ricardo Fonseca https://sites.google.com/view/rafonseca2017/ Outline Shared Memory Programming OpenMP Fork-Join Model Compiler Directives / Run time library routines Compiling and
More informationOperating Systems 2 nd semester 2016/2017. Chapter 4: Threads
Operating Systems 2 nd semester 2016/2017 Chapter 4: Threads Mohamed B. Abubaker Palestine Technical College Deir El-Balah Note: Adapted from the resources of textbox Operating System Concepts, 9 th edition
More informationUvA-SARA High Performance Computing Course June Clemens Grelck, University of Amsterdam. Parallel Programming with Compiler Directives: OpenMP
Parallel Programming with Compiler Directives OpenMP Clemens Grelck University of Amsterdam UvA-SARA High Performance Computing Course June 2013 OpenMP at a Glance Loop Parallelization Scheduling Parallel
More informationLAB. Preparing for Stampede: Programming Heterogeneous Many-Core Supercomputers
LAB Preparing for Stampede: Programming Heterogeneous Many-Core Supercomputers Dan Stanzione, Lars Koesterke, Bill Barth, Kent Milfeld dan/lars/bbarth/milfeld@tacc.utexas.edu XSEDE 12 July 16, 2012 1 Discovery
More informationX-Kaapi C programming interface
X-Kaapi C programming interface Fabien Le Mentec, Vincent Danjean, Thierry Gautier To cite this version: Fabien Le Mentec, Vincent Danjean, Thierry Gautier. X-Kaapi C programming interface. [Technical
More informationNew Features after OpenMP 2.5
New Features after OpenMP 2.5 2 Outline OpenMP Specifications Version 3.0 Task Parallelism Improvements to nested and loop parallelism Additional new Features Version 3.1 - New Features Version 4.0 simd
More information6.1 Multiprocessor Computing Environment
6 Parallel Computing 6.1 Multiprocessor Computing Environment The high-performance computing environment used in this book for optimization of very large building structures is the Origin 2000 multiprocessor,
More informationChapter 4: Threads. Chapter 4: Threads
Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples
More informationIntroduction to OpenMP
Introduction to OpenMP Lecture 4: Work sharing directives Work sharing directives Directives which appear inside a parallel region and indicate how work should be shared out between threads Parallel do/for
More informationMetaFork: A Compilation Framework for Concurrency Platforms Targeting Multicores
MetaFork: A Compilation Framework for Concurrency Platforms Targeting Multicores Presented by Xiaohui Chen Joint work with Marc Moreno Maza, Sushek Shekar & Priya Unnikrishnan University of Western Ontario,
More informationCOSC 6374 Parallel Computation. Introduction to OpenMP(I) Some slides based on material by Barbara Chapman (UH) and Tim Mattson (Intel)
COSC 6374 Parallel Computation Introduction to OpenMP(I) Some slides based on material by Barbara Chapman (UH) and Tim Mattson (Intel) Edgar Gabriel Fall 2014 Introduction Threads vs. processes Recap of
More information