wrench::ExecutionController

class ExecutionController : public wrench::Service

An abstraction of an execution controller, i.e., a running process that interacts with other services to accomplish some computational goal. The simulation will terminate when all execution controllers have terminated.

Subclassed by wrench::ActionExecutor, wrench::WorkloadTraceFileReplayer, wrench::WorkloadTraceFileReplayerEventReceiver

Public Functions

ExecutionController(const std::string &hostname, const std::string &suffix)

Constructor.

Parameters:
  • hostname – the name of the host on which to run the controller

  • suffix – a string to append to the controller process name (which will show up in logs)

Throws:

std::invalid_argument

std::shared_ptr<BandwidthMeterService> createBandwidthMeter(const std::map<std::string, double> &measurement_periods)

Instantiate and start a bandwidth meter.

Parameters:

measurement_periods – the measurement period for each metered link

Returns:

a link meter

std::shared_ptr<BandwidthMeterService> createBandwidthMeter(const std::vector<std::string> &linknames, double measurement_period)

Instantiate and start a bandwidth meter.

Parameters:
  • link_names – the list of metered links

  • measurement_period – the measurement period

Returns:

a link meter

virtual std::shared_ptr<DataMovementManager> createDataMovementManager()

Instantiate and start a data movement manager.

Returns:

a data movement manager

std::shared_ptr<EnergyMeterService> createEnergyMeter(const std::map<std::string, double> &measurement_periods)

Instantiate and start an energy meter.

Parameters:

measurement_periods – the measurement period for each metered host

Returns:

an energy meter

std::shared_ptr<EnergyMeterService> createEnergyMeter(const std::vector<std::string> &hostnames, double measurement_period)

Instantiate and start an energy meter.

Parameters:
  • hostnames – the list of metered hosts, as hostnames

  • measurement_period – the measurement period

Returns:

an energy meter

virtual std::shared_ptr<JobManager> createJobManager()

Instantiate and start a job manager.

Returns:

a job manager

virtual void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>)

Process a standard job completion event.

Parameters:

event – a CompoundJobCompletedEvent

virtual void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent>)

Process a standard job failure event.

Parameters:

event – a CompoundJobFailedEvent

virtual void processEventFileCopyCompletion(std::shared_ptr<FileCopyCompletedEvent>)

Process a file copy completion event.

Parameters:

event – a FileCopyCompletedEvent

virtual void processEventFileCopyFailure(std::shared_ptr<FileCopyFailedEvent>)

Process a file copy failure event.

Parameters:

event – a FileCopyFailedEvent

virtual void processEventPilotJobExpiration(std::shared_ptr<PilotJobExpiredEvent>)

Process a pilot job expiration event.

Parameters:

event – a PilotJobExpiredEvent

virtual void processEventPilotJobStart(std::shared_ptr<PilotJobStartedEvent>)

Process a pilot job start event.

Parameters:

event – a PilotJobStartedEvent

virtual void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>)

Process a standard job completion event.

Parameters:

event – a StandardJobCompletedEvent

virtual void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>)

Process a standard job failure event.

Parameters:

event – a StandardJobFailedEvent

virtual void processEventTimer(std::shared_ptr<TimerEvent>)

Process a timer event.

Parameters:

event – a TimerEvent

void setDaemonized(bool daemonized)

Make the execution controller daemonized, meaning that the simulation can terminate without.

Parameters:

daemonized – true if the controller should be daemonized, false otherwise

void setTimer(double date, std::string message)

Sets a timer (which, when it goes off, will generate a TimerEvent)

Parameters:
  • date – the date at which the timer should go off

  • message – a string message that will be in the generated TimerEvent

void waitForAndProcessNextEvent()

Wait for an execution event and then call the associated function to process that event.

bool waitForAndProcessNextEvent(double timeout)

Wait for an execution event and then call the associated function to process that event.

Parameters:

timeout – a timeout value in seconds

Throws:

wrench::ExecutionException

Returns:

false if a timeout occurred (in which case no event was received/processed)

std::shared_ptr<ExecutionEvent> waitForNextEvent()

Wait for an execution event.

Returns:

the event

std::shared_ptr<ExecutionEvent> waitForNextEvent(double timeout)

Wait for an execution event with a timeout.

Parameters:

timeout – a timeout value in seconds

Returns:

the event