Class Node
- java.lang.Object
-
- edu.isi.pegasus.planner.provisioner.Node
-
public class Node extends java.lang.ObjectAn instance of this class represents an independent task of a workflow. A task has PET(predicted execution time), list of input data sources(parent tasks), and list of output data(child tasks). This class also used for BTS algorithm such as EST, LFT, schdeuled start/finish time and core methods for BTS algorithm used by OccupationDiagram class.- Author:
- Eunkyu Byun
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashSetancestorsprivate longancETintclusterprivate EdgecritEdgestatic longDEFAULT_WEIGHTprivate java.util.HashSetdescendantsprivate longdesETprivate longdownLenbooleanexaminedprivate java.lang.Stringidprivate java.util.LinkedListinEdgeslonglblongolblongorbprivate java.util.LinkedListoutEdgeslongrblongstbooleanstackedprivate java.lang.StringtaskNamelongtempFTlongtempSTlongtlevelprivate longupLenprivate longweight
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIn(Edge e)add a data dependency edge to this taskvoidaddOut(Edge e)add a data dependency edge from this taskjava.util.SetbuildAncestors()build the list of ancestor tasksjava.util.SetbuildDescendants()build the list of descendant tasksbooleancheckIn()check whether all parent tasks are finished.voidcheckIntegrity()check all child task's start time is scheduled after the finishtime of this taskbooleanequals(java.lang.Object e)longevalWeight()return execution time of this tasklonggetAncET()intgetAncSize()longgetDepET()intgetDepSize()longgetDesET()intgetDesSize()longgetDownLen()return the DnLength of this task.java.lang.StringgetID()java.util.LinkedListgetIn()return the list of incoming edges.java.util.LinkedListgetOut()return the list of outgoing edges.longgetUpLen()return the UpLength of this task.voidinit()voidinitOut(boolean s, long et)notify child nodes that this task will finish at time etbooleanisAnc(Node n)booleanisBottom()Check whether this task is the exit task or not.booleanisDes(Node n)booleanisFree()used for DSC algorithmbooleanisTop()Check whether this task is the entry task or not.booleanmoveLeft(java.util.LinkedList[] timeMap, int limit, long bound)Redistribute this task to the earlier time.booleanmoveRight(java.util.LinkedList[] timeMap, int limit, long bound)Redistribute this task to the later time.booleanNPbalance(java.util.LinkedList[] timeMap, int limit, boolean force)Non-propagate redistribution of this taskvoidprint()private intpushedChildren(long timeLimit)private intpushedParents(long timeLimit)voidremoveIn(Edge e)remove a specified data dependency edge from this taskvoidremoveOut(Edge e)remove a specified data dependency edge from this taskvoidsetWeight(long w)set execution time of this taskprivate voidupdateDownLen()voidupdateLeftBound(long nlb, java.util.TreeSet set)update EST(earliest start time) of this task.voidupdateRightBound(long nrb, java.util.TreeSet set)update LFT(latest finish time) of this task.private voidupdateUpLen()
-
-
-
Field Detail
-
DEFAULT_WEIGHT
public static final long DEFAULT_WEIGHT
- See Also:
- Constant Field Values
-
inEdges
private java.util.LinkedList inEdges
-
outEdges
private java.util.LinkedList outEdges
-
critEdge
private Edge critEdge
-
id
private java.lang.String id
-
taskName
private java.lang.String taskName
-
weight
private long weight
-
upLen
private long upLen
-
downLen
private long downLen
-
ancestors
private java.util.HashSet ancestors
-
descendants
private java.util.HashSet descendants
-
st
public long st
-
stacked
public boolean stacked
-
lb
public long lb
-
rb
public long rb
-
olb
public long olb
-
orb
public long orb
-
tempST
public long tempST
-
tempFT
public long tempFT
-
ancET
private long ancET
-
desET
private long desET
-
cluster
public int cluster
-
tlevel
public long tlevel
-
examined
public boolean examined
-
-
Constructor Detail
-
Node
public Node(java.lang.String id, java.lang.String name, long w)constructor- Parameters:
id- the unique ID of this taskname- task name(executable name)w- predicted execution time
-
Node
public Node(java.lang.String id, java.lang.String name, int n, long w)
-
Node
public Node(java.lang.String id)
-
-
Method Detail
-
init
public void init()
-
setWeight
public void setWeight(long w)
set execution time of this task- Parameters:
w- excution time
-
evalWeight
public long evalWeight()
return execution time of this task- Returns:
- excution time
-
addIn
public void addIn(Edge e)
add a data dependency edge to this task- Parameters:
e- the edge to be added
-
removeIn
public void removeIn(Edge e)
remove a specified data dependency edge from this task- Parameters:
e- the edge to be removed
-
addOut
public void addOut(Edge e)
add a data dependency edge from this task- Parameters:
e- the edge to be added
-
removeOut
public void removeOut(Edge e)
remove a specified data dependency edge from this task- Parameters:
e- the edge to be removed
-
checkIn
public boolean checkIn()
check whether all parent tasks are finished.- Returns:
- true if all parent tasks are finished.
-
getIn
public java.util.LinkedList getIn()
return the list of incoming edges.- Returns:
- LinkedList of edges.
-
getOut
public java.util.LinkedList getOut()
return the list of outgoing edges.- Returns:
- LinkedList of edges.
-
initOut
public void initOut(boolean s, long et)notify child nodes that this task will finish at time et- Parameters:
et- finish time
-
updateUpLen
private void updateUpLen()
-
getUpLen
public long getUpLen()
return the UpLength of this task. UpLength is the longest path from the entry task- Returns:
- UpLength
-
updateDownLen
private void updateDownLen()
-
getDownLen
public long getDownLen()
return the DnLength of this task. DnLength is the longest path to the exit task- Returns:
- DnLength
-
isTop
public boolean isTop()
Check whether this task is the entry task or not.- Returns:
- true or false
-
isBottom
public boolean isBottom()
Check whether this task is the exit task or not.- Returns:
- true or false
-
getID
public java.lang.String getID()
-
updateLeftBound
public void updateLeftBound(long nlb, java.util.TreeSet set)update EST(earliest start time) of this task.- Parameters:
nlb- new ESTset- set of ancestor tasks
-
updateRightBound
public void updateRightBound(long nrb, java.util.TreeSet set)update LFT(latest finish time) of this task.- Parameters:
nrb- new LFTset- set of descendant tasks
-
NPbalance
public boolean NPbalance(java.util.LinkedList[] timeMap, int limit, boolean force)Non-propagate redistribution of this task- Parameters:
timeMap- List of scheduled tasks at each time slot. i.e., Occupation diagram itselflimit- maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.force- Not used.- Returns:
- true if this task is redistributed.
-
moveLeft
public boolean moveLeft(java.util.LinkedList[] timeMap, int limit, long bound)Redistribute this task to the earlier time. This causes ancestor tasks to be redistributed too.- Parameters:
timeMap- List of scheduled tasks at each time slot. i.e., Occupation diagram itselflimit- maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.bound- Earliest time this tasks can be scheduled.- Returns:
- true if this task is redistributed.
-
moveRight
public boolean moveRight(java.util.LinkedList[] timeMap, int limit, long bound)Redistribute this task to the later time. This causes descensant tasks to be redistributed too.- Parameters:
timeMap- List of scheduled tasks at each time slot. i.e., Occupation diagram itselflimit- maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.bound- Lastest time this tasks can be scheduled.- Returns:
- true if this task is redistributed.
-
pushedParents
private int pushedParents(long timeLimit)
-
pushedChildren
private int pushedChildren(long timeLimit)
-
checkIntegrity
public void checkIntegrity()
check all child task's start time is scheduled after the finishtime of this task
-
buildDescendants
public java.util.Set buildDescendants()
build the list of descendant tasks- Returns:
- the list of descensant tasks
-
buildAncestors
public java.util.Set buildAncestors()
build the list of ancestor tasks- Returns:
- the list of ancestor tasks
-
getDepSize
public int getDepSize()
-
getAncSize
public int getAncSize()
-
getDesSize
public int getDesSize()
-
getAncET
public long getAncET()
- Returns:
- the sum of execution time of all ancestor tasks
-
getDesET
public long getDesET()
- Returns:
- the sum of execution time of all descendant tasks
-
getDepET
public long getDepET()
- Returns:
- the sum of execution time of all dependent tasks
-
isAnc
public boolean isAnc(Node n)
-
isDes
public boolean isDes(Node n)
-
print
public void print()
-
isFree
public boolean isFree()
used for DSC algorithm
-
equals
public boolean equals(java.lang.Object e)
- Overrides:
equalsin classjava.lang.Object
-
-