Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update definition of makespan #70

Open
wants to merge 2 commits into
base: batprotocol
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/output-schedule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 11 additions & 4 deletions src/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ void JobsTracer::finalize()
double mean_waiting_time = static_cast<double>(_sum_waiting_time)/_nb_jobs;
double mean_turnaround_time = static_cast<double>(_sum_turnaround_time)/_nb_jobs;
double mean_slowdown = static_cast<double>(_sum_slowdown)/_nb_jobs;
double makespan = static_cast<double>(_max_completion_time - _min_submission_time);

output_map["batsim_version"] = _context->batsim_version;
output_map["nb_jobs"] = to_string(_nb_jobs);
Expand All @@ -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<double>(_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);
Expand All @@ -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<double>(_makespan), static_cast<double>(seconds_used_by_scheduler),
makespan, static_cast<double>(seconds_used_by_scheduler),
static_cast<double>(mean_waiting_time), static_cast<double>(mean_turnaround_time), mean_slowdown,
static_cast<double>(_max_waiting_time), static_cast<double>(_max_turnaround_time), static_cast<double>(_max_slowdown));
XBT_INFO("mean_machines_running=%lf, max_machines_running=%lf",
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/export.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down