Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Aug 25, 2022
1 parent b24e4ed commit 8e8a552
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/variorum/Intel/power_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,16 @@ static void create_rapl_data_batch(struct rapl_data *rapl,
rapl->old_pkg_bits = (uint64_t *) calloc(nsockets, sizeof(uint64_t));
rapl->old_pkg_joules = (double *) calloc(nsockets, sizeof(double));
rapl->pkg_delta_joules = (double *) calloc(nsockets, sizeof(double));
rapl->pkg_delta_bits = (uint64_t *) calloc(nsockets, sizeof(double));
rapl->pkg_delta_bits = (uint64_t *) calloc(nsockets, sizeof(uint64_t));
rapl->pkg_watts = (double *) calloc(nsockets, sizeof(double));
load_socket_batch(msr_pkg_energy_status, rapl->pkg_bits, RAPL_DATA);

rapl->dram_bits = (uint64_t **) calloc(nsockets, sizeof(uint64_t *));
rapl->old_dram_bits = (uint64_t *) calloc(nsockets, sizeof(uint64_t));
rapl->dram_joules = (double *) calloc(nsockets, sizeof(double));
rapl->old_dram_bits = (uint64_t *) calloc(nsockets, sizeof(uint64_t));
rapl->old_dram_joules = (double *) calloc(nsockets, sizeof(double));
rapl->dram_delta_joules = (double *) calloc(nsockets, sizeof(double));
rapl->dram_delta_bits = (uint64_t *) calloc(nsockets, sizeof(uint64_t));
rapl->dram_watts = (double *) calloc(nsockets, sizeof(double));
load_socket_batch(msr_dram_energy_status, rapl->dram_bits, RAPL_DATA);

Expand Down Expand Up @@ -888,7 +889,7 @@ int delta_rapl_data(off_t msr_rapl_unit)
}

/* Check to see if there was wraparound and use corresponding translation. */
if ((double)*rapl->dram_bits[i] - (double)rapl->dram_pkg_bits[i] < 0)
if ((double)*rapl->dram_bits[i] - (double)rapl->old_dram_bits[i] < 0)
{
rapl->dram_delta_bits[i] = (uint64_t)((*rapl->dram_bits[i] +
(uint64_t)max_joules) - rapl->old_dram_bits[i]);
Expand Down
1 change: 1 addition & 0 deletions src/variorum/Intel/power_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ struct rapl_data
double *old_dram_joules;
/// @brief Difference in DRAM energy usage between two data measurements.
double *dram_delta_joules;
uint64_t *dram_delta_bits;
/// @brief DRAM power consumption (in Watts) derived by dividing difference
/// in DRAM energy usage by time elapsed between data measurements.
double *dram_watts;
Expand Down

0 comments on commit 8e8a552

Please sign in to comment.