wrench::ActionExecutionService
-
class wrench::ActionExecutionService : public wrench::Service
An action execution service that:
Accepts only ready actions
Run actions FCFS w.r.t to memory constraints without backfilling
Will oversubscribe cores in whatever way
Attempts some load balancing
Tries to execute actions with as many cores as possible
Public Functions
Constructor.
- Parameters
hostname – the name of the host on which the service should be started
compute_resources – a map of <num_cores, memory> tuples, indexed by hostname, which represents the compute resources available to this service.
use num_cores = ComputeService::ALL_CORES to use all cores available on the host
use memory_manager_service = ComputeService::ALL_RAM to use all RAM available on the host
parent_service – the parent compute service (nullptr if not known at this time)
property_list – a property list ({} means “use all defaults”)
messagepayload_list – a message payload list ({} means “use all defaults”)
-
~ActionExecutionService()
Destructor.
Helper method that determines whether a submitted action (with service-specific arguments) can run given available resources.
- Parameters
action – the action
- Returns
true if the action can run
-
std::map<std::string, std::tuple<unsigned long, double>> &getComputeResources()
Get a (reference to) the compute resources of this service.
- Returns
the compute resources
-
std::shared_ptr<Service> getParentService() const
Get the parent compute service (could be nullptr if stand-alone)
- Returns
a compute service
-
std::map<std::string, double> getResourceInformation(const std::string &key)
Return resource information.
- Parameters
key – the information key
- Returns
resource information
-
bool IsThereAtLeastOneHostWithAvailableResources(unsigned long num_cores, double ram)
Determine whether there is at least one host with (currently) available resources.
- Parameters
num_cores – the desired number of cores
ram – the desired RAM
- Returns
true or false
Set parent service.
- Parameters
parent – the parent service
Submit an action to the action execution service service.
- Parameters
action – an action
Synchronously terminate an action.
- Parameters
action – an action
termination_cause – termination cause
- Throws
std::runtime_error –