SimGrid  3.13
Versatile Simulation of Distributed Systems
simgrid::surf::Action Class Reference

SURF action interface class. More...

#include <surf_interface.hpp>

Inheritance diagram for simgrid::surf::Action:
simgrid::surf::CpuAction simgrid::surf::NetworkAction simgrid::surf::StorageAction simgrid::surf::CpuCas01Action simgrid::surf::CpuTiAction simgrid::surf::L07Action simgrid::surf::NetworkCm02Action simgrid::surf::NetworkConstantAction simgrid::surf::NetworkNS3Action simgrid::surf::StorageN11Action

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_hookActionOptions
 
typedef boost::intrusive::list< Action, ActionOptionsActionList
 

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 ()
 Mark that the action is now finished. More...
 
Action::State getState ()
 Get the state of the current Action. More...
 
virtual void setState (Action::State state)
 Set the state of the current Action. More...
 
double getBound ()
 Get the bound of the current Action. More...
 
void setBound (double bound)
 Set the bound of the current Action. More...
 
double getStartTime ()
 Get the start time of the current action. More...
 
double getFinishTime ()
 Get the finish time of the current action. More...
 
voidgetData ()
 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 ()
 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 ()
 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 ()
 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 ()
 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 ()
 Get the priority of the current Action. More...
 
virtual void setPriority (double priority)
 Set the priority of the current Action. More...
 
ActionListgetStateSet ()
 Get the state set in which the action is. More...
 
simgrid::surf::ModelgetModel ()
 
virtual void updateRemainingLazy (double now)
 
void heapInsert (xbt_heap_t heap, double key, enum heap_action_type hat)
 
void heapRemove (xbt_heap_t heap)
 
void heapUpdate (xbt_heap_t heap, double key, enum heap_action_type hat)
 
void updateIndexHeap (int i)
 
lmm_variable_t getVariable ()
 
double getLastUpdate ()
 
void refreshLastUpdate ()
 
enum heap_action_type getHat ()
 
bool is_linked ()
 
void gapRemove ()
 

Public Attributes

boost::intrusive::list_member_hook action_hook
 
boost::intrusive::list_member_hook action_lmm_hook
 
s_xbt_swag_hookup_t stateHookup_ = {NULL,NULL}
 

Protected Attributes

ActionListstateSet_
 
double priority_ = 1.0
 priority (1.0 by default) More...
 
int refcount_ = 1
 
double remains_
 How much of that cost remains to be done in the currently running task. More...
 
double maxDuration_ = NO_MAX_DURATION
 
double finishTime_ = -1
 finish time : this is modified during the run and fluctuates until the task is completed More...
 
lmm_variable_t variable_ = nullptr
 
double lastValue_ = 0
 
double lastUpdate_ = 0
 
int suspended_ = 0
 
int indexHeap_
 
enum heap_action_type hat_ = NOTSET
 

Detailed Description

SURF action interface class.

An action is an event generated by a resource (e.g.: a communication for the network)

Member Typedef Documentation

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

Member Enumeration Documentation

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 ?

Constructor & Destructor Documentation

simgrid::surf::Action::Action ( simgrid::surf::Model model,
double  cost,
bool  failed 
)

Action constructor.

Parameters
modelThe Model associated to this Action
costThe cost of the Action
failedIf the action is impossible (e.g.: execute something on a switched off host)
simgrid::surf::Action::Action ( simgrid::surf::Model model,
double  cost,
bool  failed,
lmm_variable_t  var 
)

Action constructor.

Parameters
modelThe Model associated to this Action
costThe cost of the Action
failedIf the action is impossible (e.g.: execute something on a switched off host)
varThe lmm variable associated to this Action if it is part of a LMM component
simgrid::surf::Action::~Action ( )
virtual

Destructor.

Member Function Documentation

void simgrid::surf::Action::finish ( )

Mark that the action is now finished.

Action::State simgrid::surf::Action::getState ( )

Get the state of the current Action.

get the state

void simgrid::surf::Action::setState ( Action::State  state)
virtual
double simgrid::surf::Action::getBound ( )

Get the bound of the current Action.

void simgrid::surf::Action::setBound ( double  bound)

Set the bound of the current Action.

double simgrid::surf::Action::getStartTime ( )

Get the start time of the current action.

double simgrid::surf::Action::getFinishTime ( )

Get the finish time of the current action.

void* simgrid::surf::Action::getData ( )
inline

Get the user data associated to the current action.

void simgrid::surf::Action::setData ( void data)

Set the user data associated to the current action.

double simgrid::surf::Action::getCost ( )
inline

Get the cost of the current action.

void simgrid::surf::Action::setCost ( double  cost)
inline

Set the cost of the current action.

void simgrid::surf::Action::updateMaxDuration ( double  delta)
inline

Update the maximum duration of the current action.

Parameters
deltaAmount to remove from the MaxDuration
void simgrid::surf::Action::updateRemains ( double  delta)
inline

Update the remaining time of the current action.

Parameters
deltaAmount to remove from the remaining time
void simgrid::surf::Action::setRemains ( double  value)
inline

Set the remaining time of the current action.

double simgrid::surf::Action::getRemains ( )
virtual

Get the remaining time of the current action after updating the resource.

Reimplemented in simgrid::surf::CpuTiAction.

double simgrid::surf::Action::getRemainsNoUpdate ( )

Get the remaining time of the current action without updating the resource.

void simgrid::surf::Action::setFinishTime ( double  value)
inline

Set the finish time of the current action.

void simgrid::surf::Action::ref ( )

Add a reference to the current action (refcounting)

int simgrid::surf::Action::unref ( )
virtual

Unref that action (and destroy it if refcount reaches 0)

Returns
true if the action was destroyed and false if someone still has references on it

Reimplemented in simgrid::surf::L07Action, simgrid::surf::CpuTiAction, simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.

void simgrid::surf::Action::cancel ( )
virtual

Cancel the current Action if running.

Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.

void simgrid::surf::Action::suspend ( )
virtual
void simgrid::surf::Action::resume ( )
virtual
bool simgrid::surf::Action::isSuspended ( )
virtual

Returns true if the current action is running.

Reimplemented in simgrid::surf::StorageN11Action, and simgrid::surf::NetworkNS3Action.

double simgrid::surf::Action::getMaxDuration ( )
inline

Get the maximum duration of the current action.

void simgrid::surf::Action::setMaxDuration ( double  duration)
virtual

Set the maximum duration of the current Action.

Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.

char* simgrid::surf::Action::getCategory ( )
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.

double simgrid::surf::Action::getPriority ( )
inline

Get the priority of the current Action.

void simgrid::surf::Action::setPriority ( double  priority)
virtual

Set the priority of the current Action.

Reimplemented in simgrid::surf::CpuTiAction, and simgrid::surf::StorageN11Action.

ActionList* simgrid::surf::Action::getStateSet ( )
inline

Get the state set in which the action is.

simgrid::surf::Model* simgrid::surf::Action::getModel ( )
inline
void simgrid::surf::Action::updateRemainingLazy ( double  now)
virtual
void simgrid::surf::Action::heapInsert ( xbt_heap_t  heap,
double  key,
enum heap_action_type  hat 
)
void simgrid::surf::Action::heapRemove ( xbt_heap_t  heap)
void simgrid::surf::Action::heapUpdate ( xbt_heap_t  heap,
double  key,
enum heap_action_type  hat 
)
void simgrid::surf::Action::updateIndexHeap ( int  i)
lmm_variable_t simgrid::surf::Action::getVariable ( )
inline
double simgrid::surf::Action::getLastUpdate ( )
inline
void simgrid::surf::Action::refreshLastUpdate ( )
inline
enum heap_action_type simgrid::surf::Action::getHat ( )
inline
bool simgrid::surf::Action::is_linked ( )
inline
void simgrid::surf::Action::gapRemove ( )

Member Data Documentation

boost::intrusive::list_member_hook simgrid::surf::Action::action_hook
boost::intrusive::list_member_hook simgrid::surf::Action::action_lmm_hook
s_xbt_swag_hookup_t simgrid::surf::Action::stateHookup_ = {NULL,NULL}
ActionList* simgrid::surf::Action::stateSet_
protected
double simgrid::surf::Action::priority_ = 1.0
protected

priority (1.0 by default)

int simgrid::surf::Action::refcount_ = 1
protected
double simgrid::surf::Action::remains_
protected

How much of that cost remains to be done in the currently running task.

double simgrid::surf::Action::maxDuration_ = NO_MAX_DURATION
protected
double simgrid::surf::Action::finishTime_ = -1
protected

finish time : this is modified during the run and fluctuates until the task is completed

lmm_variable_t simgrid::surf::Action::variable_ = nullptr
protected
double simgrid::surf::Action::lastValue_ = 0
protected
double simgrid::surf::Action::lastUpdate_ = 0
protected
int simgrid::surf::Action::suspended_ = 0
protected
int simgrid::surf::Action::indexHeap_
protected
enum heap_action_type simgrid::surf::Action::hat_ = NOTSET
protected

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