Skip to content

Commit 99a53c8

Browse files
author
Maël Madon
committed
code: change definition for makespan, github issue oar-team#69
1 parent 6e5a6fa commit 99a53c8

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

docs/output-schedule.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This file contains the following fields in lexicographic order of the fields nam
99

1010
- ``batsim_version``: Similar to the output of the ``--version`` :ref:`cli` option.
1111
- ``consumed_joules``: The total amount of joules consumed by the machines from the submission time of the first job to the finish time of the last job.
12-
- ``makespan``: The completion time of the last job.
12+
- ``makespan``: The time that elapses from the submission time of the first job to the finish time of the last job. It is calculated by `max(completion_time) - min(submission_time)`.
1313
- ``max_slowdown``: The maximum slowdown observed on a job.
1414
Slowdown is computed for a job as its turnaround time divided by its execution time.
1515
- ``max_turnaround_time``: The maximum turnaround time observed on a job.

src/export.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ void JobsTracer::finalize()
10661066
double mean_waiting_time = static_cast<double>(_sum_waiting_time)/_nb_jobs;
10671067
double mean_turnaround_time = static_cast<double>(_sum_turnaround_time)/_nb_jobs;
10681068
double mean_slowdown = static_cast<double>(_sum_slowdown)/_nb_jobs;
1069+
double makespan = static_cast<double>(_max_completion_time - _min_submission_time);
10691070

10701071
output_map["batsim_version"] = _context->batsim_version;
10711072
output_map["nb_jobs"] = to_string(_nb_jobs);
@@ -1075,7 +1076,7 @@ void JobsTracer::finalize()
10751076
output_map["nb_jobs_rejected"] = to_string(_nb_jobs_rejected);
10761077
output_map["success_rate"] = to_string(success_rate);
10771078

1078-
output_map["makespan"] = to_string(static_cast<double>(_makespan));
1079+
output_map["makespan"] = to_string(makespan);
10791080
output_map["mean_waiting_time"] = to_string(mean_waiting_time);
10801081
output_map["mean_turnaround_time"] = to_string(mean_turnaround_time);
10811082
output_map["mean_slowdown"] = to_string(mean_slowdown);
@@ -1089,7 +1090,7 @@ void JobsTracer::finalize()
10891090
_nb_jobs, _nb_jobs_finished, _nb_jobs_success, _nb_jobs_killed, success_rate);
10901091
XBT_INFO("makespan=%lf, scheduling_time=%lf, mean_waiting_time=%lf, mean_turnaround_time=%lf, "
10911092
"mean_slowdown=%lf, max_waiting_time=%lf, max_turnaround_time=%lf, max_slowdown=%lf",
1092-
static_cast<double>(_makespan), static_cast<double>(seconds_used_by_scheduler),
1093+
makespan, static_cast<double>(seconds_used_by_scheduler),
10931094
static_cast<double>(mean_waiting_time), static_cast<double>(mean_turnaround_time), mean_slowdown,
10941095
static_cast<double>(_max_waiting_time), static_cast<double>(_max_turnaround_time), static_cast<double>(_max_slowdown));
10951096
XBT_INFO("mean_machines_running=%lf, max_machines_running=%lf",
@@ -1171,14 +1172,20 @@ void JobsTracer::write_job(const JobPtr job)
11711172
long double completion_time = job->starting_time + job->runtime;
11721173
long double turnaround_time = completion_time - job->submission_time;
11731174
long double slowdown = turnaround_time / job->runtime;
1175+
long double submission_time = job->submission_time;
11741176

11751177
_sum_waiting_time += waiting_time;
11761178
_sum_turnaround_time += turnaround_time;
11771179
_sum_slowdown += slowdown;
11781180

1179-
if (completion_time > _makespan)
1181+
if (completion_time > _max_completion_time)
11801182
{
1181-
_makespan = completion_time;
1183+
_max_completion_time = completion_time;
1184+
}
1185+
1186+
if (submission_time < _min_submission_time)
1187+
{
1188+
_min_submission_time = submission_time;
11821189
}
11831190

11841191
if (waiting_time > _max_waiting_time)

src/export.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ class JobsTracer
512512
int _nb_jobs_success = 0; //!< The number of successful jobs.
513513
int _nb_jobs_killed = 0; //!< The number of killed jobs.
514514
int _nb_jobs_rejected = 0; //!< The number of rejected jobs.
515-
long double _makespan = 0; //!< The makespan.
515+
long double _max_completion_time = 0; //!< The maximum completion time observed.
516+
long double _min_submission_time = 0; //!< The minimum submission time observed.
516517
long double _sum_waiting_time = 0; //!< The sum of the waiting time of jobs.
517518
long double _sum_turnaround_time = 0; //!< The sum of the turnaround time of jobs.
518519
long double _sum_slowdown = 0; //!< The sum of the slowdown (AKA stretch) of jobs.

0 commit comments

Comments
 (0)