WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
wrench::Job Class Reference

Abstraction of a job used for executing tasks in a Workflow. More...

#include <Job.h>

Inheritance diagram for wrench::Job:
wrench::CompoundJob wrench::PilotJob wrench::StandardJob

Public Member Functions

virtual ~Job ()
 Destructor.
 
simgrid::s4u::Mailbox * getCallbackMailbox ()
 Get the job's "next" callback mailbox, without popping it. More...
 
double getEndDate ()
 Get the date at which the job ended (<0 means "never submitted") More...
 
std::string getName ()
 Get the job's name. More...
 
simgrid::s4u::Mailbox * getOriginCallbackMailbox ()
 Get the "origin" callback mailbox. More...
 
std::shared_ptr< ComputeServicegetParentComputeService ()
 Get the compute service that is running /ran the job. More...
 
double getPriority () const
 Get the job's priority (the higher the priority value, the higher the priority) More...
 
std::map< std::string, std::string > & getServiceSpecificArguments ()
 Return the service-specific arguments that are used during job submission. More...
 
double getSubmitDate ()
 Get the date at which the job was last submitted (<0 means "never submitted") More...
 
simgrid::s4u::Mailbox * popCallbackMailbox ()
 Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty), and pops it. More...
 
void printCallbackMailboxStack ()
 Method to print the call back stack.
 
void pushCallbackMailbox (simgrid::s4u::Mailbox *mailbox)
 Pushes a callback mailbox. More...
 
void setParentComputeService (std::shared_ptr< ComputeService > compute_service)
 Set the parent compute service of the job. More...
 
virtual void setPriority (double priority)
 Set the job's priority (the higher the priority value, the higher the priority) More...
 

Protected Member Functions

 Job (std::string name, std::shared_ptr< JobManager > job_manager)
 Constructor. More...
 
unsigned long getNewUniqueNumber ()
 Generate a unique number (for each newly generated job) More...
 
void setServiceSpecificArguments (std::map< std::string, std::string > args)
 Sets the service-specific arguments that are used during job submission. More...
 

Protected Attributes

bool already_submitted_to_job_manager = false
 Whether the job has already been submitted to the job manager.
 
std::stack< simgrid::s4u::Mailbox * > callback_mailbox_stack
 Stack of callback mailboxes (to pop notifications)
 
double end_date
 The date at which the job ended (with success or failure)
 
std::shared_ptr< JobManagerjob_manager
 The Job Manager in charge of this job.
 
std::string name
 The job's name.
 
simgrid::s4u::Mailbox * originator_mailbox
 The originator's mailbox.
 
std::shared_ptr< ComputeServiceparent_compute_service
 The compute service to which the job was submitted.
 
double priority = 0.0
 The job's priority (the higher the number, the higher the priority)
 
std::map< std::string, std::string > service_specific_args
 Service-specific arguments used during job submission.
 
double submit_date
 The date at which the job was last submitted.
 

Detailed Description

Abstraction of a job used for executing tasks in a Workflow.

Constructor & Destructor Documentation

◆ Job()

wrench::Job::Job ( std::string  name,
std::shared_ptr< JobManager job_manager 
)
protected

Constructor.

Parameters
namejob name (if empty, a name will be chosen for you)
job_managermanager in charge of this job

Member Function Documentation

◆ getCallbackMailbox()

simgrid::s4u::Mailbox * wrench::Job::getCallbackMailbox ( )

Get the job's "next" callback mailbox, without popping it.

Returns
the next callback mailbox

◆ getEndDate()

double wrench::Job::getEndDate ( )

Get the date at which the job ended (<0 means "never submitted")

Returns
the end date

◆ getName()

std::string wrench::Job::getName ( )

Get the job's name.

Returns
the name as a string

◆ getNewUniqueNumber()

unsigned long wrench::Job::getNewUniqueNumber ( )
protected

Generate a unique number (for each newly generated job)

Returns
a unique number

◆ getOriginCallbackMailbox()

simgrid::s4u::Mailbox * wrench::Job::getOriginCallbackMailbox ( )

Get the "origin" callback mailbox.

Returns
the next callback mailbox

◆ getParentComputeService()

std::shared_ptr< ComputeService > wrench::Job::getParentComputeService ( )

Get the compute service that is running /ran the job.

Returns
a compute service

◆ getPriority()

double wrench::Job::getPriority ( ) const

Get the job's priority (the higher the priority value, the higher the priority)

Returns
the job's priority

◆ getServiceSpecificArguments()

std::map< std::string, std::string > & wrench::Job::getServiceSpecificArguments ( )

Return the service-specific arguments that are used during job submission.

Returns
a map of argument name/values

◆ getSubmitDate()

double wrench::Job::getSubmitDate ( )

Get the date at which the job was last submitted (<0 means "never submitted")

Returns
the submit date

◆ popCallbackMailbox()

simgrid::s4u::Mailbox * wrench::Job::popCallbackMailbox ( )

Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty), and pops it.

Returns
the next callback mailbox

◆ pushCallbackMailbox()

void wrench::Job::pushCallbackMailbox ( simgrid::s4u::Mailbox *  mailbox)

Pushes a callback mailbox.

Parameters
mailboxthe mailbox name

◆ setParentComputeService()

void wrench::Job::setParentComputeService ( std::shared_ptr< ComputeService compute_service)

Set the parent compute service of the job.

Parameters
compute_servicea compute service

◆ setPriority()

void wrench::Job::setPriority ( double  priority)
virtual

Set the job's priority (the higher the priority value, the higher the priority)

Parameters
prioritya priority

Reimplemented in wrench::CompoundJob.

◆ setServiceSpecificArguments()

void wrench::Job::setServiceSpecificArguments ( std::map< std::string, std::string >  args)
protected

Sets the service-specific arguments that are used during job submission.

Parameters
argsa map of argument name/values

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