org.gridlab.gat.resources
Class WrapperSoftwareDescription

java.lang.Object
  extended by org.gridlab.gat.resources.SoftwareDescription
      extended by org.gridlab.gat.resources.JavaSoftwareDescription
          extended by org.gridlab.gat.resources.WrapperSoftwareDescription
All Implemented Interfaces:
Serializable

public class WrapperSoftwareDescription
extends JavaSoftwareDescription

An instance of this class is a description of a piece of java software (component) which is to be submitted as a wrapper job.

A wrapper job is a job will be submitted to a certain location and when it runs it will submit other jobs (again using JavaGAT, which if needed is copied to the remote location).

Wrapper jobs are useful in certain circumstances. First, some adaptors (like the SGE adaptor) can only be used on a machine with specific software installed. If you want to submit a job using SGE from a machine that doesn't have a SGE installation but you are able to SSH to that machine, you can submit an SSH wrapper job, which will be submitted using the SSH adaptor and when the job runs, it will invoke the SGE adaptor to run the 'real' jobs.

The second situation where wrapper jobs are useful, is when you've single threaded jobs that will be scheduled to multicore nodes. Without the wrapper job it will only use one of the available cores and waste the other resources. But using the wrapper job, one can start the wrapper on such a node and then using the Local adaptor, submit as many jobs as wanted to make full use of the available cores.

Third, wrapper jobs can prevent the overloading of a head node due to staging. If jobs need a lot of staging, all the data will be staged to the headnode of a cluster. After that, the jobs will be submitted and when the jobs run, they access there data through a shared file system. This works perfectly fine as long as you've enough quota on the head node. But sometimes you don't, but you do have enough quota on the local disks of the nodes. So it might be useful to stage the data to the local node disks. This can be done using the wrapper job. One starts a wrapper job, which will run on a node, then on the node itself it starts the pre staging process for the 'real' jobs, making it possible to pre stage directly to the nodes.

The wrapper job always executes the java application "org.gridlab.gat.resources.cpi.Wrapper". Because many things of the software description are fixed for this application, certain inherited methods are overwritten and will do nothing. It's still needed to set the executable (it should point to a java (version 6 or higher) program, for instance /usr/bin/java). Furthermore, you can specify a GAT location to indicate that there's already a GAT installation on the other side and JavaGAT doesn't need to be pre staged. Please be careful that your JavaGAT versions match.

Author:
rkemp
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.gridlab.gat.resources.JavaSoftwareDescription
JAVA_ARGUMENTS, JAVA_MAIN, JAVA_OPTIONS, JAVA_SYSTEM_PROPERTIES
 
Fields inherited from class org.gridlab.gat.resources.SoftwareDescription
CPUTIME_MAX, DIRECTORY, DRY_RUN, HOST_COUNT, JOB_QUEUE, JOB_TYPE, MEMORY_MAX, MEMORY_MIN, PROJECT, RESTART, SANDBOX_DELETE, SANDBOX_POSTSTAGE_STDERR, SANDBOX_POSTSTAGE_STDOUT, SANDBOX_PRESTAGE_STDIN, SANDBOX_ROOT, SANDBOX_USEROOT, SAVE_STATE, STOP_ON_EXIT, TIME_MAX, WALLTIME_MAX
 
Constructor Summary
WrapperSoftwareDescription()
          Creates a new WrapperSoftwareDescription.
 
Method Summary
 Map<String,Object> getEnvironment()
          Returns the environment of the executable.
 String getGATLocation()
          Gets the GAT location that can be used to run the wrapper application.
 String getJavaClassPath()
          Gets the java class path for the wrapper job.
 Map<String,String> getJavaSystemProperties()
          Returns the java system properties.
 Map<File,File> getPreStaged()
          Returns the pre staged file set.
 void setGATLocation(String gatLocation)
          Sets the GAT location that can be used to run the wrapper application.
 void setJavaClassPath(String classpath)
          Don't use this method.
 void setJavaMain(String main)
          Don't use this method.
 
Methods inherited from class org.gridlab.gat.resources.JavaSoftwareDescription
addJavaSystemProperty, getArguments, getExecutable, getJavaArguments, getJavaMain, getJavaOptions, setArguments, setJavaArguments, setJavaOptions, setJavaSystemProperties
 
Methods inherited from class org.gridlab.gat.resources.SoftwareDescription
addAttribute, addDeletedFile, addPostStagedFile, addPostStagedFile, addPreStagedFile, addPreStagedFile, addWipedFile, clone, deletePostStaged, deletePreStaged, enableStreamingStderr, enableStreamingStdin, enableStreamingStdout, equals, getAttributes, getBooleanAttribute, getDeletedFiles, getIntAttribute, getJSDL, getLongAttribute, getObjectAttribute, getPostStaged, getStderr, getStdin, getStdout, getStringAttribute, getWipedFiles, hashCode, removeAttribute, setAttributes, setDeletePostStaged, setDeletePreStaged, setEnvironment, setExecutable, setPostStaged, setPreStaged, setStderr, setStdin, setStdout, setWipePostStaged, setWipePreStaged, streamingStderrEnabled, streamingStdinEnabled, streamingStdoutEnabled, toString, toWrapper, wipePostStaged, wipePreStaged
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrapperSoftwareDescription

public WrapperSoftwareDescription()
Creates a new WrapperSoftwareDescription.

Method Detail

setJavaMain

public void setJavaMain(String main)
Don't use this method. Calls of this method will be ignored, since the java main is fixed: "org.gridlab.gat.resources.cpi.Wrapper".

Overrides:
setJavaMain in class JavaSoftwareDescription
Parameters:
main - the main class.

setGATLocation

public void setGATLocation(String gatLocation)
Sets the GAT location that can be used to run the wrapper application.

Parameters:
gatLocation - the GAT location that can be used to run the wrapper application.

getGATLocation

public String getGATLocation()
Gets the GAT location that can be used to run the wrapper application.

Returns:
the GAT location that can be used to run the wrapper application.

setJavaClassPath

public void setJavaClassPath(String classpath)
Don't use this method. The java class path is fixed for this object and cannot be set. Calls to this method are ignored.

Overrides:
setJavaClassPath in class JavaSoftwareDescription
Parameters:
classpath - the class path to be set.

getJavaClassPath

public String getJavaClassPath()
Gets the java class path for the wrapper job. Doesn't support the attributes 'sandbox.enable', 'sandbox.use.root'.

Overrides:
getJavaClassPath in class JavaSoftwareDescription
Returns:
the java class path for the wrapper job.

getPreStaged

public Map<File,File> getPreStaged()
Description copied from class: SoftwareDescription
Returns the pre staged file set. This a Map with the source Files as keys and the destination Files as values. This method returns the files that should be pre staged regardless of whether they are already pre staged or not.

Overrides:
getPreStaged in class SoftwareDescription
Returns:
the pre staged file set.

getJavaSystemProperties

public Map<String,String> getJavaSystemProperties()
Description copied from class: JavaSoftwareDescription
Returns the java system properties.

Overrides:
getJavaSystemProperties in class JavaSoftwareDescription
Returns:
the java system properties.

getEnvironment

public Map<String,Object> getEnvironment()
Description copied from class: SoftwareDescription
Returns the environment of the executable. The environment of the executable consists of a Map of environment variables with their values (for instance the key, value pair "JAVA_HOME", "/path/to/java").

Overrides:
getEnvironment in class SoftwareDescription
Returns:
the environment