SimpleNetwork.cc (9117:49116b947194) SimpleNetwork.cc (9274:ba635023d4bb)
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 }
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 }
81}
82
83void
84SimpleNetwork::init()
85{
86 Network::init();
87
88 // The topology pointer should have already been initialized in
89 // the parent class network constructor.
90 assert(m_topology_ptr != NULL);
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);
91 int number_of_switches = m_topology_ptr->numSwitches();
92 for (int i = 0; i < number_of_switches; i++) {
93 m_switch_ptr_vector.push_back(new Switch(i, this));
94 }
95
96 // false because this isn't a reconfiguration
97 m_topology_ptr->createLinks(this, false);
98}
99
100void
101SimpleNetwork::reset()
102{
103 for (int node = 0; node < m_nodes; node++) {

--- 173 unchanged lines hidden (view full) ---

277 uint64 total_msgs = 0;
278 uint64 total_bytes = 0;
279 for (MessageSizeType type = MessageSizeType_FIRST;
280 type < MessageSizeType_NUM;
281 ++type) {
282
283 if (total_msg_counts[type] > 0) {
284 out << "total_msg_count_" << type << ": " << total_msg_counts[type]
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]
285 << " " << total_msg_counts[type] *
286 uint64(RubySystem::getNetwork()->MessageSizeType_to_int(type))
289 << " " << total_msg_counts[type] *
290 uint64(MessageSizeType_to_int(type))
287 << endl;
288
289 total_msgs += total_msg_counts[type];
290
291 total_bytes += total_msg_counts[type] *
291 << endl;
292
293 total_msgs += total_msg_counts[type];
294
295 total_bytes += total_msg_counts[type] *
292 uint64(RubySystem::getNetwork()->MessageSizeType_to_int(type));
293
296 uint64(MessageSizeType_to_int(type));
294 }
295 }
296
297 out << "total_msgs: " << total_msgs
298 << " total_bytes: " << total_bytes << endl;
299
300 out << endl;
301 for (int i = 0; i < m_switch_ptr_vector.size(); i++) {

--- 25 unchanged lines hidden ---
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 ---