Try to understand the output of the scheduler in the terminal as well.
Try to understand the output of the scheduler in the terminal as well.
That's it, you run your first simulation!
That's it, you have run your first simulation!
### Exercise 3: understand and visualize Batsim outputs
Simulation outputs are stored in the `out` directory.
Simulation outputs are stored in the `out` directory.
You have [schedule-centric outputs](https://batsim.readthedocs.io/en/latest/output-schedule.html)(`schedule.csv`) and [job-centric outputs](https://batsim.readthedocs.io/en/latest/output-jobs.html).
You have [schedule-centric outputs](https://batsim.readthedocs.io/en/latest/output-schedule.html)(`schedule.csv`) and [job-centric outputs](https://batsim.readthedocs.io/en/latest/output-jobs.html).
Open them, read the doc, and make sure you understand most of the fields.
Open them, read the doc, and make sure you understand most of the fields.
...
@@ -120,35 +123,45 @@ Have a look also at the file `out/example_jobs.csv` to see how the job output lo
...
@@ -120,35 +123,45 @@ Have a look also at the file `out/example_jobs.csv` to see how the job output lo
Finally, to get a visual representation of the outputs, we will use the visualization software `evalys`.
Finally, to get a visual representation of the outputs, we will use the visualization software `evalys`.
We provide a wrapper of `evalys` with the main functions that you need in the file `util/plot.py`.
We provide a wrapper of `evalys` with the main functions that you need in the file `util/plot.py`.
The `jobs.csv` output that was produced before is not suitable for visualization since it has no jobs that executed.
The `jobs.csv` output that was produced before is not suitable for visualization since it has no jobs that executed.
Produce the visualization:
Visualize the jobs on the example instead:
```bash
```bash
python util/plot.py out/example_jobs.csv
python util/plot.py out/example_jobs.csv
```
```
You have an option to store the output in a PDF file.
NB: the script has an option to store the output in a PDF file.
Check available options with `python util/plot.py -h`.
Check available options with `python util/plot.py -h`.
### Exercise 3: FCFS monomachine
### Exercise 4: FCFS monomachine
Now, it's time to develop your own scheduler!
Now, it's time to develop your own scheduler.
We will start with a FCFS monomachine: it schedules the jobs by order of arrival (and lexicographical order on the job ID in case of a tie).
We will start with a FCFS monomachine: it schedules the jobs by order of arrival.
Create a file `fcfsMono.py` in `sched` directory.
Create a file `fcfsMono.py` in the `sched` directory.
Draw inspiration from the template in `sched/template.py` to create your scheduler.
Draw inspiration from the template in `sched/template.py` to create your scheduler.
Warning: the file name and class name must match (for example, `fcfsMono.py` for the file name and `FcfsMono` for the class name).
Warning: the file name and class name must match (for example, `fcfsMono.py` for the file name and `FcfsMono` for the class name).
Test it on `2jobs.json` and `ex1.json` inputs, and other inputs that you will create.
You can use the following functions:
Visualize the outputs with evalys to see if it worked correcty.
-`job.id`, `job.submit_time`, `job.profile.name`, `job.requested_resources`, etc. to retrieve information about the job
-`self.bs.reject_jobs(list_of_jobs)`: to reject all the jobs in the list `list_of_jobs` (message [REJECT_JOB](https://batsim.readthedocs.io/en/latest/protocol.html#reject-job) in Batsim protocol)
-`self.bs.execute_jobs(list_of_jobs)`: to execute all the jobs in the list `list_of_jobs` (message [EXECUTE_JOB](https://batsim.readthedocs.io/en/latest/protocol.html#execute-job) in Batsim protocol). **Warning:** this function expects the jobs to have been allocated to one or several machines first. Use `job.allocation = 0` in the monocore context.
Test your algorithm on `2jobs.json` and `ex1.json` inputs, and other inputs that you will create.
Visualize the outputs with the visualization script to see if it worked correctly.
## Session 2: monomachine schedulers
## 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)
**Objective for this session:**
=> example simple avec 1 grosse tâche + 1 petite tâche avec deadline, en EDF sans preamption ça passe pas.
- implement another monomachine scheduler: EDF
- compare FCFS and EDF in terms of mean waiting time and tardiness
## Session 3: multimachine schedulers
## Session 3: multimachine schedulers
- séance 3 : multimachine hétérogènes en vitesse avec deadlines
- 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.
## Session 4: energy constraint
## Session 4: energy constraint
- séacnz 4 : EDF avec contrainte énergétique (powercap ou energycap)
- séacnz 4 : EDF avec contrainte énergétique (powercap ou energycap)
...
@@ -157,11 +170,6 @@ Visualize the outputs with evalys to see if it worked correcty.
...
@@ -157,11 +170,6 @@ Visualize the outputs with evalys to see if it worked correcty.
- séance 5 : implémenter la préamption
- 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