ARC SDK
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Friends
Arc::Job Class Reference

Job. More...

#include <arc/compute/Job.h>

Public Types

enum  ResourceType {
  STDIN, STDOUT, STDERR, STAGEINDIR,
  STAGEOUTDIR, SESSIONDIR, JOBLOG, JOBDESCRIPTION
}
 

Public Member Functions

 Job ()
 Create a Job object. More...
 
 Job (const Job &job)
 
 Job (XMLNode job)
 
void SaveToStream (std::ostream &out, bool longlist) const
 Write job information to a std::ostream object. More...
 
void SaveToStreamJSON (std::ostream &out, bool longlist) const
 
Joboperator= (XMLNode job)
 Set Job attributes from a XMLNode. More...
 
Joboperator= (const Job &job)
 
int operator== (const Job &other)
 
void SetFromXML (XMLNode job)
 Set Job attributes from a XMLNode representing GLUE2 ComputingActivity. More...
 
void ToXML (XMLNode job) const
 Add job information to a XMLNode. More...
 
bool PrepareHandler (const UserConfig &uc)
 
bool Update ()
 
bool Clean ()
 
bool Cancel ()
 
bool Resume ()
 
bool Renew ()
 
bool GetURLToResource (ResourceType resource, URL &url) const
 
bool Retrieve (const UserConfig &uc, const URL &destination, bool force) const
 

Static Public Member Functions

static bool CopyJobFile (const UserConfig &uc, const URL &src, const URL &dst)
 
static bool ListFilesRecursive (const UserConfig &uc, const URL &dir, std::list< std::string > &files)
 
static bool CompareJobID (const Job &a, const Job &b)
 
static bool CompareSubmissionTime (const Job &a, const Job &b)
 
static bool CompareJobName (const Job &a, const Job &b)
 
static bool ReadJobIDsFromFile (const std::string &filename, std::list< std::string > &jobids, unsigned nTries=10, unsigned tryInterval=500000)
 Read a list of Job IDs from a file, and append them to a list. More...
 
static bool WriteJobIDToFile (const std::string &jobid, const std::string &filename, unsigned nTries=10, unsigned tryInterval=500000)
 Append a jobID to a file. More...
 
static bool WriteJobIDsToFile (const std::list< std::string > &jobids, const std::string &filename, unsigned nTries=10, unsigned tryInterval=500000)
 Append list of URLs to a file. More...
 
static bool WriteJobIDsToFile (const std::list< Job > &jobs, const std::string &filename, unsigned nTries=10, unsigned tryInterval=500000)
 

Data Fields

std::string JobID
 
std::string Name
 
URL ServiceInformationURL
 
std::string ServiceInformationInterfaceName
 
URL JobStatusURL
 
std::string JobStatusInterfaceName
 
URL JobManagementURL
 
std::string JobManagementInterfaceName
 
URL StageInDir
 
URL StageOutDir
 
URL SessionDir
 
std::string Type
 
std::string IDFromEndpoint
 
std::string LocalIDFromManager
 
std::string JobDescription
 Language of job description describing job. More...
 
std::string JobDescriptionDocument
 Job description document describing job. More...
 
JobState State
 
JobState RestartState
 
int ExitCode
 
std::string ComputingManagerExitCode
 
std::list< std::string > Error
 
int WaitingPosition
 
std::string UserDomain
 
std::string Owner
 
std::string LocalOwner
 
Period RequestedTotalWallTime
 
Period RequestedTotalCPUTime
 
int RequestedSlots
 
std::list< std::string > RequestedApplicationEnvironment
 
std::string StdIn
 
std::string StdOut
 
std::string StdErr
 
std::string LogDir
 
std::list< std::string > ExecutionNode
 
std::string Queue
 
Period UsedTotalWallTime
 
Period UsedTotalCPUTime
 
int UsedMainMemory
 
Time LocalSubmissionTime
 
Time SubmissionTime
 
Time ComputingManagerSubmissionTime
 
Time StartTime
 
Time ComputingManagerEndTime
 
Time EndTime
 
Time WorkingAreaEraseTime
 
Time ProxyExpirationTime
 
std::string SubmissionHost
 
std::string SubmissionClientName
 
Time CreationTime
 
Period Validity
 
std::list< std::string > OtherMessages
 
std::list< std::string > ActivityOldID
 
std::map< std::string, std::string > LocalInputFiles
 
std::list< std::string > DelegationID
 

Friends

class JobSupervisor
 

Detailed Description

Job.

This class describe a Grid job. The class contains public accessible member attributes and methods for dealing with a Grid job. Most of the member attributes contained in this class are directly linked to the ComputingActivity defined in the GLUE Specification v. 2.0 (GFD-R-P.147).

Constructor & Destructor Documentation

◆ Job()

Arc::Job::Job ( )

Create a Job object.

Default constructor. Takes no arguments.

Member Function Documentation

◆ operator=()

Job& Arc::Job::operator= ( XMLNode  job)

Set Job attributes from a XMLNode.

The attributes of the Job object is set to the values specified in the XMLNode. The XMLNode should be a ComputingActivity type using the GLUE2 XML hierarchical rendering, see http://forge.gridforum.org/sf/wiki/do/viewPage/projects.glue-wg/wiki/GLUE2XMLSchema for more information. Note that associations are not parsed.

Parameters
jobis a XMLNode of GLUE2 ComputingActivity type.
See also
ToXML
Python interface deviation
Method is unavailable in Python interface

◆ ReadJobIDsFromFile()

static bool Arc::Job::ReadJobIDsFromFile ( const std::string &  filename,
std::list< std::string > &  jobids,
unsigned  nTries = 10,
unsigned  tryInterval = 500000 
)
static

Read a list of Job IDs from a file, and append them to a list.

This static method will read job IDs from the given file, and append the strings to the string list given as parameter. File locking will be done as described for the ReadAllJobsFromFile method. It returns false if the file was not readable, true otherwise, even if there were no IDs in the file. The lines of the file will be trimmed, and lines starting with # will be ignored.

Parameters
filenameis the filename of the jobidfile
jobidsis a list of strings, to which the IDs read from the file will be appended
nTriesspecifies the maximal number of times the method will try to acquire a lock on file to read.
tryIntervalspecifies the interval (in micro seconds) between each attempt to acquire a lock.
Returns
true in case of success, otherwise false.

◆ SaveToStream()

void Arc::Job::SaveToStream ( std::ostream &  out,
bool  longlist 
) const

Write job information to a std::ostream object.

This method will write job information to the passed std::ostream object. The longlist boolean specifies whether more (true) or less (false) information should be printed.

Parameters
outis the std::ostream object to print the attributes to.
longlistis a boolean for switching on long listing (more details).

◆ SetFromXML()

void Arc::Job::SetFromXML ( XMLNode  job)

Set Job attributes from a XMLNode representing GLUE2 ComputingActivity.

Because job XML representation follows GLUE2 model this method is similar to operator=(XMLNode). But it only covers job attributes which are part of GLUE2 computing activity. Also it treats Job object as being iextended with information provided by XMLNode. Contrary operator=(XMLNode) fully reinitializes Job, hence removing any associations to other objects.

◆ ToXML()

void Arc::Job::ToXML ( XMLNode  job) const

Add job information to a XMLNode.

Child nodes of GLUE ComputingActivity type containing job information of this object will be added to the passed XMLNode.

Parameters
jobis the XMLNode to add job information to in form of GLUE2 ComputingActivity type child nodes.
See also
operator=

◆ WriteJobIDsToFile()

static bool Arc::Job::WriteJobIDsToFile ( const std::list< std::string > &  jobids,
const std::string &  filename,
unsigned  nTries = 10,
unsigned  tryInterval = 500000 
)
static

Append list of URLs to a file.

This static method will put the ID given as a string, and append it to the given file. File locking will be done as described for the ReadAllJobsFromFile method. It returns false if the file was not writable, true otherwise.

Parameters
jobidsis a list of URL objects to be written to file
filenameis the filename of file, where the URL objects will be appended to.
nTriesspecifies the maximal number of times the method will try to acquire a lock on file to read.
tryIntervalspecifies the interval (in micro seconds) between each attempt to acquire a lock.
Returns
true in case of success, otherwise false.

◆ WriteJobIDToFile()

static bool Arc::Job::WriteJobIDToFile ( const std::string &  jobid,
const std::string &  filename,
unsigned  nTries = 10,
unsigned  tryInterval = 500000 
)
static

Append a jobID to a file.

This static method will put the ID represented by a URL object, and append it to the given file. File locking will be done as described for the ReadAllJobsFromFile method. It returns false if the file is not writable, true otherwise.

Parameters
jobidis a jobID as a URL object
filenameis the filename of the jobidfile, where the jobID will be appended
nTriesspecifies the maximal number of times the method will try to acquire a lock on file to read.
tryIntervalspecifies the interval (in micro seconds) between each attempt to acquire a lock.
Returns
true in case of success, otherwise false.

Field Documentation

◆ DelegationID

std::list<std::string> Arc::Job::DelegationID

This member is not a part of GLUE2.

Since
Added in 4.1.0.

◆ JobDescription

std::string Arc::Job::JobDescription

Language of job description describing job.

Equivalent to the GLUE2 ComputingActivity entity JobDescription (open enumeration), which here is represented by a string.

◆ JobDescriptionDocument

std::string Arc::Job::JobDescriptionDocument

Job description document describing job.

No GLUE2 entity equivalent. Should hold the job description document which was submitted to the computing service for this job.


The documentation for this class was generated from the following file: