A Chemical Approach to Distributed Computing

Embed Size (px)

DESCRIPTION

A Chemical Approach to Distributed Computing. Zsolt N émeth MTA SZTAKI Computer and Automation Research Institute /CoreGrid Christian P é rez, Thierry Priol IRISA -INRIA/CoreGrid Manuel Caeiro University of Vigo. Overview. - PowerPoint PPT Presentation

Citation preview

Distributed Workflow Coordination: Molecules and Reactions

A Chemical Approach to Distributed Computing
Zsolt NmethMTA SZTAKI Computer and Automation Research Institute/CoreGridChristian Prez, Thierry PriolIRISA-INRIA/CoreGridManuel CaeiroUniversity of Vigo

Overview
A highly abstract coordination model for workflow enactment is soughtAbstraction is based on a nature metaphor: chemical analogyAn appropriate modeling framework: the -calculusQuest: vision: idea of chemical coordinationmethods for transforming the vision into a modelmodel: a coordination framework formalizd in the -calculus

Motivation
Large-scale heterogeneous distributed systemsAdaptability, flexibility, dynamic behaviourApplications, platforms, services, etc.Self-* propertiesHuman in the loop should be eliminatedIntelligence is pushed into the systemsThat formerly resided in outside entitiesWhat is intelligence, how it can be simulatedNature metaphors

This talk is about workflow but
Workflow is just an exampleIt is a common programming model for gridsFeatures many coordination problemsFocus: coordinationLarge-scale distributed, dynamic, error prone environment and applicationsSome degree of autonomy, adaptability must be provided

Workflow
The computerized facilitation or automation of a business process in whole or in part The Workflow Management Coalitiona collection of activities that are processed in some order and where both data-flow and control-flow relationships may be present

The workflow management reference model (Workflow Management Coalition)
Process Analysis, Modeling& Definition Tools
Process Definition
Workflow Enactment Service
Applications &Tools
User (human)
Process Design& Definition
Build time
Run time
Process Instantiation& Control
Interaction withUsers & Application Tools

Scope of enactment
Abstract workflow standalone application componentsthe order in which they are executednames, references, etc. are logicalRepresented by a graphtypically: DAG
Problem
Abstract workflow
Concrete workflow
Physical environment

Scope of enactment
Concrete workflow standalone application componentsthe order in which they are executedselected resources, servicesadditional activities (e.g. file transfer, staging, etc.)all names, references, etc. are physical
Problem
Abstract workflow
Concrete workflow
Physical environment

A common scenario(e.g. grid workflow)
Resources
Workflow engine

A common scenario (e.g. grid workflow)
Resources
Workflow engine

A common scenario (e.g. grid workflow)
Resources
Workflow engine

A common scenario(e.g. grid workflow)
Resources
Workflow engine
Concrete workflow

A common scenario(e.g. grid workflow)
Resources
Workflow engine
Concrete workflow

Problem analysis (current approaches)
The abstract workflow is static(Typically) no advanced control structuresA priori mapping/ partly a priori mappingMapping based on stored informationA priori simulation/ a priori test/ a priori optimisationCentralised engineHuman interactionLimited autonomy, limited ability for adaptationOverall lack of any high level model

Enactment as a coordination procedure
Workflow enactment in large-scale heterogeneous environmentsshould provide a higher level of autonomyshould be able to adapt to changing conditionsshould be distributedshould be able to make decisions on partial and actual informationshould support arbitrarily complex control structuresoften a complex problem can be solved in a more simple way using nature inspired models

This talk is about a chemical metaphor but
It is just an exampleChemical reactions are reasonably similar to workflow enactmentIt has a well established formalismGenerally: nature inspiration for solving complex problemsSimple, primitive parts behave intelligently as a wholeAnts, termites, cells, molecules, etc.

A chemical metaphor
Reactions areautonomousdistributedconcurrentdepending on local conditionsdepending on actual conditionsnot following any a priori patternevolving in time

A chemical metaphor
Reactions areautonomousdistributedconcurrentdepending on local conditionsdepending on actual conditionsnot following any a priori patternevolving in time
Workflow enactment shouldprovide a higher level of autonomybe able to adapt to changing conditionsbe distributedbe able to make decisions on partial and actual informationsupport arbitrarily complex control structuresevolve in time

A vision

A vision of chemical enactment
Resources
Resources
Chemical solution

A vision of chemical enactment
ResourcesActivities
Resources
Activities

A vision of chemical enactment
ResourcesActivitiesControl
Resources
Control
Activities
Chemical solution

A vision of chemical enactment
React
Activities
Resources
Chemical solution

Key elements of the chemical metaphor
Resources and activities are autonomous entities modeled as moleculesThe enactment is realised by a series of independent reactionsReactions are governed by the properties of resources and activities and actual conditionsThe state of the computation is a chemical solution

From a vision to a model
Materialize information: resource quantumsDefine an abstract chemical coordination model using the -calculus

Resource quantums
The usual solutions
P1
P2
P3
P4
P5
P6
stored information may be time sensitive

Resource quantums(materialization of information)
P1
P2
P3
P4
P5
P6

quantums represent a guaranteed service
resources represented as quantums

Resource quantums
The usual solutions
P6
P1
P2
P3
P4
P5

Resource quantums (materialization of information)

Processes compete for the quantums
Processes holding a quantum access the resources in a controlled way

The -calculus
captures the chemical notiona declarative, functional formalisminherently concurrent, indeterministic model of computationbasic data structure: multiset (chemical solution)passive molecules: booleans, integers, tuples, naming moleculesactive molecules: -abstractionreaction: an active molecule captures others and transformsexecution: perform reactions until a stable (inert) chemical solution is resulted
1
1
x,y.x+y
x,y.x+y
1

Active molecules: -abstraction
P.MP is a pattern that selects elements for the reactionM is the actioncapture x and replace by its square: x . x*xConditional reactions: PC.MC is a condition; the reaction takes place if C is truecapture x and if positive, replace by its square root: x x>0 . sqr(x)Atomic capture: x1,x2,xn.Ma single reaction may capture multiple molecules capture x,y and replace them by their sum: x,y . x+yReaction: active molecules capture other molecules x.M, N M[x:=N]x,y . x+y, 2, 3 2+3

The -calculus
-terms areCommutative: M1,M2M2,M1Associative: (M1,M2),M3M1,(M2,M3)Realize Brownian motion

ReactionsLocality: if M1M2, then M,M1M,M2Solution: if M1M2, then
x,y.x+y
x,y.x+y

The coordination model

Resources
a resource quantum is modeled as a sub-solutionrecall: chemical solutions can be nestedelements in the solution are inert attribute:value pairsthere are mandatory attributes otherwise, the format is flexible


Elementary activities
the chemical model does not execute an activity, just enacts it execution is externalexit from the chemical world:execute activity on resource using parametera symbolic notation that can be realised in many waysreturn to the chemical worldthe execution produces some result or error put back in form of a solution (control molecule)

execute A on R ,

Resource dependency
activity A needs a resource. execute A on r
. execute A on r
< id:R1, type:comp, proc:16, OS:Linux, >
< id:R2, type:comp, proc:1,>
< id:R3, type:comp,proc:1, OS:SunOS, >
< id:R4, type:comp, proc:1, memory:23, >
< id:R5, type:comp, proc:1, disk:12, >

Resource dependency
. execute A on rCaptured a matching resource
< id:R1, type:comp, proc:16, OS:Linux, >
< id:R2, type:comp, proc:1,>
< id:R4, type:comp, proc:1, memory:23, >
< id:R5, type:comp, proc:1, disk:12, >
execute A on R3

Resource dependency
Both the resource and the activity are replaced by a control molecule
< id:R1, type:comp, proc:16, OS:Linux, >
< id:R2, type:comp, proc:1,>
< id:R4, type:comp, proc:1, memory:23, >
< id:R5, type:comp, proc:1, disk:12, >

< id:R3, type:comp,proc:1, OS:SunOS, >

Data and control dependency
activity A waits a result from activity B. execute A using x


. execute A using x




Data and control dependency
. execute A using xCaptured a corresponding control molecule
execute A using 18



Data and control dependency
Replaced by the result




Complex dependencies
An activity needs both input from another activity and resources, . execute A on r using xDependencies can be arbitrarily combinedfind a resource r1 for activity A and a resource r2 for B so that r1 and r2 have the same operating system, . execute A on r1, execute B on r2Conditions can be added as well x>30, y>12 . execute A on rResource, data, control dependencies can be combined

Workflow patterns
SequenceConditionalSplitSynchronizing mergeP-splitp-out-of-n activities follow AP-mergep-out-of-n results trigger activity ALoop

An HOCL Workflow Engine
HOCL: Higher Order Chemical LanguageBased on the -calculus Molecules involved:Tasks. They include the following elements:A program to be executedThey need specific input data and produce output dataThey need a resource or a service satisfying certain featuresConnectors. They can be of several types:Control-flow: AND-split, AND-join, XOR-split, etc.Data-flow : one-to-one, all-to-all, data loop lists, etc.Activators. They are used to control the execution of tasks and nodesData Elements. They maintain input and output dataResources. Computational resources that can perform the tasks.

An HOCL Workflow Engine
Workflow Specification
Compile
Disabled TasksDisabled Conn.
InputData
Execute
Activators
Data Elements
Enabled Task
Ready Task
Resources
Initiated Task
Activator
Data Element
Resource
Chemical Solution
Disabled Enabled Ready Initiated

3. An HOCL Workflow Engine
Disabled TasksDisabled Conn.
Activators
Data Elements
Resources
Chemical Solution
Connectors: AND-split
T.A
&
T.B
T.C
T.A
Act.1
Data Element
Resource
Connector &
Act.1
Act.2
Act.3
Act.2 Act.3

3. An HOCL Workflow Engine
Disabled TasksDisabled Conn.
Activators
Data Elements
+ 1 Connector
Resources
T.A
Act.1
D.A.1..n
Resource
Chemical Solution
Data One-to-One Connector
T.A
+
T.B
Data A.1,2, , N
Data B. 1,2, , N
Data C.1,2, , N
Act.1
Act.2
Act.3.1 3.N
T.B
Act.2
D.B.1..n
Resource
+ Connector
+ 2 Connector
+ N Connector
Data A.1
Data B.1
Data C.1
Act3.1
T.C

Outlook
What we have so far is a frameworkPrinciples of a chemical coordination modelBasic and most advanced workflow patterns modeledSimple resource management strategiesIt is just the beginning!Lets explore and advanceSolve further aspects of workflow enactment: fault tolerance, optimization, resource control, complex workflow structures, constraints, co-allocation, compensation, etc.Find further nature analogon within the chemical model: temperature, weight, magnetic properties, size, gravity, catalysts, membranes, etc.

Challenges (examples)
Resource control by chemical agentswithdraw, modify, block, accept, reject, group, etc.Assert a neutralization agent: .Replace a molecule: . Combine two molecules: (, ).

Challenges (examples)
Fault-tolerance by chemical agentserror molecules, retry, rollback, redundancy, compensation, etc.Assert an error handling molecule that reactivates in case of error(, , ). (execute A on r using x y, (,).execute A on r using x y))

Challenges (examples)
Complex resource allocation and co-allocation scenarios by moleculese.g. reserve r1 and r2 so that there is a network link between them(, , ). (execute A on r1, (.execute B on r2 using x))

Conclusion
The chemical metaphor: autonomous, adapting, distributed, actualThe nature inspired coordination modelactivities, resources and control are modeled using the same formalism-calculus is not just description but defines execution semantics as wellworkflow structure, resources and control can be added/withdrawn/modified in a fully dynamic and adaptive way

If interested
See on www.gridworkflow.orghttp://www.gridworkflow.org/snips/gridworkflow/space/Gamma-calculus