Skip to content

Commit

Permalink
- Change "energy_per_ingress" to "ingress_energy" for consistency
Browse files Browse the repository at this point in the history
  with other stat names.
- Change final pJ/op stat prints to fJ/op for better readability.
  • Loading branch information
angshuman-parashar committed Sep 21, 2023
1 parent 1ddd52f commit b65f7b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions include/model/network-legacy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class LegacyNetwork : public Network
Attribute<double> energy_per_hop; //pJ

// Additional overheads.
Attribute<double> energy_per_ingress; //pJ
Attribute<double> ingress_energy; //pJ

// Network fill and drain latency
Attribute<std::uint64_t> fill_latency;
Expand All @@ -90,7 +90,7 @@ class LegacyNetwork : public Network
ar& BOOST_SERIALIZATION_NVP(wire_energy);
ar& BOOST_SERIALIZATION_NVP(tile_width);
ar& BOOST_SERIALIZATION_NVP(energy_per_hop);
ar& BOOST_SERIALIZATION_NVP(energy_per_ingress);
ar& BOOST_SERIALIZATION_NVP(ingress_energy);
ar& BOOST_SERIALIZATION_NVP(fill_latency);
ar& BOOST_SERIALIZATION_NVP(drain_latency);
}
Expand Down
13 changes: 7 additions & 6 deletions src/model/network-legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ LegacyNetwork::Specs LegacyNetwork::ParseSpecs(config::CompoundConfigNode networ
double energy_per_hop;
if (network.lookupValue("energy-per-hop", energy_per_hop)) specs.energy_per_hop = energy_per_hop;

double energy_per_ingress;
if (network.lookupValue("energy-per-ingress", energy_per_ingress)) specs.energy_per_ingress = energy_per_ingress;
double ingress_energy;
if (network.lookupValue("energy-per-ingress", ingress_energy)) specs.ingress_energy = ingress_energy;

// Network fill and drain latency
unsigned long long fill_latency;
Expand Down Expand Up @@ -407,7 +407,7 @@ void LegacyNetwork::ComputeNetworkEnergy()
specs_.energy_per_hop.IsSpecified() ?
specs_.energy_per_hop.Get() : WireEnergyPerHop(specs_.word_bits.Get(), specs_.tile_width.Get(), wire_energy);
double energy_per_router = specs_.router_energy.IsSpecified() ? specs_.router_energy.Get() : 0.0; // Set to 0 since no internal model yet
double energy_per_ingress = specs_.energy_per_ingress.IsSpecified() ? specs_.energy_per_ingress.Get() : 0.0;
double ingress_energy = specs_.ingress_energy.IsSpecified() ? specs_.ingress_energy.Get() : 0.0;

/*
auto fanout = stats_.distributed_multicast.at(pv) ?
Expand Down Expand Up @@ -470,7 +470,7 @@ void LegacyNetwork::ComputeNetworkEnergy()
stats_.energy[pv] =
total_wire_hops * energy_per_hop + // wire energy
total_routers_touched * energy_per_router + // router energy
energy_per_ingress * total_ingresses;
ingress_energy * total_ingresses;

stats_.link_transfer_energy[pv] =
stats_.link_transfers.at(pv) * (energy_per_hop + 2*energy_per_router);
Expand Down Expand Up @@ -563,8 +563,9 @@ void LegacyNetwork::Print(std::ostream& out) const
out << indent << indent << "Word bits : " << specs_.word_bits << std::endl;
out << indent << indent << "Router energy : " << specs_.router_energy << " pJ" << std::endl;
out << indent << indent << "Wire energy : " << specs_.wire_energy << " pJ/b/mm" << std::endl;
out << indent << indent << "Fill latency : " << stats_.fill_latency << std::endl;
out << indent << indent << "Drain latency : " << stats_.drain_latency << std::endl;
out << indent << indent << "Ingress energy : " << specs_.ingress_energy << " pJ" << std::endl;
out << indent << indent << "Fill latency : " << stats_.fill_latency << std::endl;
out << indent << indent << "Drain latency : " << stats_.drain_latency << std::endl;


out << std::endl;
Expand Down
12 changes: 6 additions & 6 deletions src/model/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,13 @@ out << std::endl
{
all_titles = {"Algorithmic Computes", "Actual Computes"};
all_num_computes = {topology.stats_.algorithmic_computes, topology.stats_.actual_computes};
all_units = {"pJ/Algorithmic-Compute", "pJ/Compute"};
all_units = {"fJ/Algorithmic-Compute", "fJ/Compute"};
}
else
{
all_titles = {"Computes"};
all_num_computes = {topology.stats_.actual_computes};
all_units = {"pJ/Compute"};
all_units = {"fJ/Compute"};
}

for (unsigned i = 0; i < all_titles.size(); i++)
Expand All @@ -533,26 +533,26 @@ out << std::endl
{
auto level = topology.GetLevel(i);
out << indent << std::setw(align) << std::left << level->Name() << "= "
<< level->Energy() / num_computes << std::endl;
<< level->Energy()*1000 / num_computes << std::endl;
}

#ifdef PRINT_NETWORKS_IN_LEGACY_ORDER
for (unsigned storage_level_id = 0; storage_level_id < topology.NumStorageLevels(); storage_level_id++)
{
auto network = topology.GetStorageLevel(storage_level_id)->GetReadNetwork();
out << indent << std::setw(align) << std::left << network->Name() << "= "
<< network->Energy() / num_computes << std::endl;
<< network->Energy()*1000 / num_computes << std::endl;
}
#else
for (auto& network: topology.networks_)
{
out << indent << std::setw(align) << std::left << network.second->Name() << "= "
<< network.second->Energy() / num_computes << std::endl;
<< network.second->Energy()*1000 / num_computes << std::endl;
}
#endif

out << indent << std::setw(align) << std::left << "Total" << "= "
<< topology.Energy() / num_computes << std::endl;
<< topology.Energy()*1000 / num_computes << std::endl;
}
}
// Restore ios format state.
Expand Down

0 comments on commit b65f7b1

Please sign in to comment.