Package org.globus.gram
Class GramAttributes
java.lang.Object
org.globus.rsl.RslAttributes
org.globus.gram.GramAttributes
A convienience class for operating on GRAM-specific RSL attributes.
Please note the attribute values for attributes such as setStdout,
setStderr, setStdin, setDirectory, setExecutable, etc. are treated
as single arguments. In case the value contains a RSL variable,
the variable will not be properly resolved. For example, if you
set the stdout to:
atts.setStdout("$(MY_URL)/bar"); atts.addEnvVariable("MY_URL", "http://foo");the resulting rsl will look like:
&("stdout"="$(MY_URL)/hello")("environment"=("MY_URL" "http://foo"))Since the "$(MY_URL)/hello" is in double quotes it will be treated as a single string and the variable will never be resolved. The parser will set "stdout" to "$(MY_URL)/hello" instead of "http://foo/hello".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields inherited from class org.globus.rsl.RslAttributes
rslTree
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, empty GramAttributes object.GramAttributes
(String rsl) Constructs a new GramAttributes object initialized with the specified RSL string.GramAttributes
(RslNode rslTree) Constructs a new GramAttributes object initialized with the specified RSL parse tree. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgument
(String argument) Adds a single argument.void
addEnvVariable
(String varName, String value) Adds an environment variable.boolean
deleteArgument
(String argument) Removes a specific argument from the argument list.boolean
deleteEnvVariable
(String varName) Removes a specific environment variable from the environment list.Returns a list of arguments.Return directory pathReturns a variable/value pair list of environment variables.Return executable nameint
Returns type of the job.int
Return the maximum cpu time limit set for the jobint
Return the maximum memory limit set for the jobint
Return the maximum wall time limit set for the jobint
Return the minimum memory limit set for the jobint
Return the number of processorsReturn the project name charged for this jobgetQueue()
Return the queue name used for this jobReturn the location used to redirect stderr on the submission machinegetStdin()
Return the location used to redirect stdin on the submission machineReturn the location used to redirect stdout on the submission machineboolean
isDryRun()
Checks if dryryn is enabled.void
setDirectory
(String directory) Specify the directory path the executable will be run invoid
setDryRun
(boolean enable) Sets the dryrun parameter.void
setExecutable
(String executable) Specify the name of the executable to runvoid
setJobType
(int jobType) Sets a job type.void
setMaxCPUTime
(int maxcputime) Specify the maximum cpu time limit for this jobvoid
setMaxMemory
(int maxmemory) Specify the maximum memory limit for this jobvoid
setMaxWallTime
(int maxwalltime) Specify the maximum wall time limit for this jobvoid
setMinMemory
(int minmemory) Specify the minimum memory limit for this jobvoid
setNumProcs
(int numprocs) Specify the nuber of processors to be used by the current executablevoid
setProject
(String project) Specify the project to be charged for this jobvoid
Specify the queue name to be used for this jobvoid
Specify the location to redirect stderr on the submission machinevoid
Specify the location to redirect stdin on the submission machinevoid
Specify the location to redirect stdout on the submission machineMethods inherited from class org.globus.rsl.RslAttributes
add, addMulti, addVariable, get, getFirstValue, getMap, getMulti, getRelation, getRslNode, getSingle, getVariables, remove, remove, removeMap, removeVariable, set, setMulti, toRSL
-
Field Details
-
JOBTYPE_SINGLE
public static final int JOBTYPE_SINGLE- See Also:
-
JOBTYPE_MULTIPLE
public static final int JOBTYPE_MULTIPLE- See Also:
-
JOBTYPE_MPI
public static final int JOBTYPE_MPI- See Also:
-
JOBTYPE_CONDOR
public static final int JOBTYPE_CONDOR- See Also:
-
-
Constructor Details
-
GramAttributes
public GramAttributes()Constructs a new, empty GramAttributes object. -
GramAttributes
Constructs a new GramAttributes object initialized with the specified RSL string.- Parameters:
rsl
- the rsl string to initialize the class with.- Throws:
ParseException
- if the rsl cannot be parsed.
-
GramAttributes
Constructs a new GramAttributes object initialized with the specified RSL parse tree.- Parameters:
rslTree
- the rsl parse tree to initialize the class with.
-
-
Method Details
-
setExecutable
Specify the name of the executable to run- Parameters:
executable
- the name of the executable
-
getExecutable
Return executable name- Returns:
- executable
-
setDirectory
Specify the directory path the executable will be run in- Parameters:
directory
- the directory path on the submission machine
-
getDirectory
Return directory path- Returns:
- directory
-
setStdout
Specify the location to redirect stdout on the submission machine- Parameters:
stdout
- the location to redirect stdout on the submission machine
-
getStdout
Return the location used to redirect stdout on the submission machine- Returns:
- stdout
-
setStderr
Specify the location to redirect stderr on the submission machine- Parameters:
stderr
- the location to redirect stderr on the submission machine
-
getStderr
Return the location used to redirect stderr on the submission machine- Returns:
- stderr
-
setStdin
Specify the location to redirect stdin on the submission machine- Parameters:
stdin
- the location to redirect stdin on the submission machine
-
getStdin
Return the location used to redirect stdin on the submission machine- Returns:
- stdin
-
setDryRun
public void setDryRun(boolean enable) Sets the dryrun parameter.- Parameters:
enable
- true to enable dryrun, false otherwise.
-
isDryRun
public boolean isDryRun()Checks if dryryn is enabled.- Returns:
- true only if dryrun is enabled. False, otherwise.
-
setQueue
Specify the queue name to be used for this job- Parameters:
queue
- the queue name to be used for this job
-
getQueue
Return the queue name used for this job- Returns:
- queue
-
setProject
Specify the project to be charged for this job- Parameters:
project
- the project to be charged for this job
-
getProject
Return the project name charged for this job- Returns:
- project
-
setJobType
public void setJobType(int jobType) Sets a job type.- Parameters:
jobType
- type of the job: One of the following: SINGLE, MULTIPLE, MPI, or CONDOR.
-
getJobType
public int getJobType()Returns type of the job.- Returns:
- job type. -1 if not set or job type is unknown.
-
setMinMemory
public void setMinMemory(int minmemory) Specify the minimum memory limit for this job- Parameters:
minmemory
- the minimum memory limit for this job
-
getMinMemory
public int getMinMemory()Return the minimum memory limit set for the job- Returns:
- minmemory
-
setNumProcs
public void setNumProcs(int numprocs) Specify the nuber of processors to be used by the current executable- Parameters:
numprocs
- the number of processors to use
-
getNumProcs
public int getNumProcs()Return the number of processors- Returns:
- numprocs
-
setMaxWallTime
public void setMaxWallTime(int maxwalltime) Specify the maximum wall time limit for this job- Parameters:
maxwalltime
- the maximum wall time limit for this job
-
getMaxWallTime
public int getMaxWallTime()Return the maximum wall time limit set for the job- Returns:
- maxwalltime
-
setMaxCPUTime
public void setMaxCPUTime(int maxcputime) Specify the maximum cpu time limit for this job- Parameters:
maxcputime
- the maximum cpu time limit for this job
-
getMaxCPUTime
public int getMaxCPUTime()Return the maximum cpu time limit set for the job- Returns:
- maxcputime
-
setMaxMemory
public void setMaxMemory(int maxmemory) Specify the maximum memory limit for this job- Parameters:
maxmemory
- the maximum memory limit for this job
-
getMaxMemory
public int getMaxMemory()Return the maximum memory limit set for the job- Returns:
- maxmemory
-
addArgument
Adds a single argument.- Parameters:
argument
- an argument to add. It will be treated as a single argument.
-
deleteArgument
Removes a specific argument from the argument list.- Parameters:
argument
- argument to remove.- Returns:
- true if the argument was removed, false otherwise.
-
getArguments
Returns a list of arguments.- Returns:
- list of arguments.
-
addEnvVariable
Adds an environment variable.- Parameters:
varName
- the variable name.value
- the value of the variable.
-
deleteEnvVariable
Removes a specific environment variable from the environment list.- Parameters:
varName
- name of the variable to remove.- Returns:
- true if the environment variables was removed, false otherwise.
-
getEnvironment
Returns a variable/value pair list of environment variables.- Returns:
- the association list of environment variables.
-