CpuTiProfile::CpuTiProfile(const profile::Profile* profile)
{
- double integral = 0;
- double time = 0;
+ double integral = 0;
+ double time = 0;
unsigned nb_points = profile->event_list.size() + 1;
time_points_.reserve(nb_points);
integral_.reserve(nb_points);
{
if ((a < 0.0) || (a > b)) {
xbt_die("Error, invalid integration interval [%.2f,%.2f]. "
- "You probably have a task executing with negative computation amount. Check your code.", a, b);
+ "You probably have a task executing with negative computation amount. Check your code.",
+ a, b);
}
if (fabs(a - b) < EPSILON)
return 0.0;
a_index = ceil(a / last_time_);
double b_index = floor(b / last_time_);
- if (a_index > b_index) { /* Same chunk */
+ if (a_index > b_index) { /* Same chunk */
return profile_->integrate_simple(a - (a_index - 1) * last_time_, b - b_index * last_time_);
}
double CpuTiProfile::integrate_simple_point(double a) const
{
double integral = 0;
- double a_aux = a;
+ double a_aux = a;
int ind = binary_search(time_points_, a);
integral += integral_[ind];
/* Sanity checks */
if ((a < 0.0) || (amount < 0.0)) {
- XBT_CRITICAL ("Error, invalid parameters [a = %.2f, amount = %.2f]. "
- "You probably have a task executing with negative computation amount. Check your code.", a, amount);
+ XBT_CRITICAL("Error, invalid parameters [a = %.2f, amount = %.2f]. "
+ "You probably have a task executing with negative computation amount. Check your code.",
+ a, amount);
xbt_abort();
}
*/
double CpuTiTmgr::get_power_scale(double a) const
{
- double reduced_a = a - floor(a / last_time_) * last_time_;
+ double reduced_a = a - floor(a / last_time_) * last_time_;
int point = CpuTiProfile::binary_search(profile_->time_points_, reduced_a);
kernel::profile::DatedValue val = speed_profile_->event_list.at(point);
return val.value_;