wrench::Action

class Action : public std::enable_shared_from_this<Action>

An abstract class that implements the concept of an action.

Subclassed by wrench::ComputeAction, wrench::CustomAction, wrench::FileCopyAction, wrench::FileDeleteAction, wrench::FileReadAction, wrench::FileRegistryAction, wrench::FileWriteAction, wrench::MPIAction, wrench::SleepAction

Public Types

enum State

Action states.

Values:

enumerator NOT_READY

Not ready (not ready, because depends on other actions)

enumerator READY

Ready (ready to execute)

enumerator STARTED

Started (is being executed)

enumerator COMPLETED

Completed (successfully completed)

enumerator KILLED

Killed (due to user actions, service being terminated, etc.)

enumerator FAILED

Failed (has failed)

Public Functions

std::set<std::shared_ptr<Action>> getChildren()

Get the action’s children.

Returns:

a set of children

double getEndDate() const

Returns this action’s end date (-1.0 if not ended)

Returns:

a data

std::stack<Action::ActionExecution> &getExecutionHistory()

Retrieve the execution history.

Returns:

the execution history

std::shared_ptr<FailureCause> getFailureCause() const

Returns the action’s failure cause.

Returns:

aa failure cause

std::shared_ptr<CompoundJob> getJob() const

Returns the job this action belongs to.

Returns:

the job

virtual unsigned long getMaxNumCores() const

Get the maximum number of cores that can be used to execute the action.

Returns:

a number of cores

virtual unsigned long getMinNumCores() const

Get the minimum number of cores required to execute the action.

Returns:

a number of cores

virtual sg_size_t getMinRAMFootprint() const

Get the minimum required amount of RAM to execute the action.

Returns:

a number of bytes

const std::string &getName() const

Returns the action’s name.

Returns:

the name

std::set<std::shared_ptr<Action>> getParents()

Get the action’s parents.

Returns:

a set of parents

double getPriority() const

Get the action’s priority.

Returns:

a priority

inline std::shared_ptr<Action> getSharedPtr()

Get the shared pointer for this object.

Returns:

a shared pointer to the object

double getStartDate() const

Returns ths action’s started date (-1.0 if not started)

Returns:

a data

Action::State getState() const

Returns the action’s state.

Returns:

the state

std::string getStateAsString() const

Returns the action’s state as a human-readable string.

Returns:

a string

void setPriority(double priority)

Set the action’s priority.

Parameters:

p – a priority

virtual bool usesScratch() const

Determine whether the action uses scratch.

Returns:

true if the action uses scratch, false otherwise

Public Static Functions

static std::string getActionTypeAsString(const std::shared_ptr<Action> &action)

Returns an action’s type as a human-readable string.

Parameters:

action – the action

Returns:

the type as a string

static std::string stateToString(Action::State state)

Convert an action state to a human-readable string.

Parameters:

state – an action state

Returns:

a string

struct ActionExecution

A data structure that keeps track of an action’s execution(s)

Public Members

double end_date = -1.0

end date

std::string execution_host

execution host (could be a virtual host)

std::shared_ptr<FailureCause> failure_cause

Failure cause (if applicable)

unsigned long num_cores_allocated = 0

Number of allocated cores.

std::string physical_execution_host

physical execution host

sg_size_t ram_allocated = 0

RAM allocated cores.

double start_date = -1.0

start date

Action::State state

final state