wrench::ActionExecutionService

class 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

ActionExecutionService(const std::string &hostname, const std::map<simgrid::s4u::Host*, std::tuple<unsigned long, sg_size_t>> &compute_resources, std::shared_ptr<Service> parent_service, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOAD_COLLECTION_TYPE messagepayload_list = {})

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 host, which represents the compute resources available to this service.

  • 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() override

Destructor.

bool actionCanRun(const std::shared_ptr<Action> &action)

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<simgrid::s4u::Host*, std::tuple<unsigned long, sg_size_t>> &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, sg_size_t 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

void setParentService(std::shared_ptr<Service> parent)

Set parent service.

Parameters:

parent – the parent service

void submitAction(const std::shared_ptr<Action> &action)

Submit an action to the action execution service service.

Parameters:

action – an action

void terminateAction(std::shared_ptr<Action> action, ComputeService::TerminationCause termination_cause)

Synchronously terminate an action.

Parameters:
  • action – an action

  • termination_cause – termination cause