wrench::NetworkProximityService

class NetworkProximityService : public wrench::Service

A network proximity service that continuously estimates inter-host latencies and can be queried for such estimates.

Public Functions

NetworkProximityService(std::string db_hostname, std::vector<std::string> hosts_in_network, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})

Constructor.

Parameters:
  • hostname – the name of the host on which to start the service

  • hosts_in_network – the hosts participating in network measurements

  • property_list – a property list ({} means “use all defaults”)

  • messagepayload_list – a message payload list ({} means “use all defaults”)

std::pair<std::pair<double, double>, double> getHostCoordinate(std::string)

Look up the current (x,y) coordinates of a given host (only for a Vivaldi network service type)

Parameters:

requested_host – the host whose coordinates are being requested

Throws:
  • WorkFlowExecutionException

  • std::runtime_error

Returns:

A pair:

  • a (x,y) coordinate pair

  • a timestamp (the oldest timestamp of measurements used to compute the coordinate)

std::vector<std::string> getHostnameList()

Gets the list of hosts monitored by this service (does not involve simulated network communications with the service)

Returns:

a list of hostnames

std::pair<double, double> getHostPairDistance(std::pair<std::string, std::string> hosts)

Look up a proximity value in database.

Parameters:

hosts – the pair of hosts whose proximity is of interest

Throws:
Returns:

A pair:

  • The proximity value between the pair of hosts (or DBL_MAX if none)

  • The timestamp of the oldest measurement use to compute the proximity value (or -1.0 if none)

std::string getNetworkProximityServiceType()

Get the network proximity service type.

Returns:

a string specifying the network proximity service type