diff --git a/docs/output-schedule.rst b/docs/output-schedule.rst index 3fc166b..b073293 100644 --- a/docs/output-schedule.rst +++ b/docs/output-schedule.rst @@ -9,17 +9,17 @@ This file contains the following fields in lexicographic order of the fields nam - ``batsim_version``: Similar to the output of the ``--version`` :ref:`cli` option. - ``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. -- ``makespan``: The completion time of the last job. +- ``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(finish_time) - min(submission_time)`. - ``max_slowdown``: The maximum slowdown observed on a job. Slowdown is computed for a job as its turnaround time divided by its execution time. - ``max_turnaround_time``: The maximum turnaround time observed on a job. - Turnaround time is computed for a job as its completion time minus its submission time. + Turnaround time is computed for a job as its finish time minus its submission time. - ``max_waiting_time``: The maximum waiting time observed on a job. Waiting time is computed for a job as its starting time minus its submission time. - ``mean_slowdown``: The average slowdown observed on jobs. Slowdown is computed for a job as its turnaround time divided by its execution time. - ``mean_turnaround_time``: The average turnaround time observed on jobs. - Turnaround time is computed for a job as its completion time minus its submission time. + Turnaround time is computed for a job as its finish time minus its submission time. - ``mean_waiting_time``: The average waiting time observed on jobs. Waiting time is computed for a job as its starting time minus its submission time. - ``nb_computing_machines``: The number of computing machines in the simulation. diff --git a/src/export.cpp b/src/export.cpp index 944d64e..320ed29 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -1066,6 +1066,7 @@ void JobsTracer::finalize() double mean_waiting_time = static_cast(_sum_waiting_time)/_nb_jobs; double mean_turnaround_time = static_cast(_sum_turnaround_time)/_nb_jobs; double mean_slowdown = static_cast(_sum_slowdown)/_nb_jobs; + double makespan = static_cast(_max_completion_time - _min_submission_time); output_map["batsim_version"] = _context->batsim_version; output_map["nb_jobs"] = to_string(_nb_jobs); @@ -1075,7 +1076,7 @@ void JobsTracer::finalize() output_map["nb_jobs_rejected"] = to_string(_nb_jobs_rejected); output_map["success_rate"] = to_string(success_rate); - output_map["makespan"] = to_string(static_cast(_makespan)); + output_map["makespan"] = to_string(makespan); output_map["mean_waiting_time"] = to_string(mean_waiting_time); output_map["mean_turnaround_time"] = to_string(mean_turnaround_time); output_map["mean_slowdown"] = to_string(mean_slowdown); @@ -1089,7 +1090,7 @@ void JobsTracer::finalize() _nb_jobs, _nb_jobs_finished, _nb_jobs_success, _nb_jobs_killed, success_rate); XBT_INFO("makespan=%lf, scheduling_time=%lf, mean_waiting_time=%lf, mean_turnaround_time=%lf, " "mean_slowdown=%lf, max_waiting_time=%lf, max_turnaround_time=%lf, max_slowdown=%lf", - static_cast(_makespan), static_cast(seconds_used_by_scheduler), + makespan, static_cast(seconds_used_by_scheduler), static_cast(mean_waiting_time), static_cast(mean_turnaround_time), mean_slowdown, static_cast(_max_waiting_time), static_cast(_max_turnaround_time), static_cast(_max_slowdown)); XBT_INFO("mean_machines_running=%lf, max_machines_running=%lf", @@ -1171,14 +1172,20 @@ void JobsTracer::write_job(const JobPtr job) long double completion_time = job->starting_time + job->runtime; long double turnaround_time = completion_time - job->submission_time; long double slowdown = turnaround_time / job->runtime; + long double submission_time = job->submission_time; _sum_waiting_time += waiting_time; _sum_turnaround_time += turnaround_time; _sum_slowdown += slowdown; - if (completion_time > _makespan) + if (completion_time > _max_completion_time) { - _makespan = completion_time; + _max_completion_time = completion_time; + } + + if (submission_time < _min_submission_time) + { + _min_submission_time = submission_time; } if (waiting_time > _max_waiting_time) diff --git a/src/export.hpp b/src/export.hpp index 95818d1..a97ec1b 100644 --- a/src/export.hpp +++ b/src/export.hpp @@ -512,7 +512,8 @@ class JobsTracer int _nb_jobs_success = 0; //!< The number of successful jobs. int _nb_jobs_killed = 0; //!< The number of killed jobs. int _nb_jobs_rejected = 0; //!< The number of rejected jobs. - long double _makespan = 0; //!< The makespan. + long double _max_completion_time = 0; //!< The maximum completion time observed. + long double _min_submission_time = 0; //!< The minimum submission time observed. long double _sum_waiting_time = 0; //!< The sum of the waiting time of jobs. long double _sum_turnaround_time = 0; //!< The sum of the turnaround time of jobs. long double _sum_slowdown = 0; //!< The sum of the slowdown (AKA stretch) of jobs.