EN.540.635 - Software Carpentry Python – A Crash Course Esoteric Sections Parallelization https://lammps.sandia.gov/movies.html.

Slides:



Advertisements
Similar presentations
Parallel Processing with OpenMP
Advertisements

Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
Concurrent Programming Introducing the principles of reentrancy, mutual exclusion and thread-synchronication.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
Debugging Introduction to Computing Science and Programming I.
MULTICORE, PARALLELISM, AND MULTITHREADING By: Eric Boren, Charles Noneman, and Kristen Janick.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
Threading Part 2 CS221 – 4/22/09. Where We Left Off Simple Threads Program: – Start a worker thread from the Main thread – Worker thread prints messages.
Engineering H193 - Team Project Gateway Engineering Education Coalition P. 1 Spring Quarter 2008 Robot Programming Tips Week 4 Day 2 By Matt Gates and.
1 Advanced Computer Programming Concurrency Multithreaded Programs Copyright © Texas Education Agency, 2013.
CSE 380 – Computer Game Programming Render Threading Portal, by Valve,
DATA STRUCTURES OPTIMISATION FOR MANY-CORE SYSTEMS Matthew Freeman | Supervisor: Maciej Golebiewski CSIRO Vacation Scholar Program
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Multi-Threading and Load Balancing Compiled by Paul TaylorCSE3AGR Stolen mainly from Orion Granatir
University of Michigan Electrical Engineering and Computer Science 1 Dynamic Acceleration of Multithreaded Program Critical Paths in Near-Threshold Systems.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
Games Development 2 Concurrent Programming CO3301 Week 9.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
Laboratory - 4.  Threading Concept  Threading in.NET  Multi-Threaded Socket  Example.
11/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
Threads Opening Discussion zWhat did we talk about last class? zDo you have any questions about the assignment?
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Software Systems Advanced Synchronization Emery Berger and Mark Corner University.
Concurrent Computing CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Synchronization These notes introduce:
Threaded Programming Lecture 1: Concepts. 2 Overview Shared memory systems Basic Concepts in Threaded Programming.
Single Node Optimization Computational Astrophysics.
Lab 4 : Real-Time OS Team #7 P 李彥勳 P 謝嵩淮 R 侯凱文.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.
Representation of Data Binary Representation of Instructions teachwithict.weebly.com.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
MULTITHREADED PROGRAMMING Processes vs. Threads Process states and state transitions Hazards and Semaphores 1.
1 ITCS 4/5145 Parallel Programming, B. Wilkinson, Nov 12, CUDASynchronization.ppt Synchronization These notes introduce: Ways to achieve thread synchronization.
Pitfalls: Time Dependent Behaviors CS433 Spring 2001 Laxmikant Kale.
Java Thread Programming
Using the VTune Analyzer on Multithreaded Applications
EMERALDS Landon Cox March 22, 2017.
CS 6560: Operating Systems Design
Multithreading Tutorial
Introduction to Parallelism.
Processing Framework Sytse van Geldermalsen
Operating System Concepts
L21: Putting it together: Tree Search (Ch. 6)
Multi-Processing in High Performance Computer Architecture:
Multithreading Tutorial
Race conditions and Synchronization
Parallelism and Concurrency
Questions Parallel Programming Shared memory performance issues
Concurrency: Mutual Exclusion and Process Synchronization
Multithreading Tutorial
CSCI1600: Embedded and Real Time Software
Multithreading Tutorial
Multithreading Why & How.
Lecture 2 The Art of Concurrency
Parallel Computing Explained How to Parallelize a Code
CS333 Intro to Operating Systems
Learning Intention I will learn about the different types of programming errors.
January 15, 2004 Adrienne Noble
CSCI1600: Embedded and Real Time Software
Synchronization These notes introduce:
EE 155 / Comp 122 Parallel Computing
“The Little Book on Semaphores” Allen B. Downey
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
What is a Thread? A thread is similar to a process, but it typically consists of just the flow of control. Multiple threads use the address space of a.
Ch 3.
Run time performance for all benchmarked software.
Presentation transcript:

EN.540.635 - Software Carpentry Python – A Crash Course Esoteric Sections Parallelization https://lammps.sandia.gov/movies.html

Central Processing Units (CPUs) Intel i7 7700k ----------------------- 4 Cores 8 Threads AMD Ryzen 7 1800X ----------------------- 8 Cores 16 Threads

Cores and Threads Computers need to run code All code is run serially in the Processing Unit of the CPU With more Processing Units, we can effectively run them in parallel NOTE! Still in serial on the Processing Unit, but in parallel in the CPU CPU Core

Cores and Threads Multithreading is when a single core tries parallelizing code. Recall that cores cannot truly do this! Standard practice restricts multithreading to 2 threads per core CPU Core

Memory Imagine the following pseudo-code: What happens?

Locks / Mutex To prevent multiple writes to the same location (leading to corruption), we lock the memory down A mutex is a fancy word for a lock How it works: Code checks if lock exists If yes, then wait If no, then lock and continue NOTE! An “atomic operation” must occur here

Locks / Mutex What’s wrong with the following lock method: Scope

Typical Outline of Parallel Code

Typical Outline of Parallel Code

Embarrassingly Parallel What if there is little to no need for different cores to communicate? Ex. Re-run a probabilistic code N times for an average Much easier to accomplish!

Always Parallel If embarrassingly parallel code is so easy to setup, why not always use it instead of a regular for loop? A lot still needs to be done in the background! Locks/Mutexs Delegation of tasks to cores Multithreading