composing models of computation in kepler/ptolemy ii antoon goderisu of manchester ( my grid/...

34
Composing Models of Computation in Kepler/Ptolemy II Antoon Goderis U of Manchester ( my Grid/ Taverna) Christopher Brooks UC Berkeley (Ptolemy II) Ilkay Altintas UC San Diego (Kepler) Edward A. Lee UC Berkeley (Ptolemy II)

Upload: aileen-hardy

Post on 28-Dec-2015

225 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Composing Models of Computation

in Kepler/Ptolemy II

Antoon Goderis U of Manchester (myGrid/ Taverna)Christopher Brooks UC Berkeley (Ptolemy II)Ilkay Altintas UC San Diego (Kepler)Edward A. Lee UC Berkeley (Ptolemy II)Carole Goble U of Manchester (myGrid/Taverna)

Page 2: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

The talk

• Models of Computation (MoCs)– Use cases from science– PtolemyII/Kepler

• Composing Models of Computation– Use cases from science– PtolemyII/Kepler

• Conditions for valid (hierarchical-) compositions• Example based on process networks and data flow • Table of valid compositions

Page 3: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Use cases for different MoCs

To model scientific problems naturally

• Biology: Gene annotation pipelines– [Dataflow] for pipeline compositions

• Fluid dynamics: Lattice-Boltzmann simulations– [Continuous-time based ordinary

differential equation solvers]

Page 4: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Models of Computation

• What is a component? (ontology)– States? Processes? Threads? Differential equations?

Constraints? Objects (data + methods)?

• What knowledge do components share? (epistemology)– Time? Name spaces? Signals? State?

• How do components communicate? (protocols)– Rendezvous? Message passing? Continuous-time signals?

Streams? Method calls? Events in time?

• What do components communicate? (lexicon)– Objects? Transfer of control? Data structures? ASCII text?

Thomas Kuhn, originator ofthe paradigm paradigm

Page 5: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Exploring Models of

Computation…

Ptolemy II

… for scientific computing

Kepler

Page 6: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Scientific workflow design and re-use

• Support design & re-use via separation of concerns– Structural data types – Semantic types– Type checking– Structure – Execution semantics

Page 7: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

PtolemyII/Kepler: Actor-Oriented Design

Object orientation:class name

data

methods

call return

What flows through an object is

sequential control

Actor orientation:actor name

data (state)

portsInput data

parameters

Output data

What flows through an object is

streams of data

Page 8: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Structure of PtolemyII/Kepler workflows

P ortP ort

A ctor A ctor

L inkR elation

A ctor

P ort

connection

connection conn

ectio

n

L ink

Link

A ttribu tes A ttribu tes

A ttribu tes

Syntax defines the structure of a workflow, but says little about what it means.

• Hierarchical Entities, Ports, Connections and Attributes

Page 9: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Execution semantics: Director

• Implements the model of computation

• Governs the execution of an actor (workflow)– Scheduling, dispatching threads, etc.

Page 10: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Implemented Models of Computation• PN – process networks• SDF – synchronous dataflow• DDF – dynamic dataflow• FSM – finite state machines

• CT – continuous-time modeling • DE – discrete-event systems• SR - Synchronous/Reactive systems• RendezVous – concurrent threads with rendezvous • GR – graphics• …

Each of these defines a component ontology and an interaction semantics between components. There are many more possibilities!

Realized in Ptolemy II

Survival of the fittest is the only reasonable way to choose among these.

Available in Kepler

In use

in Kepler

Page 11: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

The talk

• Models of Computation (MoCs)– Use cases from science– PtolemyII/Kepler

• Composing Models of Computation– Use cases from science– PtolemyII/Kepler

• Conditions for valid (hierarchical-) compositions• Example based on process networks and data flow • Table of valid compositions

Page 12: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Use cases for composing MoCs (1)

• Intra-disciplinary collaboration – Biology: gene annotation to systems biology [data

flow + cont time]

• Inter-disciplinary collaboration– Chem- to bio-informatics [cont time + data flow]

• Mix software workflows with physical systems– sensor networks and electron microscopes [cont time]

• Performance of computation-intensive workflows– visualization [3D animation]

Page 13: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Use cases for composing MoCs (2)

• Mix workflow management with running models for analysis or simulation – Biology: selective extraction and analysis of proteins

from public databases [finite state machines + dataflow]

– Fluid dynamics: dynamically adapting model control parameters of Lattice-Boltzmann simulations [finite state machines + cont time]

• Integrated provenance collection – Include dynamic changes in the overall model as well

as parameter sweeps within each model

Page 14: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

MoC composition in chemistry

Actor/workflow based on

KahnProcess Network

Actor/workflow based on

SynchronousDataFlow

Page 15: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

How to compose MoCs (directors)?

• No classification exists to determine which director combinations are valid

Page 16: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

How to compose MoCs (directors)?

• No classification exists to determine which director combinations are valid

• We need to know two things about a director:

1. What properties it exports via the composite actor in which it is placed

Page 17: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Inner directorexports certain properties

Page 18: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

How to compose MoCs (directors)?

• No classification exists to determine which director combinations are valid

• We need to know two things about a director:

1. What properties it exports via the composite actor in which it is placed

2. What properties it requires of the actors under its control

Page 19: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

outer director requires certainproperties

Page 20: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

If a director’s exported properties match those required by another director, then it can be used within that other director

Page 21: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

So, what are these properties?

It turns out we can determine director compatibility based on three levels of adherence to actor abstract semantics

Page 22: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Actor Abstract Semantics

Flow of control• Initialization• Execution• Finalization

Specifications:• prefire(): synchronizes to the environment and checks firing

conditions • fire(): generates outputs based on current inputs and states• postfire(): updates the states for next iteration

iterate()

prefire() fire() postfire()

Page 23: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Three flavours of actor semantics

Strict Loose Loosest

Implements methods?

Yes Yes Yes

Methods must return?

Yes Yes No

Fire() doesn’t change state?

Yes No No

Page 24: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Compatible director compositions

exported abstract semantics

should be stricter than or equal to

required abstract semantics

Inner director (exports X)

Outer director (requires Y)

PN SDF DDF CT FSM

(?) (?) (?) (?) (?)

PN (?)

SDF (?)

DDF (?)

CT (?)

FSM (?)

Page 25: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Example: composing PN and SDF

• Kahn Process Networks – Asynchronous communication between processes;

thread for each actor. – PN director does not require that any method

eventually returns. The methods run in a separate thread belonging entirely to the actor.

– PN does not guarantee that any method eventually returns.

• Synchronous Data Flow– Director “fires” actors when input tokens are available.– SDF director requires that methods return. The fire()

method can change state.– SDF director guarantees that methods return.

Page 26: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Determining PN and SDF compatibility

Inner director (exports X)

Outer director (requires Y)

PN SDF

(loosest) (loose)

PN (loosest)

SDF (loose)

exported abstract semantics

should be stricter than or equal to

required abstract semantics

Page 27: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Determining PN and SDF compatibility

Inner director (exports X)

Outer director (requires Y)

PN SDF

(loosest) (loose)

PN (loosest) Yes No

SDF (loose) Yes Yes

exported abstract semantics

should be stricter than or equal to

required abstract semantics

Page 28: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

SDF inside PN example

Actor/workflow based on

KahnProcess Network

PN requiresloosest abstract actor semantics

Page 29: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

SDF inside PN example

Actor/workflow based on

SynchronousDataFlow

SDF exportsloose abstract actor semantics

Page 30: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

SDF inside PN example

SDF exports loose PN requires loosest,

so OK to combine

Actor/workflow based on

SynchronousDataFlow

Actor/workflow based on

KahnProcess Network

Page 31: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

The others

• FSM very flexible• CT (continuous dynamics) works well as inner director• PN very inflexible• Living document:

http://www.mygrid.org.uk/wiki/Papers/IccsPaper2007

Inner director (exports X)

Outer director (requires Y)

PN SDF DDF CT FSM

(loosest) (loose) (loose) (strict) (loose)

PN (loosest) Yes No No No No

SDF (loose) Yes Yes Yes No Yes

DDF (loose) Yes Yes Yes No Yes

CT (loose) Yes Yes Yes No Yes

FSM (refinement) Yes if the refinement is stricter than or equal to Y

Page 32: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Summary

• A need for multiple models of computation, and their composition, in e-science

• Practical table of valid compositions for models of computation in PtolemyII/Kepler

• Questions?

• E-mail: [email protected]

Page 33: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay

Xie Xie

• Bertram Ludaescher, UC Davis, Kepler

• Gang Zhou and Thomas Feng, UC Berkeley, PtolemyII

• John Brooke, U Manchester

Page 34: Composing Models of Computation in Kepler/Ptolemy II Antoon GoderisU of Manchester ( my Grid/ Taverna) Christopher BrooksUC Berkeley(Ptolemy II) Ilkay