coordinating data parallel sac programs with s net
play

Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz - PowerPoint PPT Presentation

Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz Clemens Grelck and Alex Shafarenko Compiler Technology and Computer Architecture Group University of Hertfordshire, UK HIPS-ToPMoDRS, 26.March 2007, Long Beach


  1. Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz Clemens Grelck and Alex Shafarenko Compiler Technology and Computer Architecture Group University of Hertfordshire, UK HIPS-ToPMoDRS, 26.March 2007, Long Beach www.aether-ist.org Sven-Bodo Scholz Coordinating SAC with S-Net

  2. SAC in a nutshell ◮ generic array programming ◮ purely functional ◮ no-frills ◮ aggressive program optimisation ◮ sequential performance competitive with fortran 77 ◮ generation of multi-threaded code without annotations For details see www.sac-home.org Sven-Bodo Scholz Coordinating SAC with S-Net

  3. Exploitation of Data-Parallelism in SAC ◮ hinges on our data-parallel construct, the With-Loop ◮ all our array operations are defined by these ◮ granularity control by ◮ array size inference ◮ several fusion techniques ◮ architecture specific code generation ◮ POSIX-threads for SMPs ◮ taylor-made memory management ◮ almost linear speedups for examples such as NAS-benchmarks Sven-Bodo Scholz Coordinating SAC with S-Net

  4. So what is the catch?? Our compiler maps all concur- rency into one Concurrency pat- tern: Sven-Bodo Scholz Coordinating SAC with S-Net

  5. So what is the catch?? Our compiler maps all concur- rency into one Concurrency pat- tern: if our application cannot be mapped on this pattern, we cannot exploit its concurrency! Sven-Bodo Scholz Coordinating SAC with S-Net

  6. An example: Search Algorithms Sven-Bodo Scholz Coordinating SAC with S-Net

  7. Our Approach: S-Net Existing software S-Net : ◮ asynchronous component code framework ◮ functional stream code processing code ◮ pure coordination language code ◮ dynamic network creation code ◮ orthogonal to the box language code code Sven-Bodo Scholz Coordinating SAC with S-Net

  8. S-Net at a Glance ◮ central construct: box wraps existing code box foo Sven-Bodo Scholz Coordinating SAC with S-Net

  9. S-Net at a Glance ◮ central construct: box wraps existing code ◮ connected by ◮ single input stream ◮ single output stream box foo Sven-Bodo Scholz Coordinating SAC with S-Net

  10. S-Net at a Glance ◮ central construct: box wraps existing code ◮ connected by ◮ single input stream ◮ single output stream ◮ streams transport records: sets of named fields ◮ opaque value fields ◮ integer-valued tag fields box foo {A,B,<T>} Sven-Bodo Scholz Coordinating SAC with S-Net

  11. S-Net at a Glance ◮ central construct: box ◮ box behaviour declared by wraps existing code type signature ◮ connected by ◮ single input stream ◮ single output stream ◮ streams transport records: sets of named fields ◮ opaque value fields ◮ integer-valued tag fields box foo {A,B,<T>} {A,B,<T>} {X,<T>} Sven-Bodo Scholz Coordinating SAC with S-Net

  12. S-Net at a Glance ◮ central construct: box ◮ box behaviour declared by wraps existing code type signature ◮ connected by ◮ behaviour defined in box ◮ single input stream language, not S-Net ◮ single output stream ◮ streams transport records: sets of named fields ◮ opaque value fields ◮ integer-valued tag fields box foo {A,B,<T>} {A,B,<T>} {X,<T>} Sven-Bodo Scholz Coordinating SAC with S-Net

  13. S-Net at a Glance ◮ central construct: box ◮ box behaviour declared by wraps existing code type signature ◮ connected by ◮ behaviour defined in box ◮ single input stream language, not S-Net ◮ single output stream ◮ box maps single input ◮ streams transport records: record to stream of output sets of named fields records ◮ opaque value fields ◮ integer-valued tag fields box foo {X,<T>}; {A,B,<T>} {X,<T>}; {A,B,<T>} {X,<T>} Sven-Bodo Scholz Coordinating SAC with S-Net

  14. Network Combinators: Serial box X := A..B A B Sven-Bodo Scholz Coordinating SAC with S-Net

  15. Network Combinators: Choice box X := A..B A B box X := A||B A B Sven-Bodo Scholz Coordinating SAC with S-Net

  16. Network Combinators: Serial Replication box X := A..B box X := A||B A A B B box X := A*{<stop>} A {<stop>} Sven-Bodo Scholz Coordinating SAC with S-Net

  17. Network Combinators: Index Split box X := A..B box X := A||B box X := A*{<stop>} A A B A {<stop>} B box X := A!<T> A <T> A Sven-Bodo Scholz Coordinating SAC with S-Net

  18. Primitive Boxes: Filter and Sync Filter {A,B,<T>} {A,<T>,<X>:=1}; {B,<T>,<X>:=2} housekeeping: ◮ eliminate record fields ◮ duplicate record fields ◮ add tags ◮ manipulate tag values ◮ ... Sven-Bodo Scholz Coordinating SAC with S-Net

  19. Primitive Boxes: Filter and Sync Filter Sync {A,B,<T>} {A,B} {C,D} {A,<T>,<X>:=1}; {B,<T>,<X>:=2} {A,B,C,D} housekeeping: synchronisation: ◮ eliminate record fields ◮ keep record that matches pattern ◮ duplicate record fields ◮ all patterns matched: ◮ add tags release merged records ◮ manipulate tag values ◮ pattern already matched: ◮ ... pass through Sven-Bodo Scholz Coordinating SAC with S-Net

  20. Problem: Incompatible Boxes box foo box bar ? {A,B} {C,X} {C,D} {X,Y} ◮ Box code typically designed in isolation. ◮ Interfaces only partially overlap. ◮ Network composition unfeasible in practice? Sven-Bodo Scholz Coordinating SAC with S-Net

  21. Solution: Flow Inheritence flow inheritence bypass box foo { A,B,X } { C,D,X } {A,B} {C,D} ◮ Any “unwanted” field is bypassed to output channel ◮ and is attached to any record produced in response. Sven-Bodo Scholz Coordinating SAC with S-Net

  22. Solution: Flow Inheritence flow inheritence bypass box foo { C,D,X } {A,B} { A,B,X } { C,D,X } {C,D} { C,D,X } ◮ Any “unwanted” field is bypassed to output channel ◮ and is attached to any record produced in response. Sven-Bodo Scholz Coordinating SAC with S-Net

  23. Flow Inheritence: Enabling Network Combination {X} box foo box bar {A,B} {C,X} {C,D} {X,Y} {D} ◮ Flow inheritence is the key to network glue. Sven-Bodo Scholz Coordinating SAC with S-Net

  24. How to apply this to our problem? box vert:= hor *{<done>} box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} Sven-Bodo Scholz Coordinating SAC with S-Net

  25. How to apply this to our problem? box vert:= hor *{<done>} box hor:= solveOneLevel ! <k> box solveOneLevel box hor:= solveOneLevel ! <k> {board, opts} −> {board, opts, <k>} box solveOneLevel {..., <k=0>} | {board, <done>} {board, opts} −> {board, opts, <k>} <k> | {board, <done>} box solveOneLevel <k> {board, opts} −> {board, opts, <k>} box solveOneLevel | {board, <done>} {board, opts} −> {board, opts, <k>} | {board, <done>} Sven-Bodo Scholz Coordinating SAC with S-Net

  26. How to apply this to our problem? box solveOneLevel box vert:= hor *{<done>} {board, opts} −> {board, opts, <k>} | {board, <done>} <k=0> box hor:= solveOneLevel ! <k> box hor:= solveOneLevel ! <k> box solveOneLevel {..., <k=0>} {board, opts} −> {board, opts, <k>} box solveOneLevel | {board, <done>} {board, opts} −> {board, opts, <k>} | {board, <done>} <k> <k> box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel | {board, <done>} {board, opts} −> {board, opts, <k>} | {board, <done>} Sven-Bodo Scholz Coordinating SAC with S-Net

  27. How to apply this to our problem? {..., <k=0>} box solveOneLevel box vert:= hor *{<done>} {board, opts} −> {board, opts, <k>} | {board, <done>} <k=0> box hor:= solveOneLevel ! <k> {..., <k=1>} box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel | {board, <done>} {board, opts} −> {board, opts, <k>} | {board, <done>} <k> <k> box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel | {board, <done>} {board, opts} −> {board, opts, <k>} | {board, <done>} Sven-Bodo Scholz Coordinating SAC with S-Net

Recommend


More recommend