wrench::ActionExecutor
-
class ActionExecutor : public wrench::ExecutionController
An service that performs an Action.
Public Functions
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_commport – the callback commport 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
-
sg_size_t getMemoryAllocated() const
Return the action executor’s allocated RAM.
- Returns:
a number of bytes
-
unsigned long getNumCoresAllocated() const
Return the action executor’s allocated number of cores.
- Returns:
a number of cores
-
bool getSimulateComputationAsSleep() const
Returns whether computation should be simulated as sleep.
- Returns:
true or false
-
double getThreadCreationOverhead() const
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.
- Returns:
1 if a failure timestamp should be generated, 0 otherwise