10 #ifndef WRENCH_ACTION_EXECUTOR_H
11 #define WRENCH_ACTION_EXECUTOR_H
15 #include "wrench/execution_controller/ExecutionController.h"
16 #include "wrench/services/Service.h"
17 #include "wrench/action/Action.h"
23 class ActionExecutionService;
38 unsigned long num_cores,
40 simgrid::s4u::Mailbox *callback_mailbox,
41 std::shared_ptr<Action> action,
42 std::shared_ptr<ActionExecutionService> action_execution_service);
45 void kill(
bool job_termination);
46 void cleanup(
bool has_returned_from_main,
int return_value)
override;
56 std::shared_ptr<Action> action;
57 std::shared_ptr<ActionExecutionService> action_execution_service;
58 simgrid::s4u::Mailbox *callback_mailbox;
59 bool killed_on_purpose;
61 unsigned long num_cores;
72 #endif //WRENCH_ACTION_EXECUTOR_H
unsigned long getNumCoresAllocated() const
Return the action executor's allocated nuber of cores.
Definition: ActionExecutor.cpp:166
An abstraction of an execution controller, i.e., a running process that interacts with other services...
Definition: ExecutionController.h:37
void cleanup(bool has_returned_from_main, int return_value) override
Cleanup method that implements the cleanup basics.
Definition: ActionExecutor.cpp:73
std::shared_ptr< ActionExecutionService > getActionExecutionService() const
Get the action execution service that started this action executor (or nullptr if stand-alone action ...
Definition: ActionExecutor.cpp:174
Definition: Action.cpp:28
int main() override
Main method of the action executor.
Definition: ActionExecutor.cpp:103
ActionExecutor(std::string hostname, unsigned long num_cores, double ram_footprint, simgrid::s4u::Mailbox *callback_mailbox, std::shared_ptr< Action > action, std::shared_ptr< ActionExecutionService > action_execution_service)
Constructor.
Definition: ActionExecutor.cpp:35
std::shared_ptr< Action > getAction()
Returns the executor's action.
Definition: ActionExecutor.cpp:64
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
void kill(bool job_termination)
Kill the worker thread.
Definition: ActionExecutor.cpp:143
An service that performs an Action.
Definition: ActionExecutor.h:32
double getMemoryAllocated() const
Return the action executor's allocated RAM.
Definition: ActionExecutor.cpp:158