Skip to content

Commit

Permalink
fix DTHERMAL compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Luyi Kang committed Apr 5, 2021
1 parent 47dad81 commit 2981759
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/simple_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ std::string SimpleStats::GetTextHeader(bool is_final) const {
return header;
}

double SimpleStats::RankBackgroundEnergy(const int rank) const{
return vec_doubles_.at("act_stb_energy")[rank] +
vec_doubles_.at("pre_stb_energy")[rank] +
vec_doubles_.at("sref_energy")[rank];
}

void SimpleStats::PrintEpochStats() {
UpdateEpochStats();
if (config_.output_level >= 1) {
Expand Down
3 changes: 3 additions & 0 deletions src/simple_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class SimpleStats {
// add historgram value
void AddValue(const std::string name, const int value);

// return per rank background energy
double RankBackgroundEnergy(const int r) const;

// Epoch update
void PrintEpochStats();

Expand Down
5 changes: 3 additions & 2 deletions src/thermal_replay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ void ThermalReplay::Run() {
}
}
for (int c = 0; c < config_.channels; c++) {
channel_stats_[c].PrintFinalStats(clk, std::cout, std::cout, std::cout);
//channel_stats_[c].PrintFinalStats(clk, std::cout, std::cout, std::cout);
channel_stats_[c].PrintFinalStats();
}
thermal_calc_.PrintFinalPT(clk);
}
Expand Down Expand Up @@ -187,7 +188,7 @@ void ThermalReplay::ProcessCMD(Command &cmd, uint64_t clk) {
for (int c = 0; c < config_.channels; c++) {
// where to print isn't important here what we really need is the
// updated stats
channel_stats_[c].PrintEpochStats(clk, std::cout);
channel_stats_[c].PrintEpochStats();
for (int r = 0; r < config_.ranks; r++) {
double bg_energy = channel_stats_[c].RankBackgroundEnergy(r);
thermal_calc_.UpdateBackgroundEnergy(c, r, bg_energy);
Expand Down

0 comments on commit 2981759

Please sign in to comment.