A Logical Framework for Workflow Scheduling under Resource ... Workflow Scheduling under Resource...

download A Logical Framework for Workflow Scheduling under Resource ... Workflow Scheduling under Resource Allocation

of 22

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of A Logical Framework for Workflow Scheduling under Resource ... Workflow Scheduling under Resource...

  • 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 workflowworkflow so that all constraintsconstraints are satisfied

  • 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: House 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



  • 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

    Semantics – paths 〈D0D1D2D3D4〉

    wallwall carpentrycarpentry installinstall roofroof

    D0 D1 D2 D3 D4 any interleaving of carpentry⊗roof and installation is a valid execution

    Path: sequence of DB states that result from execution of activities

  • 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. (〈D0D1〉)•p(〈D1D2•pD2D3〉 ||p〈D1D4〉)

  • Resources

    resource: an object with the attributes cost, token

    resource assignment: a partial mapping

    partial schedules → set of resources

  • Constraint System

    A partial schedule satisfiessatisfies a resource allocation constraint c if

    c(partial schedule, resource assignment) is true.

    A constraint systemconstraint system is a set of constraint definitions. It consists of

    cost subsystemcost subsystem: contains definitions of cost constraints

    control subsystemcontrol subsystem: contains definitions of control 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(ω)) value_constraint(V) = V < c op|(V1,V2)= max(V1,V2) op⊗(V1,V2)= V1+V2

    Cost of path ω

    Schema for computing costs over composite schedules

  • Control Subsystem - House Construction Workflow Template: generic procedure for computing control constraints

    ctrl_constraint(ω1•pω2,asg) = set_constraint⊗(asg(ω1),asg(ω2)), ctrl_constraint(ω1,asg), ctrl_constraint(ω2,asg)

    ctrl_constraint(ω1 || pω2,asg) = set_constraint|(asg(ω1),asg(ω2)), ctrl_constraint(ω1,asg), ctrl_constraint(ω2,asg)

    ctrl_constraint(ω,asg) = leaf_constraint(asg(ω))

    Problem specific part for the constraint: "Different subcontractors must be chosen for parallel tasks”

    set_constraint| (R1,R2) = (token_of(R1) ∩ token_of(R2) =∅ )

    Satisfy constraints on sequentialsequential combo of part.sched

    Satisfy constraints on parallelparallel combo of p.sched

    Satisfy constraints on each each p.schedp.sched


    Satisfy constraints on each each p.schedp.sched


  • Logical Entailment in Constraint System M, ζ, ω, asg ¦ ϕ


    M, ω ¦ ϕ, Ð ¦ cost_constraint( ω, asg) and Ð ¦ ctrl_constraint( ω, asg)

    Constraint system Partial schedule

    m-path structure

    Resource assignment

    CCTR formula

    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(G1 ∨ G2) = B(G1) ∨ B(G2)

    B(G) = R(G,T)⊗ cost_constraint(T)⊗ ctrl_constraint(T)

    R(A,T) = A⊗ (T=resource_asg(A,Agents))

    R(G1 | G2, T) = (T='|'(T1,T2))⊗ (R(G1,T1) | R(G1,T2))

    R(G1⊗G2, T) = (T='⊗'(T1,T2))⊗ (R(G1,T1) | R(G1,T2))

    R(G1∨ G2, T) = R(G1,T) ∨ R(G2,T)

    basically structural induction with insertion of constraints in appropriate places

  • Transformation for Part of House Construction Example

    T='|'(T1,T2)⊗ ((T1= '⊗' (T3,T4)⊗

    (((cc ⊗T3=rsrc(c,W)) ⊗ (rr ⊗ T4=rsrc(r,X))))

    | (T2='|'(T5,T6)⊗

    (((ii ⊗ T5=rsrc(i,Y)) | (ee ⊗ T6 = rsrc(e,Z)))))

    ⊗ cost_constraint(T) ⊗ ctrl_constraint(T)

    ((carpentry ⊗ roof) | (installation | ceiling)) ∧ cost_constraint ∧ ctrl_constraint

  • Constraint Template – Cost Constraints

    Template: cost_constraint(T) :- cost(T,V), value_constraint(V)

    cost((T1,T2),V) :- cost(T1,V1), cost(T2,V2), op|(V1,V2,V)

    cost(⊗(T1,T2),V) :- cost(T1,V1), cost(T2,V2), op⊗(V1,V2,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) cost_of(rsrc(T,A),V) :- duration(T,A,V) value_constraint(V) :- V

  • Constraint Template-Control Constraints

    Template: ctrl_constraint(|(T1,T2)) :- set_constraint|(T1,T2),

    ctrl_constraint(T1), ctrl_constraint(T2)

    ctrl_constraint(⊗(T1,T2)) :- set_constraint⊗(T1,T2), ctrl_constraint(T1), ctrl_constraint(T2)

    ctrl_constraint(T) :- leaf(T), leaf_constraint(T)

    User-defined predicates:

    set_constraint|(T1,T2):- disjoint(T1,T2)

    set_constraint⊗(T1,T2) :- true

    leaf_constraint(T) :- true

    -Same for the control part of a constraint system

    Ensures that resources are not shared on

    parallel paths

  • Correctness of the Transformation


    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


  • The Big Picture

    G Workflow

    G’=B(G) Const.


    Const. def.

    Transfornation Rules

    CTR Interpreter Constraint

    Solver Resource assignment

    Rsrc asg term schedule

  • 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