Package net.sf.basedb.opengrid.engine
Class OpenGridEngine
java.lang.Object
net.sf.basedb.opengrid.engine.OpenGridEngine
- All Implemented Interfaces:
ClusterEngine
public class OpenGridEngine extends Object implements ClusterEngine
Cluster engine implementation for Open Grid clusters.
- Since:
- 1.4
- Author:
- nicklas
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OpenGridEngine.OpenGridJobStatus
Job status information for Open Grid jobs.static class
OpenGridEngine.QacctCmd
Implements the 'qacct' command for getting information about a completed job.static class
OpenGridEngine.QstatCmd
Get job status information from an existing QstatXmlCmd instance.static class
OpenGridEngine.QstatXmlCmd
Execute the 'qstat -xml' command, parse the XML and store the result for future use with QstatCmd. -
Field Summary
Fields Modifier and Type Field Description private static Set<String>
ignoredQsubOptions
private static ExtensionsLogger
logger
private OpenGridEngine.QstatXmlCmd
qstatXml
static DateFormatter
STARTTIME_DATE
Format to use for the -a parameter that contols the earliest start time for a job: YYMMDDhhmm.SS Example: 2204081145.51 -
Constructor Summary
Constructors Constructor Description OpenGridEngine()
-
Method Summary
Modifier and Type Method Description CmdResult<String>
cancelJob(OpenGridSession session, JobIdentifier jobId)
Tell the cluster that a running or waiting job should be cancelled.String
createJobScript(JobDefinition job, String workFolder, String tmpFolder)
Generates a script that executes the job script.JobSubmission
createJobSubmission(OpenGridSession session, JobDefinition job, String workFolder, String tmpFolder)
Create a job submission for executing a job on the cluster.String
createQsubScript(JobDefinition job, String workFolder, String tmpFolder)
Generates a script that can be submitted with 'qsub' to the Open Grid Cluster.private UploadSource
getScript(String name)
CmdResult<JobStatus>
getStatusIfFinished(OpenGridSession session, JobIdentifier jobId, int timeAdjustment)
Get information about a job that is expected to have finished.CmdResult<JobStatus>
getStatusInQueue(OpenGridSession session, JobIdentifier jobId, int timeAdjustment)
Get information about a job that is expected to be waiting in the queue or running.void
setDefaultConfig(ClusterConfig config)
Set default configuration parameters on the given configuration object.
-
Field Details
-
logger
-
ignoredQsubOptions
-
STARTTIME_DATE
Format to use for the -a parameter that contols the earliest start time for a job: YYMMDDhhmm.SS Example: 2204081145.51- Since:
- 1.5
-
qstatXml
-
-
Constructor Details
-
OpenGridEngine
public OpenGridEngine()
-
-
Method Details
-
setDefaultConfig
Description copied from interface:ClusterEngine
Set default configuration parameters on the given configuration object. It is expected that theClusterConfig.getType()
is a type that is compatible with the engine implementation.- Specified by:
setDefaultConfig
in interfaceClusterEngine
-
createJobSubmission
public JobSubmission createJobSubmission(OpenGridSession session, JobDefinition job, String workFolder, String tmpFolder)Description copied from interface:ClusterEngine
Create a job submission for executing a job on the cluster.- Specified by:
createJobSubmission
in interfaceClusterEngine
- Parameters:
session
- A connected session that can be used to execute commands on the clusterjob
- Information about the jobworkFolder
- The work folder where files needed for the job are storedtmpFolder
- A temporary folder where the job is allowed to store files- Returns:
- A JobSubmission instance
-
getStatusInQueue
public CmdResult<JobStatus> getStatusInQueue(OpenGridSession session, JobIdentifier jobId, int timeAdjustment)Description copied from interface:ClusterEngine
Get information about a job that is expected to be waiting in the queue or running. If this is not the case, the CmdResult should return with exit status set to 1.- Specified by:
getStatusInQueue
in interfaceClusterEngine
- Parameters:
session
- A connected session that can be used to execute commands on the clusterjobId
- Job identifiertimeAdjustment
- Adjustment in seconds that should be applied to all times returned by commands on the cluster (this will make times compatible with BASE server)- Returns:
- A CmdResult instance with JobStatus information
-
getStatusIfFinished
public CmdResult<JobStatus> getStatusIfFinished(OpenGridSession session, JobIdentifier jobId, int timeAdjustment)Description copied from interface:ClusterEngine
Get information about a job that is expected to have finished.- Specified by:
getStatusIfFinished
in interfaceClusterEngine
- Parameters:
session
- A connected session that can be used to execute commands on the clusterjobId
- Job identifiertimeAdjustment
- Adjustment in seconds that should be applied to all times returned by commands on the cluster (this will make times compatible with BASE server)- Returns:
- A CmdResult instance with JobStatus information
-
cancelJob
Description copied from interface:ClusterEngine
Tell the cluster that a running or waiting job should be cancelled.- Specified by:
cancelJob
in interfaceClusterEngine
- Parameters:
session
- A connected session that can be used to execute commands on the clusterjobId
- Job identifier- Returns:
- The result of executing the command
-
createQsubScript
Generates a script that can be submitted with 'qsub' to the Open Grid Cluster. -
createJobScript
Generates a script that executes the job script. -
getScript
-