WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | Protected Member Functions | List of all members
wrench::ExecutionController Class Referenceabstract

An abstraction of an execution controller, i.e., a running process that interacts with other services to accomplish some computational goal. More...

#include <ExecutionController.h>

Inheritance diagram for wrench::ExecutionController:
wrench::Service

Public Member Functions

std::shared_ptr< BandwidthMeterServicecreateBandwidthMeter (const std::map< std::string, double > &measurement_periods)
 Instantiate and start a bandwidth meter. More...
 
std::shared_ptr< BandwidthMeterServicecreateBandwidthMeter (const std::vector< std::string > &linknames, double measurement_period)
 Instantiate and start a bandwidth meter. More...
 
virtual std::shared_ptr< DataMovementManagercreateDataMovementManager ()
 Instantiate and start a data movement manager. More...
 
std::shared_ptr< EnergyMeterServicecreateEnergyMeter (const std::map< std::string, double > &measurement_periods)
 Instantiate and start an energy meter. More...
 
std::shared_ptr< EnergyMeterServicecreateEnergyMeter (const std::vector< std::string > &hostnames, double measurement_period)
 Instantiate and start an energy meter. More...
 
virtual std::shared_ptr< JobManagercreateJobManager ()
 Instantiate and start a job manager. More...
 
virtual void processEventCompoundJobCompletion (std::shared_ptr< CompoundJobCompletedEvent >)
 Process a standard job completion event. More...
 
virtual void processEventCompoundJobFailure (std::shared_ptr< CompoundJobFailedEvent >)
 Process a standard job failure event. More...
 
virtual void processEventFileCopyCompletion (std::shared_ptr< FileCopyCompletedEvent >)
 Process a file copy completion event. More...
 
virtual void processEventFileCopyFailure (std::shared_ptr< FileCopyFailedEvent >)
 Process a file copy failure event. More...
 
virtual void processEventPilotJobExpiration (std::shared_ptr< PilotJobExpiredEvent >)
 Process a pilot job expiration event. More...
 
virtual void processEventPilotJobStart (std::shared_ptr< PilotJobStartedEvent >)
 Process a pilot job start event. More...
 
virtual void processEventStandardJobCompletion (std::shared_ptr< StandardJobCompletedEvent >)
 Process a standard job completion event. More...
 
virtual void processEventStandardJobFailure (std::shared_ptr< StandardJobFailedEvent >)
 Process a standard job failure event. More...
 
virtual void processEventTimer (std::shared_ptr< TimerEvent >)
 Process a timer event. More...
 
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. More...
 
std::shared_ptr< ExecutionEventwaitForNextEvent ()
 Wait for an execution event. More...
 
std::shared_ptr< ExecutionEventwaitForNextEvent (double timeout)
 Wait for an execution event. More...
 
- Public Member Functions inherited from wrench::Service
void assertServiceIsUp ()
 Throws an exception if the service is not up. More...
 
std::string getHostname ()
 Get the name of the host on which the service is / will be running. More...
 
double getNetworkTimeoutValue ()
 Returns the service's network timeout value. More...
 
std::string getPhysicalHostname ()
 Get the physical name of the host on which the service is / will be running. More...
 
bool getPropertyValueAsBoolean (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a boolean. More...
 
double getPropertyValueAsDouble (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a double. More...
 
std::string getPropertyValueAsString (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a string. More...
 
unsigned long getPropertyValueAsUnsignedLong (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as an unsigned long. More...
 
bool isUp ()
 Returns true if the service is UP, false otherwise. More...
 
void resume ()
 Resume the service. More...
 
void setNetworkTimeoutValue (double value)
 Sets the service's network timeout value. More...
 
void start (std::shared_ptr< Service > this_service, bool daemonize, bool auto_restart)
 Start the service. More...
 
virtual void stop ()
 Synchronously stop the service (does nothing if the service is already stopped) More...
 
void suspend ()
 Suspend the service.
 

Protected Member Functions

 ExecutionController (const std::string &hostname, const std::string suffix)
 Constructor. More...
 
void setTimer (double date, std::string message)
 Sets a timer (which, when it goes off, will generate a TimerEvent) More...
 

Detailed Description

An abstraction of an execution controller, i.e., a running process that interacts with other services to accomplish some computational goal.

Constructor & Destructor Documentation

◆ ExecutionController()

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

Constructor.

Parameters
hostnamethe name of the host on which to run the controller
suffixa string to append to the controller process name (which will show up in logs)
Exceptions
std::invalid_argument

Member Function Documentation

◆ createBandwidthMeter() [1/2]

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

Instantiate and start a bandwidth meter.

Parameters
measurement_periodsthe measurement period for each metered link
Returns
a link meter

◆ createBandwidthMeter() [2/2]

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

Instantiate and start a bandwidth meter.

Parameters
linknamesthe list of metered links
measurement_periodthe measurement period
Returns
a link meter

◆ createDataMovementManager()

std::shared_ptr< DataMovementManager > wrench::ExecutionController::createDataMovementManager ( )
virtual

Instantiate and start a data movement manager.

Returns
a data movement manager

◆ createEnergyMeter() [1/2]

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

Instantiate and start an energy meter.

Parameters
measurement_periodsthe measurement period for each metered host
Returns
an energy meter

◆ createEnergyMeter() [2/2]

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

Instantiate and start an energy meter.

Parameters
hostnamesthe list of metered hosts, as hostnames
measurement_periodthe measurement period
Returns
an energy meter

◆ createJobManager()

std::shared_ptr< JobManager > wrench::ExecutionController::createJobManager ( )
virtual

Instantiate and start a job manager.

Returns
a job manager

◆ processEventCompoundJobCompletion()

void wrench::ExecutionController::processEventCompoundJobCompletion ( std::shared_ptr< CompoundJobCompletedEvent event)
virtual

Process a standard job completion event.

Parameters
eventa CompoundJobCompletedEvent

◆ processEventCompoundJobFailure()

void wrench::ExecutionController::processEventCompoundJobFailure ( std::shared_ptr< CompoundJobFailedEvent event)
virtual

Process a standard job failure event.

Parameters
eventa CompoundJobFailedEvent

◆ processEventFileCopyCompletion()

void wrench::ExecutionController::processEventFileCopyCompletion ( std::shared_ptr< FileCopyCompletedEvent event)
virtual

Process a file copy completion event.

Parameters
eventa FileCopyCompletedEvent

◆ processEventFileCopyFailure()

void wrench::ExecutionController::processEventFileCopyFailure ( std::shared_ptr< FileCopyFailedEvent event)
virtual

Process a file copy failure event.

Parameters
eventa FileCopyFailedEvent

◆ processEventPilotJobExpiration()

void wrench::ExecutionController::processEventPilotJobExpiration ( std::shared_ptr< PilotJobExpiredEvent event)
virtual

Process a pilot job expiration event.

Parameters
eventa PilotJobExpiredEvent

◆ processEventPilotJobStart()

void wrench::ExecutionController::processEventPilotJobStart ( std::shared_ptr< PilotJobStartedEvent event)
virtual

Process a pilot job start event.

Parameters
eventa PilotJobStartedEvent

◆ processEventStandardJobCompletion()

void wrench::ExecutionController::processEventStandardJobCompletion ( std::shared_ptr< StandardJobCompletedEvent event)
virtual

Process a standard job completion event.

Parameters
eventa StandardJobCompletedEvent

◆ processEventStandardJobFailure()

void wrench::ExecutionController::processEventStandardJobFailure ( std::shared_ptr< StandardJobFailedEvent event)
virtual

Process a standard job failure event.

Parameters
eventa StandardJobFailedEvent

◆ processEventTimer()

void wrench::ExecutionController::processEventTimer ( std::shared_ptr< TimerEvent event)
virtual

Process a timer event.

Parameters
eventa TimerEvent

◆ setTimer()

void wrench::ExecutionController::setTimer ( double  date,
std::string  message 
)
protected

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

Parameters
datethe date at which the timer should go off
messagea string message that will be in the generated TimerEvent

◆ waitForAndProcessNextEvent()

bool wrench::ExecutionController::waitForAndProcessNextEvent ( double  timeout)

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

Parameters
timeouta timeout value in seconds
Returns
false if a timeout occurred (in which case no event was received/processed)
Exceptions
wrench::ExecutionException

◆ waitForNextEvent() [1/2]

std::shared_ptr< ExecutionEvent > wrench::ExecutionController::waitForNextEvent ( )

Wait for an execution event.

Returns
the event

◆ waitForNextEvent() [2/2]

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

Wait for an execution event.

Parameters
timeouta timeout value in seconds
Returns
the event

The documentation for this class was generated from the following files: