Skip to content

Commit

Permalink
Fix num routers and router radix assumption in info logging (#8)
Browse files Browse the repository at this point in the history
* Fix num routers and router radix assumption in info logging
* Fix Dragonfly router lookup bug
  • Loading branch information
nicmcd authored Feb 27, 2020
1 parent 8a47061 commit ae3268f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,19 @@ s32 main(s32 _argc, char** _argv) {
gSim->setNetwork(network);
u32 numInterfaces = network->numInterfaces();
u32 numRouters = network->numRouters();
u32 routerRadix = network->getRouter(0)->numPorts();
std::map<u32, u32> routerRadices;
for (u32 routerId = 0; routerId < numRouters; routerId++) {
routerRadices[network->getRouter(routerId)->numPorts()] += 1;
}
u32 numVcs = network->numVcs();
u64 numComponents = Component::numComponents();

gSim->infoLog.logInfo("Endpoints", std::to_string(numInterfaces));
gSim->infoLog.logInfo("Routers", std::to_string(numRouters));
gSim->infoLog.logInfo("Router0 Radix", std::to_string(routerRadix));
for (auto& p : routerRadices) {
gSim->infoLog.logInfo("Router radix " + std::to_string(p.first),
std::to_string(p.second));
}
gSim->infoLog.logInfo("VCs", std::to_string(numVcs));
gSim->infoLog.logInfo("Components", std::to_string(numComponents));

Expand Down
4 changes: 2 additions & 2 deletions src/network/dragonfly/Network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ u32 Network::numInterfaces() const {
Router* Network::getRouter(u32 _id) const {
std::vector<u32> routerAddress;
translateRouterIdToAddress(_id, &routerAddress);
u32 g = routerAddress.at(0);
u32 r = routerAddress.at(1);
u32 g = routerAddress.at(1);
u32 r = routerAddress.at(0);
return routers_.at(g).at(r);
}

Expand Down

0 comments on commit ae3268f

Please sign in to comment.