Verified Commit 71113e3b authored by Raphaël Bleuse's avatar Raphaël Bleuse
Browse files

Move functional API in `pybatsim-functional` package

parent 4f2c5d01
This diff is collapsed.
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "pybatsim-functional"
version = "4.0.0-alpha.0"
description = "Functional API for PyBatsim"
keywords = [
"scheduler",
"simulation",
]
repository = "https://gitlab.inria.fr/batsim/pybatsim"
authors = [
"Steffen Lackner <lackner@cs.tu-darmstadt.de>",
"Michael Mercier <michael.mercier@inria.fr>",
"Clément Mommessin <clement.mommessin@inria.fr>",
]
maintainers = [
"Raphaël Bleuse <raphael.bleuse@inria.fr>",
]
license = "LGPL-3.0-only"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: System :: Distributed Computing",
]
packages = [
{include = "pybatsim_functional", from = "src"},
]
[tool.poetry.dependencies]
python = "^3.7.1"
pybatsim = {path = "../pybatsim-core", develop = true}
[tool.poetry.dev-dependencies]
# definition of PyBatsim schedulers
[tool.poetry.plugins."pybatsim.schedulers"]
"func:backfill-sjf" = "pybatsim_functional.schedulers.schedEasySjfBackfill:SchedEasySjfBackfill"
"func:fcfs" = "pybatsim_functional.schedulers.schedFcfs:SchedFcfs"
"func:filler" = "pybatsim_functional.schedulers.schedFiller:SchedFiller"
"func:send-recv" = "pybatsim_functional.schedulers.schedSendRecv:SchedSendRecv"
"""
batsim.sched
~~~~~~~~~~~~
pybatsim_functional
~~~~~~~~~~~~~~~~~~~
An advanced scheduler API based on Pybatsim.
......@@ -10,5 +10,5 @@ from .alloc import Allocation
from .job import Job, Jobs
from .profiles import Profile, Profiles
from .resource import ComputeResource, Resource, ResourceRequirement, Resources
from .scheduler import Scheduler, as_scheduler
from .scheduler import Scheduler
from .workloads import JobDescription, WorkloadDescription, generate_workload
"""
batsim.sched.algorithms
~~~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.algorithms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Helper modules for implementing concrete scheduling algorithms.
......
"""
batsim.sched.algorithms.backfilling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.algorithms.backfilling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implementation of a simple backfilling algorithm.
......
"""
batsim.sched.algorithms.filling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.algorithms.filling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implementation of a simple job filling algorithm.
......
"""
batsim.sched.algorithms.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.algorithms.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utils for implementing scheduling algorithms.
......@@ -295,7 +295,7 @@ def best_find_shortest_current_time(
def generate_resources_filter(filter_funcs=[], find_best_funcs=[]):
"""Generate a filter method (`batsim.sched.utils`) to filter the resources.
"""Generate a filter method (`pybatsim_functional.utils`) to filter the resources.
:param filter_funcs: filter methods which will be called on each resource whether
or not it should be added in the current iteration.
......
"""
batsim.sched.allocs
~~~~~~~~~~~~~~~~~~~
pybatsim_functional.alloc
~~~~~~~~~~~~~~~~~~~~~~~~~
This module generalises the allocation of resources.
"""
import sys
from .resource import Resources, Resource, ComputeResource
from .resource import Resource, ComputeResource
from .utils import ListView
......
"""
batsim.sched.events
~~~~~~~~~~~~~~~~~~~
pybatsim_functional.events
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides handling of scheduling events.
This module provides handling of scheduling events.
"""
import logging
......
"""
batsim.sched.job
~~~~~~~~~~~~~~~~
pybatsim_functional.job
~~~~~~~~~~~~~~~~~~~~~~~
This module provides general abstractions to manage jobs (either created by Batsim
or by the user to submit dynamic jobs).
......@@ -11,7 +11,7 @@ from pybatsim.batsim.batsim import Job as BatsimJob, Batsim
from .utils import ObserveList, filter_list, ListView
from .alloc import Allocation
from .messages import MessageBuffer
from .profiles import Profiles, Profile
from .profiles import Profiles
from .workloads import WorkloadDescription
......
"""
batsim.sched.logging
~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.logging
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides logging and exporting utilities for data in the scheduler.
"""
......
"""
batsim.sched.messages
~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides abstractions for managing the message buffers with messages from jobs.
"""
......
"""
batsim.sched.profiles
~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.profiles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides an abstraction layer for job profiles.
......
"""
batsim.sched.reply
~~~~~~~~~~~~~~~~~~
pybatsim_functional.reply
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides helper classes for replies sent by Batsim.
......
"""
batsim.sched.resource
~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides an abstraction around resources to keep track of allocations.
......
"""
batsim.sched.scheduler
~~~~~~~~~~~~~~~~~~~~~~
pybatsim_functional.scheduler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a high-level interface for implementing schedulers for Batsim.
It contains a basic scheduler used by Pybatsim directly and a high-level scheduler API which will
It contains a basic scheduler used by PyBatsim directly and a high-level scheduler API which will
interact with the basic scheduler to provide a richer interface.
"""
from abc import ABCMeta, abstractmethod
from pybatsim.batsim.batsim import BatsimScheduler, Batsim
from pybatsim.batsim.network import NetworkHandler
from pybatsim.batsim.tools.launcher import launch_scheduler_main
from .resource import Resources, ComputeResource
from .job import Job, Jobs
from .reply import ConsumedEnergyReply
from .utils import DictWrapper
from .messages import Message
from .utils import ListView
from .logging import Logger
from .events import LoggingEvent, EventLogger, EventList
from .workloads import WorkloadDescription
class BaseBatsimScheduler(BatsimScheduler):
"""The basic Pybatsim scheduler.
"""The basic PyBatsim scheduler.
:param scheduler: the high-level scheduler which uses this basic scheduler.
......@@ -243,7 +240,7 @@ class Scheduler(metaclass=ABCMeta):
self._events = EventList()
# Use the basic Pybatsim scheduler to wrap the Batsim API
# Use the basic PyBatsim scheduler to wrap the Batsim API
self._scheduler = BaseBatsimScheduler(self, options)
self._time = 0
......@@ -346,7 +343,7 @@ class Scheduler(metaclass=ABCMeta):
self._batsim.request_consumed_energy()
def __call__(self):
"""Return the underlying Pybatsim scheduler."""
"""Return the underlying PyBatsim scheduler."""
return self._scheduler
def _format_log_msg(self, msg, **kwargs):
......
......@@ -6,9 +6,9 @@
of the new scheduler api.
"""
from pybatsim.batsim.sched.algorithms.backfilling import backfilling_sched
from pybatsim.batsim.sched.algorithms.utils import consecutive_resources_filter
from pybatsim.batsim.sched.scheduler import as_scheduler, adapt_functional_scheduler
from pybatsim_functional.algorithms.backfilling import backfilling_sched
from pybatsim_functional.algorithms.utils import consecutive_resources_filter
from pybatsim_functional.scheduler import as_scheduler, adapt_functional_scheduler
def _func_SchedEasySjfBackfill(scheduler):
......
......@@ -6,9 +6,9 @@
"""
from pybatsim.batsim.sched.algorithms.filling import filler_sched
from pybatsim.batsim.sched.algorithms.utils import consecutive_resources_filter
from pybatsim.batsim.sched.scheduler import as_scheduler, adapt_functional_scheduler
from pybatsim_functional.algorithms.filling import filler_sched
from pybatsim_functional.algorithms.utils import consecutive_resources_filter
from pybatsim_functional.scheduler import as_scheduler, adapt_functional_scheduler
def _func_SchedFcfs(scheduler):
......
......@@ -6,9 +6,9 @@
"""
from pybatsim.batsim.sched.algorithms.filling import filler_sched
from pybatsim.batsim.sched.algorithms.utils import consecutive_resources_filter
from pybatsim.batsim.sched.scheduler import as_scheduler, adapt_functional_scheduler
from pybatsim_functional.algorithms.filling import filler_sched
from pybatsim_functional.algorithms.utils import consecutive_resources_filter
from pybatsim_functional.scheduler import as_scheduler, adapt_functional_scheduler
def _func_SchedFiller(scheduler):
......
......@@ -7,9 +7,9 @@
"""
from pybatsim.batsim.sched.algorithms.filling import filler_sched
from pybatsim.batsim.sched.algorithms.utils import consecutive_resources_filter
from pybatsim.batsim.sched.scheduler import Scheduler, adapt_functional_scheduler
from pybatsim_functional.algorithms.filling import filler_sched
from pybatsim_functional.algorithms.utils import consecutive_resources_filter
from pybatsim_functional.scheduler import Scheduler, adapt_functional_scheduler
class _func_SchedSendRecv(Scheduler):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment