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; --- 64 unchanged lines hidden (view full) --- 73 m_fromNetQueues[node].resize(m_virtual_networks); 74 for (int j = 0; j < m_virtual_networks; j++) { 75 m_toNetQueues[node][j] = 76 new MessageBuffer(csprintf("toNet node %d j %d", node, j)); 77 m_fromNetQueues[node][j] = 78 new MessageBuffer(csprintf("fromNet node %d j %d", node, j)); 79 } 80 } |
81 82 // record the routers 83 for (vector<BasicRouter*>::const_iterator i = 84 m_topology_ptr->params()->routers.begin(); 85 i != m_topology_ptr->params()->routers.end(); ++i) { 86 Switch* s = safe_cast<Switch*>(*i); 87 m_switch_ptr_vector.push_back(s); 88 s->init_net_ptr(this); 89 } |
90} 91 92void 93SimpleNetwork::init() 94{ 95 Network::init(); 96 97 // The topology pointer should have already been initialized in 98 // the parent class network constructor. 99 assert(m_topology_ptr != NULL); |
100 // false because this isn't a reconfiguration 101 m_topology_ptr->createLinks(this, false); 102} 103 104void 105SimpleNetwork::reset() 106{ 107 for (int node = 0; node < m_nodes; node++) { --- 173 unchanged lines hidden (view full) --- 281 uint64 total_msgs = 0; 282 uint64 total_bytes = 0; 283 for (MessageSizeType type = MessageSizeType_FIRST; 284 type < MessageSizeType_NUM; 285 ++type) { 286 287 if (total_msg_counts[type] > 0) { 288 out << "total_msg_count_" << type << ": " << total_msg_counts[type] |
289 << " " << total_msg_counts[type] * 290 uint64(MessageSizeType_to_int(type)) |
291 << endl; 292 293 total_msgs += total_msg_counts[type]; 294 295 total_bytes += total_msg_counts[type] * |
296 uint64(MessageSizeType_to_int(type)); |
297 } 298 } 299 300 out << "total_msgs: " << total_msgs 301 << " total_bytes: " << total_bytes << endl; 302 303 out << endl; 304 for (int i = 0; i < m_switch_ptr_vector.size(); i++) { --- 25 unchanged lines hidden --- |