wrench::ActionExecutor

class ActionExecutor : public wrench::ExecutionController

An service that performs an Action.

Public Functions

ActionExecutor(std::string hostname, unsigned long num_cores, double ram_footprint, double thread_creation_overhead, bool simulate_computation_as_sleep, simgrid::s4u::Mailbox *callback_mailbox, std::shared_ptr<Action> action, std::shared_ptr<ActionExecutionService> action_execution_service)

Constructor.

Parameters
  • hostname – the name of the host on which the action executor will run

  • num_cores – the number of cores

  • ram_footprint – the RAM footprint

  • thread_creation_overhead – the thread creation overhead in seconds

  • simulate_computation_as_sleep – whether to simulate computation as sleep

  • callback_mailbox – the callback mailbox to which a “action done” or “action failed” message will be sent

  • action – the action to perform

  • action_execution_service – the parent action execution service

virtual void cleanup(bool has_returned_from_main, int return_value) override

Cleanup method that implements the cleanup basics.

Parameters
  • has_returned_from_main – true if main has returned

  • return_value – main’s return value

std::shared_ptr<Action> getAction()

Returns the executor’s action.

Returns

the action

std::shared_ptr<ActionExecutionService> getActionExecutionService() const

Get the action execution service that started this action executor (or nullptr if stand-alone action executor)

Returns

an action execution service

double getMemoryAllocated() const

Return the action executor’s allocated RAM.

Returns

a number of bytes

unsigned long getNumCoresAllocated() const

Return the action executor’s allocated nuber of cores.

Returns

a number of cores

bool getSimulateComputationAsSleep()

Returns whether computation should be simulated as sleep.

Returns

true or false

double getThreadCreationOverhead()

Return the executor’s thread creation overhead.

Returns

an overhead (in seconds)

void kill(bool job_termination)

Kill the worker thread.

Parameters

job_termination – if the reason for being killed is that the job was terminated by the submitter (as opposed to being terminated because the above service was also terminated).

virtual int main() override

Main method of the action executor.

Throws

std::runtime_error

Returns

1 if a failure timestamp should be generated, 0 otherwise