diff --git a/.gitignore b/.gitignore index 23ff99ed25435734878454bd62cfce5e549f0001..9ec45b7e82a0c3508f8e62166650b167cac26184 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 7541e4ce7cd1d79835b67f46bd0f1b4fad1e8ab4..eaa52b816bad1dc7df341903cb5ae42b93905ddb 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 0000000000000000000000000000000000000000..430193c49a762e25c2f77668227801897730acab --- /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