SLIDE 3 Simple Communication Model
Data dependent = communication channel "Simple" debugging The same program executes sequentially or in parallel, communication, scheduling etc does not have to be considered when debugging No deadlocks may be introduced by parallelization! (But an erroneous (sequential) program is of course erroneous in a parallel execution.) Performance problems still have to examine with real tests (or simulations).
Language Issues – Design
Redex 4 an expression (often function application) that can be evaluated There exists two main classes of functional languages: Strict vs non"strict Strict language 4 all arguments are evaluated, may be evaluated in parallel, before the body of the function Non"strict – arguments are evaluated if/when they are needed => The evaluation of the function body may start before the arguments "exists”. ”Lazy evaluation”. ”Data4driven” vs ”Demand4driven” evaluation. Strict – sometimes have to limit the parallelism Non"strict 4 problems finding enough parallelism
- In non4strict languages you use strictness-analysis to decide (at
compile time) which expressions that are really being used A function is strict if f ⊥ = ⊥, ⊥ denotes a non4defined value. Is also used for programs that never finish executing. If a function is strict it is safe to evaluate the arguments (and function body) in parallel.
How to utilize the parallelism?
- Partitioning into tasks – implicit or explicit?
- Static or dynamic load balancing?
- Task placement?
- Granularity?
Where is the control?
Implicit parallelism 4 compiler & runtime4system decides about partitioning, distribution of data, load balancing, communication Strict languages: easy to partition into tasks, often (too) fine grained Non4strict: strictness analysis needed Limited implicit parallelism
- Some language constructs matches parallel computation schemes
- Data parallelism (SIMD) – the same operation is applied in parallel on
every element in a large data structure. Powerful in functional languages with advanced data structures and higher order functions. Controlled (semi"explicit) parallelism 4 Annotation 4 directives / suggestions to the compiler 4 Evaluation strategies Explicit parallelism Language constructs for partitioning, communication etc. ”Algorithm skeletons” – catch common patterns for parallel computations in higher
- rder functions. Express programs in these ”skeletons”.