Skip to content

Commit

Permalink
Merge pull request #568 from jjwilke/fat-tree-scale
Browse files Browse the repository at this point in the history
fix port scaling issue for fat tree
  • Loading branch information
jjwilke authored Jul 31, 2020
2 parents 8eb2d79 + f1414eb commit fdaedca
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 60 deletions.
32 changes: 10 additions & 22 deletions sstmac/hardware/topology/fat_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,28 +340,6 @@ FatTree::connectedOutports(SwitchId src, std::vector<Connection>& conns) const
}
}

double
FatTree::portScaleFactor(uint32_t addr, int /*port*/) const
{
int my_level = level(addr);

int n_leaf_port = up_ports_per_leaf_switch_ + concentration();
int n_agg_port = up_ports_per_agg_switch_ + down_ports_per_agg_switch_;
int n_core_port = down_ports_per_core_switch_;
int min_port = std::min(n_leaf_port,n_agg_port);
min_port = std::min(min_port,n_core_port);

double multiplier = 1.0;
if (my_level == 0 && n_leaf_port > min_port)
multiplier *= double(n_leaf_port) / double(min_port);
else if (my_level == 1 && n_agg_port > min_port)
multiplier *= double(n_agg_port) / double(min_port);
else if (my_level == 2 && n_core_port > min_port)
multiplier *= double(n_core_port) / double(min_port);

return multiplier;
}

void
FatTree::checkInput() const
{
Expand Down Expand Up @@ -430,6 +408,16 @@ FatTree::checkInput() const
"agg_switches_per_subtree * down_ports_per_agg_switch must equal leaf_switches_per_subtree * up_ports_per_leaf_switch (%d != %d)",
ndown,nup);
}

#if !SSTMAC_INTEGRATED_SST_CORE
int agg_ports = down_ports_per_agg_switch_ + up_ports_per_agg_switch_;
int core_ports = down_ports_per_core_switch_;
int leaf_ports = concentration() + up_ports_per_leaf_switch_;

if (agg_ports != core_ports || leaf_ports != agg_ports || leaf_ports != core_ports){
std::cerr << "WARNING: Fat tree configured with non-uniform switches (different no. ports per switch). SST/macro may not accurately model nonuniform switch crossbars without sst-core support" << std::endl;
}
#endif
}

void
Expand Down
2 changes: 0 additions & 2 deletions sstmac/hardware/topology/fat_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ class FatTree :

void connectedOutports(SwitchId src, std::vector<Connection>& conns) const override;

double portScaleFactor(uint32_t addr, int port) const override;

int minimalDistance(SwitchId src, SwitchId dst) const {
if (src == dst){
return 0;
Expand Down
38 changes: 19 additions & 19 deletions tests/reference/test_core_apps_ping_all_fattree_tapered.ref-out
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,45 @@ Rank 25 = 5000.0888ms
Rank 20 = 5000.0943ms
Rank 18 = 5000.0952ms
Rank 21 = 5000.0962ms
Rank 1 = 5000.0977ms
Rank 1 = 5000.0976ms
Rank 19 = 5000.0982ms
Rank 4 = 5000.0997ms
Rank 0 = 5000.1016ms
Rank 5 = 5000.1023ms
Rank 3 = 5000.1077ms
Rank 0 = 5000.1006ms
Rank 5 = 5000.1033ms
Rank 3 = 5000.1078ms
Rank 12 = 5000.1111ms
Rank 15 = 5000.1121ms
Rank 7 = 5000.1122ms
Rank 8 = 5000.1162ms
Rank 7 = 5000.1125ms
Rank 8 = 5000.1152ms
Rank 24 = 5000.1162ms
Rank 9 = 5000.1187ms
Rank 41 = 5000.1218ms
Rank 10 = 5000.1231ms
Rank 6 = 5000.1231ms
Rank 6 = 5000.1234ms
Rank 29 = 5000.1254ms
Rank 22 = 5000.1253ms
Rank 11 = 5000.1268ms
Rank 27 = 5000.1286ms
Rank 27 = 5000.1288ms
Rank 23 = 5000.1304ms
Rank 40 = 5000.1317ms
Rank 28 = 5000.1326ms
Rank 31 = 5000.1334ms
Rank 28 = 5000.1321ms
Rank 31 = 5000.1337ms
Rank 46 = 5000.1357ms
Rank 45 = 5000.1365ms
Rank 26 = 5000.1381ms
Rank 26 = 5000.1384ms
Rank 14 = 5000.1406ms
Rank 30 = 5000.1412ms
Rank 43 = 5000.1430ms
Rank 44 = 5000.1469ms
Rank 42 = 5000.1483ms
Rank 32 = 5000.1525ms
Rank 17 = 5000.1549ms
Rank 32 = 5000.1526ms
Rank 17 = 5000.1550ms
Rank 47 = 5000.1584ms
Rank 2 = 5000.1624ms
Rank 33 = 5000.1639ms
Rank 34 = 5000.1683ms
Rank 2 = 5000.1627ms
Rank 33 = 5000.1640ms
Rank 34 = 5000.1679ms
Rank 48 = 5000.1699ms
Rank 35 = 5000.1786ms
Rank 35 = 5000.1781ms
Rank 68 = 5000.1817ms
Rank 66 = 5000.1867ms
Rank 72 = 5000.1869ms
Expand All @@ -54,7 +54,7 @@ Rank 73 = 5000.2064ms
Rank 37 = 5000.2126ms
Rank 64 = 5000.2137ms
Rank 76 = 5000.2156ms
Rank 74 = 5000.2159ms
Rank 74 = 5000.2160ms
Rank 65 = 5000.2164ms
Rank 69 = 5000.2166ms
Rank 53 = 5000.2166ms
Expand All @@ -78,4 +78,4 @@ Rank 62 = 5000.2932ms
Rank 58 = 5000.3006ms
Rank 63 = 5000.3168ms
Rank 59 = 5000.3236ms
Estimated total runtime of 5.00033221 seconds
Estimated total runtime of 5.00033155 seconds
34 changes: 17 additions & 17 deletions tests/reference/test_core_apps_ping_all_tree_table.ref-out
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Rank 1 = 5000.0073ms
Rank 2 = 5000.0087ms
Rank 0 = 5000.0094ms
Rank 3 = 5000.0099ms
Rank 4 = 5000.0138ms
Rank 8 = 5000.0220ms
Rank 6 = 5000.0227ms
Rank 7 = 5000.0281ms
Rank 10 = 5000.0282ms
Rank 5 = 5000.0319ms
Rank 11 = 5000.0347ms
Rank 9 = 5000.0456ms
Rank 12 = 5000.0468ms
Rank 13 = 5000.0544ms
Rank 14 = 5000.0609ms
Rank 15 = 5000.0689ms
Estimated total runtime of 5.00007431 seconds
Rank 1 = 5000.0069ms
Rank 2 = 5000.0078ms
Rank 0 = 5000.0090ms
Rank 3 = 5000.0090ms
Rank 4 = 5000.0161ms
Rank 8 = 5000.0228ms
Rank 10 = 5000.0321ms
Rank 6 = 5000.0324ms
Rank 7 = 5000.0368ms
Rank 11 = 5000.0385ms
Rank 5 = 5000.0436ms
Rank 9 = 5000.0477ms
Rank 12 = 5000.0516ms
Rank 13 = 5000.0582ms
Rank 14 = 5000.0628ms
Rank 15 = 5000.0708ms
Estimated total runtime of 5.00007615 seconds

0 comments on commit fdaedca

Please sign in to comment.