gov.bnl.star.offline.scheduler.Dispatchers.sge
Class SGEDispatcher

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.sge.SGEDispatcher
All Implemented Interfaces:
Dispatcher, java.io.Serializable

public class SGEDispatcher
extends LSFDispatcher
implements Dispatcher

Dispatches a jobs using SGE.

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:
Levente Hajdu, Jerome Lauret
See Also:
Serialized Form

Field Summary
protected  CSHApplication application
           
protected  boolean reportedFailure
           
protected  boolean simulation
           
 
Fields inherited from class gov.bnl.star.offline.scheduler.Dispatchers.lsf.LSFDispatcher
run, scratchDir
 
Fields inherited from class gov.bnl.star.offline.scheduler.Dispatchers.DispatcherBase
threadOuput
 
Constructor Summary
SGEDispatcher()
           
 
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()
          Get the class that writes the sricpt that will be executed by the batch system
 int getMaxAttempts()
           
 int getMsBtwnFailure()
           
 int getMsBtwnSuccess()
           
 java.lang.String getQsubEx()
           
 java.lang.String getQsubOptions()
           
 java.util.List getResourceStrategyList()
           
protected  java.lang.String getResourceUsageSwitch(Job job)
          Biuld an SGE resource usage switch for this job to be appanded to the submitting comaand
 void Kill(Request request, java.util.List jobs)
          Kills the processes associated with this job.
 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)
           
 void setMsBtwnFailure(int msBtwnFailure)
           
 void setMsBtwnSuccess(int msBtwnSuccess)
           
 void setQsubEx(java.lang.String bsubEx)
           
 void setQsubOptions(java.lang.String qsubOptions)
           
 void setResourceRequirementStringDefinition(java.lang.String ResReqDefinitionObj)
           
 void setResourceStrategyList(java.util.List sgeResourceStrategy)
           
 java.lang.String Status(Job job, int Processe)
          Returns The status of the job
 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
getBsubEx, getBsubOptions, getClusterName, getMaxElapseTime, getNodePriorityStringGenerator, getOmitTargetNode, getQueueName, getQueueName, reportFailure, reportProcessSubmissionFailure, setBsubEx, setBsubOptions, setClusterName, setMaxElapseTime, setNodePriorityStringGenerator, setOmitTargetNode, setQueueName, setResourceStrategy, stop
 
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
 
Methods inherited from interface gov.bnl.star.offline.scheduler.Dispatcher
stop
 

Field Detail

simulation

protected boolean simulation

reportedFailure

protected boolean reportedFailure

application

protected CSHApplication application
Constructor Detail

SGEDispatcher

public SGEDispatcher()
Method Detail

setResourceRequirementStringDefinition

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

getQsubEx

public java.lang.String getQsubEx()

setQsubEx

public void setQsubEx(java.lang.String bsubEx)

getMaxAttempts

public int getMaxAttempts()
Overrides:
getMaxAttempts in class LSFDispatcher

setMaxAttempts

public void setMaxAttempts(int maxAttempts)
Overrides:
setMaxAttempts in class LSFDispatcher

getMsBtwnSuccess

public int getMsBtwnSuccess()
Overrides:
getMsBtwnSuccess in class LSFDispatcher

setMsBtwnSuccess

public void setMsBtwnSuccess(int msBtwnSuccess)
Overrides:
setMsBtwnSuccess in class LSFDispatcher

getMsBtwnFailure

public int getMsBtwnFailure()
Overrides:
getMsBtwnFailure in class LSFDispatcher

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

getResourceStrategyList

public java.util.List getResourceStrategyList()
Overrides:
getResourceStrategyList in class LSFDispatcher

setResourceStrategyList

public void setResourceStrategyList(java.util.List sgeResourceStrategy)
Overrides:
setResourceStrategyList in class LSFDispatcher

addResourceStrategy

public void addResourceStrategy(AbstractResourceStrategy resourceStrategy)
Overrides:
addResourceStrategy in class LSFDispatcher

getResourceUsageSwitch

protected java.lang.String getResourceUsageSwitch(Job job)
Biuld an SGE resource usage switch for this job to be appanded to the submitting comaand

Overrides:
getResourceUsageSwitch in class LSFDispatcher
Parameters:
job - job to biuld the resource uisage string from
Returns:
SGE resource usage switch for this job

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)
Description copied from interface: Dispatcher
Kills the processes associated with this job.

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

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
Overrides:
Status in class LSFDispatcher

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

getQsubOptions

public java.lang.String getQsubOptions()

setQsubOptions

public void setQsubOptions(java.lang.String qsubOptions)

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 to be tested
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.