|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridlab.gat.resources.SoftwareDescription
public class SoftwareDescription
An instance of this class is a description of a piece of software (component) which is to be submitted as a job. It currently takes a table describing this piece of software's attributes to any underlying job submission system.
The following attributes are defined in the specification and should be
recognized by ResourceBroker adaptors.
| Name | Type | Description |
|---|---|---|
| directory | String
| working directory |
count (deprecated use JobDescription.setProcessCount(int))
| Integer/String
| number of executables to run |
host.count (deprecated use
JobDescription.setResourceCount(int))
| Integer/String
| number of hosts to distribute on |
| time.max | Long/String
| The maximum walltime or cputime for a single execution of the executable. The units is in minutes. |
| walltime.max | Long/String
| the maximum walltime in minutes |
| cputime.max | Long/String
| the maximum cputime in minutes |
| job.type | String
| single|multiple|mpi|condor|... |
| project | String
| project to use, for accounting purposes |
| dry.run | String
| if set, don't submit but return success |
| memory.min | String
| minimal required memory in MB |
| memory.max | String
| maximal required memory in MB |
| save.state | Boolean/String
| keep job data persistent for restart |
| restart | String
| restart job with given ID |
| Field Summary | |
|---|---|
static String |
CPUTIME_MAX
Indicates the maximum cputime for a single execution of the executable. |
static String |
DIRECTORY
Indicates the working directory. |
static String |
DRY_RUN
If set, don't submit but return success. |
static String |
HOST_COUNT
Indicates the number of hosts to distribute on. |
static String |
JOB_QUEUE
Indicates a job queue: FORK, SGE, PBS, ... |
static String |
JOB_TYPE
Indicates the job type: single|multiple|mpi|condor|... |
static String |
MEMORY_MAX
Indicates the minimal required memory in MB. |
static String |
MEMORY_MIN
Indicates the minimal required memory in MB. |
static String |
PROJECT
Indicates the project to use, for accounting purposes. |
static String |
RESTART
Indicates the job id of a to-be-restarted job. |
static String |
SANDBOX_DELETE
Boolean attribute that indicates if the sandbox is to be deleted after the run. |
static String |
SANDBOX_POSTSTAGE_STDERR
Boolean attribute that indicates if the stderr file should be poststaged when the job is finished. |
static String |
SANDBOX_POSTSTAGE_STDOUT
Boolean attribute that indicates if the stdout file should be poststaged when the job is finished. |
static String |
SANDBOX_PRESTAGE_STDIN
Boolean attribute that indicates if the stdin file should be prestaged before the job is submitted. |
static String |
SANDBOX_ROOT
When set, defines a path to the root where sandbox directories are created. |
static String |
SANDBOX_USEROOT
Boolean attribute that indicates that the directory specified with the SANDBOX_ROOT attribute should itself be used as a sandbox (instead of creating the sandbox in this directory). |
static String |
SAVE_STATE
Indicates that the job data must be kept persistent for restart. |
static String |
STOP_ON_EXIT
Boolean attribute that indicates if the job needs to be terminated when GAT exits. |
static String |
TIME_MAX
Indicates the maximum walltime or cputime for a single execution of the executable. |
static String |
WALLTIME_MAX
Indicates the maximum walltime for a single execution of the executable. |
| Constructor Summary | |
|---|---|
SoftwareDescription()
Create a SoftwareDescription, which describes the application
you want to run. |
|
SoftwareDescription(Map<String,Object> attributes)
Create a SoftwareDescription, which describes the application
you want to run. |
|
SoftwareDescription(String jsdlString)
To be implemented. |
|
| Method Summary | |
|---|---|
void |
addAttribute(String key,
Object value)
Add an attribute to the existing attribute set. |
void |
addDeletedFile(File file)
Adds a File to the set of Files that should be deleted
after the run. |
void |
addPostStagedFile(File src)
Add a single post stage file. |
void |
addPostStagedFile(File src,
File dest)
Add a single post stage file that should be post staged to the given destination. |
void |
addPreStagedFile(File src)
Add a single pre stage file. |
void |
addPreStagedFile(File src,
File dest)
Add a single pre stage file that should be pre staged to the given destination. |
void |
addWipedFile(File file)
Adds a File to the set of Files that should be wiped
after the run. |
Object |
clone()
|
boolean |
deletePostStaged()
Returns whether the Files in the post stage file set should be
deleted after the post staging. |
boolean |
deletePreStaged()
Returns whether the Files in the pre stage file set should be
deleted after the post staging. |
void |
enableStreamingStderr(boolean enabled)
Enable or disable streaming standard error. |
void |
enableStreamingStdin(boolean enabled)
Enable or disable streaming standard input. |
void |
enableStreamingStdout(boolean enabled)
Enable or disable streaming standard output. |
boolean |
equals(Object o)
Tests this SoftwareDescription for equality with the passed
Object. |
String[] |
getArguments()
Returns the arguments of the executable. |
Map<String,Object> |
getAttributes()
Gets the attributes of this SoftwareDescription. |
boolean |
getBooleanAttribute(String name,
boolean defaultVal)
Returns the boolean value of an attribute. |
List<File> |
getDeletedFiles()
Returns a List of the Files that should be deleted after
the run. |
Map<String,Object> |
getEnvironment()
Returns the environment of the executable. |
String |
getExecutable()
Returns the path to the executable. |
int |
getIntAttribute(String name,
int defaultVal)
Returns the int value of an attribute. |
String |
getJSDL()
to be implemented. |
long |
getLongAttribute(String name,
long defaultVal)
Returns the long value of an attribute. |
Object |
getObjectAttribute(String name)
Returns the Object value of an attribute. |
Map<File,File> |
getPostStaged()
Returns the post stage file set. |
Map<File,File> |
getPreStaged()
Returns the pre staged file set. |
File |
getStderr()
Returns the stderr File. |
File |
getStdin()
Returns the stdin File. |
File |
getStdout()
Returns the stdout File. |
String |
getStringAttribute(String name,
String defaultVal)
Returns the String value of an attribute. |
List<File> |
getWipedFiles()
Returns a List of the Files that should be wiped and
deleted after the run. |
int |
hashCode()
Returns the hashcode of this SoftwareDescription |
Object |
removeAttribute(String key)
Remove an attribute from the attribute set. |
void |
setArguments(String... arguments)
Sets the arguments of the executable. |
void |
setAttributes(Map<String,Object> attributes)
Set the attributes to the attributes specified in the Map. |
void |
setDeletePostStaged(boolean deletePostStaged)
Sets the value which is used to determine whether the Files in
the post stage file set should be deleted after the post staging. |
void |
setDeletePreStaged(boolean deletePreStaged)
Sets the value which is used to determine whether the Files in
the pre stage file set should be deleted after the post staging. |
void |
setEnvironment(Map<String,Object> environment)
Sets the environment of the executable. |
void |
setExecutable(String executable)
Sets the path to the executable. |
void |
setPostStaged(File... files)
Sets the post staged file set. |
void |
setPreStaged(File... files)
Sets the pre staged file set. |
void |
setStderr(File stderr)
Sets the stderr File. |
void |
setStdin(File stdin)
Sets the File where stdin is redirected from. |
void |
setStdout(File stdout)
Sets the stdout File. |
void |
setWipePostStaged(boolean wipePostStaged)
Sets the value which is used to determine whether the Files in
the post stage file set should be wiped after the post staging. |
void |
setWipePreStaged(boolean wipePreStaged)
Sets the value which is used to determine whether the Files in
the pre stage file set should be wiped after the post staging. |
boolean |
streamingStderrEnabled()
Returns whether streaming standard error is enabled. |
boolean |
streamingStdinEnabled()
Returns whether streaming standard input is enabled. |
boolean |
streamingStdoutEnabled()
Returns whether streaming standard output is enabled. |
String |
toString()
|
void |
toWrapper(GATContext context,
String wrapperFileName,
String exitValueFileName)
Do not use this method. |
boolean |
wipePostStaged()
Returns whether the Files in the post stage file set should be
wiped after the post staging. |
boolean |
wipePreStaged()
Returns whether the Files in the pre stage file set should be
wiped after the post staging. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DIRECTORY
public static final String HOST_COUNT
public static final String TIME_MAX
public static final String WALLTIME_MAX
public static final String CPUTIME_MAX
public static final String JOB_TYPE
public static final String JOB_QUEUE
public static final String PROJECT
public static final String DRY_RUN
public static final String MEMORY_MIN
public static final String MEMORY_MAX
public static final String SAVE_STATE
public static final String RESTART
public static final String STOP_ON_EXIT
public static final String SANDBOX_ROOT
public static final String SANDBOX_USEROOT
public static final String SANDBOX_DELETE
public static final String SANDBOX_PRESTAGE_STDIN
public static final String SANDBOX_POSTSTAGE_STDOUT
public static final String SANDBOX_POSTSTAGE_STDERR
| Constructor Detail |
|---|
public SoftwareDescription()
SoftwareDescription, which describes the application
you want to run.
public SoftwareDescription(String jsdlString)
jsdlString - public SoftwareDescription(Map<String,Object> attributes)
SoftwareDescription, which describes the application
you want to run.
attributes - See the comment above for a list of known attributes.| Method Detail |
|---|
public boolean equals(Object o)
SoftwareDescription for equality with the passed
Object. SoftwareDescriptions are equal if they have
equivalent entries in the description table.
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
SoftwareDescription
hashCode in class ObjectSoftwareDescriptionObject.hashCode()public String[] getArguments()
"/bin/cat hello world > out" it will return a
String[]{"hello", "world", ">", "out"}
public void setArguments(String... arguments)
"/bin/cat hello world" the String[]{"hello",
"world"} contains the arguments.
arguments - The commandline arguments to set.public Map<String,Object> getAttributes()
SoftwareDescription. This method
converts the well known attributes as listed in the table of
SoftwareDescription to their specific type (which means that if
an value can be a String or an Integer, it's cast to the non String
type).
public void setAttributes(Map<String,Object> attributes)
Map. This
will create a set of attributes only containing the attributes from the
Map. Use addAttribute to add attributes to an existing set of
attributes.
attributes - The attributes to set. See the comment above for a list of
known attributes. Note that some adaptors may also support
other attributes.
public void addAttribute(String key,
Object value)
key - the key of the attributevalue - the value of the attributepublic Object removeAttribute(String key)
key - the key of the attribute
public Map<String,Object> getEnvironment()
Map of environment variables with their
values (for instance the key, value pair "JAVA_HOME", "/path/to/java").
public void setEnvironment(Map<String,Object> environment)
Map of environment variables with their values (for
instance the key, value pair "JAVA_HOME", "/path/to/java").
environment - The environment to set.public String getExecutable()
"/bin/cat hello world > out" it will return a
String "/bin/cat".
public void setExecutable(String executable)
"/bin/cat hello world > out" the String "/bin/cat"
should be provided.
executable - The path to the executable.public Map<File,File> getPreStaged()
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.
public void setPreStaged(File... files)
Files can be added using the addPreStagedFile
methods. See these methods for a table stating at which locations the
Files will end up after the pre staging.
files - An array of files that should be pre staged.public void addPreStagedFile(File src)
addPreStagedFile(src, null).
src - the file that should be pre staged.
public void addPreStagedFile(File src,
File dest)
| source file | destination file | location after pre staging |
|---|---|---|
path/to/file
| null
| sandbox/file
|
path/to/file
| other/path/to/file
| sandbox/other/path/to/file
|
path/to/file
| /other/path/to/file
| /other/path/to/file
|
/path/to/file
| null
| sandbox/file
|
/path/to/file
| other/path/to/file
| sandbox/other/path/to/file
|
/path/to/file
| /other/path/to/file
| /other/path/to/file |
src - the File that should be pre staged (may not be
null)dest - the File that should exist after the pre staging
(may be null, see table).public Map<File,File> getPostStaged()
Files are the source
files on the execution site, the values are the Files with the
destination of the post staging. This method returns the files that
should be post staged regardless of whether they are already post staged
or not.
public void setPostStaged(File... files)
Files can be added using the addPostStagedFile
methods. See these methods for a table stating at which locations the
Files will end up after the post staging.
files - An array of files that should be pre staged.public void addPostStagedFile(File src)
addPostStagedFile(src, null).
src - the file that should be post staged.
public void addPostStagedFile(File src,
File dest)
| source file | destination file | location after post staging |
|---|---|---|
path/to/file
| null
| cwd/file
|
path/to/file
| other/path/to/file
| cwd/other/path/to/file
|
path/to/file
| /other/path/to/file
| /other/path/to/file
|
/path/to/file
| null
| cwd/file
|
/path/to/file
| other/path/to/file
| cwd/other/path/to/file
|
/path/to/file
| /other/path/to/file
| /other/path/to/file |
src - the File that should be post staged (may not be
null)dest - the File that should exist after the post staging
(may be null, see table).public List<File> getDeletedFiles()
List of the Files that should be deleted after
the run.
public void addDeletedFile(File file)
File to the set of Files that should be deleted
after the run. Normally the ResourceBroker will delete the
sandbox with all its contents after the run and it isn't necessary to
specify Files using this method to be deleted. However, there
are two cases where this method will be applicable.
First of all, Files outside the sandbox are not automatically
deleted by the ResourceBroker. Those Files should be
explicitly added to be deleted using this method.
Second, it's possible to specify that sandbox isn't deleted after the job run, using the attribute SANDBOX_DELETE set to "false". In the case that sandbox isn't deleted but some files inside the sandbox should be deleted, use this method.
file - the file to be deleted after the run.public List<File> getWipedFiles()
List of the Files that should be wiped and
deleted after the run.
public void addWipedFile(File file)
File to the set of Files that should be wiped
after the run. When a File gets deleted, it's possible that some
data that was in the file remains on the disk. To be sure these data is
also removed, the wiping of a File consists of first overwriting
the File, in order to delete the contents of the File. And then
deleting the File, in order to free up the disk space.
file - the file to be wiped (overwritten) and deleted after the
run.public File getStderr()
File.
Filepublic void enableStreamingStderr(boolean enabled)
enabled - true if streaming standard error should be
enabled, false otherwise.public boolean streamingStderrEnabled()
public void enableStreamingStdout(boolean enabled)
enabled - true if streaming standard output should be
enabled, false otherwise.public boolean streamingStdoutEnabled()
public void enableStreamingStdin(boolean enabled)
enabled - true if streaming standard input should be
enabled, false otherwise.public boolean streamingStdinEnabled()
public void setStderr(File stderr)
File. Note that stderr will be redirected to
either a File or a OutputStream. The last invocation of
setStderr() determines whether the destination of the
output.
stderr - The File where stderr is redirected to.public File getStdin()
File.
File.public void setStdin(File stdin)
File where stdin is redirected from.
stdin - The File where stdin is redirected from.public File getStdout()
File.
File.public void setStdout(File stdout)
File. Note that stdout will be redirected to
either a File or a OutputStream. The last invocation of
setStdout() determines whether the destination of the
output.
stdout - The File where stdout is redirected to.public String toString()
toString in class Objectpublic boolean deletePostStaged()
Files in the post stage file set should be
deleted after the post staging.
public void setDeletePostStaged(boolean deletePostStaged)
Files in
the post stage file set should be deleted after the post staging. (TRUE
if the post stage files should be deleted, FALSE if they shouldn't be
deleted).
deletePostStaged - delete the post stage Files after post staging.public boolean deletePreStaged()
Files in the pre stage file set should be
deleted after the post staging.
public void setDeletePreStaged(boolean deletePreStaged)
Files in
the pre stage file set should be deleted after the post staging. (TRUE if
the pre stage files should be deleted, FALSE if they shouldn't be
deleted).
deletePreStaged - delete the pre stage Files after post staging.public boolean wipePostStaged()
Files in the post stage file set should be
wiped after the post staging.
public void setWipePostStaged(boolean wipePostStaged)
Files in
the post stage file set should be wiped after the post staging. (TRUE if
the post stage files should be wiped, FALSE if they shouldn't be wiped).
wipePostStaged - wipe the post stage Files after post staging.public boolean wipePreStaged()
Files in the pre stage file set should be
wiped after the post staging.
public void setWipePreStaged(boolean wipePreStaged)
Files in
the pre stage file set should be wiped after the post staging. (TRUE if
the pre stage files should be wiped, FALSE if they shouldn't be wiped).
wipePreStaged - wipe the pre stage Files after post staging.
public int getIntAttribute(String name,
int defaultVal)
null) can be found for the given name,
the defaultVal is returned. If there exist a value for the
key, but this value cannot be parsed to an int, this method throws an
Error.
name - the key of the attributedefaultVal - the default value
name.
public long getLongAttribute(String name,
long defaultVal)
null) can be found for the given name,
the defaultVal is returned. If there exist a value for the
key, but this value cannot be parsed to a long, this method throws an
Error.
name - the key of the attributedefaultVal - the default value
name.
public String getStringAttribute(String name,
String defaultVal)
String value of an attribute. If no value (or the
value null) can be found for the given name,
the defaultVal is returned.
name - the key of the attributedefaultVal - the default value
String value of the attribute indicated by the
name.public Object getObjectAttribute(String name)
Object value of an attribute. If no value (or the
value null) can be found for the given name,
null is returned.
name - the key of the attribute
Object value of the attribute indicated by the
name.
public boolean getBooleanAttribute(String name,
boolean defaultVal)
null) can be found for the given name,
the defaultVal is returned. If there exist a value for the
key, but this value cannot be parsed to a boolean, this method throws an
Error.
name - the key of the attributedefaultVal - the default value
name.
public void toWrapper(GATContext context,
String wrapperFileName,
String exitValueFileName)
throws GATInvocationException
It creates a wrapper script out of this SoftwareDescription in
order to be able to retrieve the exit code of a Globus job, it stores the
output value in a file.
context - the GATContext used to create the wrapper filewrapperFileName - the wrapper file nameexitValueFileName - the file name where the exit value is written to
GATInvocationExceptionpublic Object clone()
clone in class Objectpublic String getJSDL()
SoftwareDescription
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||