3-Parallel Software
3-Parallel Software
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
CENG479 PARALLEL COMPUTING
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
CENG479 PARALLEL COMPUTING
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
CENG479 PARALLEL COMPUTING
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
CENG479 PARALLEL COMPUTING
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
BM5351 PARALEL HESAPLAMA YÖNTEMLERİ
Multitasking
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
BM5351 PARALEL HESAPLAMA YÖNTEMLERİ
Threading
https://www.studytonight.com/operating-system/multithreading
Copyright © 2010, Elsevier Inc. All rights Reserved
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Hardware to Software mapping…
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
SPMD – single program multiple data
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Nondeterminism
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Writing Parallel Programs
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Sequential vs Parallel
● The parallel software must give same result / output with sequential version
○ The last result must be reduced on a process / thread
● Parallel software implementation is much more costly than sequential version
● Parallel software has side costs
○ Synchronization
○ Communication
Shared Memory System
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Shared Memory
● Dynamic threads
○ Master thread waits for work, forks new threads, and when threads are done, they terminate
○ Efficient use of resources
○ Thread creation and termination is time consuming
● Static threads
○ Pool of threads created and are allocated work, but do not terminate until cleanup.
○ Better performance
○ Potential waste of system resources
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Shared memory issues
● Race condition
● Critical section
● Mutually exclusive
● Mutual exclusion lock (mutex,
semaphore, ...)
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Busy-waiting
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Distributed Memory System
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.
Distributed Memory: message-passing
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
We want to write a parallel program ... Now what?
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Foster’s methodology
(The PCAM Methodology)
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Foster Methodology - Partitioning
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Foster Methodology - Communication
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Foster Methodology - Aggregation
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Foster Methodology - Mapping
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Example - histogram
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Serial program - input
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Serial program - output
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Serial Program
int bin = 0;
bin_counts[bin]++;
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Adding the local arrays
Better Performance ?
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
Adding the local arrays
These slides are adopted from Prof Dr Zahran's Parallel Computing lecture notes.z
BBM101- Bilgisayar Programlamaya Giriş-I
Questions