wrench::Service
-
class Service : public wrench::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::ActionExecutionService, wrench::Alarm, wrench::BandwidthMeterService, wrench::ComputeService, wrench::DataMovementManager, wrench::EnergyMeterService, wrench::ExecutionController, wrench::FileReaderThread, wrench::FileRegistryService, wrench::FileTransferThread, wrench::FileWriterThread, wrench::HTCondorNegotiatorService, wrench::HostStateChangeDetector, wrench::JobManager, wrench::MemoryManager, wrench::NetworkProximityReceiverDaemon, wrench::NetworkProximitySenderDaemon, wrench::NetworkProximityService, wrench::ServiceTerminationDetector, wrench::StorageService
Public Functions
-
void assertServiceIsUp()
Throws an exception if the service is not up.
-
simgrid::s4u::Host *getHost()
Get the the host on which the service is / will be running.
- Returns:
the hostname
-
std::string getHostname()
Get the name of the host on which the service is / will be running.
- Returns:
the hostname
-
const WRENCH_MESSAGE_PAYLOAD_COLLECTION_TYPE &getMessagePayloadList() const
Get all message payloads and their values of the Service.
- Returns:
the message payload map
-
sg_size_t getMessagePayloadValue(WRENCH_MESSAGEPAYLOAD_TYPE)
Get a message payload of the Service as a double.
- Parameters:
message_payload – the message payload
- Returns:
the message payload value as a double
-
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)
-
void setStateToDown()
Set the state of the service to DOWN.
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()