Skip to main content

Python API and schedulers for Batsim

Project description

PyBatsim helps you developing your own scheduler in python!

The library consists of two layers:

  1. The low level API batsim.batsim which handles the communication with the Batsim instance (example scheduler: schedulers/

  2. The high level API batsim.sched which contains an object oriented abstraction layer to provide a simpler API for accessing data from Batsim and filtering for jobs and resources (example scheduler: schedulers/


The following commands are provided:


To launch schedulers


To launch experiments. See sample.expe.json for an example configuration file expected by this launcher. The launcher will start Batsim and the scheduler with the correct options.


To manipulate the out_jobs.csv file based on data only available in the scheduler but not in Batsim.

Batsim Version Compatibilities

As there are different release paces between Batsim and Pybatsim versions, here is a list of compatibilities between the two projects:

Moreover, all notable changes are listed in the changelog.


Start a scheduler

See the schedulers directory for the available built-in schedulers. A simple built-in scheduler instance can be executed by calling:

pybatsim fillerSched

This command, however, requires an already running Batsim instance.

The parameter to pybatsim can also be a file outside of the project directory like:

pybatsim path/to/

Schedulers of the higher level API (batsim.sched) can be executed in the same way:

pybatsim delayProfilesAsTasks

This example scheduler will make use of dynamic jobs and convert delay jobs into tasks. Note that dynamic job submissions have to be enabled in your running Batsim instance to be able to use this scheduler.

To see all available starting options see also:

pybatsim --help

Run an experiment

To run a complete experiment the experiment launcher can be used:

pybatsim-experiment --verbose sample.expe.json

Please note that Batsim has to be installed and the environment has to be set-up for this command to succeed.



See launch_expe.json


This class helps you communicate with the batsim server


High level scheduler API


Tools to start the schedulers or for working with the generated data


Contains all the schedulers. Schedulers name should follow this convention: contains the FooBar classname which has as an ancestor batsim.batsim.BatsimScheduler.


A kind of first fit without topology scheduler


EASY backfilling where jobs are seen as rectangles


A scheduler using the high level scheduler API to split big delay jobs into small tasks.


You can install, upgrade, uninstall PyBatsim with these commands:

pip install [--user] pybatsim
pip install [--user] --upgrade pybatsim
pip uninstall pybatsim


To generate the html documentation use the setup target:

./ doc


To run the test experiments it is preferable to first enter in a nix shell specific for the pybatsim development with the following command:

nix-shell -A pybatsim_dev

Then you can run tests with the setup target:

./ test --batsim-bin=path/to/batsim/binary

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybatsim-3.2.1.tar.gz (92.8 kB view hashes)

Uploaded Source

Built Distribution

pybatsim-3.2.1-py3-none-any.whl (109.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page