SimGrid
3.18
Versatile Simulation of Distributed Systems
|
SURF action interface class.
An action is an event generated by a resource (e.g.: a communication for the network)
#include <surf_interface.hpp>
Public Types | |
enum | State { State::ready = 0, State::running, State::failed, State::done, State::to_free, State::not_in_the_system } |
typedef boost::intrusive::member_hook< Action, boost::intrusive::list_member_hook<>, &Action::action_hook > | ActionOptions |
typedef boost::intrusive::list< Action, ActionOptions > | ActionList |
Public Member Functions | |
Action (simgrid::surf::Model *model, double cost, bool failed) | |
Action constructor. More... | |
Action (simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var) | |
Action constructor. More... | |
virtual | ~Action () |
Destructor. More... | |
void | finish (Action::State state) |
Mark that the action is now finished. More... | |
Action::State | getState () const |
Get the state of the current Action. More... | |
virtual void | setState (Action::State state) |
Set the state of the current Action. More... | |
double | getBound () const |
Get the bound of the current Action. More... | |
void | setBound (double bound) |
Set the bound of the current Action. More... | |
double | getStartTime () const |
Get the start time of the current action. More... | |
double | getFinishTime () const |
Get the finish time of the current action. More... | |
void * | getData () const |
Get the user data associated to the current action. More... | |
void | setData (void *data) |
Set the user data associated to the current action. More... | |
double | getCost () const |
Get the cost of the current action. More... | |
void | setCost (double cost) |
Set the cost of the current action. More... | |
void | updateMaxDuration (double delta) |
Update the maximum duration of the current action. More... | |
void | updateRemains (double delta) |
Update the remaining time of the current action. More... | |
void | setRemains (double value) |
Set the remaining time of the current action. More... | |
virtual double | getRemains () |
Get the remaining time of the current action after updating the resource. More... | |
double | getRemainsNoUpdate () const |
Get the remaining time of the current action without updating the resource. More... | |
void | setFinishTime (double value) |
Set the finish time of the current action. More... | |
void | ref () |
Add a reference to the current action (refcounting) More... | |
virtual int | unref () |
Unref that action (and destroy it if refcount reaches 0) More... | |
virtual void | cancel () |
Cancel the current Action if running. More... | |
virtual void | suspend () |
Suspend the current Action. More... | |
virtual void | resume () |
Resume the current Action. More... | |
virtual bool | isSuspended () |
Returns true if the current action is running. More... | |
double | getMaxDuration () const |
Get the maximum duration of the current action. More... | |
virtual void | setMaxDuration (double duration) |
Set the maximum duration of the current Action. More... | |
char * | getCategory () const |
Get the tracing category associated to the current action. More... | |
void | setCategory (const char *category) |
Set the tracing category of the current Action. More... | |
double | getPriority () const |
Get the priority of the current Action. More... | |
virtual void | setSharingWeight (double priority) |
Set the priority of the current Action. More... | |
void | setSharingWeightNoUpdate (double weight) |
ActionList * | getStateSet () const |
Get the state set in which the action is. More... | |
simgrid::surf::Model * | getModel () const |
virtual void | updateRemainingLazy (double now) |
void | heapInsert (heap_type &heap, double key, enum heap_action_type hat) |
void | heapRemove (heap_type &heap) |
void | heapUpdate (heap_type &heap, double key, enum heap_action_type hat) |
void | clearHeapHandle () |
lmm_variable_t | getVariable () const |
void | setVariable (lmm_variable_t var) |
double | getLastUpdate () const |
void | refreshLastUpdate () |
double | getLastValue () const |
void | setLastValue (double val) |
enum heap_action_type | getHat () const |
bool | is_linked () const |
Public Attributes | |
boost::intrusive::list_member_hook | action_hook |
boost::intrusive::list_member_hook | action_lmm_hook |
Protected Attributes | |
ActionList * | stateSet_ |
int | refcount_ = 1 |
int | suspended_ = 0 |
typedef boost::intrusive::member_hook< Action, boost::intrusive::list_member_hook<>, &Action::action_hook> simgrid::surf::Action::ActionOptions |
typedef boost::intrusive::list<Action, ActionOptions> simgrid::surf::Action::ActionList |
|
strong |
Enumerator | |
---|---|
ready | Ready. |
running | Running. |
failed | Task Failure. |
done | Completed. |
to_free | Action to free in next cleanup. |
not_in_the_system | Not in the system anymore. Why did you ask ? |
simgrid::surf::Action::Action | ( | simgrid::surf::Model * | model, |
double | cost, | ||
bool | failed | ||
) |
simgrid::surf::Action::Action | ( | simgrid::surf::Model * | model, |
double | cost, | ||
bool | failed, | ||
lmm_variable_t | var | ||
) |
|
virtual |
Destructor.
void simgrid::surf::Action::finish | ( | Action::State | state | ) |
Action::State simgrid::surf::Action::getState | ( | ) | const |
|
virtual |
Set the state of the current Action.
Reimplemented in simgrid::surf::NetworkAction, simgrid::surf::StorageAction, simgrid::surf::CpuAction, and simgrid::surf::CpuTiAction.
double simgrid::surf::Action::getBound | ( | ) | const |
Get the bound of the current Action.
|
inline |
Get the start time of the current action.
|
inline |
Get the finish time of the current action.
|
inline |
Get the user data associated to the current action.
Set the user data associated to the current action.
|
inline |
Get the cost of the current action.
|
inline |
Set the cost of the current action.
|
inline |
Update the maximum duration of the current action.
delta | Amount to remove from the MaxDuration |
|
inline |
Update the remaining time of the current action.
delta | Amount to remove from the remaining time |
|
inline |
Set the remaining time of the current action.
|
virtual |
Get the remaining time of the current action after updating the resource.
Reimplemented in simgrid::surf::CpuTiAction.
|
inline |
Get the remaining time of the current action without updating the resource.
|
inline |
Set the finish time of the current action.
void simgrid::surf::Action::ref | ( | ) |
Add a reference to the current action (refcounting)
|
virtual |
Unref that action (and destroy it if refcount reaches 0)
Reimplemented in simgrid::surf::L07Action, simgrid::surf::CpuTiAction, simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.
|
virtual |
Cancel the current Action if running.
Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.
|
virtual |
Suspend the current Action.
Reimplemented in simgrid::surf::CpuAction, simgrid::surf::CpuTiAction, simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.
|
virtual |
Resume the current Action.
Reimplemented in simgrid::surf::CpuAction, simgrid::surf::CpuTiAction, simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.
|
virtual |
Returns true if the current action is running.
Reimplemented in simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.
|
inline |
Get the maximum duration of the current action.
|
virtual |
Set the maximum duration of the current Action.
Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.
|
inline |
Get the tracing category associated to the current action.
void simgrid::surf::Action::setCategory | ( | const char * | category | ) |
Set the tracing category of the current Action.
|
inline |
Get the priority of the current Action.
|
virtual |
Set the priority of the current Action.
Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.
|
inline |
|
inline |
Get the state set in which the action is.
|
inline |
|
inlinevirtual |
Reimplemented in simgrid::surf::CpuAction, and simgrid::surf::NetworkCm02Action.
void simgrid::surf::Action::heapInsert | ( | heap_type & | heap, |
double | key, | ||
enum heap_action_type | hat | ||
) |
void simgrid::surf::Action::heapUpdate | ( | heap_type & | heap, |
double | key, | ||
enum heap_action_type | hat | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
boost::intrusive::list_member_hook simgrid::surf::Action::action_hook |
boost::intrusive::list_member_hook simgrid::surf::Action::action_lmm_hook |
|
protected |
|
protected |
|
protected |