Slide 29
Slide 29 text
WLog Program Example: Workflow
Scheduling Problem
import(amazonec2).
import(montage).
goal minimize Ct in totalcost(Ct).
cons deadline(95%, 10h).
var configs(Tid,Vid,Con) forall task(Tid) and
Vm(Vid).
r1 path(X,Y,Y,Tp) :- edge(X,Y), exetime(X,Vid,T),
configs(X,Y,Y,Tp), Con==1, Tp is T.
r2 path(X,Y,Z,Tp) :- edge(X,Z), Z\==Y,
path(Z,Y,Z2,T1), exetime(X,Vid,T),
configs(X,Vid,Con), Con==1, C is T+T1.
r3 maxtime(Path,T) :- setof([Z,T1],
path(root,tail,Z,T1), Set), max(Set,[Path,T]).
r4 cost(Tid,Vid,C) :- config(Tid, Vid,
Con),price(Vid,Up), exetime(Tid,Vid,T), C is
T*Up*Con.
r5 totalcost(Ct) :- findall(C, cost(Tid,Vid,C), Bag),
sum(Bag,Ct).
ProLog conventions
• A set of declarative rules, each in the
form
h :- c1, c2, …, cn.
• Built-in predicates, e.g., is, setoff.
1. Import the cloud- and workflow-related
facts.
2. Specify the optimization goal, constraints
and variable of the problem.
3. Specify the derivation rules
• r1 to r3 calculate the overall execution
time of a workflow to check the
deadline constraint.
• r4 and r5 calculate the overall monetary
cost to evaluate the optimization goal.
31