Topology.cc (9869:a204694db4f9) | Topology.cc (10005:8c2b0dc16ccd) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 115 unchanged lines hidden (view full) --- 124 125void 126Topology::createLinks(Network *net) 127{ 128 // Find maximum switchID 129 SwitchID max_switch_id = 0; 130 for (LinkMap::const_iterator i = m_link_map.begin(); 131 i != m_link_map.end(); ++i) { | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 115 unchanged lines hidden (view full) --- 124 125void 126Topology::createLinks(Network *net) 127{ 128 // Find maximum switchID 129 SwitchID max_switch_id = 0; 130 for (LinkMap::const_iterator i = m_link_map.begin(); 131 i != m_link_map.end(); ++i) { |
132 std::pair<int, int> src_dest = (*i).first; | 132 std::pair<SwitchID, SwitchID> src_dest = (*i).first; |
133 max_switch_id = max(max_switch_id, src_dest.first); 134 max_switch_id = max(max_switch_id, src_dest.second); 135 } 136 137 // Initialize weight, latency, and inter switched vectors 138 Matrix topology_weights; 139 int num_switches = max_switch_id+1; 140 topology_weights.resize(num_switches); --- 164 unchanged lines hidden (view full) --- 305 int d = 0; 306 int machines; 307 int max_machines; 308 309 machines = MachineType_NUM; 310 max_machines = MachineType_base_number(MachineType_NUM); 311 312 for (int m = 0; m < machines; m++) { | 133 max_switch_id = max(max_switch_id, src_dest.first); 134 max_switch_id = max(max_switch_id, src_dest.second); 135 } 136 137 // Initialize weight, latency, and inter switched vectors 138 Matrix topology_weights; 139 int num_switches = max_switch_id+1; 140 topology_weights.resize(num_switches); --- 164 unchanged lines hidden (view full) --- 305 int d = 0; 306 int machines; 307 int max_machines; 308 309 machines = MachineType_NUM; 310 max_machines = MachineType_base_number(MachineType_NUM); 311 312 for (int m = 0; m < machines; m++) { |
313 for (int i = 0; i < MachineType_base_count((MachineType)m); i++) { | 313 for (NodeID i = 0; i < MachineType_base_count((MachineType)m); i++) { |
314 // we use "d+max_machines" below since the "destination" 315 // switches for the machines are numbered 316 // [MachineType_base_number(MachineType_NUM)... 317 // 2*MachineType_base_number(MachineType_NUM)-1] for the 318 // component network 319 if (link_is_shortest_path_to_node(src, next, d + max_machines, 320 weights, dist)) { 321 MachineID mach = {(MachineType)m, i}; --- 14 unchanged lines hidden --- | 314 // we use "d+max_machines" below since the "destination" 315 // switches for the machines are numbered 316 // [MachineType_base_number(MachineType_NUM)... 317 // 2*MachineType_base_number(MachineType_NUM)-1] for the 318 // component network 319 if (link_is_shortest_path_to_node(src, next, d + max_machines, 320 weights, dist)) { 321 MachineID mach = {(MachineType)m, i}; --- 14 unchanged lines hidden --- |