A Logical Framework for Workflow Scheduling under Resource Allocation Constraints Pinar Senkul ( Middle East Technical University, Ankara, Turkey ) Michael Kifer (Stony Brook University, USA) Ismail H. Toroslu (Middle East Technical University, Ankara, Turkey)
Problem Workflow Scheduling: Find execution sequence of tasks in a workflow so that all constraints constraints are satisfied workflow
Definitions Workflow : A coordinated set of activities that act together to achieve a well-defined goal Constraints : Temporal/causality Do t1 only after t2 and t3 have been executed Do t1 if t2 has been or will be executed Resource allocation Execute workflow keeping the cost below threshold Don’t use same machine for concurrent subtasks in workflow
Problem (contd.) Most works deal with temporal/causality constraints We deal with resource allocation constraints
Example: H ouse Construction Workflow The budget should not exceed the given amount The construction should not last longer than the given duration Different companies must be chosen for parallel tasks
Approaches to Workflow Scheduling Operations Research AI Petri Nets Logic (temporal, concurrent transaction logic)
Our Approach CCTR – Concurrent Constraint Transaction Logic Integrates Concurrent Transaction Logic (CTR) with Constraint Logic Programming (CLP) Gives precise semantics to workflows Can Model Reason about Schedule workflows
Overview of Concurrent Transaction Logic Extension of first order logic for programming, executing and reasoning with state changing concurrent processes. Syntax wall ⊗ ( ( carpentry ⊗ roof ) | installation ) execute wall then in parallel do: carpentry followed by roofing installation work Path: sequence of DB states that result from Semantics – paths execution of activities 〈 D 0 D 1 D 2 D 3 D 4 〉 wall wall carpentry carpentry install install roof roof D 0 D 1 D 2 D 3 D 4 any interleaving of carpentry ⊗ roof and installation is a valid execution
Concurrent Constraint Transaction Logic ( CCTR) syntax : same as in CTR semantics : partial schedule is more structured than a path, parallel and serial parts of the execution are explicitly shown. e.g . ( 〈 D 0 D 1 〉 ) • p ( 〈 D 1 D 2 • p D 2 D 3 〉 || p 〈 D 1 D 4 〉 )
Resources resource : an object with the attributes cost, token resource assignment : a partial mapping partial schedules → set of resources
Constraint System A partial schedule satisfies satisfies a resource allocation constraint c if c( partial schedule , resource assignment ) is true. constraint system is a set of constraint A constraint system definitions. It consists of cost subsystem : contains definitions of cost cost subsystem constraints control subsystem : contains definitions of control control subsystem constraints
Cost Subsystem - House Construction Workflow Template: generic procedure for computing costs over schedules cost_constraint( ω ,asg) = value_constraint(cost( ω, asg)) cost( ω 1 • p ω 2 ,asg) = op ⊗ (cost( ω 1 ,asg),cost( ω 2 ,asg)) cost( ω 1 || p ω 2 ,asg) = op | (cost( ω 1 ,asg),cost( ω 2 ,asg)) Problem-specific part for the constraint: "construction should not exceed the given duration” cost( ω ,asg) = cost_of(asg( ω )) Cost of path ω value_constraint(V) = V < c op | (V 1 ,V 2 )= max(V 1 ,V 2 ) Schema for computing costs op ⊗ (V 1 ,V 2 )= V 1 +V 2 over composite schedules
Control Subsystem - House Construction Workflow Template: generic procedure for computing control constraints ctrl_constraint( ω 1 • p ω 2 , asg) = Satisfy constraints on sequential sequential combo of part.sched set_constraint ⊗ (asg( ω 1 ), asg( ω 2 )), Satisfy constraints ctrl_constraint( ω 1 , asg), ctrl_constraint( ω 2 , asg) on each each p.sched p.sched separately separately ctrl_constraint( ω 1 || p ω 2 , asg) = Satisfy constraints on parallel combo of p.sched parallel set_constraint | (asg( ω 1 ), asg( ω 2 )), ctrl_constraint( ω 1 , asg), ctrl_constraint( ω 2 , asg) Satisfy constraints on each each p.sched p.sched ctrl_constraint( ω, asg) = leaf_constraint(asg( ω)) separately separately Problem specific part for the constraint: "Different subcontractors must be chosen for parallel tasks” set_constraint | ( R 1 ,R 2 ) = (token_of(R 1 ) ∩ token_of(R 2 ) = ∅ )
Logical Entailment in Constraint System M, ζ , ω, asg ¦ ϕ CCTR formula Resource assignment m-path structure Constraint Partial system schedule iff M, ω ¦ ϕ, Ð ¦ cost_constraint( ω, asg ) and Ð ¦ ctrl_constraint( ω, asg ) Constraint universe
Using CCTR as a Workflow Scheduler Take a CCTR workflow which includes constraints Construct an equivalent CTR workflow so that: There is a 1-1 correspondence between the partial schedules of the CCTR workflow and the resulting CTR workflow These partial schedules & resource assignments for them are computed by the proof theory of CTR Can now schedule conjunction-free workflows using CTR interpreter Can take advantage of prior work on scheduling workflows under causality/temporal constraints
Transformation Rules B(G 1 ∨ G 2 ) = B(G 1 ) ∨ B(G 2 ) B(G) = R(G,T) ⊗ cost_constraint(T) ⊗ ctrl_constraint(T) R(A,T) = A ⊗ (T=resource_asg(A,Agents)) R(G 1 | G 2 , T) = (T='|'(T 1 ,T 2 )) ⊗ (R(G 1 ,T 1 ) | R(G 1 ,T 2 )) R(G 1 ⊗ G 2 , T) = (T=' ⊗ '(T 1 ,T 2 )) ⊗ (R(G 1 ,T 1 ) | R(G 1 ,T 2 )) R(G 1 ∨ G 2 , T) = R(G 1 ,T) ∨ R(G 2 ,T) basically structural induction with insertion of constraints in appropriate places
Transformation for Part of House Construction Example (( c arpentry ⊗ r oof ) | ( i nstallation | c e iling )) ∧ cost_constraint ∧ ctrl_constraint T='|'(T 1 ,T 2 ) ⊗ ((T 1 = ' ⊗ ' (T 3 ,T 4 ) ⊗ c ⊗ T 3 =rsrc(c,W)) ⊗ ((( c r ⊗ T 4 =rsrc(r,X)))) ( r | (T 2 ='|'(T 5 ,T 6 ) ⊗ i ⊗ T 5 =rsrc(i,Y)) | ((( i e ⊗ T 6 = rsrc(e,Z))))) ( e ⊗ cost_constraint(T) ⊗ ctrl_constraint(T)
Constraint Template – Cost Constraints - Logic rules that mimic the definition of the cost part of a constraint system Template : cost_constraint(T) :- cost(T,V), value_constraint(V) cost((T 1 ,T 2 ),V) :- cost(T 1 ,V 1 ), cost(T 2 ,V 2 ), op | (V 1 ,V 2 ,V) cost( ⊗ (T 1 ,T 2 ),V) :- cost(T 1 ,V 1 ), cost(T 2 ,V 2 ), op ⊗ (V 1 ,V 2 ,V) cost(resource_asg(T,Agents),V):- cost_of(resource_asg(T,Agents),V) User-defined terms and predicates: resource_asg(T, A) : = rsrc(T,A) Ensures that duration cost_of(rsrc(T,A),V) :- duration(T,A,V) is within constraints value_constraint(V) :- V <c op | (V 1 ,V 2 ,V) :- V = max(V 1 ,V 2 ) op ⊗ (V 1 ,V 2 ,V) :- V = V 1 +V 2
Constraint Template-Control Constraints - Same for the control part of a constraint system Template: ctrl_constraint(|(T 1 ,T 2 )) :- set_constraint | (T 1 ,T 2 ), ctrl_constraint(T 1 ), ctrl_constraint(T 2 ) ctrl_constraint( ⊗ (T 1 ,T 2 )) :- set_constraint ⊗ (T 1 ,T 2 ), ctrl_constraint(T 1 ), ctrl_constraint(T 2 ) ctrl_constraint(T) :- leaf(T), leaf_constraint(T) User-defined predicates: set_constraint | (T 1 ,T 2 ):- disjoint(T 1 ,T 2 ) Ensures that resources set_constraint ⊗ (T 1 ,T 2 ) :- true are not shared on parallel paths leaf_constraint(T) :- true
Correctness of the Transformation Theorem: Let ζ be a constraint system and Ð be a constraint domain, which can be represented using the template rules. Then, the transformation B is a correct prescheduler (I.e., B yields equivalent workflows that satisfy constraints)
The Big Picture Const. def. Rsrc asg term schedule Transfornation Constraint CTR Interpreter Rules G G’=B(G) Const. Resource Solver Workflow assignment set
Conclusion Presented a logical framework for modelling and scheduling workflows under resource allocation constraints (implemented using a CTR interpreter and XSB) This framework can be extended with special- purpose constraint solvers optimised for our framework Scheduling under resource allocation constraints for dynamically changing workflows and for multiple concurrent instances of the same workflow are topics for future work
Recommend
More recommend