Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
DragonflyZone: Add limiters for switches
authorBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 4 May 2021 15:34:08 +0000 (17:34 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 4 May 2021 16:04:49 +0000 (18:04 +0200)
Final change to make uniform the behavior of limiters in the clusters:
Fat-Tree, Torus and Dragonfly.

Changes in tests flatifier and cluster-multicpu

examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
examples/cpp/clusters-multicpu/s4u-clusters-multicpu.tesh
include/simgrid/kernel/routing/DragonflyZone.hpp
include/simgrid/kernel/routing/FatTreeZone.hpp
include/simgrid/s4u/NetZone.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DragonflyZone.cpp
teshsuite/simdag/flatifier/flatifier.tesh

index 849148e..0cf10c4 100644 (file)
@@ -84,7 +84,7 @@ public:
  *   CPU1   ...   CPU8
  *
  * @param zone Cluster netzone being created (usefull to create the hosts/links inside it)
- * @param coord Coordinates in the torus (e.g. "0,0,0", "0,1,0")
+ * @param coord Coordinates in the cluster
  * @param id Internal identifier in the torus (for information)
  * @return netpoint, gateway: the netpoint to the StarZone and CPU0 as gateway
  */
@@ -124,12 +124,21 @@ create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned int>& /*coo
 /*************************************************************************************************/
 /**
  * @brief Callback to create limiter link (1Gbs) for each netpoint
+ *
+ * The coord parameter depends on the cluster being created:
+ * - Torus: Direct translation of the Torus' dimensions, e.g. (0, 0, 0) for a 3-D Torus
+ * - Fat-Tree: A pair (level in the tree, id), e.g. (0, 0) for first leaf in the tree and (1,0) for the first switch at
+ * level 1.
+ * - Dragonfly: a tuple (group, chassis, blades/routers, nodes), e.g. (0, 0, 0, 0) for first node in the cluster. To
+ * identify the router inside a (group, chassis, blade), we use MAX_UINT in the last parameter (e.g. 0, 0, 0,
+ * 4294967295).
+ *
  * @param zone Torus netzone being created (usefull to create the hosts/links inside it)
- * @param coord Coordinates in the torus (e.g. "0,0,0", "0,1,0")
+ * @param coord Coordinates in the cluster
  * @param id Internal identifier in the torus (for information)
  * @return Limiter link
  */
-static sg4::Link* create_limiter(sg4::NetZone* zone, const std::vector<unsigned int>& coord, int id)
+static sg4::Link* create_limiter(sg4::NetZone* zone, const std::vector<unsigned int>& /*coord*/, int id)
 {
   return zone->create_link("limiter-" + std::to_string(id), 1e9)->seal();
 }
@@ -182,30 +191,30 @@ static void create_torus_cluster()
  *
  * Creates a Fat-Tree cluster with 2 levels and 6 nodes
  * The following parameters are used to create this cluster:
- * - Levels: 2 - two-level cluster
- * - Down links: 2, 3 - L1 routers is connected to 2 elements, L2 routers to 3 elements
- * - Up links: 1, 2 - Each node (A-F) is connected to 1 L2 router, L2 routers are connected to 2 L1
+ * - Levels: 2 - two-level of switches in the cluster
+ * - Down links: 2, 3 - L2 routers is connected to 2 elements, L1 routers to 3 elements
+ * - Up links: 1, 2 - Each node (A-F) is connected to 1 L1 router, L1 routers are connected to 2 L2
  * - Link count: 1, 1 - Use 1 link in each level
  *
  * The first parameter describes how many levels we have.
  * The following ones describe the connection between the elements and must have exactly n_levels components.
  *
  *
- *                         S3     S4                <-- Level 1 routers
+ *                         S3     S4                <-- Level 2 routers
  *    link:limiter -      /   \  /  \
  *                       +     ++    +
  *    link: 10GBps -->  |     /  \    |
  *     (full-duplex)    |    /    \   |
  *                      +   +      +  +
  *                      |  /        \ |
- *                      S1           S2             <-- Level 2 routers
+ *                      S1           S2             <-- Level 1 routers
  *   link:limiter ->    |             |
  *                      +             +
  *  link:10GBps  -->   /|\           /|\
  *                    / | \         / | \
  *                   +  +  +       +  +  +
  *  link:limiter -> /   |   \     /   |   \
- *                 A    B    C   D    E    F        <-- Nodes
+ *                 A    B    C   D    E    F        <-- level 0 Nodes
  *
  * Each element (A to F) is a StarZone containing 8 Hosts.
  * The connection uses 2 links:
@@ -260,14 +269,12 @@ static void create_fatTree_cluster()
  *  Group 1
  *
  * Each element (A, B, C, etc) is a StarZone containing 8 Hosts.
- * The connection between nodes and routers (e.g. A->R1) uses 2 links:
+ * The connection between elements (e.g. A->R1) uses 2 links:
  * 1) limiter: a 1Gbs limiter link (set by user through the set_limiter callback)
  * 2) link: 10Gbs link connecting the components (created automatically)
  *
  * For example, a communication from A to C goes through:
- * <tt> A->limiter(A)->link(A-R1)->link(R1-R2)->limiter(C)->C</tt>
- *
- * Note that limiters are only valid for leaves, not routers.
+ * <tt> A->limiter(A)->link(A-R1)->limiter(R1)->link(R1-R2)->limiter(R2)->link(R2-C)limiter(C)->C</tt>
  *
  * More details in: <a href="https://simgrid.org/doc/latest/Platform_examples.html#dragonfly-cluster">Dragonfly
  * Cluster</a>
index d8d75a3..9245cbb 100644 (file)
@@ -130,112 +130,112 @@ $ ${bindir:=.}/s4u-clusters-multicpu dragonfly
 > [host0-cpu2:receiver-host0-cpu2:(4) 0.000083] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
 > [host0-cpu1:receiver-host0-cpu1:(3) 0.000083] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
 > [host0-cpu0:receiver-host0-cpu0:(2) 0.000083] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu0:receiver-host1-cpu0:(10) 0.095153] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu7:receiver-host1-cpu7:(17) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu6:receiver-host1-cpu6:(16) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu5:receiver-host1-cpu5:(15) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu4:receiver-host1-cpu4:(14) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu3:receiver-host1-cpu3:(13) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu2:receiver-host1-cpu2:(12) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host1-cpu1:receiver-host1-cpu1:(11) 0.095759] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu0:receiver-host3-cpu0:(74) 0.111399] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu0:receiver-host2-cpu0:(66) 0.111399] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu7:receiver-host3-cpu7:(81) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu6:receiver-host3-cpu6:(80) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu5:receiver-host3-cpu5:(79) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu4:receiver-host3-cpu4:(78) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu3:receiver-host3-cpu3:(77) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu2:receiver-host3-cpu2:(76) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host3-cpu1:receiver-host3-cpu1:(75) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu7:receiver-host2-cpu7:(73) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu6:receiver-host2-cpu6:(72) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu5:receiver-host2-cpu5:(71) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu4:receiver-host2-cpu4:(70) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu3:receiver-host2-cpu3:(69) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu2:receiver-host2-cpu2:(68) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host2-cpu1:receiver-host2-cpu1:(67) 0.111944] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu0:receiver-host5-cpu0:(90) 0.112633] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu0:receiver-host4-cpu0:(82) 0.112633] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu7:receiver-host5-cpu7:(97) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu6:receiver-host5-cpu6:(96) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu5:receiver-host5-cpu5:(95) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu4:receiver-host5-cpu4:(94) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu3:receiver-host5-cpu3:(93) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu2:receiver-host5-cpu2:(92) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host5-cpu1:receiver-host5-cpu1:(91) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu7:receiver-host4-cpu7:(89) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu6:receiver-host4-cpu6:(88) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu5:receiver-host4-cpu5:(87) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu4:receiver-host4-cpu4:(86) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu3:receiver-host4-cpu3:(85) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu2:receiver-host4-cpu2:(84) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host4-cpu1:receiver-host4-cpu1:(83) 0.113085] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu0:receiver-host9-cpu0:(122) 0.121906] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu0:receiver-host8-cpu0:(114) 0.121906] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu7:receiver-host9-cpu7:(129) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu6:receiver-host9-cpu6:(128) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu5:receiver-host9-cpu5:(127) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu4:receiver-host9-cpu4:(126) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu3:receiver-host9-cpu3:(125) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu2:receiver-host9-cpu2:(124) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host9-cpu1:receiver-host9-cpu1:(123) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu7:receiver-host8-cpu7:(121) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu6:receiver-host8-cpu6:(120) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu5:receiver-host8-cpu5:(119) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu4:receiver-host8-cpu4:(118) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu3:receiver-host8-cpu3:(117) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu2:receiver-host8-cpu2:(116) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host8-cpu1:receiver-host8-cpu1:(115) 0.122267] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu0:receiver-host7-cpu0:(106) 0.122697] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu0:receiver-host6-cpu0:(98) 0.122697] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu7:receiver-host7-cpu7:(113) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu6:receiver-host7-cpu6:(112) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu5:receiver-host7-cpu5:(111) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu4:receiver-host7-cpu4:(110) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu3:receiver-host7-cpu3:(109) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu2:receiver-host7-cpu2:(108) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host7-cpu1:receiver-host7-cpu1:(107) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu7:receiver-host6-cpu7:(105) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu6:receiver-host6-cpu6:(104) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu5:receiver-host6-cpu5:(103) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu4:receiver-host6-cpu4:(102) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu3:receiver-host6-cpu3:(101) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu2:receiver-host6-cpu2:(100) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host6-cpu1:receiver-host6-cpu1:(99) 0.122977] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu0:receiver-host11-cpu0:(26) 0.127894] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu0:receiver-host10-cpu0:(18) 0.127894] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu7:receiver-host11-cpu7:(33) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu6:receiver-host11-cpu6:(32) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu5:receiver-host11-cpu5:(31) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu4:receiver-host11-cpu4:(30) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu3:receiver-host11-cpu3:(29) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu2:receiver-host11-cpu2:(28) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host11-cpu1:receiver-host11-cpu1:(27) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu7:receiver-host10-cpu7:(25) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu6:receiver-host10-cpu6:(24) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu5:receiver-host10-cpu5:(23) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu4:receiver-host10-cpu4:(22) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu3:receiver-host10-cpu3:(21) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu2:receiver-host10-cpu2:(20) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host10-cpu1:receiver-host10-cpu1:(19) 0.128094] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu0:receiver-host13-cpu0:(42) 0.128297] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu0:receiver-host12-cpu0:(34) 0.128297] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu7:receiver-host13-cpu7:(49) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu6:receiver-host13-cpu6:(48) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu5:receiver-host13-cpu5:(47) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu4:receiver-host13-cpu4:(46) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu3:receiver-host13-cpu3:(45) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu2:receiver-host13-cpu2:(44) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host13-cpu1:receiver-host13-cpu1:(43) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu7:receiver-host12-cpu7:(41) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu6:receiver-host12-cpu6:(40) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu5:receiver-host12-cpu5:(39) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu4:receiver-host12-cpu4:(38) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu3:receiver-host12-cpu3:(37) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu2:receiver-host12-cpu2:(36) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host12-cpu1:receiver-host12-cpu1:(35) 0.128424] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host15-cpu0:receiver-host15-cpu0:(58) 0.130101] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
-> [host14-cpu0:receiver-host14-cpu0:(50) 0.130101] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu0:receiver-host1-cpu0:(10) 0.075914] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu7:receiver-host1-cpu7:(17) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu6:receiver-host1-cpu6:(16) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu5:receiver-host1-cpu5:(15) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu4:receiver-host1-cpu4:(14) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu3:receiver-host1-cpu3:(13) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu2:receiver-host1-cpu2:(12) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host1-cpu1:receiver-host1-cpu1:(11) 0.076281] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu0:receiver-host3-cpu0:(74) 0.102132] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu0:receiver-host2-cpu0:(66) 0.102132] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu7:receiver-host3-cpu7:(81) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu6:receiver-host3-cpu6:(80) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu5:receiver-host3-cpu5:(79) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu4:receiver-host3-cpu4:(78) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu3:receiver-host3-cpu3:(77) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu2:receiver-host3-cpu2:(76) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host3-cpu1:receiver-host3-cpu1:(75) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu7:receiver-host2-cpu7:(73) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu6:receiver-host2-cpu6:(72) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu5:receiver-host2-cpu5:(71) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu4:receiver-host2-cpu4:(70) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu3:receiver-host2-cpu3:(69) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu2:receiver-host2-cpu2:(68) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host2-cpu1:receiver-host2-cpu1:(67) 0.102454] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu0:receiver-host5-cpu0:(90) 0.102853] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu0:receiver-host4-cpu0:(82) 0.102853] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu7:receiver-host5-cpu7:(97) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu6:receiver-host5-cpu6:(96) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu5:receiver-host5-cpu5:(95) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu4:receiver-host5-cpu4:(94) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu3:receiver-host5-cpu3:(93) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu2:receiver-host5-cpu2:(92) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host5-cpu1:receiver-host5-cpu1:(91) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu7:receiver-host4-cpu7:(89) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu6:receiver-host4-cpu6:(88) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu5:receiver-host4-cpu5:(87) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu4:receiver-host4-cpu4:(86) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu3:receiver-host4-cpu3:(85) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu2:receiver-host4-cpu2:(84) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host4-cpu1:receiver-host4-cpu1:(83) 0.103113] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu0:receiver-host9-cpu0:(122) 0.118451] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu0:receiver-host8-cpu0:(114) 0.118451] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu7:receiver-host9-cpu7:(129) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu6:receiver-host9-cpu6:(128) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu5:receiver-host9-cpu5:(127) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu4:receiver-host9-cpu4:(126) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu3:receiver-host9-cpu3:(125) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu2:receiver-host9-cpu2:(124) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host9-cpu1:receiver-host9-cpu1:(123) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu7:receiver-host8-cpu7:(121) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu6:receiver-host8-cpu6:(120) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu5:receiver-host8-cpu5:(119) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu4:receiver-host8-cpu4:(118) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu3:receiver-host8-cpu3:(117) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu2:receiver-host8-cpu2:(116) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host8-cpu1:receiver-host8-cpu1:(115) 0.118652] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu0:receiver-host7-cpu0:(106) 0.118890] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu0:receiver-host6-cpu0:(98) 0.118890] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu7:receiver-host7-cpu7:(113) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu6:receiver-host7-cpu6:(112) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu5:receiver-host7-cpu5:(111) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu4:receiver-host7-cpu4:(110) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu3:receiver-host7-cpu3:(109) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu2:receiver-host7-cpu2:(108) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host7-cpu1:receiver-host7-cpu1:(107) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu7:receiver-host6-cpu7:(105) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu6:receiver-host6-cpu6:(104) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu5:receiver-host6-cpu5:(103) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu4:receiver-host6-cpu4:(102) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu3:receiver-host6-cpu3:(101) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu2:receiver-host6-cpu2:(100) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host6-cpu1:receiver-host6-cpu1:(99) 0.119044] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu0:receiver-host11-cpu0:(26) 0.127302] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu0:receiver-host10-cpu0:(18) 0.127302] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu7:receiver-host11-cpu7:(33) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu6:receiver-host11-cpu6:(32) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu5:receiver-host11-cpu5:(31) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu4:receiver-host11-cpu4:(30) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu3:receiver-host11-cpu3:(29) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu2:receiver-host11-cpu2:(28) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host11-cpu1:receiver-host11-cpu1:(27) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu7:receiver-host10-cpu7:(25) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu6:receiver-host10-cpu6:(24) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu5:receiver-host10-cpu5:(23) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu4:receiver-host10-cpu4:(22) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu3:receiver-host10-cpu3:(21) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu2:receiver-host10-cpu2:(20) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host10-cpu1:receiver-host10-cpu1:(19) 0.127410] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu0:receiver-host13-cpu0:(42) 0.127518] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu0:receiver-host12-cpu0:(34) 0.127518] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu7:receiver-host13-cpu7:(49) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu6:receiver-host13-cpu6:(48) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu5:receiver-host13-cpu5:(47) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu4:receiver-host13-cpu4:(46) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu3:receiver-host13-cpu3:(45) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu2:receiver-host13-cpu2:(44) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host13-cpu1:receiver-host13-cpu1:(43) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu7:receiver-host12-cpu7:(41) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu6:receiver-host12-cpu6:(40) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu5:receiver-host12-cpu5:(39) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu4:receiver-host12-cpu4:(38) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu3:receiver-host12-cpu3:(37) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu2:receiver-host12-cpu2:(36) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host12-cpu1:receiver-host12-cpu1:(35) 0.127586] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host15-cpu0:receiver-host15-cpu0:(58) 0.130128] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
+> [host14-cpu0:receiver-host14-cpu0:(50) 0.130128] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
 > [host15-cpu7:receiver-host15-cpu7:(65) 0.130157] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
 > [host15-cpu6:receiver-host15-cpu6:(64) 0.130157] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
 > [host15-cpu5:receiver-host15-cpu5:(63) 0.130157] [s4u_torus_multicpu/INFO] I got a 'Hello, I'm alive and running on host0-cpu0'.
index fa5fa22..70c6e62 100644 (file)
@@ -19,10 +19,14 @@ public:
   unsigned int chassis_;
   unsigned int blade_;
   resource::LinkImpl* blue_link_ = nullptr;
+  resource::LinkImpl* limiter_   = nullptr;
   std::vector<resource::LinkImpl*> black_links_;
   std::vector<resource::LinkImpl*> green_links_;
   std::vector<resource::LinkImpl*> my_nodes_;
-  DragonflyRouter(unsigned group, unsigned chassis, unsigned blade) : group_(group), chassis_(chassis), blade_(blade) {}
+  DragonflyRouter(unsigned group, unsigned chassis, unsigned blade, resource::LinkImpl* limiter)
+      : group_(group), chassis_(chassis), blade_(blade), limiter_(limiter)
+  {
+  }
 };
 
 /** @ingroup ROUTING_API
@@ -83,6 +87,8 @@ public:
   /** @brief Set Dragonfly topology */
   void set_topology(unsigned int n_groups, unsigned int groups_links, unsigned int n_chassis,
                     unsigned int chassis_links, unsigned int n_routers, unsigned int routers_links, unsigned int nodes);
+  /** @brief Build upper levels (routers) in Dragonfly */
+  void build_upper_levels(const s4u::ClusterCallbacks& set_callbacks);
   /** @brief Set the characteristics of links inside the Dragonfly zone */
   void set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy) override;
   Coords rankId_to_coords(int rank_id) const;
@@ -90,8 +96,7 @@ public:
                                                                                        unsigned int coords[4]) const;
 
 private:
-  void do_seal() override;
-  void generate_routers();
+  void generate_routers(const s4u::ClusterCallbacks& set_callbacks);
   void generate_links();
   void generate_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
 
index 05c3474..4ab2110 100644 (file)
@@ -151,7 +151,7 @@ public:
                     const std::vector<unsigned int>& up_links, const std::vector<unsigned int>& link_count);
   void add_processing_node(int id, resource::LinkImpl* limiter, resource::LinkImpl* loopback);
   /**
-   * @brief Build upper levels (switchs) in Fat-Tree
+   * @brief Build upper levels (switches) in Fat-Tree
    *
    * Suppose that set_topology and add_processing_node have already been called
    */
index 085788e..c100c59 100644 (file)
@@ -173,6 +173,13 @@ struct ClusterCallbacks {
   /**
    * @brief Callback used to set the links for some leaf of the cluster (Torus, FatTree, etc)
    *
+   * The coord parameter depends on the cluster being created:
+   * - Torus: Direct translation of the Torus' dimensions, e.g. (0, 0, 0) for a 3-D Torus
+   * - Fat-Tree: A pair (level in the tree, id), e.g. (0, 0): first leaf and (1,0): first switch at level 1.
+   * - Dragonfly: a tuple (group, chassis, blades/routers, nodes), e.g. (0, 0, 0, 0) for first node in the cluster.
+   * Important: To identify the router inside a "group, chassis, blade", we use MAX_UINT in the last parameter (e.g. 0,
+   * 0, 0, 4294967295).
+   *
    * @param zone: The newly create zone, needed for creating new resources (hosts, links)
    * @param coord: the coordinates of the element
    * @param id: Internal identifier of the element
index 43651e2..6d33261 100644 (file)
@@ -193,7 +193,7 @@ void ClusterZone::fill_leaf_from_cb(unsigned int position, const std::vector<uns
   // auxiliary function to get dims from index
   auto index_to_dims = [&dimensions](int index) {
     std::vector<unsigned int> dims_array(dimensions.size());
-    for (unsigned long i = dimensions.size() - 1; i != 0; --i) {
+    for (auto i = static_cast<int>(dimensions.size() - 1); i >= 0; --i) {
       if (index <= 0) {
         break;
       }
index bc7a8c1..beb0ebf 100644 (file)
@@ -142,22 +142,30 @@ s4u::DragonflyParams DragonflyZone::parse_topo_parameters(const std::string& top
 }
 
 /* Generate the cluster once every node is created */
-void DragonflyZone::do_seal()
+void DragonflyZone::build_upper_levels(const s4u::ClusterCallbacks& set_callbacks)
 {
-  if (num_nodes_per_blade_ == 0)
-    return;
-
-  generate_routers();
+  generate_routers(set_callbacks);
   generate_links();
 }
 
-void DragonflyZone::generate_routers()
+void DragonflyZone::generate_routers(const s4u::ClusterCallbacks& set_callbacks)
 {
+  int id = 0;
   routers_.reserve(num_groups_ * num_chassis_per_group_ * num_blades_per_chassis_);
-  for (unsigned int i = 0; i < num_groups_; i++)
-    for (unsigned int j = 0; j < num_chassis_per_group_; j++)
-      for (unsigned int k = 0; k < num_blades_per_chassis_; k++)
-        routers_.emplace_back(i, j, k);
+  for (unsigned int i = 0; i < num_groups_; i++) {
+    for (unsigned int j = 0; j < num_chassis_per_group_; j++) {
+      for (unsigned int k = 0; k < num_blades_per_chassis_; k++) {
+        resource::LinkImpl* limiter = nullptr;
+        if (set_callbacks.limiter) {
+          auto* s4u_link =
+              set_callbacks.limiter(get_iface(), {i, j, k, std::numeric_limits<unsigned int>::max()}, --id);
+          if (s4u_link)
+            limiter = s4u_link->get_impl();
+        }
+        routers_.emplace_back(i, j, k, limiter);
+      }
+    }
+  }
 }
 
 void DragonflyZone::generate_link(const std::string& id, int numlinks, resource::LinkImpl** linkup,
@@ -298,20 +306,22 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route,
                                             targetCoords.chassis * num_blades_per_chassis_ + targetCoords.blade];
   DragonflyRouter* currentRouter = myRouter;
 
+  if (has_limiter()) { // limiter for sender
+    route->link_list_.push_back(get_uplink_from(node_pos_with_loopback(src->id())));
+  }
+
   // node->router local link
   route->link_list_.push_back(myRouter->my_nodes_[myCoords.node * num_links_per_link_]);
   if (latency)
     *latency += myRouter->my_nodes_[myCoords.node * num_links_per_link_]->get_latency();
 
-  if (has_limiter()) { // limiter for sender
-    route->link_list_.push_back(get_uplink_from(node_pos_with_loopback(src->id())));
-  }
-
   if (targetRouter != myRouter) {
     // are we on a different group ?
     if (targetRouter->group_ != currentRouter->group_) {
       // go to the router of our group connected to this one.
       if (currentRouter->blade_ != targetCoords.group) {
+        if (currentRouter->limiter_)
+          route->link_list_.push_back(currentRouter->limiter_);
         // go to the nth router in our chassis
         route->link_list_.push_back(currentRouter->green_links_[targetCoords.group]);
         if (latency)
@@ -322,6 +332,8 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route,
 
       if (currentRouter->chassis_ != 0) {
         // go to the first chassis of our group
+        if (currentRouter->limiter_)
+          route->link_list_.push_back(currentRouter->limiter_);
         route->link_list_.push_back(currentRouter->black_links_[0]);
         if (latency)
           *latency += currentRouter->black_links_[0]->get_latency();
@@ -331,6 +343,8 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route,
 
       // go to destination group - the only optical hop
       route->link_list_.push_back(currentRouter->blue_link_);
+      if (currentRouter->limiter_)
+        route->link_list_.push_back(currentRouter->limiter_);
       if (latency)
         *latency += currentRouter->blue_link_->get_latency();
       currentRouter =
@@ -339,6 +353,8 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route,
 
     // same group, but same blade ?
     if (targetRouter->blade_ != currentRouter->blade_) {
+      if (currentRouter->limiter_)
+        route->link_list_.push_back(currentRouter->limiter_);
       route->link_list_.push_back(currentRouter->green_links_[targetCoords.blade]);
       if (latency)
         *latency += currentRouter->green_links_[targetCoords.blade]->get_latency();
@@ -348,23 +364,28 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route,
 
     // same blade, but same chassis ?
     if (targetRouter->chassis_ != currentRouter->chassis_) {
+      if (currentRouter->limiter_)
+        route->link_list_.push_back(currentRouter->limiter_);
       route->link_list_.push_back(currentRouter->black_links_[targetCoords.chassis]);
       if (latency)
         *latency += currentRouter->black_links_[targetCoords.chassis]->get_latency();
     }
   }
 
-  if (has_limiter()) { // limiter for receiver
-    route->link_list_.push_back(get_downlink_to(node_pos_with_loopback(dst->id())));
-  }
-
   // router->node local link
+  if (targetRouter->limiter_)
+    route->link_list_.push_back(targetRouter->limiter_);
   route->link_list_.push_back(
       targetRouter->my_nodes_[targetCoords.node * num_links_per_link_ + num_links_per_link_ - 1]);
+
   if (latency)
     *latency +=
         targetRouter->my_nodes_[targetCoords.node * num_links_per_link_ + num_links_per_link_ - 1]->get_latency();
 
+  if (has_limiter()) { // limiter for receiver
+    route->link_list_.push_back(get_downlink_to(node_pos_with_loopback(dst->id())));
+  }
+
   // set gateways (if any)
   route->gw_src_ = get_gateway(src->id());
   route->gw_dst_ = get_gateway(dst->id());
@@ -424,6 +445,7 @@ NetZone* create_dragonfly_zone(const std::string& name, const NetZone* parent, c
     Link* loopback;
     zone->fill_leaf_from_cb(i, dimensions, set_callbacks, &netpoint, &loopback, &limiter);
   }
+  zone->build_upper_levels(set_callbacks);
 
   return zone->get_iface();
 }
index eaf3ef5..87c02cd 100644 (file)
@@ -1226,6 +1226,10 @@ $ ${bindir:=.}/flatifier ../platforms/cluster_dragonfly_noncontiguous_rad.xml "-
 >   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP" bandwidth="375000000" latency="0.000050000"/>
 >   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_DOWN" bandwidth="375000000" latency="0.000050000"/>
 >   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP" bandwidth="375000000" latency="0.000050000"/>
+>   <link id="bob_cluster_link_-1_limiter" bandwidth="150000000" latency="0.000000000"/>
+>   <link id="bob_cluster_link_-2_limiter" bandwidth="150000000" latency="0.000000000"/>
+>   <link id="bob_cluster_link_-3_limiter" bandwidth="150000000" latency="0.000000000"/>
+>   <link id="bob_cluster_link_-4_limiter" bandwidth="150000000" latency="0.000000000"/>
 >   <link id="bob_cluster_link_0_limiter" bandwidth="150000000" latency="0.000000000"/>
 >   <link id="bob_cluster_link_0_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
 >   <link id="bob_cluster_link_1002_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
@@ -1250,46 +1254,46 @@ $ ${bindir:=.}/flatifier ../platforms/cluster_dragonfly_noncontiguous_rad.xml "-
 >   <link_ctn id="bob_cluster_link_0_loopback"/>
 >   </route>
 >   <route src="node-0.simgrid.org" dst="node-1002.simgrid.org">
->   <link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_UP"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/>
+>   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/><link_ctn id="bob_cluster_link_1_limiter"/>
 >   </route>
 >   <route src="node-0.simgrid.org" dst="node-1003.simgrid.org">
->   <link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/>
+>   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/><link_ctn id="bob_cluster_link_2_limiter"/>
 >   </route>
 >   <route src="node-0.simgrid.org" dst="node-1004.simgrid.org">
->   <link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_UP"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/>
+>   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_UP"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-1002.simgrid.org" dst="node-0.simgrid.org">
->   <link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/>
+>   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/>
 >   </route>
 >   <route src="node-1002.simgrid.org" dst="node-1002.simgrid.org">
 >   <link_ctn id="bob_cluster_link_1002_loopback"/>
 >   </route>
 >   <route src="node-1002.simgrid.org" dst="node-1003.simgrid.org">
->   <link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/>
+>   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/><link_ctn id="bob_cluster_link_2_limiter"/>
 >   </route>
 >   <route src="node-1002.simgrid.org" dst="node-1004.simgrid.org">
->   <link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/>
+>   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-1003.simgrid.org" dst="node-0.simgrid.org">
->   <link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/>
+>   <link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_DOWN"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/>
 >   </route>
 >   <route src="node-1003.simgrid.org" dst="node-1002.simgrid.org">
->   <link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_UP"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/>
+>   <link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/><link_ctn id="bob_cluster_link_1_limiter"/>
 >   </route>
 >   <route src="node-1003.simgrid.org" dst="node-1003.simgrid.org">
 >   <link_ctn id="bob_cluster_link_1003_loopback"/>
 >   </route>
 >   <route src="node-1003.simgrid.org" dst="node-1004.simgrid.org">
->   <link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_UP"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/>
+>   <link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_UP"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_DOWN"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-1004.simgrid.org" dst="node-0.simgrid.org">
->   <link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/>
+>   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="local_link_from_router_0_to_node_0_0_DOWN"/><link_ctn id="bob_cluster_link_0_limiter"/>
 >   </route>
 >   <route src="node-1004.simgrid.org" dst="node-1002.simgrid.org">
->   <link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_DOWN"/><link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/>
+>   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_DOWN"/><link_ctn id="bob_cluster_link_-2_limiter"/><link_ctn id="local_link_from_router_1_to_node_0_1_DOWN"/><link_ctn id="bob_cluster_link_1_limiter"/>
 >   </route>
 >   <route src="node-1004.simgrid.org" dst="node-1003.simgrid.org">
->   <link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/>
+>   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="local_link_from_router_3_to_node_0_3_UP"/><link_ctn id="bob_cluster_link_-4_limiter"/><link_ctn id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN"/><link_ctn id="bob_cluster_link_-1_limiter"/><link_ctn id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP"/><link_ctn id="bob_cluster_link_-3_limiter"/><link_ctn id="local_link_from_router_2_to_node_0_2_DOWN"/><link_ctn id="bob_cluster_link_2_limiter"/>
 >   </route>
 >   <route src="node-1004.simgrid.org" dst="node-1004.simgrid.org">
 >   <link_ctn id="bob_cluster_link_1004_loopback"/>