A F amily of Data P a rallel Derivations Maurice Clint - - PDF document

a f amily of data p a rallel derivations maurice clint
SMART_READER_LITE
LIVE PREVIEW

A F amily of Data P a rallel Derivations Maurice Clint - - PDF document

A F amily of Data P a rallel Derivations Maurice Clint Stephen Fitzpatrick T erence J Ha rmer P eter L Kilpatrick Depa rtment of Computer Science The Queens Universit y of Belfast Belfast No rthern


slide-1
SLIDE 1 A F amily
  • f
Data P a rallel Derivations Maurice Clint Stephen Fitzpatrick T erence J Ha rmer P eter L Kilpatrick Depa rtment
  • f
Computer Science The Queens Universit y
  • f
Belfast Belfast No rthern Ireland UK James M Bo yle Mathematics and Computer Science Division Argonne National Lab
  • rato
ry Argonne USA This w
  • rk
is supp
  • rted
b y SERC Grant GRG
  • b
y a resea rch studentship from the Depa rtment
  • f
Education fo r No rthern Ireland and b y the Oce
  • f
Scientic Computing US Depa rtment
  • f
Energy
  • under
Contract WEng
slide-2
SLIDE 2 Cla rit y V Eciency Highlevel a rchitectureindep endent p rograms
  • Easier
to construct
  • Easier
to understand
  • P
  • rtable
Ecient p rograms
  • T
ailo red to pa rticula r machine nonp
  • rtable
  • Aw
ash with details
  • Dicult
to construct
  • Dicult
to understand
slide-3
SLIDE 3 Example T ransp
  • se
  • f
a Matrix Denition transp
  • se
A T
  • f
mn matrix A is an nm matrix such that i j
  • A
T i j Aj i Highlevel implementation function transpose A m n
  • generate
n m f n i j A j i
  • Ecient
sequential implementation fo r squa re matrix m
  • n
SUBROUTINE transpose An
  • DO
in DO jin t
  • Aij
Aij
  • Aji
Aji
  • t
END END
slide-4
SLIDE 4 Our resolution Programmer constructs sp ecication and implementation automatically derived Sp ecication language F unctional p rogramming language
  • Mathematically
based
  • Simple
semantics easily understo
  • d
  • Useful
mathematical p rop erties
  • Executable
p rotot yp es Implementation language Whatever required b y implementation environ ment usually version
  • f
F
  • rtran
  • r
C
  • Ecient
  • Go
  • d
vendo r supp
  • rt
  • Mo
re convenient than machine language Derivation b y p rogram transfo rmation
slide-5
SLIDE 5 Program T ransfo rmations Program rewrite rules patter n r epl acement All
  • ccurrences
  • f
patter n in p rogram changed to r epl acement
  • Achieves
a small lo cal change
  • Based
  • n
fo rmal p rop erties Clea rly p reserves meaning
  • f
p rogram
  • F
  • rmally
dened in wide sp ectrum gram ma r
  • F
  • rmal
p ro
  • f
p
  • ssible
Derivations Sequences
  • f
transfo rmations
  • Complete
metamo rphosis through many ap plications
  • f
many transfo rmations
  • Automatically
applied b y T AMPR system
slide-6
SLIDE 6 F amily
  • f
Derivations Derivation p erfo rmed in steps
  • Subderivations
  • Intermediate
fo rms b et w een sp ecication and implementation languages F
  • r
example SML
  • calculus
  • F
  • rtran
Same intermediate fo rm fo r
  • ther
sp ecication languages
  • ther
a rchitecturesimplementation languages Combinations have included SML Lisp Miranda
  • calculus
  • F
  • rtran
CRA Y F
  • rtran
D AP F
  • rtran
C
slide-7
SLIDE 7 Other subderivationsintermediate fo rms fo r
  • Optimization
eg function unfolding common sub exp ression elimination
  • T
ailo ring fo r pa rticula r fo rms
  • f
data eg spa rse matrices

SML Lisp λ-calculus Evaluated Unfolded Processes Shared Memory Processes & Communication Distributed Memory Sectioned Array Form Common Subexpression DAP Fortran Fortran90 Fortran77 Common Subexpression CRAY Sparse

slide-8
SLIDE 8 Example Matrixvecto r multiplication
  • a
b c d
  • a
  • b
  • c
  • d
  • fun
timesUve ct
  • r
V ve ct
  • r
  • ve
ct
  • r
  • generates
iz e U fn i i nt
  • U
  • i
V i
  • fun
sumUvect
  • r
  • re
al
  • reduceU
  • fun
innerprodu ct U v ect
  • r
V v ec to r r ea l
  • sumtimes
U V
  • fun
mvmultAm at ri x Vv ec to r v ec to r
  • generates
iz e A
  • fniint
  • in
ne rpr
  • d
uc t ro w A i V
  • SML
sp ecication Data pa rallel functions
  • generate
denes vecto rmatrix
  • reduce
combines elements
  • f
vecto rmatrix into single value
slide-9
SLIDE 9 Optimize generate n i reducen j realtimes
  • elementA
i j
  • elementV
j
  • realplus
  • SequentialCRA
Y implementation generate and reduce implemented as lo
  • ps
DO in AVi DO jn AViAVi A i j
  • Vj
  • ENDDO
ENDDO D AP implementation wholea rra y
  • p
erations AVsumcA ma tr V n
slide-10
SLIDE 10 Assessment T echniques have b een applied to mo re com plex algo rithms fo r sequentialvecto r a rra y and sha redmemo ry a rchitectures Compa ring with indep endent manually con structed implementations
  • Derived
implementations simila r
  • Execution
p erfo rmance equal
  • r
b etter T echniques a re b eing extended fo r y et mo re complex algo rithms fo r distributed and sha red memo ry pa rallel a rchitectures and fo r further sp ecial data structures
slide-11
SLIDE 11 With derivational app roach p rogrammer
  • develops
implementation techniques
  • enco
des techniques as derivations Reusabilit y Multiple sp ecications Multiple implementations
  • f
each Algo rithm mo died mo dify sp ecication and reapply derivation Extensibilit y New
  • ptimization
technique
  • r
new a rchitecture
  • r
new data rep resentation slot in new subderivation T ransferabilit y Subderivation requires no exp ertise to use One p rogrammer ma y use anothers w
  • rk
Co rrectness Co rrectness
  • f
transfo rmations implies co rrectness
  • f
implementation