From f4a70daea95b899232339f1d9abe9ac1fa7275a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ABl=20Madon?= <mael.madon@irit.fr>
Date: Mon, 12 Feb 2024 10:59:15 +0100
Subject: [PATCH] add topics for mini-project

---
 README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 53 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index 5c38ca1..487984c 100644
--- a/README.md
+++ b/README.md
@@ -20,9 +20,9 @@ This repository contains the material for the practical session of course [RM4ES
     - [Exercise 2: FCFS and EDF multimachine](#exercise-2-fcfs-and-edf-multimachine)
     - [Exercise 3: back to the course exercise](#exercise-3-back-to-the-course-exercise)
     - [Exercise 4: bigger workload input](#exercise-4-bigger-workload-input)
-  - [Session 4: energy constraint](#session-4-energy-constraint)
-  - [Session 5: preamptive scheduling](#session-5-preamptive-scheduling)
-  - [Vrac](#vrac)
+  - [Mini-projects](#mini-projects)
+    - [Presentation](#presentation)
+    - [Topics](#topics)
 
 
 ## Session 1: getting started
@@ -277,16 +277,58 @@ Create the workload input `20jobs.csv` fulfilling all the criteria below:
 
 Upload your file `20jobs.csv` along with the 4 gantt charts and (FCFS and EDF, mono and 2-machine) and a text file stating the values for max lateness obtained in all cases.
 
-## Session 4: energy constraint
-- séacnz 4 : EDF avec contrainte énergétique (powercap ou energycap)
+## Mini-projects
+**Objective for this session:** 
+- strengthens your understanding of scheduling and simulation
+- solving an open question
+- carry an experimental approach by proposing suitable inputs for validation
+
+### Presentation
+Your presentation should:
+- explain your scheduling algorithm,
+- show how it is implemented (the main points)
+- make a demonstration of your scheduler, including everything you deem relevant: gantt charts, scheduling metrics, energy metrics, comparison with FCFS/EDF...
+- use complex examples (many machines, many jobs, ...)
+
+The presentation should last around 10 minutes per group
+
+### Topics
+**Heterogeneous machines with deadlines.**
+Until now, all the machines in our platform were identical (same computing speed). 
+Create a platform with heterogeneous machines (for example one very fast machine, many slow) and a scheduling algorithm that take into account this heterogeneity.  
+You will have to use [parallel_homogeneous_total](https://batsim.readthedocs.io/en/latest/input-workload.html?highlight=parallel#homogeneous-parallel-task-with-total-amount) job profiles in your workload instead of the simple [delay](https://batsim.readthedocs.io/en/latest/input-workload.html?highlight=parallel#delay) profile that ignores the speed of machines.
+
+**Energy & machine on/off.**
+Implement a heuristic to switch off idle machines in order to save energy.  
+You will need to adapt 
+- the platform file to give an energy consumption value to your machines in computing, sleep, switching on and switching off state (see [Millian Poquet PhD thesis](https://theses.hal.science/tel-01757245v2/document) parts 2.3 and 4.5 where the energy model is explained, you can draw inspiration from [this platform file](https://github.com/oar-team/batsim/blob/master/platforms/energy_platform.xml)). 
+- the workload file to use [parallel_homogeneous_total](https://batsim.readthedocs.io/en/latest/input-workload.html?highlight=parallel#homogeneous-parallel-task-with-total-amount) job profiles instead of [delay](https://batsim.readthedocs.io/en/latest/input-workload.html?highlight=parallel#delay) that do not take into account energy
+- the `batsim` call to get [energy-specific output files](https://batsim.readthedocs.io/en/latest/output-energy.html) (add the option `--energy`)
+
+**Energy & powercap.**
+Implement a scheduler with instantaneous power constraint.  
+You will have as input a power envelope defining the maximum power available at time t.
+The consumed power curve (`epower` in the [energy consumption trace](https://batsim.readthedocs.io/en/latest/output-energy.html#energy-consumption-trace)) should be at all points under your power envelope.
+You will need to adapt to the energy model (see the 3 bullet points in the topic above).
+
+**Multimachine jobs.**
+When a job requests many resources, it sometimes "blocks the queue" because there are currently not enough machines available to execute it.
+To solve this problem, we can use a technique called "backfilling".
+It consists in looking for jobs that are situated **after** the blocking job in the queue and execute them now, under certain conditions.   
+Implement your version of backfilling and demonstrate that it improves the scheduling (on simple cases and on big cases by looking at scheduling metrics).
+
+**Preemption.**
+Implement EDF with preemption.  
+To simulate preemption, you can kill and resubmit a job.
+For example, imagine `job1` needs to execute for 5UT.
+It runs for 2UT and then `job2` arrives with a shorter deadline. 
+To simulate preemption you need to kill `job1` and dynamically resubmit a job with the same deadline, and 5-2=3UT to execute.  
+Look at messages KILL_JOB, REGISTER_JOB and REGISTER_PROFILE in [batsim protocol](https://batsim.readthedocs.io/en/latest/protocol.html) (respectively `self.bs.kill_jobs(jobs)`, `self.bs.register_profiles(workload_name, profiles)` and `self.bs.register_job(id,res,walltime,profile_name)` in pybatsim).
+You will also need to clean the duplicated jobs in the batsim output.
+
+
 
-## Session 5: preamptive scheduling
-- séance 5 : implémenter la préamption
 
-## Vrac
-- séance 3 : multimachine hétérogènes en vitesse avec deadlines 
-- séance 2 : monomachine + d'autres algos : RMS, EDF (3 cas: infra sous-dimensionnée / normalement dim / sur-dim, remarquer que sur du surdimensioné, l'algo change rien)
-	=> example simple avec 1 grosse tâche + 1 petite tâche avec deadline, en EDF sans preamption ça passe pas.
 
 
 [Batsim]: https://batsim.org/
-- 
GitLab