// 2D torus topology void Torus2DTopology::construct() { Vector< Vector < SwitchID > > nodePairs; // node pairs extracted from the file Vector latencies; // link latencies for each link extracted Vector bw_multis; // bw multipliers for each link extracted Vector < SwitchID > nodes; // temporary buffer nodes.setSize(2); // number of inter-chip switches int numberOfTorusSwitches = m_nodes/MachineType_base_level(MachineType_NUM); // one switch per machine node grouping Vector torusSwitches; for(int i=0; igetLinkLatency(); // external link latency int bw_multiplier = 1; // external link bw multiplier of the global bandwidth for(int i=0; i= 2*m_nodes+numberOfTorusSwitches){ // determine if node is on the bottom // sorin: bad bug if this is a > instead of a >= nodes[1] = nodes[0] + lengthOfSide - (lengthOfSide*lengthOfSide); } else { nodes[1] = nodes[0] + lengthOfSide; } nodePairs.insertAtBottom(nodes); latencies.insertAtBottom(latency); bw_multis.insertAtBottom(bw_multiplier); } // add links ASSERT(nodePairs.size() == latencies.size() && latencies.size() == bw_multis.size()) for (int k = 0; k < nodePairs.size(); k++) { ASSERT(nodePairs[k].size() == 2); addLink(nodePairs[k][0], nodePairs[k][1], latencies[k], bw_multis[k]); } }