wrench::Service
-
class Service : public S4U_Daemon
A service that can be added to the simulation and that can be used by a WMS when executing a workflow.
Subclassed by wrench::BandwidthMeterService, wrench::ComputeService, wrench::DataMovementManager, wrench::EnergyMeterService, wrench::ExecutionController, wrench::FileRegistryService, wrench::JobManager, wrench::NetworkProximityService, wrench::StorageService
Public Functions
-
void assertServiceIsUp()
Throws an exception if the service is not up.
-
std::string getHostname()
Get the name of the host on which the service is / will be running.
- Returns:
the hostname
-
double getNetworkTimeoutValue() const
Returns the service’s network timeout value.
- Returns:
a duration in seconds
-
std::string getPhysicalHostname()
Get the physical name of the host on which the service is / will be running.
- Returns:
the physical hostname
-
const WRENCH_PROPERTY_COLLECTION_TYPE &getPropertyList() const
Get all properties attached to this service.
- Returns:
the property list
-
double getPropertyValueAsBandwidthInBytePerSecond(WRENCH_PROPERTY_TYPE)
Method to parse a property value that is a bandwidth with (optional) units.
- Parameters:
property – the property
- Returns:
the bandwidth in byte/sec
-
bool getPropertyValueAsBoolean(WRENCH_PROPERTY_TYPE)
Get a property of the Service as a boolean.
- Parameters:
property – the property
- Returns:
the property value as a boolean
-
double getPropertyValueAsDouble(WRENCH_PROPERTY_TYPE)
Get a property of the Service as a double.
- Parameters:
property – the property
- Returns:
the property value as a double
-
sg_size_t getPropertyValueAsSizeInByte(WRENCH_PROPERTY_TYPE)
Method to parse a property value that is a date size with (optional) units.
- Parameters:
property – the property
- Returns:
the size in byte
-
std::string getPropertyValueAsString(WRENCH_PROPERTY_TYPE)
Get a property of the Service as a string.
- Parameters:
property – the property
- Returns:
the property value as a string
-
double getPropertyValueAsTimeInSecond(WRENCH_PROPERTY_TYPE)
Method to parse a property value that is a time with (optional) units.
- Parameters:
property – the property
- Returns:
the time in second
-
unsigned long getPropertyValueAsUnsignedLong(WRENCH_PROPERTY_TYPE)
Get a property of the Service as an unsigned long.
- Parameters:
property – the property
- Returns:
the property value as an unsigned long
-
bool isUp()
Returns true if the service is UP, false otherwise.
- Returns:
true or false
-
void resume()
Resume the service.
-
void setNetworkTimeoutValue(double value)
Sets the service’s network timeout value.
- Parameters:
value – a duration in seconds (<0 means: never timeout)
Start the service.
- Parameters:
this_service – a shared pointer to the service
daemonize – true if the daemon is to be daemonized, false otherwise
auto_restart – true if the daemon should restart automatically after a reboot or not
-
virtual void stop()
Synchronously stop the service (does nothing if the service is already stopped)
-
void suspend()
Suspend the service.
-
void assertServiceIsUp()