14. Multithreading [HPC in Julia]
Jamie Mair
0:00 / 0:00
14. Multithreading [HPC in Julia]
1 884 просмотра · 1 год назад
Jamie Mair
1,86 тыс. подписчиков
1 884 просмотра · 1 год назад
In this video we will introduce multithreading, which allows you to write code that executes in parallel. Multithreading is a shared memory parallel programming paradigm, and is the first paradigm we will cover in this series. Writing multithreaded code can be notoriously difficult, as it is very easy to introduce correctness bugs due to race conditions. We will see the common methods used to combat race conditions, including mutexes, semaphores and algorithm redesign.
This module was designed as an MPAGS (Midlands Physics Alliance Graduate School) module and aimed at postgraduates and early career researchers.
Simultaneous Multithreading (SMT) / Hyperthreading:
https://en.wikipedia.org/wiki/Simulta...
https://www.intel.com/content/www/us/...
Timestamps:
00:00:00 Introduction
00:00:40 Concurrency
00:00:56 Multicore CPUs
00:02:33 Multithreading
00:05:11 Launching Julia with multiple threads
00:06:18 Task based parallelism
00:08:46 Parallel "for" loop
00:10:45 Example: Monte-Carlo calculation
00:11:55 Race conditions
00:15:32 Atomics
00:19:52 Mutexes
00:23:58 Semaphores
00:27:12 Mutexes vs Semaphores
00:28:04 Separate memory per thread
00:31:59 Benchmarks
00:35:21 Multithreading considerations
Useful links:
Git/GitHub for Researchers: • MLiS1 Introduction to Git by Jamie Mair
Julia Documentation: https://docs.julialang.org/en/v1/
MPAGS Registration: https://warwick.ac.uk/fac/sci/physics...
Course Notes: https://jamiemair.co.uk/courses/hpc