#include <arc/compute/JobDescription.h>
|
class | JobDescriptionParserPlugin |
|
The JobDescription class is the internal representation of a job description in the ARC-lib. It is structured into a number of other classes/objects which should strictly follow the description given in the job description document http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/doc/tech_doc/client/job_description.odt.
The class consist of a parsing method JobDescription::Parse which tries to parse the passed source using a number of different parsers. The parser method is complemented by the JobDescription::UnParse method, a method to generate a job description document in one of the supported formats. Additionally the internal representation is contained in public members which makes it directly accessible and modifiable from outside the scope of the class.
◆ AddAlternative()
Add alternative job description.
- Parameters
-
[in] | j | JobDescription object to add as an alternative job description to this. |
◆ GetAlternatives() [1/2]
const std::list<JobDescription>& Arc::JobDescription::GetAlternatives |
( |
| ) |
const |
|
inline |
Get list of alternative job descriptions.
- Returns
- A const reference to the list of alternative job descriptions is returned.
◆ GetAlternatives() [2/2]
Get list of alternative job descriptions (modifiable)
- Returns
- A reference to the list of alternative job descriptions is returned.
◆ GetAlternativesCopy()
std::list<JobDescription> Arc::JobDescription::GetAlternativesCopy |
( |
| ) |
const |
|
inline |
Get a copy of the list of alternative job descriptions.
- Returns
- A copy of the list of alternative job descriptions is returned.
◆ GetSourceLanguage()
const std::string& Arc::JobDescription::GetSourceLanguage |
( |
| ) |
const |
|
inline |
Get input source language.
If this object was created by a JobDescriptionParserPlugin, then this method returns a string which indicates the job description language of the parsed source. If not created by a JobDescripionParser the string returned is empty.
- Returns
- const std::string& source langauge of parsed input source.
◆ HasAlternatives()
bool Arc::JobDescription::HasAlternatives |
( |
| ) |
const |
|
inline |
Has alternative job descriptions.
- Returns
- true if this job description has any alternative job descriptions
◆ operator=()
Testing.
- Python interface deviation
- Method is unavailable in Python interface
◆ Parse()
static JobDescriptionResult Arc::JobDescription::Parse |
( |
const std::string & |
source, |
|
|
std::list< JobDescription > & |
jobdescs, |
|
|
const std::string & |
language = "" , |
|
|
const std::string & |
dialect = "" |
|
) |
| |
|
static |
Parse string into JobDescription objects.
The passed string will be tried parsed into the list of JobDescription objects. The available specialized JobDesciptionParser classes will be tried one by one, parsing the string, and if one succeeds the list of JobDescription objects is filled with the parsed contents and true is returned, otherwise false is returned. If no language specified, each JobDescriptionParserPlugin will try all its supported languages. On the other hand if a language is specified, only the JobDescriptionParserPlugin supporting that language will be tried. A dialect can also be specified, which only has an effect on the parsing if the JobDescriptionParserPlugin supports that dialect.
- Parameters
-
source | |
jobdescs | |
language | |
dialect | |
- Returns
- true if the passed string can be parsed successfully by any of the available parsers.
◆ Prepare()
Prepare for submission to target.
The Prepare method, is used to check and adapt the JobDescription object to the passed ExecutionTarget object before submitting the job description to the target. This method is normally called by SubmitterPlugin plugin classes, before submitting the job description. First the method checks the DataStaging.InputFiles list, for identical file names, and non-existent local input files. If any of such files are found, the method returns false. Then if the Application.Executable and Application.Input objects are specified as local input files, and they are not among the files in the DataStaging.InputFiles list a existence check will be done and if not found, false will be returned, otherwise they will be added to the list. Likewise if the Application.Output, Application.Error and Application.LogDir attributes have been specified, and is not among the files in the DataStaging.OutputFiles list, they will be added to this list. After the file check, the Resources.RunTimeEnvironment, Resources.CEType and Resources.OperatingSystem SoftwareRequirement objects are respectively resolved against the ExecutionTarget::ApplicationEnvironments, ExecutionTarget::Implementation and ExecutionTarget::OperatingSystem Software objects using the SoftwareRequirement::selectSoftware method. If that method returns false i.e. unable to resolve the requirements false will be returned. After resolving software requirements, the value of the Resources.QueueName attribute will be set to that of the ExecutionTarget::ComputingShareName attribute, and then true is returned.
- Parameters
-
et | ExecutionTarget object which to resolve software requirements against, and to pick up queue name from. |
- Returns
- false is returned is file checks fails, or if unable to resolve software requirements.
◆ SaveToStream()
JobDescriptionResult Arc::JobDescription::SaveToStream |
( |
std::ostream & |
out, |
|
|
const std::string & |
format |
|
) |
| const |
Print job description to a std::ostream object.
The job description will be written to the passed std::ostream object out in the format indicated by the format parameter. The format parameter should specify the format of one of the job description languages supported by the library. Or by specifying the special "user" or "userlong" format the job description will be written as a attribute/value pair list with respectively less or more attributes.
The mote
- Returns
- true if writing the job description to the out object succeeds, otherwise false.
- Parameters
-
out | a std::ostream reference specifying the ostream to write the job description to. |
format | specifies the format the job description should written in. |
◆ UnParse()
JobDescriptionResult Arc::JobDescription::UnParse |
( |
std::string & |
product, |
|
|
std::string |
language, |
|
|
const std::string & |
dialect = "" |
|
) |
| const |
Output contents in the specified language.
- Parameters
-
- Returns
◆ UseAlternative()
bool Arc::JobDescription::UseAlternative |
( |
| ) |
|
Fill next alternative into this object.
The next alternative job description is filled into this object.
- Returns
- If there is a next alternative then it is filled into this object and true is returned. If there is no next false is returned.
◆ Application
Structure for apllication options.
All options relating to the application is stored in this structure.
◆ DataStaging
Structure for data staging.
Input files requirements, and destinations for output files can be specified using this structure.
◆ Identification
Structure for identification.
This member object stores information which can be used to identify the job description.
◆ OtherAttributes
std::map<std::string, std::string> Arc::JobDescription::OtherAttributes |
◆ Resources
Structure for resource requirements.
This structure specifies requirements which should be satisfied before application can be started.
The documentation for this class was generated from the following file: