Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapel Chao, Dave, Esteban. Overview High-Productivity Computing Systems (HPCS, Darpa) High-Productivity Computing Systems (HPCS, Darpa) Cray’s Cascade.

Similar presentations


Presentation on theme: "Chapel Chao, Dave, Esteban. Overview High-Productivity Computing Systems (HPCS, Darpa) High-Productivity Computing Systems (HPCS, Darpa) Cray’s Cascade."— Presentation transcript:

1 Chapel Chao, Dave, Esteban

2 Overview High-Productivity Computing Systems (HPCS, Darpa) High-Productivity Computing Systems (HPCS, Darpa) Cray’s Cascade High Productivity Language (CHaPeL) Cray’s Cascade High Productivity Language (CHaPeL) Programmability Programmability Performance Performance Portability Portability Robustness Robustness Want to solve the “Parallel Programming Problem” Want to solve the “Parallel Programming Problem” Simplify initial creation of parallel programs Simplify initial creation of parallel programs Support evolution of programs to high performance, production-quality code Support evolution of programs to high performance, production-quality code Emphasize generality Emphasize generality Motivating features: Motivating features: Multithreaded programming Multithreaded programming Locality-aware programming Locality-aware programming Object-oriented programming Object-oriented programming Generic programming and type inference Generic programming and type inference

3 Key Features Abstractions for data and task parallelism Abstractions for data and task parallelism Data: domains, arrays, iterators Data: domains, arrays, iterators Task: cobegin, atomic transactions, synchronization variables Task: cobegin, atomic transactions, synchronization variables Global view of computation, data Global view of computation, data

4 Domains

5

6 Cobegin Starts several statements at once, blocks until they finish Starts several statements at once, blocks until they finish 1. Quicksort(low, high, data){ 2. if( …/* too small */){ 3. … // sort here 4. return; 5. } 6. pivot = computePivot(lo, hi, data); 7. cobegin { //below happen in parallel 8. Quicksort(lo, pivot, data); 9. Quicksort(pivot, high, data); 10. } 11. // blocks here until both Quicksort calls above finish 12. }

7 Atomic Transactions “atomic” statements like database transaction If two start at once and collide, one rolled back and retried Occur as if rest of the program were suspended 1. 1. atomic { 2. 2. newnode.next = insertpt; 3. 3. newnode.prev = insertpt.prev; 4. 4. insertpt.prev.next = newnode; 5. 5. insertpt.prev = newnode; 6. 6. }

8 Synchronization Single assignment variables – block on access if not assigned Single assignment variables – block on access if not assigned 1. 1. function Tree.sum() { 2. 2. if(is_leaf) return value; 3. 3. single var x ; 4. 4. begin x = left.sum; 5. 5. var y = right.sum; 6. 6. return x+y; 7. 7. } sync variables – only have one value at a time sync variables – only have one value at a time Read consumes value, makes variable undefined Read consumes value, makes variable undefined If variable undefined, reads block If variable undefined, reads block Write creates value, defines variable Write creates value, defines variable If variable defined, writes block If variable defined, writes block

9 Serial Statement serial ; Allows serialization of parallel statements under certain conditions 1. 1. class Tree { 2. 2. var is_leaf : boolean; 3. 3. var left : Tree; 4. 4. var right : Tree; 5. 5. } 6. 6. iterator Tree.walk : Tree { 7. 7. if(is_leaf) yield(this); 8. 8. else 9. 9. serial(height <= 10) 10. 10. cobegin { 11. 11. yield(left.walk); 12. 12. yield(right.walk); 13. 13. } 14. 14. }

10 Generic Programming Features Can have type variables and parameters Can have type variables and parameters 1. 1. class Stack { 2. 2. type t; 3. 3. var buffsize:integer= 128; 4. 4. var data: [1..buffsize] t; 5. 5. functiontop(): t { … }; 6. 6. } “Type query” vars 1. 1. function copyN(data: [?D] ?t; n: integer): [D] t { 2. 2. var newcopy: [D] t; 3. 3. forall i in1..n do newcopy(i) = data(i); 4. 4. return newcopy; 5. 5. } Elided types 1. 1. function inc(val): { 2. 2. var tmp = val; 3. 3. return tmp + 1; 4. 4. }

11 Locales A locale is a unit of storage and processing A locale is a unit of storage and processing Specify at run-time the number of locales Specify at run-time the number of locales Can specify at which locale objects are stored, computations performed Can specify at which locale objects are stored, computations performed Can specify locale by a variable Can specify locale by a variable 1. on TaskLocalA do taskA() Can specify locale by data location Can specify locale by data location 1. 1. forall i in D on(a(i)) do...

12 References Slides heavily influenced by Slides heavily influenced by http://chapel.cs.washington.edu/ChapelForAH PCRC.pdf http://chapel.cs.washington.edu/ChapelForAH PCRC.pdf http://chapel.cs.washington.edu/ChapelForAH PCRC.pdf http://chapel.cs.washington.edu/ChapelForAH PCRC.pdf http://chapel.cs.washington.edu/specification. pdf http://chapel.cs.washington.edu/specification. pdf http://chapel.cs.washington.edu/specification. pdf http://chapel.cs.washington.edu/specification. pdf http://chapel.cs.washington.edu/ChapelForLC PC.pdf http://chapel.cs.washington.edu/ChapelForLC PC.pdf http://chapel.cs.washington.edu/ChapelForLC PC.pdf http://chapel.cs.washington.edu/ChapelForLC PC.pdf


Download ppt "Chapel Chao, Dave, Esteban. Overview High-Productivity Computing Systems (HPCS, Darpa) High-Productivity Computing Systems (HPCS, Darpa) Cray’s Cascade."

Similar presentations


Ads by Google