gov.bnl.star.offline.scheduler.Dispatchers.lsf
Class LSFDispatcher

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
      extended by gov.bnl.star.offline.scheduler.Dispatchers.lsf.LSFDispatcher
All Implemented Interfaces:
Dispatcher, java.io.Serializable
Direct Known Subclasses:
CondorDispatcher, CondorGRSLDispatcher, LocalDispatcher, SGEDispatcher

public class LSFDispatcher
extends DispatcherBase
implements Dispatcher, java.io.Serializable

Dispatches a job using LSF.

For each process, two files are created: a script for the execution and a text file containing the file list. The script basically sets the environment variables and executes the command line. The file list contains the input file requested, one full path for each line in the list.

Each script is submitted through bsub.

The simulation flag will make the scheduler not actually execute the command lines. Therefore scripts and fileLists are created, but the bsub and chmod 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:
Gabriele Carcassi, Jerome Lauret, Levente Hajdu
See Also:
Serialized Form

Field Summary
protected  CSHApplication application
           
protected  boolean reportedFailure
           
 boolean run
           
protected  java.lang.String scratchDir
           
protected  boolean simulation
           
 
Fields inherited from class gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
threadOuput
 
Constructor Summary
LSFDispatcher()
           
 
Method Summary
 void addResourceStrategy(AbstractResourceStrategy resourceStrategy)
           
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()
          recovers the initialized object that writes the CSH application
 java.lang.String getBsubEx()
           
 java.lang.String getBsubOptions()
           
 java.lang.String getClusterName()
          Getter for property clusterName.
 int getMaxAttempts()
           
 int getMaxElapseTime()
           
 int getMsBtwnFailure()
           
 int getMsBtwnSuccess()
           
 LSFNodePriorityStringGenerator getNodePriorityStringGenerator()
           
 boolean getOmitTargetNode()
           
 java.lang.String getQueueName()
           
protected  java.lang.String getQueueName(Job job)
           
 java.util.List getResourceStrategyList()
           
protected  java.lang.String getResourceUsageSwitch(Job job)
           
 void Kill(Request request, java.util.List jobs)
          Kills the processes associated with this job.
protected  void reportFailure(Job job)
           
protected  void reportProcessSubmissionFailure(Request request, Job job, int jobNumber, java.lang.String message)
           
 void retrieveOutput(Request request, java.util.List jobs)
          Currently not implemented
 void setApplication(CSHApplication application)
          Sets the object initialized that writes the CSH script.
 void setBsubEx(java.lang.String bsubEx)
           
 void setBsubOptions(java.lang.String bsubOptions)
           
 void setClusterName(java.lang.String clusterName)
          Setter for property clusterName.
 void setMaxAttempts(int maxAttempts)
           
 void setMaxElapseTime(int maxElapseTime)
           
 void setMsBtwnFailure(int msBtwnFailure)
           
 void setMsBtwnSuccess(int msBtwnSuccess)
           
 void setNodePriorityStringGenerator(LSFNodePriorityStringGenerator nodePriorityStringGenerator)
          Set the object used to generate the node priority string.
 void setOmitTargetNode(boolean omitTargetNode)
           
 void setQueueName(java.lang.String queueName)
           
 void setResourceRequirementStringDefinition(java.lang.String ResReqDefinitionObj)
           
 void setResourceStrategy(AbstractResourceStrategy resourceStrategy)
          This function is deprecated but still exists to be backwards compatible with older configuration files.
 void setResourceStrategyList(java.util.List lsfResourceStrategy)
           
 java.lang.String Status(Job job, int Processe)
          Returns The status of the job
 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)
          Test the queue get an indication if job can be submitted successfully to the queue.
 void useSimulationMode(boolean simulation)
           
 
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

scratchDir

protected java.lang.String scratchDir

simulation

protected boolean simulation

reportedFailure

protected boolean reportedFailure

application

protected CSHApplication application

run

public volatile boolean run
Constructor Detail

LSFDispatcher

public LSFDispatcher()
Method Detail

setOmitTargetNode

public void setOmitTargetNode(boolean omitTargetNode)

getOmitTargetNode

public boolean getOmitTargetNode()

setMaxElapseTime

public void setMaxElapseTime(int maxElapseTime)

getMaxElapseTime

public int getMaxElapseTime()

setResourceRequirementStringDefinition

public void setResourceRequirementStringDefinition(java.lang.String ResReqDefinitionObj)

getBsubEx

public java.lang.String getBsubEx()

setBsubEx

public void setBsubEx(java.lang.String bsubEx)

getQueueName

public java.lang.String getQueueName()

setQueueName

public void setQueueName(java.lang.String queueName)

getBsubOptions

public java.lang.String getBsubOptions()

setBsubOptions

public void setBsubOptions(java.lang.String bsubOptions)

getMaxAttempts

public int getMaxAttempts()

setMaxAttempts

public void setMaxAttempts(int maxAttempts)

getMsBtwnSuccess

public int getMsBtwnSuccess()

setMsBtwnSuccess

public void setMsBtwnSuccess(int msBtwnSuccess)

getMsBtwnFailure

public int getMsBtwnFailure()

setMsBtwnFailure

public void setMsBtwnFailure(int msBtwnFailure)

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
Parameters:
request - the job request

useSimulationMode

public void useSimulationMode(boolean simulation)

reportProcessSubmissionFailure

protected void reportProcessSubmissionFailure(Request request,
                                              Job job,
                                              int jobNumber,
                                              java.lang.String message)

reportFailure

protected void reportFailure(Job job)

retrieveOutput

public void retrieveOutput(Request request,
                           java.util.List jobs)
Currently not implemented

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

dispatch

protected void dispatch(Request request,
                        Job job)

getResourceStrategyList

public java.util.List getResourceStrategyList()

setResourceStrategyList

public void setResourceStrategyList(java.util.List lsfResourceStrategy)

addResourceStrategy

public void addResourceStrategy(AbstractResourceStrategy resourceStrategy)

setResourceStrategy

public void setResourceStrategy(AbstractResourceStrategy resourceStrategy)
This function is deprecated but still exists to be backwards compatible with older configuration files. The function really calls addResourceStrategy(). For new configuration files please use addResourceStrategy() instead.


getResourceUsageSwitch

protected java.lang.String getResourceUsageSwitch(Job job)

getQueueName

protected java.lang.String getQueueName(Job job)

getClusterName

public java.lang.String getClusterName()
Getter for property clusterName.

Returns:
Value of property clusterName.

setClusterName

public void setClusterName(java.lang.String clusterName)
Setter for property clusterName.

Parameters:
clusterName - New value of property clusterName.

Kill

public void Kill(Request request,
                 java.util.List jobs)
Description copied from interface: Dispatcher
Kills the processes associated with this job.

Specified by:
Kill in interface Dispatcher

Status

public java.lang.String Status(Job job,
                               int Processe)
Description copied from interface: Dispatcher
Returns The status of the job

Specified by:
Status in interface Dispatcher

setApplication

public void setApplication(CSHApplication application)
Sets the object initialized that writes the CSH script.

Parameters:
application - The initialized CSH writer object

getApplication

public CSHApplication getApplication()
recovers the initialized object that writes the CSH application

Returns:
the object that writes the csh script

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

setNodePriorityStringGenerator

public void setNodePriorityStringGenerator(LSFNodePriorityStringGenerator nodePriorityStringGenerator)
Set the object used to generate the node priority string.


getNodePriorityStringGenerator

public LSFNodePriorityStringGenerator getNodePriorityStringGenerator()

test

public boolean test(Queue queue)
Test the queue get an indication if job can be submitted successfully to the queue.

Specified by:
test in interface Dispatcher
Parameters:
queue - The queue object to be tested
Returns:
Ture if the job will most likely run, and false if the job will most likely fail.


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