|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.ece.iacl.jist.pipeline.PipeScheduler
public class PipeScheduler
Pipe scheduler creates and schedules the execution of execution contexts.
Nested Class Summary | |
---|---|
protected class |
PipeScheduler.CleanAllDialog
The Class CleanAllDialog. |
protected class |
PipeScheduler.DestinationProcessor
The Class DestinationProcessor. |
Field Summary | |
---|---|
protected boolean |
completed
indicate that scheduler has completed running and processing destinations. |
protected java.util.LinkedList<ExecutionContext> |
completedQueue
Queue to store completed contexts. |
protected java.util.Vector<java.util.Vector<ExecutionContext>> |
contextTable
Table of dependent contexts for each scheduled context. |
protected java.util.Vector<PipeDestination> |
dests
List of all destinations. |
protected int |
initializedCount
Counter to indicate the number of initialized experiments. |
protected boolean |
initializing
Flag indicating the scheduler is initializing. |
protected PipeLayout |
layout
pipeline layout to schedule. |
protected int |
pauseCount
The pause count. |
protected boolean |
refreshQueuesLock
Semaphore for locking queue. |
protected boolean |
requestTreeUpdate
Flag indicating a request to update input/output information about the experiments. |
protected boolean |
runningFlag
Flag indicates the scheduler is running. |
protected java.util.LinkedList<ExecutionContext> |
runningQueue
Queue to store contexts that are currently running. |
protected java.util.LinkedList<ExecutionContext> |
schedule
List storing all contexts. |
protected java.util.Vector<PipeSource> |
srcRoots
List of all source roots. |
protected boolean |
stopped
Flag indicating a request to stop the running process. |
protected java.lang.Thread |
th
Thread for running a process. |
protected java.lang.Object |
thLock
The th lock. |
protected boolean |
useWorker
Use worker to process destination. |
protected java.lang.String |
uuid
Global ID. |
protected java.util.Vector<ExecutionContext> |
waitingQueue
Queue to store contexts that are waiting to run. |
protected java.util.HashMap |
waitingQueueHash
The waiting queue hash. |
Constructor Summary | |
---|---|
PipeScheduler(PipeLayout layout,
ProcessManager parentFrame)
Constructor. |
Method Summary | |
---|---|
protected void |
addDependencyContexts(java.util.Vector<PipeAlgorithm> algoRoots,
int iter)
Create dependent contexts for specified parent contexts. |
void |
clean(java.util.Vector<ExecutionContext> contexts,
boolean forceRemoveLock)
Clean output directory for specified contexts. |
void |
cleanAll()
Clean all experiments in output directory |
void |
cleanAll(boolean quiet)
|
void |
contextUpdate(ExecutionContext context,
ExecutionContext.Update type)
Update queues if a context's status changes. |
protected ExecutionContext |
createNewContext(PipeAlgorithm algo,
int iter)
Create new context for specific algorithm. |
java.lang.String |
createUniqueName(ExecutionContext parentContext)
Create unique name for specified context. |
void |
demote(java.util.Vector<ExecutionContext> contexts)
Demote position of processes in queue. |
protected ExecutionContext |
dequeue()
Remove and process context in waiting queue. |
void |
dispose()
Dispose of scheduler by killing all current processes. |
protected ExecutionContext |
doesScenarioExist(PipeAlgorithm algo)
Find existing context with the same parameters as the algorithm module if one exists. |
void |
enqueue()
Enqueue all waiting processes. |
void |
enqueue(java.util.Vector<ExecutionContext> contexts)
Enqueue processes in queue. |
int |
getCompletedCount()
Get the number of completed experiments. |
long |
getElapsedActualTime()
Gets the elapsed actual time. |
long |
getElapsedCpuTime()
Gets the elapsed cpu time. |
int |
getFailedCount()
Get number of failed experiments. |
int |
getInitializedCount()
Get the total number of initialized experiments. |
int |
getNotReadyCount()
Get number of experiments that are not ready to run. |
int |
getQueuedCount()
Get number of queued waiting to run experiments. |
int |
getQueuePosition(ExecutionContext context)
Return queue position based on status and priority. |
int |
getReadyCount()
Get number of experiments that are ready to run. |
int |
getRunningCount()
Get number of running experiments. |
java.util.LinkedList<ExecutionContext> |
getRunningQueue()
Get running queue for the scheduler. |
java.lang.String |
getUUID()
Gets the uUID. |
int |
getWaitingCount()
Get number of waiting to run experiments. |
protected boolean |
hasNext()
Returns true if sources have move elements. |
boolean |
hasRunningQueue()
Checks for running queue. |
void |
init()
Generate list of contexts parsed on sources. |
protected void |
insertIntoProperQueue(ExecutionContext context)
Insert experiment into proper queue based on experiment status. |
boolean |
isCompleted()
Checks if is completed. |
boolean |
isInitializing()
Indicates the scheduler is initializing. |
boolean |
isRunning()
Indicates that the scheduler is running. |
boolean |
isUsingWorker()
Checks if is using worker. |
protected boolean |
iterate(java.util.Vector<PipeSource> srcRoots)
Iterate through all values for sources. |
void |
killAll()
Kill all running processes. |
void |
pause()
Pausing the scheduler will prevent new execution contexts from starting or completing. |
void |
processDestinations()
Process all destinations for this scheduler. |
void |
promote(java.util.Vector<ExecutionContext> contexts)
Promote position of processes in queue. |
protected void |
refreshQueues()
Refresh queues based on current status of context. |
void |
restart(java.util.Vector<ExecutionContext> contexts)
Restart specified contexts. |
void |
resume()
Resume the scheduler. |
void |
run()
Schedule and run all experiments. |
void |
run(java.util.Vector<ExecutionContext> contexts)
Enqueue and run processes. |
void |
setOverrideRunOutOfProcess(boolean val)
|
void |
setUseWorker(boolean useWorker)
Sets the use worker. |
void |
start()
Start scheduler thread. |
void |
stop()
Stop scheduler thread. |
void |
stop(java.util.Vector<ExecutionContext> contexts)
Stop running specified contexts. |
void |
updateManagerTable()
Update table describing. |
protected void |
useExistingContext(ExecutionContext c)
Load existing context into graph instead of creating a new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PipeLayout layout
protected java.util.Vector<ExecutionContext> waitingQueue
protected java.util.HashMap waitingQueueHash
protected java.util.LinkedList<ExecutionContext> runningQueue
protected java.util.LinkedList<ExecutionContext> completedQueue
protected java.util.LinkedList<ExecutionContext> schedule
protected boolean refreshQueuesLock
protected java.lang.Thread th
protected java.lang.Object thLock
protected java.util.Vector<java.util.Vector<ExecutionContext>> contextTable
protected boolean stopped
protected int pauseCount
protected boolean requestTreeUpdate
protected boolean initializing
protected int initializedCount
protected boolean runningFlag
protected java.util.Vector<PipeSource> srcRoots
protected java.util.Vector<PipeDestination> dests
protected boolean useWorker
protected boolean completed
protected java.lang.String uuid
Constructor Detail |
---|
public PipeScheduler(PipeLayout layout, ProcessManager parentFrame)
layout
- Layout to scheduleparentFrame
- Parent frame that monitors schedulerMethod Detail |
---|
public boolean isUsingWorker()
public void setUseWorker(boolean useWorker)
useWorker
- the new use workerpublic void setOverrideRunOutOfProcess(boolean val)
public java.lang.String getUUID()
protected void addDependencyContexts(java.util.Vector<PipeAlgorithm> algoRoots, int iter)
algoRoots
- parent contextsiter
- the iterationpublic void clean(java.util.Vector<ExecutionContext> contexts, boolean forceRemoveLock)
contexts
- the contextsforceRemoveLock
- the force remove lockpublic void cleanAll()
public void cleanAll(boolean quiet)
public void contextUpdate(ExecutionContext context, ExecutionContext.Update type)
contextUpdate
in interface ExecutionContext.ContextListener
context
- the contexttype
- the typeprotected ExecutionContext createNewContext(PipeAlgorithm algo, int iter)
algo
- algorithmiter
- experiment number id
public java.lang.String createUniqueName(ExecutionContext parentContext)
parentContext
- parent context
public void demote(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextsprotected ExecutionContext dequeue()
public void dispose()
protected ExecutionContext doesScenarioExist(PipeAlgorithm algo)
algo
- Algorithm module
public void enqueue()
public void enqueue(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextspublic int getCompletedCount()
public int getFailedCount()
public int getInitializedCount()
public int getNotReadyCount()
public int getQueuedCount()
public int getQueuePosition(ExecutionContext context)
context
- the context
public int getReadyCount()
public int getRunningCount()
public java.util.LinkedList<ExecutionContext> getRunningQueue()
public boolean hasRunningQueue()
public int getWaitingCount()
public void init()
protected void insertIntoProperQueue(ExecutionContext context)
context
- experimentpublic boolean isInitializing()
public boolean isRunning()
protected boolean iterate(java.util.Vector<PipeSource> srcRoots)
srcRoots
- source roots to iterate
protected boolean hasNext()
public void killAll()
public void pause()
public void processDestinations()
public void promote(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextsprotected void refreshQueues()
public void restart(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextspublic void resume()
public void run()
run
in interface java.lang.Runnable
public boolean isCompleted()
public void run(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextspublic void start()
public void stop()
public void stop(java.util.Vector<ExecutionContext> contexts)
contexts
- the contextspublic void updateManagerTable()
protected void useExistingContext(ExecutionContext c)
c
- contextpublic long getElapsedCpuTime()
public long getElapsedActualTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |