Throttle.cc (10895:287285860dd6) Throttle.cc (10918:dd3ab1f109ad)
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;

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

41
42const int MESSAGE_SIZE_MULTIPLIER = 1000;
43//const int BROADCAST_SCALING = 4; // Have a 16p system act like a 64p systems
44const int BROADCAST_SCALING = 1;
45const int PRIORITY_SWITCH_LIMIT = 128;
46
47static int network_message_to_size(Message* net_msg_ptr);
48
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;

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

41
42const int MESSAGE_SIZE_MULTIPLIER = 1000;
43//const int BROADCAST_SCALING = 4; // Have a 16p system act like a 64p systems
44const int BROADCAST_SCALING = 1;
45const int PRIORITY_SWITCH_LIMIT = 128;
46
47static int network_message_to_size(Message* net_msg_ptr);
48
49Throttle::Throttle(int sID, NodeID node, Cycles link_latency,
49Throttle::Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency,
50 int link_bandwidth_multiplier, int endpoint_bandwidth,
51 ClockedObject *em)
50 int link_bandwidth_multiplier, int endpoint_bandwidth,
51 ClockedObject *em)
52 : Consumer(em)
52 : Consumer(em), m_ruby_system(rs)
53{
54 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
55 m_sID = sID;
56}
57
53{
54 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
55 m_sID = sID;
56}
57
58Throttle::Throttle(NodeID node, Cycles link_latency,
58Throttle::Throttle(RubySystem *rs, NodeID node, Cycles link_latency,
59 int link_bandwidth_multiplier, int endpoint_bandwidth,
60 ClockedObject *em)
59 int link_bandwidth_multiplier, int endpoint_bandwidth,
60 ClockedObject *em)
61 : Consumer(em)
61 : Consumer(em), m_ruby_system(rs)
62{
63 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
64 m_sID = 0;
65}
66
67void
68Throttle::init(NodeID node, Cycles link_latency,
69 int link_bandwidth_multiplier, int endpoint_bandwidth)

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

240Throttle::clearStats()
241{
242 m_link_utilization_proxy = 0;
243}
244
245void
246Throttle::collateStats()
247{
62{
63 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
64 m_sID = 0;
65}
66
67void
68Throttle::init(NodeID node, Cycles link_latency,
69 int link_bandwidth_multiplier, int endpoint_bandwidth)

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

240Throttle::clearStats()
241{
242 m_link_utilization_proxy = 0;
243}
244
245void
246Throttle::collateStats()
247{
248 m_link_utilization = 100.0 * m_link_utilization_proxy
249 / (double(g_system_ptr->curCycle() - g_ruby_start));
248 double time_delta = double(m_ruby_system->curCycle() -
249 m_ruby_system->getStartCycle());
250
251 m_link_utilization = 100.0 * m_link_utilization_proxy / time_delta;
250}
251
252void
253Throttle::print(ostream& out) const
254{
255 ccprintf(out, "[%i bw: %i]", m_node, getLinkBandwidth());
256}
257

--- 14 unchanged lines hidden ---
252}
253
254void
255Throttle::print(ostream& out) const
256{
257 ccprintf(out, "[%i bw: %i]", m_node, getLinkBandwidth());
258}
259

--- 14 unchanged lines hidden ---