Public Member Functions | Static Public Member Functions | Data Fields | Friends

#include <arc/compute/JobDescription.h>

Public Member Functions

 JobDescription (const JobDescription &j, bool withAlternatives=true)
 JobDescription (const long int &ptraddr)
JobDescriptionoperator= (const JobDescription &j)
 Testing. More...
void AddAlternative (const JobDescription &j)
 Add alternative job description. More...
bool HasAlternatives () const
 Has alternative job descriptions. More...
const std::list< JobDescription > & GetAlternatives () const
 Get list of alternative job descriptions. More...
std::list< JobDescription > & GetAlternatives ()
 Get list of alternative job descriptions (modifiable) More...
std::list< JobDescriptionGetAlternativesCopy () const
 Get a copy of the list of alternative job descriptions. More...
bool UseAlternative ()
 Fill next alternative into this object. More...
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...


class JobDescriptionParserPlugin

Detailed Description

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

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.

Member Function Documentation

◆ AddAlternative()

void Arc::JobDescription::AddAlternative ( const JobDescription j)

Add alternative job description.

[in]jJobDescription object to add as an alternative job description to this.

◆ GetAlternatives() [1/2]

const std::list<JobDescription>& Arc::JobDescription::GetAlternatives ( ) const

Get list of alternative job descriptions.

A const reference to the list of alternative job descriptions is returned.

◆ GetAlternatives() [2/2]

std::list<JobDescription>& Arc::JobDescription::GetAlternatives ( )

Get list of alternative job descriptions (modifiable)

A reference to the list of alternative job descriptions is returned.

◆ GetAlternativesCopy()

std::list<JobDescription> Arc::JobDescription::GetAlternativesCopy ( ) const

Get a copy of the list of alternative job descriptions.

A copy of the list of alternative job descriptions is returned.

◆ GetSourceLanguage()

const std::string& Arc::JobDescription::GetSourceLanguage ( ) const

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.

const std::string& source langauge of parsed input source.

◆ HasAlternatives()

bool Arc::JobDescription::HasAlternatives ( ) const

Has alternative job descriptions.

true if this job description has any alternative job descriptions

◆ operator=()

JobDescription& Arc::JobDescription::operator= ( const JobDescription j)


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 = "" 

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.

true if the passed string can be parsed successfully by any of the available parsers.

◆ Prepare()

bool Arc::JobDescription::Prepare ( const ExecutionTarget et)

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.

etExecutionTarget object which to resolve software requirements against, and to pick up queue name from.
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

true if writing the job description to the out object succeeds, otherwise false.
outa std::ostream reference specifying the ostream to write the job description to.
formatspecifies 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.


◆ UseAlternative()

bool Arc::JobDescription::UseAlternative ( )

Fill next alternative into this object.

The next alternative job description is filled into this object.

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.

Field Documentation

◆ Application

ApplicationType Arc::JobDescription::Application

Structure for apllication options.

All options relating to the application is stored in this structure.

◆ DataStaging

DataStagingType Arc::JobDescription::DataStaging

Structure for data staging.

Input files requirements, and destinations for output files can be specified using this structure.

◆ Identification

JobIdentificationType Arc::JobDescription::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

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:


E.g.: "nordugrid:xrsl;hostname".

Attribute mapping specific to this field/value.

◆ Resources

ResourcesType Arc::JobDescription::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: