diff --git a/README.md b/README.md index 3154395ab10e254d5f3d6bb50ec582a7a21c50f5..138ae1bbdbaf39fd20f46cc41308d489a430e43a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ git clone git@gitlab.irit.fr:sepia-pub/mael/RM4ES-practicals.git cd RM4ES-practicals ``` +TODO: how to install Nix on lab computers + +TODO: how to install poetry on lab computers + ## Status rn We can start a small expe! @@ -21,5 +25,82 @@ pybatsim newSched On the other shell: ``` ns -A expe -batsim -p expe/2machines.xml -w expe/backfill.json -e out/ -``` \ No newline at end of file +batsim -p expe/1machine.xml -w expe/2jobs.json -e out/ +``` + + +## Session 1 : getting started + +**Objective for this session:** +- setting up all the simulation environment +- understanding the workload representation in [Batsim] +- having a first scheduling algorithm running + +### Introduction + +The resource and job management simulator [Batsim], that we are going to use during these practicals, needs three inputs: + +- **a platform**: description of the IT infrastructure; +- **a workload**: list of jobs that are going to arrive and their characteristics; +- **a scheduling algorithm**: the "brain" of the system, taking decision on when and where to execute the jobs. + +The platform is represented by an XML file. +You have a simple example (monomachine platform) in the file [expe/1machine.xml](./expe/1machine.xml). +This is enough for now! +We will come back to it in more detail in session 3. + +The workload is represented by a JSON file (see [expe/2jobs.json](./expe/2jobs.json)): + +```json +{ + "jobs": [ + {"id": "1", "profile": "3UT", "res": 1, "walltime":10, "subtime": 0}, + {"id": "2", "profile": "4UT", "res": 1, "walltime":6, "subtime": 0}, + ], + "profiles": { + "3UT": {"delay": 3,"type": "delay"}, + "4UT": {"delay": 4,"type": "delay"} + } +} +``` + +The meaning of each field in the JSON is explained in [Batsim workload documentation](https://batsim.readthedocs.io/en/latest/input-workload.html). + +The scheduling algorithm has to be developed separately, and communicates with [Batsim] through the messages defined in [Batsim protocol](https://batsim.readthedocs.io/en/latest/protocol.html). +In this tutorial, we will develop our schedulers in Python thanks to [pybatsim](https://gitlab.inria.fr/batsim/pybatsim). +The scheduler implementations will be located in the folder [sched/](./sched/). + + +### Exercise 1 +Represent the workload used previously in this course (exercise 1 from the [exercise document](https://docs.google.com/document/d/15nfFvYgTwStwS0JGt5DMaQs6JDya8dKzFj69wMLTuTw/edit)) in Batsim JSON format. +You will put it in a new file named `expe/ex1.json` + +### Exercise 2 +TODO run a simulation with pre-defined scheduler `rejector`. +Look at the outputs... + +### Exercise 3 +TODO develop a monomachine FCFS scheduler and run it on the inputs from ex1. +Visualize the output thanks to evalys. + +## Session 2: monomachine schedulers +- 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. + +## Session 3: multimachine schedulers +- séance 3 : multimachine hétérogènes en vitesse avec deadlines + +## Session 4: energy constraint +- séacnz 4 : EDF avec contrainte énergétique (powercap ou energycap) + +## Session 5: preamptive scheduling +- séance 5 : implémenter la préamption + + +## Open bugs +- mismatch python version if I want to use batsim and evalys. Either `python util/plot.py out/_jobs.csv ` or ` batsim -p expe/1machine.xml -w expe/ex1.json -e out/` make an error +- no working poetry in nix-shell +- will that work in the lab's machines? + +[Batsim]: https://batsim.org/ +[Nix]: https://nixos.org/nix/ \ No newline at end of file diff --git a/default.nix b/default.nix index e096399aea3782a8a67352a122b01a7585762e50..09834755e1261198d11c73f4cc1f616263998c8f 100644 --- a/default.nix +++ b/default.nix @@ -4,7 +4,8 @@ {} , kapack ? import (fetchTarball "https://github.com/oar-team/nur-kapack/archive/901a5b656f695f2c82d17c091a55db2318ed3f39.tar.gz") - {inherit pkgs;} + {} + # {inherit pkgs;} , python3 ? pkgs.python311 , python3Packages ? pkgs.python311Packages # , pybatsim-core ? kapack.pybatsim-core @@ -53,7 +54,7 @@ let # pkgs.stdenv.cc.cc.lib # poetry # pybatsim-core - # kapack.batsim + kapack.batsim # batexpe # nixpkgs.qt6.qtbase # nixpkgs.qt5.qtbase diff --git a/expe/2machines.xml b/expe/1machine.xml similarity index 87% rename from expe/2machines.xml rename to expe/1machine.xml index 5b0d6c610be4270af6b4aad0a23169382d9ad299..26f46cc775de8b80f38fd785cfa04dfc32705d4e 100644 --- a/expe/2machines.xml +++ b/expe/1machine.xml @@ -8,6 +8,5 @@ <host id="node_0" speed="10Gf"/> - <host id="node_1" speed="10Gf"/> </zone> </platform> diff --git a/expe/2jobs.json b/expe/2jobs.json new file mode 100644 index 0000000000000000000000000000000000000000..3f4ea8a22a943420bf4b79d8dfdd558141120ba7 --- /dev/null +++ b/expe/2jobs.json @@ -0,0 +1,12 @@ +{ + "description": "2jobs", + "nb_res": 1, + "jobs": [ + {"id": "1", "profile": "3UT", "res": 1, "walltime":10, "subtime": 0}, + {"id": "2", "profile": "4UT", "res": 1, "walltime":6, "subtime": 0} + ], + "profiles": { + "3UT": {"delay": 3,"type": "delay"}, + "4UT": {"delay": 4,"type": "delay"} + } +} \ No newline at end of file