Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ignore the lat parameter of peer tag
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Jan 2017 17:01:21 +0000 (18:01 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Jan 2017 17:01:29 +0000 (18:01 +0100)
- 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...

doc/doxygen/platform.doc
examples/java/app/tokenring/app_tokenring.tesh
examples/msg/app-token-ring/app-token-ring.tesh
examples/platforms/two_peers.xml
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/VivaldiZone.hpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp

index ba3bb76..14b94aa 100644 (file)
@@ -129,7 +129,7 @@ between the hosts goes through link1.
 
 \subsection pf_Cr Computing resources: hosts, clusters and peers.
 
-\subsubsection pf_host &lt;host/&gt;
+\subsubsection pf_host &lt;host&gt;
 
 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,
@@ -402,10 +402,10 @@ The hosts generated in the above example are named host-1.cluster, host-2.cluste
 etc.
 
 
-\subsubsection pf_peer The &lt;peer&gt; 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
@@ -421,12 +421,21 @@ id              | yes       | string | The identifier of the peer. Facilitates r
 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
index b18b64c..73a084d 100644 (file)
@@ -22,11 +22,11 @@ $ java -classpath ${classpath:=.} app/tokenring/Main ${srcdir:=.}/../platforms/t
 > [    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.
index 936a327..8f52f93 100644 (file)
@@ -19,10 +19,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${srcdir:=.}/routing_cluster.xml "-
 $ $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'
index 00d9768..92ac5d5 100644 (file)
@@ -2,7 +2,7 @@
 <!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>
index e88cc0f..25b6e65 100644 (file)
@@ -58,7 +58,7 @@ VivaldiZone::VivaldiZone(NetZone* father, const char* name) : ClusterZone(father
 {
 }
 
-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");
 
@@ -66,8 +66,8 @@ void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, dou
 
   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}});
 }
 
index 2c84ac7..28d53aa 100644 (file)
@@ -30,6 +30,9 @@ namespace routing {
  *
  *  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
@@ -37,8 +40,6 @@ namespace routing {
  *  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.
  */
@@ -47,7 +48,7 @@ class XBT_PRIVATE VivaldiZone : public ClusterZone {
 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;
 };
 
index 577dab3..2cc3b17 100644 (file)
@@ -563,7 +563,7 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
   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 */
index 790876a..e604e46 100644 (file)
@@ -78,7 +78,6 @@ typedef struct s_sg_platf_peer_cbarg {
   double speed;
   double bw_in;
   double bw_out;
-  double lat;
   const char* coord;
   tmgr_trace_t speed_trace;
   tmgr_trace_t state_trace;
index 8292cf7..d9a4c52 100644 (file)
@@ -639,11 +639,14 @@ void STag_surfxml_peer(){
   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);
 }