ARC SDK
|
#include <arc/compute/JobDescription.h>
Public Member Functions | |
JobDescription (const JobDescription &j, bool withAlternatives=true) | |
JobDescription (const long int &ptraddr) | |
JobDescription & | operator= (const JobDescription &j) |
void | AddAlternative (const JobDescription &j) |
bool | HasAlternatives () const |
const std::list< JobDescription > & | GetAlternatives () const |
std::list< JobDescription > & | GetAlternatives () |
std::list< JobDescription > | GetAlternativesCopy () const |
bool | UseAlternative () |
void | UseOriginal () |
void | RemoveAlternatives () |
JobDescriptionResult | UnParse (std::string &product, std::string language, const std::string &dialect="") const |
Output contents in the specified language. More... | |
const std::string & | GetSourceLanguage () const |
Get input source language. More... | |
JobDescriptionResult | SaveToStream (std::ostream &out, const std::string &format) const |
Print job description to a std::ostream object. More... | |
bool | Prepare (const ExecutionTarget &et) |
Prepare for submission to target. More... | |
bool | Prepare () |
Static Public Member Functions | |
static JobDescriptionResult | Parse (const std::string &source, std::list< JobDescription > &jobdescs, const std::string &language="", const std::string &dialect="") |
Parse string into JobDescription objects. More... | |
static JobDescriptionResult | ParseFromFile (const std::string &filename, std::list< JobDescription > &jobdescs, const std::string &language="", const std::string &dialect="") |
static bool | GetTestJob (int testid, JobDescription &jobdescription) |
Data Fields | |
JobIdentificationType | Identification |
Structure for identification. More... | |
ApplicationType | Application |
Structure for apllication options. More... | |
ResourcesType | Resources |
Structure for resource requirements. More... | |
DataStagingType | DataStaging |
Structure for data staging. More... | |
std::map< std::string, std::string > | OtherAttributes |
Holds attributes not fitting into this class. More... | |
Friends | |
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.
|
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.
|
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.
source | |
jobdescs | |
language | |
dialect |
|
inline |
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.
et | ExecutionTarget object which to resolve software requirements against, and to pick up queue name from. |
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
out | a std::ostream reference specifying the ostream to write the job description to. |
format | specifies the format the job description should written in. |
JobDescriptionResult Arc::JobDescription::UnParse | ( | std::string & | product, |
std::string | language, | ||
const std::string & | dialect = "" |
||
) | const |
Output contents in the specified language.
product | |
language | |
dialect |
ApplicationType Arc::JobDescription::Application |
Structure for apllication options.
All options relating to the application is stored in this structure.
DataStagingType Arc::JobDescription::DataStaging |
Structure for data staging.
Input files requirements, and destinations for output files can be specified using this structure.
JobIdentificationType Arc::JobDescription::Identification |
Structure for identification.
This member object stores information which can be used to identify the job description.
std::map<std::string, std::string> Arc::JobDescription::OtherAttributes |
Holds attributes not fitting into this class.
This member is used by JobDescriptionParserPlugin classes to store attribute/value pairs not fitting into attributes stored in this class. The form of the attribute (the key in the map) should be as follows:
<language>;<attribute-name>
E.g.: "nordugrid:xrsl;hostname".
ResourcesType Arc::JobDescription::Resources |
Structure for resource requirements.
This structure specifies requirements which should be satisfied before application can be started.