wrench::Action
-
class wrench::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::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)
-
enumerator NOT_READY
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
an internal state
-
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 double 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
-
double getPriority() const
Get the action’s priority.
- Returns
a priority
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
-
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
priority – a priority
-
virtual bool usesScratch() const
Determine whether the action uses scratch.
- Returns
true if the action uses scratch, false otherwise
Public Static Functions
Returns an action’s type as a human-readable string.
- Parameters
action – the action
- Returns
the type as 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
-
double ram_allocated = 0
RAM allocated cores.
-
double start_date = -1.0
start date
-
double end_date = -1.0
-
enum State