gov.bnl.star.offline.scheduler.Dispatchers.pbs
Class PBSDispatcher

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.Dispatchers.pbs.PBSDispatcher
All Implemented Interfaces:
Dispatcher

public class PBSDispatcher
extends java.lang.Object
implements Dispatcher

Dispatches a job using PBS.

For each process (job), 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 qsub.

The simulation flag will make the scheduler not actually execute the command lines. Therefore scripts and fileLists are created, but the qsub 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

Field Summary
protected  CSHApplication application
           
protected  boolean reportedFailure
           
protected  boolean simulation
           
 
Constructor Summary
PBSDispatcher()
           
 
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
 java.lang.String getClusterName()
          Getter for property clusterName.
 int getMaxAttempts()
           
 int getMsBtwnFailure()
           
 int getMsBtwnSuccess()
           
 java.lang.String getQsubEx()
           
 java.lang.String getQsubOptions()
           
 java.lang.String getQueueName()
           
protected  java.lang.String getQueueName(Job job)
           
 PBSResourceStrategy getResourceStrategy()
           
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)
          Set the class that writes the sricpt that will be executed by the batch system
 void setClusterName(java.lang.String clusterName)
          Setter for property clusterName.
 void setMaxAttempts(int maxAttempts)
           
 void setMsBtwnFailure(int msBtwnFailure)
           
 void setMsBtwnSuccess(int msBtwnSuccess)
           
 void setQsubEx(java.lang.String qsubEx)
           
 void setQsubOptions(java.lang.String qsubOptions)
           
 void setQueueName(java.lang.String queueName)
           
 void setResourceStrategy(PBSResourceStrategy resourceStrategy)
           
 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)
          Runs test(s) on underlying components to determine if submitting jobs should be attempted.
protected  void useSimulationMode(boolean simulation)
           
 
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
Constructor Detail

PBSDispatcher

public PBSDispatcher()
Method Detail

getQsubEx

public java.lang.String getQsubEx()

setQsubEx

public void setQsubEx(java.lang.String qsubEx)

getQueueName

public java.lang.String getQueueName()

setQueueName

public void setQueueName(java.lang.String queueName)

getQsubOptions

public java.lang.String getQsubOptions()

setQsubOptions

public void setQsubOptions(java.lang.String qsubOptions)

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

protected 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)

setResourceStrategy

public void setResourceStrategy(PBSResourceStrategy resourceStrategy)

getResourceStrategy

public PBSResourceStrategy getResourceStrategy()

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.

setApplication

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


getApplication

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


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

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

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
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.