Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
batsim
pybatsim
Commits
71113e3b
Verified
Commit
71113e3b
authored
Jan 07, 2022
by
Raphaël Bleuse
Browse files
Move functional API in `pybatsim-functional` package
parent
4f2c5d01
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
pybatsim-functional/poetry.lock
0 → 100644
View file @
71113e3b
This diff is collapsed.
Click to expand it.
pybatsim-functional/pyproject.toml
0 → 100644
View file @
71113e3b
[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"
pybatsim-
core
/src/pybatsim
/batsim/sched
/__init__.py
→
pybatsim-
functional
/src/pybatsim
_functional
/__init__.py
View file @
71113e3b
"""
batsim
.sched
~~~~~~~~~~~~
py
batsim
_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
pybatsim-
core
/src/pybatsim
/batsim/sched
/algorithms/__init__.py
→
pybatsim-
functional
/src/pybatsim
_functional
/algorithms/__init__.py
View file @
71113e3b
"""
batsim
.sched
.algorithms
~~~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.algorithms
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
Helper modules for implementing concrete scheduling algorithms.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/algorithms/backfilling.py
→
pybatsim-
functional
/src/pybatsim
_functional
/algorithms/backfilling.py
View file @
71113e3b
"""
batsim
.sched
.algorithms.backfilling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.algorithms.backfilling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
Implementation of a simple backfilling algorithm.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/algorithms/filling.py
→
pybatsim-
functional
/src/pybatsim
_functional
/algorithms/filling.py
View file @
71113e3b
"""
batsim
.sched
.algorithms.filling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.algorithms.filling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
Implementation of a simple job filling algorithm.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/algorithms/utils.py
→
pybatsim-
functional
/src/pybatsim
_functional
/algorithms/utils.py
View file @
71113e3b
"""
batsim
.sched
.algorithms.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
py
batsim
_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 (`
py
batsim
_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.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/alloc.py
→
pybatsim-
functional
/src/pybatsim
_functional
/alloc.py
View file @
71113e3b
"""
batsim
.sched
.alloc
s
~~~~~~~~~~~~~~~~~~~
py
batsim
_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
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/events.py
→
pybatsim-
functional
/src/pybatsim
_functional
/events.py
View file @
71113e3b
"""
batsim.sched
.events
~~~~~~~~~~~~~~~~~~~
pybatsim_functional
.events
~~~~~~~
~~~~~~~~~~~~~~~~~~~
This module provides handling of scheduling events.
This module provides handling of scheduling events.
"""
import
logging
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/job.py
→
pybatsim-
functional
/src/pybatsim
_functional
/job.py
View file @
71113e3b
"""
batsim
.sched
.job
~~~~~~~~~~~~~~~~
py
batsim
_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
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/logging.py
→
pybatsim-
functional
/src/pybatsim
_functional
/logging.py
View file @
71113e3b
"""
batsim
.sched
.logging
~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.logging
~~~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides logging and exporting utilities for data in the scheduler.
"""
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/messages.py
→
pybatsim-
functional
/src/pybatsim
_functional
/messages.py
View file @
71113e3b
"""
batsim
.sched
.messages
~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.messages
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides abstractions for managing the message buffers with messages from jobs.
"""
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/profiles.py
→
pybatsim-
functional
/src/pybatsim
_functional
/profiles.py
View file @
71113e3b
"""
batsim
.sched
.profiles
~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.profiles
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides an abstraction layer for job profiles.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/reply.py
→
pybatsim-
functional
/src/pybatsim
_functional
/reply.py
View file @
71113e3b
"""
batsim
.sched
.reply
~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.reply
~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides helper classes for replies sent by Batsim.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/resource.py
→
pybatsim-
functional
/src/pybatsim
_functional
/resource.py
View file @
71113e3b
"""
batsim
.sched
.resource
~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.resource
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides an abstraction around resources to keep track of allocations.
...
...
pybatsim-
core
/src/pybatsim
/batsim/sched
/scheduler.py
→
pybatsim-
functional
/src/pybatsim
_functional
/scheduler.py
View file @
71113e3b
"""
batsim
.sched
.scheduler
~~~~~~~~~~~~~~~~~~~~~~
py
batsim
_functional
.scheduler
~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
This module provides a high-level interface for implementing schedulers for Batsim.
It contains a basic scheduler used by Py
b
atsim directly and a high-level scheduler API which will
It contains a basic scheduler used by Py
B
atsim 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 Py
b
atsim scheduler.
"""The basic Py
B
atsim 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 Py
b
atsim scheduler to wrap the Batsim API
# Use the basic Py
B
atsim 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 Py
b
atsim scheduler."""
"""Return the underlying Py
B
atsim scheduler."""
return
self
.
_scheduler
def
_format_log_msg
(
self
,
msg
,
**
kwargs
):
...
...
pybatsim-
core
/src/pybatsim/schedulers/schedEasySjfBackfill.py
→
pybatsim-
functional
/src/pybatsim
_functional
/schedulers/schedEasySjfBackfill.py
View file @
71113e3b
...
...
@@ -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
):
...
...
pybatsim-
core
/src/pybatsim/schedulers/schedFcfs.py
→
pybatsim-
functional
/src/pybatsim
_functional
/schedulers/schedFcfs.py
View file @
71113e3b
...
...
@@ -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
):
...
...
pybatsim-
core
/src/pybatsim/schedulers/schedFiller.py
→
pybatsim-
functional
/src/pybatsim
_functional
/schedulers/schedFiller.py
View file @
71113e3b
...
...
@@ -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
):
...
...
pybatsim-
core
/src/pybatsim/schedulers/schedSendRecv.py
→
pybatsim-
functional
/src/pybatsim
_functional
/schedulers/schedSendRecv.py
View file @
71113e3b
...
...
@@ -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
):
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment