- It was redundent with the z coordinate of the peer.
- This changes the timings of the examples using the Vivaldi routing
- Also update and improve the documentation.
- doxygen don't quite like links to sections which names contain a
html-like tag (as <peer>) and produce weird error messages in this case.
Not much I can do here...
\subsection pf_Cr Computing resources: hosts, clusters and peers.
-\subsubsection pf_host <host/>
+\subsubsection pf_host <host>
A <b>host</b> represents a computer/node card. Every host is able to execute
code and it can send and receive data to/from other hosts. Most importantly,
etc.
-\subsubsection pf_peer The <peer> tag
+\subsubsection pf_peer \<peer\> (Vivaldi netzones only)
This tag represents a peer, as in Peer-to-Peer (P2P) networks. This
-can only be used in Vivaldi NetZones. It creates the following
+can only be used in Vivaldi NetZones. It creates the following
resources to the NetZone:
\li A host
speed | yes | int | See the description of the ``host`` tag for this attribute
bw_in | yes | int | Bandwidth of the private downstream link
bw_out | yes | int | Bandwidth of the private upstream link
-lat | yes | double | Latency for both up- and downstream, in seconds.
coordinates | no | string | Coordinates of the gateway for this peer. Example value: 12.8 14.4 6.4
sharing_policy | no | SHARED\|FULLDUPLEX (default: FULLDUPLEX) | Sharing policy for links. See <b>link</b> description for details.
availability_file| no | string | Availability file for the peer. Same as host availability file. See <b>host</b> description for details.
state_file | no | string | State file for the peer. Same as host state file. See <b>host</b> description for details.
+
+The communication latency between an host A=(xA,yA,zA) and an host
+B=(xB,yB,zB) is computed as follows:
+
+ latency = sqrt( (xA-xB)² + (yA-yB)² ) + zA + zB
+
+See the documentation of simgrid::kernel::routing::VivaldiZone for
+details on how the latency is computed from the coordinate, and on the
+the up and down bandwidth are used.
+
\subsection pf_ne Network equipments: links and routers
There are two tags at all times available to represent network entities and
> [ 0.000000] (0:maestro@) Using regular java threads.
> [ 0.000000] (0:maestro@) Number of hosts '2'
> [ 0.000000] (1:0@100030591) Host '0' send 'Token' to Host '1'
-> [ 0.637910] (2:1@100036570) Host '1' received 'Token'
-> [ 0.637910] (2:1@100036570) Host '1' send 'Token' to Host '0'
-> [ 1.275820] (1:0@100030591) Host '0' received 'Token'
-> [ 1.275820] (0:maestro@) MSG_main finished; Cleaning up the simulation...
-> [ 1.275820] (0:maestro@) Simulation time 1.2758201322136908
+> [ 0.624423] (2:1@100036570) Host '1' received 'Token'
+> [ 0.624423] (2:1@100036570) Host '1' send 'Token' to Host '0'
+> [ 1.248846] (1:0@100030591) Host '0' received 'Token'
+> [ 1.248846] (0:maestro@) MSG_main finished; Cleaning up the simulation...
+> [ 1.248846] (0:maestro@) Simulation time 1.2488464578972847
$ java -classpath ${classpath:=.} app/tokenring/Main ${srcdir:=.}/../platforms/meta_cluster.xml '--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n'
> [ 0.000000] (0:maestro@) Using regular java threads.
$ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${srcdir:=.}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Number of hosts '2'
> [ 0.000000] (1:0@100030591) Host "0" send 'Token' to Host "1"
-> [ 0.637910] (2:1@100036570) Host "1" received "Token"
-> [ 0.637910] (2:1@100036570) Host "1" send 'Token' to Host "0"
-> [ 1.275820] (1:0@100030591) Host "0" received "Token"
-> [ 1.275820] (0:maestro@) Simulation time 1.27582
+> [ 0.624423] (2:1@100036570) Host "1" received "Token"
+> [ 0.624423] (2:1@100036570) Host "1" send 'Token' to Host "0"
+> [ 1.248846] (1:0@100030591) Host "0" received "Token"
+> [ 1.248846] (0:maestro@) Simulation time 1.24885
$ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${srcdir:=.}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Number of hosts '60'
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4">
<AS id="AS0" routing="Vivaldi">
- <peer id="100030591" coordinates="25.5 9.4 1.4" speed="1.5Gf" bw_in="2.25GBps" bw_out="2.25GBps" lat="500us" />
- <peer id="100036570" coordinates="-12.7 -9.9 2.1" speed="730Mf" bw_in="2.25GBps" bw_out="2.25GBps" lat="500us" />
+ <peer id="100030591" coordinates="25.5 9.4 1.4" speed="1.5Gf" bw_in="2.25GBps" bw_out="2.25GBps" />
+ <peer id="100036570" coordinates="-12.7 -9.9 2.1" speed="730Mf" bw_in="2.25GBps" bw_out="2.25GBps" />
</AS>
</platform>
{
}
-void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, double latency, const char* coord)
+void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, const char* coord)
{
xbt_assert(netcard->netzone() == this, "Cannot add a peer link to a netcard that is not in this AS");
std::string link_up = "link_" + netcard->name() + "_UP";
std::string link_down = "link_" + netcard->name() + "_DOWN";
- Link* linkUp = surf_network_model->createLink(link_up.c_str(), bw_out, latency, SURF_LINK_SHARED);
- Link* linkDown = surf_network_model->createLink(link_down.c_str(), bw_in, latency, SURF_LINK_SHARED);
+ Link* linkUp = surf_network_model->createLink(link_up.c_str(), bw_out, 0, SURF_LINK_SHARED);
+ Link* linkDown = surf_network_model->createLink(link_down.c_str(), bw_in, 0, SURF_LINK_SHARED);
privateLinks_.insert({netcard->id(), {linkUp, linkDown}});
}
*
* So, to go from an host A to an host B, the following links would be used:
* <tt>private(A)_UP, private(B)_DOWN</tt>, with the additional latency computed above.
+ * The bandwidth of the UP and DOWN links is not symmetric (in contrary to usual SimGrid
+ * links), but naturally correspond to the values provided when the peer was created.
+ * More information in the relevant section of the XML reference guide: @ref pf_peer.
*
* Such Network Coordinate systems were shown to provide rather good latency estimations
* in a compact way. Other systems, such as
* were shown superior to the Vivaldi system and could be also implemented in SimGrid.
*
*
- * @todo: the third dimension of the coordinates could be dropped and integrated in the peer private links.
- *
* @todo: we should provide a script to compute the coordinates from a matrix of latency measurements,
* according to the corresponding publications.
*/
public:
explicit VivaldiZone(NetZone* father, const char* name);
- void setPeerLink(NetCard* netcard, double bw_in, double bw_out, double lat, const char* coord);
+ void setPeerLink(NetCard* netcard, double bw_in, double bw_out, const char* coord);
void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
};
speedPerPstate.push_back(peer->speed);
simgrid::s4u::Host* host = as->createHost(peer->id, &speedPerPstate, 1);
- as->setPeerLink(host->pimpl_netcard, peer->bw_in, peer->bw_out, peer->lat, peer->coord);
+ as->setPeerLink(host->pimpl_netcard, peer->bw_in, peer->bw_out, peer->coord);
simgrid::s4u::Host::onCreation(*host);
/* Change from the defaults */
double speed;
double bw_in;
double bw_out;
- double lat;
const char* coord;
tmgr_trace_t speed_trace;
tmgr_trace_t state_trace;
peer.speed = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id);
peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id);
peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id);
- peer.lat = surf_parse_get_time(A_surfxml_peer_lat, "lat of peer", peer.id);
peer.coord = A_surfxml_peer_coordinates;
peer.speed_trace = A_surfxml_peer_availability___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_availability___file) : nullptr;
peer.state_trace = A_surfxml_peer_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_state___file) : nullptr;
+ if (A_surfxml_peer_lat[0] != '\0')
+ XBT_WARN("The latency parameter in <peer> is now deprecated. Use the z coordinate instead of '%s'.",
+ A_surfxml_peer_lat);
+
sg_platf_new_peer(&peer);
}