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

A class that implements a compute action. More...

#include <ComputeAction.h>

Inheritance diagram for wrench::ComputeAction:
wrench::Action

Public Member Functions

double getFlops () const
 Returns the action's flops. More...
 
unsigned long getMaxNumCores () const override
 Returns the action's maximum number of required cores. More...
 
unsigned long getMinNumCores () const override
 Returns the action's minimum number of required cores. More...
 
double getMinRAMFootprint () const override
 Returns the action's minimum required memory footprint. More...
 
std::shared_ptr< ParallelModelgetParallelModel () const
 Returns the action's parallel model. More...
 
- Public Member Functions inherited from wrench::Action
std::set< std::shared_ptr< Action > > getChildren ()
 Get the action's children. More...
 
double getEndDate () const
 Returns this action's end date (-1.0 if not ended) More...
 
std::stack< Action::ActionExecution > & getExecutionHistory ()
 Retrieve the execution history. More...
 
std::shared_ptr< FailureCausegetFailureCause () const
 Returns the action's failure cause. More...
 
std::shared_ptr< CompoundJobgetJob () const
 Returns the job this action belongs to. More...
 
const std::string & getName () const
 Returns the action's name. More...
 
std::set< std::shared_ptr< Action > > getParents ()
 Get the action's parents. More...
 
double getPriority () const
 Get the action's priority. More...
 
std::shared_ptr< ActiongetSharedPtr ()
 Get the shared pointer for this object. More...
 
double getStartDate () const
 Returns ths action's started date (-1.0 if not started) More...
 
Action::State getState () const
 Returns the action's state. More...
 
std::string getStateAsString () const
 Returns the action's state as a human-readable string. More...
 
void setPriority (double priority)
 Set the action's priority. More...
 
void setSimulateComputationAsSleep (bool simulate_computation_as_sleep)
 Set whether simulation should be simulated as sleep (default = false) More...
 
void setThreadCreationOverhead (double overhead_in_seconds)
 Set the thread creation overhead (default = zero) More...
 
virtual bool usesScratch () const
 Determine whether the action uses scratch. More...
 

Protected Member Functions

 ComputeAction (std::string name, std::shared_ptr< CompoundJob > job, double flops, double ram, unsigned long min_core, unsigned long max_core, std::shared_ptr< ParallelModel > parallel_model)
 Constructor. More...
 
void execute (std::shared_ptr< ActionExecutor > action_executor) override
 Method to execute the task. More...
 
void terminate (std::shared_ptr< ActionExecutor > action_executor) override
 Method called when the task terminates. More...
 
- Protected Member Functions inherited from wrench::Action
 Action (const std::string &name, const std::string &prefix, std::shared_ptr< CompoundJob > job)
 Constructor. More...
 
void newExecution (Action::State state)
 Create a new execution data structure (e.g., after a restart) More...
 
void setEndDate (double date)
 Sets the action's end date. More...
 
void setExecutionHost (std::string host)
 Sets the action's execution hosts (and the action's physical execution host) More...
 
void setFailureCause (std::shared_ptr< FailureCause > failure_cause)
 Sets the action's failure cause. More...
 
void setNumCoresAllocated (unsigned long num_cores)
 Sets the action's allocated number of cores. More...
 
void setRAMAllocated (double ram)
 Sets the action's allocated RAM. More...
 
void setStartDate (double date)
 Sets the action's start date. More...
 
void setState (Action::State new_state)
 Sets the action's state to a new value. More...
 
void updateState ()
 Update the action's state.
 

Additional Inherited Members

- Public Types inherited from wrench::Action
enum  State {
  NOT_READY, READY, STARTED, COMPLETED,
  KILLED, FAILED
}
 Action states. More...
 
- Static Public Member Functions inherited from wrench::Action
static std::string getActionTypeAsString (const std::shared_ptr< Action > &action)
 Returns an action's type as a human-readable string. More...
 
static std::string stateToString (Action::State state)
 Convert an action state to a human-readable string. More...
 
- Protected Attributes inherited from wrench::Action
bool simulate_computation_as_sleep
 Whether to simulate the computation as sleep.
 
double thread_creation_overhead
 The thread creation overhead in seconds.
 

Detailed Description

A class that implements a compute action.

Constructor & Destructor Documentation

◆ ComputeAction()

wrench::ComputeAction::ComputeAction ( std::string  name,
std::shared_ptr< CompoundJob job,
double  flops,
double  ram,
unsigned long  min_num_cores,
unsigned long  max_num_cores,
std::shared_ptr< ParallelModel parallel_model 
)
protected

Constructor.

Parameters
namethe action's name (if empty, a unique name will be picked)
jobthe job this action belongs to
flopsthe number of flops to perform
ramthe ram that is required
min_num_coresthe minimum number of cores that can be used
max_num_coresthe maximum number of cores that can be used
parallel_modelthe parallel model (to determine speedup vs. number of cores)

Member Function Documentation

◆ execute()

void wrench::ComputeAction::execute ( std::shared_ptr< ActionExecutor action_executor)
overrideprotectedvirtual

Method to execute the task.

Parameters
action_executorthe executor that executes this action

Implements wrench::Action.

◆ getFlops()

double wrench::ComputeAction::getFlops ( ) const

Returns the action's flops.

Returns
a number of flops

◆ getMaxNumCores()

unsigned long wrench::ComputeAction::getMaxNumCores ( ) const
overridevirtual

Returns the action's maximum number of required cores.

Returns
a number of cores

Reimplemented from wrench::Action.

◆ getMinNumCores()

unsigned long wrench::ComputeAction::getMinNumCores ( ) const
overridevirtual

Returns the action's minimum number of required cores.

Returns
a number of cores

Reimplemented from wrench::Action.

◆ getMinRAMFootprint()

double wrench::ComputeAction::getMinRAMFootprint ( ) const
overridevirtual

Returns the action's minimum required memory footprint.

Returns
a number of bytes

Reimplemented from wrench::Action.

◆ getParallelModel()

std::shared_ptr< ParallelModel > wrench::ComputeAction::getParallelModel ( ) const

Returns the action's parallel model.

Returns
a parallel model

◆ terminate()

void wrench::ComputeAction::terminate ( std::shared_ptr< ActionExecutor action_executor)
overrideprotectedvirtual

Method called when the task terminates.

Parameters
action_executorthe executor that executes this action

Implements wrench::Action.


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