Class Node
- java.lang.Object
-
- edu.isi.pegasus.planner.provisioner.Node
-
public class Node extends java.lang.Object
An 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.HashSet
ancestors
private long
ancET
int
cluster
private Edge
critEdge
static long
DEFAULT_WEIGHT
private java.util.HashSet
descendants
private long
desET
private long
downLen
boolean
examined
private java.lang.String
id
private java.util.LinkedList
inEdges
long
lb
long
olb
long
orb
private java.util.LinkedList
outEdges
long
rb
long
st
boolean
stacked
private java.lang.String
taskName
long
tempFT
long
tempST
long
tlevel
private long
upLen
private long
weight
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIn(Edge e)
add a data dependency edge to this taskvoid
addOut(Edge e)
add a data dependency edge from this taskjava.util.Set
buildAncestors()
build the list of ancestor tasksjava.util.Set
buildDescendants()
build the list of descendant tasksboolean
checkIn()
check whether all parent tasks are finished.void
checkIntegrity()
check all child task's start time is scheduled after the finishtime of this taskboolean
equals(java.lang.Object e)
long
evalWeight()
return execution time of this tasklong
getAncET()
int
getAncSize()
long
getDepET()
int
getDepSize()
long
getDesET()
int
getDesSize()
long
getDownLen()
return the DnLength of this task.java.lang.String
getID()
java.util.LinkedList
getIn()
return the list of incoming edges.java.util.LinkedList
getOut()
return the list of outgoing edges.long
getUpLen()
return the UpLength of this task.void
init()
void
initOut(boolean s, long et)
notify child nodes that this task will finish at time etboolean
isAnc(Node n)
boolean
isBottom()
Check whether this task is the exit task or not.boolean
isDes(Node n)
boolean
isFree()
used for DSC algorithmboolean
isTop()
Check whether this task is the entry task or not.boolean
moveLeft(java.util.LinkedList[] timeMap, int limit, long bound)
Redistribute this task to the earlier time.boolean
moveRight(java.util.LinkedList[] timeMap, int limit, long bound)
Redistribute this task to the later time.boolean
NPbalance(java.util.LinkedList[] timeMap, int limit, boolean force)
Non-propagate redistribution of this taskvoid
print()
private int
pushedChildren(long timeLimit)
private int
pushedParents(long timeLimit)
void
removeIn(Edge e)
remove a specified data dependency edge from this taskvoid
removeOut(Edge e)
remove a specified data dependency edge from this taskvoid
setWeight(long w)
set execution time of this taskprivate void
updateDownLen()
void
updateLeftBound(long nlb, java.util.TreeSet set)
update EST(earliest start time) of this task.void
updateRightBound(long nrb, java.util.TreeSet set)
update LFT(latest finish time) of this task.private void
updateUpLen()
-
-
-
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:
equals
in classjava.lang.Object
-
-