From 0f7faca08448b9a32d0a44ed0251dbdd94796cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Madon?= <mael.madon@irit.fr> Date: Mon, 29 Jan 2024 11:09:22 +0100 Subject: [PATCH] readme for session2 --- .gitignore | 3 ++- README.md | 39 ++++++++++++++++++++++++++++++++++++++- expe/metrics.txt | 13 +++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 expe/metrics.txt diff --git a/.gitignore b/.gitignore index 23ff99e..9ec45b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ out/* !out/example_jobs.csv *__pycache__* -*_perso/* \ No newline at end of file +*_perso/* +correction \ No newline at end of file diff --git a/README.md b/README.md index 7541e4c..eaa52b8 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,44 @@ Visualize the outputs with the visualization script to see if it worked correctl ## Session 2: monomachine schedulers **Objective for this session:** - implement another monomachine scheduler: EDF -- compare FCFS and EDF in terms of mean waiting time and tardiness +- compare FCFS and EDF in terms of waiting time and lateness + +### Exercise 1: EDF monomachine +Implement an EDF scheduler monomachine. +The file name will be called `edfMono.py` and the class `EdfMono`. + +**Hints:** remember that we use Batsim `walltime` field to store the deadline. +In pybatsim, this information is stored in `job.requested_time`. + +Test your scheduler by running it on different workload inputs. +**Do not hesitate to create your own inputs to see how it behaves in different situations!** + +Upload your file `edfMono.py` on Moodle. + +### Exercise 2: compare FCFS and EDF + +#### 2.1 Gantt chart +Produce the Gatt-chart visualization of the simulation with the workload of session1-exercise1, for both FCFS and EDF schedulers. +Save the image as a PDF file (we remind that we can use the option `-o` of the visualization script, for example: +`python util/plot.py out/edf_jobs.csv --noDisplay -o out/edf_ex1.pdf`). + +Upload the 2 PDFs on Moodle. + +#### 2.2 Scheduling metrics +Batsim output `schedule.csv` ([see documentation](https://batsim.readthedocs.io/en/latest/output-schedule.html)) provides us with some scheduling metrics. +For example, we can read the mean and max **waiting time**, which is the time that elapsed between the submission of the job and the beginning of its execution. + +Unfortunately, Batsim do not compute the **lateness** for us. +We will have to calculate this information form the `jobs.csv`. + +Create a script that computes the mean and max lateness from a `jobs.csv` given as input. +You can use any programming language that you like, for example python with the library [pandas](https://pandas.pydata.org/docs/index.html). +Ask for help from your lab's teacher if you don't know where to start. + +Fill in the file [expe/metrics.txt](./expe/metrics.txt) for your two schedulers, and upload it on Moodle. +Do you find the same results as when you did it in class? +Which algorithm is better in terms of waiting time on this input? +In terms of lateness? diff --git a/expe/metrics.txt b/expe/metrics.txt new file mode 100644 index 0000000..430193c --- /dev/null +++ b/expe/metrics.txt @@ -0,0 +1,13 @@ +## Workload ex1, schedulers monos + +FCFS: +- max w_time: +- mean w_time: +- max lateness: +- mean lateness: + +EDF: +- max w_time: +- mean w_time: +- max lateness: +- mean lateness: \ No newline at end of file -- GitLab