gov.bnl.star.offline.scheduler.Dispatchers.local
Class LocalDispatcher

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
      extended by gov.bnl.star.offline.scheduler.Dispatchers.lsf.LSFDispatcher
          extended by gov.bnl.star.offline.scheduler.Dispatchers.local.LocalDispatcher
All Implemented Interfaces:
Dispatcher, java.io.Serializable

public class LocalDispatcher
extends LSFDispatcher
implements Dispatcher

A dispatcher for dispatching jobs to fork on the local node. The simulation flag will make the scheduler not actually execute the command lines. Therefore scripts and fileLists are created, but the commands are not executed. Log and output won't be affected, except that there will be a message warning that the submission is simulated.

Version:
1.0 2002/12/26
Author:
Levente Hajdu
See Also:
Serialized Form

Field Summary
protected  CSHApplication application
           
protected  boolean reportedFailure
           
 boolean run
           
protected  boolean simulation
           
 
Fields inherited from class gov.bnl.star.offline.scheduler.Dispatchers.lsf.LSFDispatcher
scratchDir
 
Fields inherited from class gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
threadOuput
 
Constructor Summary
LocalDispatcher()
           
 
Method Summary
protected  void dispatch(Request request, Job job)
           
 void dispatch(Request request, java.util.List jobs)
          Creates the scripts and dispatches the job on the target machine.
 CSHApplication getApplication()
          Get the class that writes the sricpt that will be executed by the batch system
 int getMaxAttempts()
           
 int getMsBtwnFailure()
           
 int getMsBtwnSuccess()
           
 void Kill(Request request, java.util.List jobs)
          Kill all submitted jobs in the job list.
 void retrieveOutput(Request job, java.util.List jobs)
          Currently not implemented
 void setApplication(CSHApplication application)
          Set the class that writes the sricpt that will be executed by the batch system
 void setMaxAttempts(int maxAttempts)
          Set max number of times submitting the job should be tried.
 void setMsBtwnFailure(int msBtwnFailure)
           
 void setMsBtwnSuccess(int msBtwnSuccess)
          sets the number of milliseconds to delay between successful submissions.
 void setResourceRequirementStringDefinition(java.lang.String ResReqDefinitionObj)
           
 java.lang.String Status(Job job, int Processe)
          Get the status of the jobs object processe N.
 void stop()
          Cases the dispacher to stop dispaching and trys to kill dispached jobs This is currently not implemented by any dispatchers.
 boolean test(Queue queue)
          Runs test(s) on underlying components to determine if submitting jobs should be attempted.
 void useSimulationMode(boolean simulation)
           
 
Methods inherited from class gov.bnl.star.offline.scheduler.Dispatchers.lsf.LSFDispatcher
addResourceStrategy, getBsubEx, getBsubOptions, getClusterName, getMaxElapseTime, getNodePriorityStringGenerator, getOmitTargetNode, getQueueName, getQueueName, getResourceStrategyList, getResourceUsageSwitch, reportFailure, reportProcessSubmissionFailure, setBsubEx, setBsubOptions, setClusterName, setMaxElapseTime, setNodePriorityStringGenerator, setOmitTargetNode, setQueueName, setResourceStrategy, setResourceStrategyList
 
Methods inherited from class gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
getTestQueueCommand, getTestQueueCommandMustMatch, runInTimeLimitedThread, setTestQueueCommand, setTestQueueCommandMustMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simulation

protected boolean simulation

reportedFailure

protected boolean reportedFailure

application

protected CSHApplication application

run

public volatile boolean run
Constructor Detail

LocalDispatcher

public LocalDispatcher()
Method Detail

setResourceRequirementStringDefinition

public void setResourceRequirementStringDefinition(java.lang.String ResReqDefinitionObj)
Overrides:
setResourceRequirementStringDefinition in class LSFDispatcher

getMaxAttempts

public int getMaxAttempts()
Overrides:
getMaxAttempts in class LSFDispatcher
Returns:
max number of times submitting the job should be tried.

setMaxAttempts

public void setMaxAttempts(int maxAttempts)
Set max number of times submitting the job should be tried.

Overrides:
setMaxAttempts in class LSFDispatcher
Parameters:
maxAttempts - numbmer of attempts

getMsBtwnSuccess

public int getMsBtwnSuccess()
Overrides:
getMsBtwnSuccess in class LSFDispatcher
Returns:
The number of milliseconds to delay between successful submissions.

setMsBtwnSuccess

public void setMsBtwnSuccess(int msBtwnSuccess)
sets the number of milliseconds to delay between successful submissions.

Overrides:
setMsBtwnSuccess in class LSFDispatcher
Parameters:
msBtwnSuccess - delay in milliseconds

getMsBtwnFailure

public int getMsBtwnFailure()
Overrides:
getMsBtwnFailure in class LSFDispatcher
Returns:
The number of milliseconds to delay between failed submissions.

setMsBtwnFailure

public void setMsBtwnFailure(int msBtwnFailure)
Overrides:
setMsBtwnFailure in class LSFDispatcher

dispatch

public void dispatch(Request request,
                     java.util.List jobs)
Creates the scripts and dispatches the job on the target machine.

Specified by:
dispatch in interface Dispatcher
Overrides:
dispatch in class LSFDispatcher
Parameters:
request - the job request

useSimulationMode

public void useSimulationMode(boolean simulation)
Overrides:
useSimulationMode in class LSFDispatcher

dispatch

protected void dispatch(Request request,
                        Job job)
Overrides:
dispatch in class LSFDispatcher

setApplication

public void setApplication(CSHApplication application)
Set the class that writes the sricpt that will be executed by the batch system

Overrides:
setApplication in class LSFDispatcher
Parameters:
application - The initialized CSH writer object

getApplication

public CSHApplication getApplication()
Get the class that writes the sricpt that will be executed by the batch system

Overrides:
getApplication in class LSFDispatcher
Returns:
the object that writes the csh script

Kill

public void Kill(Request request,
                 java.util.List jobs)
Kill all submitted jobs in the job list.

Specified by:
Kill in interface Dispatcher
Overrides:
Kill in class LSFDispatcher
Parameters:
request - the job request
jobs - a list of jobs to be killed

Status

public java.lang.String Status(Job job,
                               int Processe)
Get the status of the jobs object processe N.

Specified by:
Status in interface Dispatcher
Overrides:
Status in class LSFDispatcher
Parameters:
job - The job object of the running process
Processe - the index of the running process of this object

retrieveOutput

public void retrieveOutput(Request job,
                           java.util.List jobs)
Description copied from class: LSFDispatcher
Currently not implemented

Specified by:
retrieveOutput in interface Dispatcher
Overrides:
retrieveOutput in class LSFDispatcher
Parameters:
job - the job for which to retrieve the output

stop

public void stop()
Description copied from interface: Dispatcher
Cases the dispacher to stop dispaching and trys to kill dispached jobs This is currently not implemented by any dispatchers.

Specified by:
stop in interface Dispatcher
Overrides:
stop in class LSFDispatcher

test

public boolean test(Queue queue)
Runs test(s) on underlying components to determine if submitting jobs should be attempted.

Specified by:
test in interface Dispatcher
Overrides:
test in class LSFDispatcher
Parameters:
queue - The queue object one is trying to submit to.
Returns:
Will return true to indicate everything is alright and false if the test has failed


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.