Package: pybatsim
PyBatsim helps you developing your own scheduler in python!The library consists of two layers:The low level APIbatsim.batsimwhich handles the communication with the
Batsim instance (example scheduler:schedulers/fillerSched.py).The high level APIbatsim.schedwhich 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/delayProfilesAsTasks.py).CommandsThe following commands are provided:pybatsimTo launch schedulerspybatsim-experimentTo launch experiments.
Seesample.expe.jsonfor an example configuration file expected by this launcher.
The launcher will start Batsim and the scheduler with the correct options.pybatsim-postprocess-jobsTo manipulate theout_jobs.csvfile based on data only available in the
scheduler but not in Batsim.Batsim Version CompatibilitiesAs there are different release paces between Batsim and Pybatsim versions, here is a list of compatibilities between the two projects:Batsim master branchwithPybatsim master branch(development branches, may be unstable)Batsim v3_0_0withPybatsim v3_0_0(latest major release, stable)Batsim v2_0_0withPybatsim batsim_2_0_compatibleMoreover, all notable changes are listed in thechangelog.ExamplesStart a schedulerSee theschedulersdirectory for the available built-in schedulers.
A simple built-in scheduler instance can be executed by calling:pybatsim fillerSchedThis command, however, requires an already running Batsim instance.The parameter topybatsimcan also be a file outside of the project directory
like:pybatsim path/to/scheduler.pySchedulers of the higher level API (batsim.sched) can be executed in the same way:pybatsim delayProfilesAsTasksThis 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 --helpRun an experimentTo run a complete experiment the experiment launcher can be used:pybatsim-experiment --verbose sample.expe.jsonPlease note that Batsim has to be installed and the environment has to be set-up for this command to succeed.Filessample.expe.jsonSeelaunch_expe.jsonbatsim/batsim.pyThis class helps you communicate with the batsim serverbatsim/sched/High level scheduler APIbatsim/tools/Tools to start the schedulers or for working with the generated dataschedulers/Contains all the schedulers. Schedulers name should follow this convention:fooBar.pycontains theFooBarclassname which has as an ancestorbatsim.batsim.BatsimScheduler.schedulers/fillerSched.pyA kind of first fit without topology schedulerschedulers/easyBackfill.pyEASY backfilling where jobs are seen as rectanglesschedulers/delayProfilesAsTasks.pyA scheduler using the high level scheduler API to split big delay jobs into
small tasks.InstallationYou can install, upgrade, uninstall PyBatsim with these commands:pip install [--user] pybatsim
pip install [--user] --upgrade pybatsim
pip uninstall pybatsimDocumentationTo generate the html documentation use the setup target:./setup.py docTestingTo 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 https://github.com/oar-team/kapack/archive/master.tar.gz -A pybatsim_devThen you can run tests with the setup target:./setup.py test --batsim-bin=path/to/batsim/binary