SimpleNetwork.cc (10311:ad9c042dce54) | SimpleNetwork.cc (10370:4466307b8a2a) |
---|---|
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; --- 103 unchanged lines hidden (view full) --- 112 113// From a switch to a switch 114void 115SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link, 116 LinkDirection direction, 117 const NetDest& routing_table_entry) 118{ 119 // Create a set of new MessageBuffers | 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; --- 103 unchanged lines hidden (view full) --- 112 113// From a switch to a switch 114void 115SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link, 116 LinkDirection direction, 117 const NetDest& routing_table_entry) 118{ 119 // Create a set of new MessageBuffers |
120 std::map<int, MessageBuffer*> queues; | 120 std::vector<MessageBuffer*> queues(m_virtual_networks); 121 |
121 for (int i = 0; i < m_virtual_networks; i++) { 122 // allocate a buffer 123 MessageBuffer* buffer_ptr = new MessageBuffer; 124 buffer_ptr->setOrdering(true); 125 126 if (m_buffer_size > 0) { 127 buffer_ptr->resize(m_buffer_size); 128 } --- 24 unchanged lines hidden (view full) --- 153 m_in_use[network_num] = true; 154} 155 156void 157SimpleNetwork::setToNetQueue(NodeID id, bool ordered, int network_num, 158 std::string vnet_type, MessageBuffer *b) 159{ 160 checkNetworkAllocation(id, ordered, network_num); | 122 for (int i = 0; i < m_virtual_networks; i++) { 123 // allocate a buffer 124 MessageBuffer* buffer_ptr = new MessageBuffer; 125 buffer_ptr->setOrdering(true); 126 127 if (m_buffer_size > 0) { 128 buffer_ptr->resize(m_buffer_size); 129 } --- 24 unchanged lines hidden (view full) --- 154 m_in_use[network_num] = true; 155} 156 157void 158SimpleNetwork::setToNetQueue(NodeID id, bool ordered, int network_num, 159 std::string vnet_type, MessageBuffer *b) 160{ 161 checkNetworkAllocation(id, ordered, network_num); |
162 while (m_toNetQueues[id].size() <= network_num) { 163 m_toNetQueues[id].push_back(nullptr); 164 } |
|
161 m_toNetQueues[id][network_num] = b; 162} 163 164void 165SimpleNetwork::setFromNetQueue(NodeID id, bool ordered, int network_num, 166 std::string vnet_type, MessageBuffer *b) 167{ 168 checkNetworkAllocation(id, ordered, network_num); | 165 m_toNetQueues[id][network_num] = b; 166} 167 168void 169SimpleNetwork::setFromNetQueue(NodeID id, bool ordered, int network_num, 170 std::string vnet_type, MessageBuffer *b) 171{ 172 checkNetworkAllocation(id, ordered, network_num); |
173 while (m_fromNetQueues[id].size() <= network_num) { 174 m_fromNetQueues[id].push_back(nullptr); 175 } |
|
169 m_fromNetQueues[id][network_num] = b; 170} 171 172void 173SimpleNetwork::regStats() 174{ 175 for (MessageSizeType type = MessageSizeType_FIRST; 176 type < MessageSizeType_NUM; ++type) { --- 78 unchanged lines hidden --- | 176 m_fromNetQueues[id][network_num] = b; 177} 178 179void 180SimpleNetwork::regStats() 181{ 182 for (MessageSizeType type = MessageSizeType_FIRST; 183 type < MessageSizeType_NUM; ++type) { --- 78 unchanged lines hidden --- |