org.ggf.drmaa
Class GridWayJobTemplate

java.lang.Object
  extended by org.ggf.drmaa.SimpleJobTemplate
      extended by org.ggf.drmaa.GridWayJobTemplate
All Implemented Interfaces:
JobTemplate

public class GridWayJobTemplate
extends SimpleJobTemplate

This class implements the GridWay specific methods.


Field Summary
 
Fields inherited from class org.ggf.drmaa.SimpleJobTemplate
args, attributeNames, blockEmail, deadlineTime, email, errorPath, hardRunDurationLimit, hardWallclockTimeLimit, inputPath, jobCategory, jobEnvironment, jobName, jobSubmissionState, joinFiles, nativeSpecification, outputPath, remoteCommand, softRunDurationLimit, softWallclockTimeLimit, startTime, transferFiles, workingDirectory
 
Fields inherited from interface org.ggf.drmaa.JobTemplate
ACTIVE_STATE, HOLD_STATE, HOME_DIRECTORY, PARAMETRIC_INDEX, WORKING_DIRECTORY
 
Constructor Summary
GridWayJobTemplate()
           
GridWayJobTemplate(java.lang.String name)
           
 
Method Summary
 java.util.List getInputFiles()
          This method get the attribute GridWayJobTemplate.inputFiles.
 long getJobTemplatePointer()
           
 java.lang.String getNp()
          This method get the attribute GridWayJobTemplate.np.
 java.lang.String getNumberOfRetries()
          This method get the attribute GridWayJobTemplate.numberOfRetries.
 java.util.List getOutputFiles()
          This method get the attribute GridWayJobTemplate.outputFiles.
 java.lang.String getRank()
          This method get the attribute GridWayJobTemplate.rank.
 java.lang.String getRequirements()
          This method get the attribute GridWayJobTemplate.requirements.
 java.lang.String getRescheduleOnFailure()
          This method get the attribute GridWayJobTemplate.rescheduleOnFailure.
 java.util.List getRestartFiles()
          This method get the attribute GridWayJobTemplate.restart_files.
 java.lang.String getType()
          This method get the attribute GridWayJobTemplate.type.
 void setInputFiles(java.util.List inputFiles)
          This method set the attribute GridWayJobTemplate.inputFiles.
 void setJobTemplatePointer(long ptr)
           
 void setNp(java.lang.String np)
          This method set the attribute GridWayJobTemplate.np.
 void setNumberOfRetries(java.lang.String numberOfRetries)
          This method set the attribute GridWayJobTemplate.numberOfRetries.
 void setOutputFiles(java.util.List outputFiles)
          This method set the attribute GridWayJobTemplate.outputFiles.
 void setRank(java.lang.String rank)
          This method set the attribute GridWayJobTemplate.rank.
 void setRequirements(java.lang.String requirements)
          This method set the attribute GridWayJobTemplate.requirements.
 void setRescheduleOnFailure(java.lang.String onFailure)
          This method set the attribute GridWayJobTemplate.rescheduleOnFailure.
 void setRestartFiles(java.util.List restartFiles)
          This method set the attribute GridWayJobTemplate.restartFiles.
 void setType(java.lang.String type)
          This method set the attribute GridWayJobTemplate.type.
 
Methods inherited from class org.ggf.drmaa.SimpleJobTemplate
getArgs, getAttributeNames, getBlockEmail, getDeadlineTime, getEmail, getErrorPath, getHardRunDurationLimit, getHardWallclockTimeLimit, getInputPath, getJobCategory, getJobEnvironment, getJobName, getJobSubmissionState, getJoinFiles, getNativeSpecification, getOptionalAttributeNames, getOutputPath, getRemoteCommand, getSoftRunDurationLimit, getSoftWallclockTimeLimit, getStartTime, getTransferFiles, getWorkingDirectory, modified, setArgs, setBlockEmail, setDeadlineTime, setEmail, setErrorPath, setHardRunDurationLimit, setHardWallclockTimeLimit, setInputPath, setJobCategory, setJobEnvironment, setJobName, setJobSubmissionState, setJoinFiles, setNativeSpecification, setOutputPath, setRemoteCommand, setSoftRunDurationLimit, setSoftWallclockTimeLimit, setStartTime, setTransferFiles, setWorkingDirectory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridWayJobTemplate

public GridWayJobTemplate()

GridWayJobTemplate

public GridWayJobTemplate(java.lang.String name)
Method Detail

setJobTemplatePointer

public void setJobTemplatePointer(long ptr)

setInputFiles

public void setInputFiles(java.util.List inputFiles)
                   throws DrmaaException
This method set the attribute GridWayJobTemplate.inputFiles. This attribute is an list of strings to refer to the input files of SimpleJobTemplate.remoteCommand. Each vector entry is a pair of the form "source destination" filenames. If the destination filename is missing, the source filename will be preserved in the execution host. Input files (sources) ARE RELATIVE TO THE WORKING DIRECTORY or can be a GSIFTP URL. Example: input_file[0]="param."GW_TASK_ID" param" will copy the local file param.2 (for task 2) as param in the remote working directory.

Parameters:
inputFiles - The input files to set
Throws:
InvalidAttributeValueException
DrmaaException

setOutputFiles

public void setOutputFiles(java.util.List outputFiles)
                    throws DrmaaException
This method set the attribute GridWayJobTemplate.outputFiles. This attribute is an array of strings to refer to the output files of SimpleJobTemplate.remoteCommand. Each vector entry is a "source destination" filenames pair. If the destination filename is missing, the source filename will be preserved in the client host. Output files can be a GSIFTP URL. Example: output_file[0]="binary binary."GW_ARCH will copy the output file "binary" to the client host with name binary.i686 (architecture of remote host is i686)

Parameters:
outputFiles - The output files to set
Throws:
InvalidAttributeValueException
DrmaaException

setRestartFiles

public void setRestartFiles(java.util.List restartFiles)
                     throws DrmaaException
This method set the attribute GridWayJobTemplate.restartFiles. This attribute is an array of strings to refer to the re-start files generated by SimpleJobTemplate.remoteCommand. Each vector entry is the name of a checkpointing file. Re-start files can be used to preserve the execution context (at the application level) of the remoteCommand on job migration or stop/resume actions.

Parameters:
restartFiles - The restart files to set
Throws:
InvalidAttributeValueException
DrmaaException

setRescheduleOnFailure

public void setRescheduleOnFailure(java.lang.String onFailure)
                            throws DrmaaException
This method set the attribute GridWayJobTemplate.rescheduleOnFailure. This attribute is a String to refer to the ON_FAILURE GridWay scheduler parameter. If set to "yes" GridWay will reschedule the job after retrying execution on a given host drmaa_gw_number_of_retries times. Values are "yes" or "no". Default value for this attribute is "no".

Parameters:
onFailure - The boolean reschedule on failure value to set
Throws:
InvalidAttributeValueException
DrmaaException

setNumberOfRetries

public void setNumberOfRetries(java.lang.String numberOfRetries)
                        throws DrmaaException
This method set the attribute GridWayJobTemplate.numberOfRetries. This attribute is a String to refer to the NUMBER_OF_RETRIES GridWay scheduler parameter, the number of times to retry the execution on a given host. Default value is 3.

Parameters:
numberOfRetries - The number of retries to set
Throws:
InvalidAttributeValueException
DrmaaException

setRank

public void setRank(java.lang.String rank)
             throws DrmaaException
This method set the attribute GridWayJobTemplate.rank. This attribute is a String to refer to the RANK job template parameter. The RANK is a mathematical expression evaluated for each candidate host (those for which the REQUIREMENTS expression is true). Those candidates with higher ranks are used first to execute your jobs. Example: "(CPU_MHZ * 2) + FREE_MEM_MB;" (NOTE: Must end with ';')

Parameters:
rank - The rank to set
Throws:
InvalidAttributeValueException
DrmaaException

setRequirements

public void setRequirements(java.lang.String requirements)
                     throws DrmaaException
This method set the attribute GridWayJobTemplate.requirements. This attribute is a String to refer to the REQUIREMENTS job template parameter. The REQUIREMENTS is a boolean expression evaluated for each host in the Grid, if it is true the host will be considered to submit the job. Example:"ARCH = "i686" & CPU_MHZ > 1000;" (NOTE: Must end with ';')

Parameters:
requirements - The requirements to set
Throws:
InvalidAttributeValueException
DrmaaException

setType

public void setType(java.lang.String type)
             throws DrmaaException
This method set the attribute GridWayJobTemplate.type. This attribute is a String to refer to the TYPE job template parameter. The TYPE is the type of the job. Possible values are "single" (default), and "mpi", with similar behaviour to that of GRAM jobs.

Parameters:
type - The type to set
Throws:
InvalidAttributeValueException
DrmaaException

setNp

public void setNp(java.lang.String np)
           throws DrmaaException
This method set the attribute GridWayJobTemplate.np. This attribute is a String to refer to the NP job template parameter. The NP is a attribute to refer to the number of process requested by a MPI job.

Parameters:
np - The number of process to set
Throws:
InvalidAttributeValueException
DrmaaException

getJobTemplatePointer

public long getJobTemplatePointer()

getInputFiles

public java.util.List getInputFiles()
This method get the attribute GridWayJobTemplate.inputFiles. This attribute is an array of strings to refer to the input files of SimpleJobTemplate.remoteCommand. Each vector entry is a pair of the form "source destination" filenames. If the destination filename is missing, the source filename will be preserved in the execution host. Input files (sources) ARE RELATIVE TO THE WORKING DIRECTORY or can be a GSIFTP URL. Example: input_file[0]="param."GW_TASK_ID" param" will copy the local file param.2 (for task 2) as param in the remote working directory.

Returns:
A String array with the drmaa_v_gw_input_files value

getOutputFiles

public java.util.List getOutputFiles()
This method get the attribute GridWayJobTemplate.outputFiles. This attribute is an array of strings to refer to the output files of SimpleJobTemplate.remoteCommand. Each vector entry is a "source destination" filenames pair. If the destination filename is missing, the source filename will be preserved in the client host. Output files can be a GSIFTP URL. Example: output_file[0]="binary binary."GW_ARCH will copy the output file "binary" to the client host with name binary.i686 (architecture of remote host is i686)

Returns:
A String array with the drmaa_v_gw_output_files value

getRestartFiles

public java.util.List getRestartFiles()
This method get the attribute GridWayJobTemplate.restart_files. This attribute is an array of strings to refer to the re-start files generated by SimpleJobTemplate.remoteCommand. Each vector entry is the name of a checkpointing file. Re-start files can be used to preserve the execution context (at the application level) of the REMOTE_COMMAND on job migration or stop/resume actions.

Returns:
A String array with the drmaa_v_gw_restart_files value

getRescheduleOnFailure

public java.lang.String getRescheduleOnFailure()
This method get the attribute GridWayJobTemplate.rescheduleOnFailure. This attribute is a String to refer to the ON_FAILURE GridWay scheduler parameter. If set to "yes" GridWay will reschedule the job after retrying execution on a given host drmaa_gw_number_of_retries times. Values are "yes" or "no". Default value for this attribute is "no".

Returns:
A String array with the drmaa_gw_reschedule_on_failure value

getNumberOfRetries

public java.lang.String getNumberOfRetries()
This method get the attribute GridWayJobTemplate.numberOfRetries. This attribute is a String to refer to the NUMBER_OF_RETRIES GridWay scheduler parameter, the number of times to retry the execution on a given host. Default value is 3.

Returns:
A String array with the numberOfRetries value

getRank

public java.lang.String getRank()
This method get the attribute GridWayJobTemplate.rank. This attribute is a String to refer to the REQUIREMENTS job template parameter. The REQUIREMENTS is a boolean expression evaluated for each host in the Grid, if it is true the host will be considered to submit the job. Example:"ARCH = "i686" & CPU_MHZ > 1000;" (NOTE: Must end with ';')

Returns:
A String array with the rank value

getRequirements

public java.lang.String getRequirements()
This method get the attribute GridWayJobTemplate.requirements. This attribute is a String to refer to the RANK job template parameter. The RANK is a mathematical expression evaluated for each candidate host (those for which the REQUIREMENTS expression is true). Those candidates with higher ranks are used first to execute your jobs. Example: "(CPU_MHZ * 2) + FREE_MEM_MB;" (NOTE: Must end with ';')

Returns:
A String array with the requirements value

getType

public java.lang.String getType()
This method get the attribute GridWayJobTemplate.type. This attribute is a String to refer to the TYPE job template parameter. The TYPE is the type of the job. Possible values are "single" (default), and "mpi", with similar behaviour to that of GRAM jobs.

Returns:
A String with the type value

getNp

public java.lang.String getNp()
This method get the attribute GridWayJobTemplate.np. This attribute is a String to refer to the NP job template parameter. The NP is a attribute to refer to the number of process requested by a MPI job.

Returns:
A String with the np value