Skip to content

Commit

Permalink
FIX-#248: Rename backends "multiprocessing" to "pymp" and "python" to…
Browse files Browse the repository at this point in the history
… "pyseq" (#265)

Signed-off-by: Igoshev, Iaroslav <[email protected]>
  • Loading branch information
YarShev authored Mar 20, 2023
1 parent eae8b44 commit 9ae4347
Show file tree
Hide file tree
Showing 56 changed files with 575 additions and 570 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
backend: ["ray", "mpi", "dask", "multiprocessing", "python"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-ubuntu (backend ${{matrix.backend}}, python ${{matrix.python-version}})
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
backend: ["ray", "dask", "multiprocessing", "python", "mpi"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-windows (backend ${{matrix.backend}}, python ${{matrix.python-version}})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
backend: ["ray", "mpi", "dask", "multiprocessing", "python"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-ubuntu (backend ${{matrix.backend}}, python ${{matrix.python-version}})
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
backend: ["ray", "dask", "multiprocessing", "python", "mpi"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-windows (backend ${{matrix.backend}}, python ${{matrix.python-version}})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Also, the framework provides a sequential ``Python`` backend, that can be used f
unidist can be installed with `pip` on Linux, Windows and MacOS:

```bash
pip install unidist # Install unidist with dependencies for Multiprocessing and sequential Python backends
pip install unidist # Install unidist with dependencies for Python Multiprocessing and Python Sequential backends
```

unidist can also be used with Dask, MPI or Ray execution backend.
Expand Down
32 changes: 16 additions & 16 deletions docs/developer/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ When calling an operation of the :doc:`API </flow/unidist/api>` provided by the
the :py:class:`~unidist.core.base.backend.BackendProxy` object that dispatches the call to
the concrete backend class instance (:py:class:`~unidist.core.backends.ray.backend.RayBackend`,
:py:class:`~unidist.core.backends.dask.backend.DaskBackend`,
:py:class:`~unidist.core.backends.multiprocessing.backend.MultiProcessingBackend`,
:py:class:`~unidist.core.backends.python.backend.PythonBackend` or :py:class:`~unidist.core.backends.mpi.backend.MPIBackend`).
:py:class:`~unidist.core.backends.pymp.backend.PyMpBackend`,
:py:class:`~unidist.core.backends.pyseq.backend.PySeqBackend` or :py:class:`~unidist.core.backends.mpi.backend.MPIBackend`).
These classes are childs of the :py:class:`~unidist.core.base.backend.Backend` interface and should override
operations declared in it. Then, the concrete backend performs passed operation and hands over the result back to
the :py:class:`~unidist.core.base.backend.BackendProxy` that postprocesses it if necessary and returns it to the user.
Expand Down Expand Up @@ -70,22 +70,22 @@ details just pick module you are interested in.
| │ ├─── :doc:`actor </flow/unidist/core/backends/mpi/actor>`
| │ ├─── :doc:`backend </flow/unidist/core/backends/mpi/backend>`
| │ └─── :doc:`remote_function </flow/unidist/core/backends/mpi/remote_function>`
| ├───multiprocessing
| ├───pymp
│ | ├───core
│ │ │ ├─── :doc:`actor </flow/unidist/core/backends/multiprocessing/core/actor>`
│ │ │ ├─── :doc:`api </flow/unidist/core/backends/multiprocessing/core/api>`
│ │ │ ├─── :doc:`object_store </flow/unidist/core/backends/multiprocessing/core/object_store>`
│ │ │ └─── :doc:`process_manager </flow/unidist/core/backends/multiprocessing/core/process_manager>`
│ │ ├─── :doc:`actor </flow/unidist/core/backends/multiprocessing/actor>`
│ │ ├─── :doc:`backend </flow/unidist/core/backends/multiprocessing/backend>`
│ │ └─── :doc:`remote_function </flow/unidist/core/backends/multiprocessing/remote_function>`
│ ├───python
│ │ │ ├─── :doc:`actor </flow/unidist/core/backends/pymp/core/actor>`
│ │ │ ├─── :doc:`api </flow/unidist/core/backends/pymp/core/api>`
│ │ │ ├─── :doc:`object_store </flow/unidist/core/backends/pymp/core/object_store>`
│ │ │ └─── :doc:`process_manager </flow/unidist/core/backends/pymp/core/process_manager>`
│ │ ├─── :doc:`actor </flow/unidist/core/backends/pymp/actor>`
│ │ ├─── :doc:`backend </flow/unidist/core/backends/pymp/backend>`
│ │ └─── :doc:`remote_function </flow/unidist/core/backends/pymp/remote_function>`
│ ├───pyseq
│ | ├───core
│ │ │ ├─── :doc:`api </flow/unidist/core/backends/python/core/api>`
│ │ │ └─── :doc:`object_store </flow/unidist/core/backends/python/core/object_store>`
│ │ ├─── :doc:`actor </flow/unidist/core/backends/python/actor>`
│ │ ├─── :doc:`backend </flow/unidist/core/backends/python/backend>`
│ │ └─── :doc:`remote_function </flow/unidist/core/backends/python/remote_function>`
│ │ │ ├─── :doc:`api </flow/unidist/core/backends/pyseq/core/api>`
│ │ │ └─── :doc:`object_store </flow/unidist/core/backends/pyseq/core/object_store>`
│ │ ├─── :doc:`actor </flow/unidist/core/backends/pyseq/actor>`
│ │ ├─── :doc:`backend </flow/unidist/core/backends/pyseq/backend>`
│ │ └─── :doc:`remote_function </flow/unidist/core/backends/pyseq/remote_function>`
│ └───ray
│ ├─── :doc:`actor </flow/unidist/core/backends/ray/actor>`
│ ├─── :doc:`backend </flow/unidist/core/backends/ray/backend>`
Expand Down
43 changes: 0 additions & 43 deletions docs/flow/unidist/core/backends/multiprocessing/actor.rst

This file was deleted.

37 changes: 0 additions & 37 deletions docs/flow/unidist/core/backends/multiprocessing/core/actor.rst

This file was deleted.

44 changes: 0 additions & 44 deletions docs/flow/unidist/core/backends/multiprocessing/core/api.rst

This file was deleted.

This file was deleted.

This file was deleted.

43 changes: 43 additions & 0 deletions docs/flow/unidist/core/backends/pymp/actor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
..
Copyright (C) 2021-2023 Modin authors
SPDX-License-Identifier: Apache-2.0

:orphan:

PyMpActor
"""""""""

The class is specific implementation of :py:class:`~unidist.core.base.actor.Actor` class using Python Multiprocessing backend.

The :py:class:`~unidist.core.backends.pymp.actor.PyMpActor` implements 2 internal methods:

* :py:meth:`~unidist.core.backends.pymp.actor.PyMpActor.__getattr__` -- transmits an access responsibility
to the methods of native Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor`,
held by this class, to :py:class:`~unidist.core.backends.pymp.actor.PyMpActorMethod` class.
* :py:meth:`~unidist.core.backends.pymp.actor.PyMpActor._remote` -- creates native
Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor` object to be held by this class.

API
===

.. autoclass:: unidist.core.backends.pymp.actor.PyMpActor
:members:
:private-members:

PyMpActorMethod
"""""""""""""""

The class is specific implementation of :py:class:`~unidist.core.base.actor.ActorMethod` class using Python Multiprocessing backend.

The :py:class:`~unidist.core.backends.pymp.actor.PyMpActorMethod` implements
internal method :py:meth:`~unidist.core.backends.pymp.actor.PyMpActorMethod._remote`
that is responsible for calls of native Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor`
class methods.

API
===

.. autoclass:: unidist.core.backends.pymp.actor.PyMpActorMethod
:members:
:private-members:
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

:orphan:

MultiProcessingBackend
""""""""""""""""""""""
PyMpBackend
"""""""""""

The class is specific implementation of :py:class:`~unidist.core.base.backend.Backend` interface using Multiprocessing.
The class is specific implementation of :py:class:`~unidist.core.base.backend.Backend` interface using Python Multiprocessing backend.

API
===

.. autoclass:: unidist.core.backends.multiprocessing.backend.MultiProcessingBackend
.. autoclass:: unidist.core.backends.pymp.backend.PyMpBackend
:members:
37 changes: 37 additions & 0 deletions docs/flow/unidist/core/backends/pymp/core/actor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
..
Copyright (C) 2021-2023 Modin authors
SPDX-License-Identifier: Apache-2.0

:orphan:

Actor
"""""

Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor` class is
intended to transform a user-defined class to the class shared between processes (using `multiprocessing.managers.BaseManager`_),
which methods will be executed in a separate Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.process_manager.Worker`.

API
===

.. autoclass:: unidist.core.backends.pymp.core.actor.Actor
:members:

ActorMethod
"""""""""""

The :py:class:`~unidist.core.backends.pymp.core.actor.ActorMethod` class is a wrapper over the method of
the shared between processes class, stored in Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor`.
Method :py:meth:`~unidist.core.backends.pymp.core.actor.ActorMethod.submit` wraps a method of the shared between processes
class object to :py:class:`~unidist.core.backends.pymp.core.process_manager.Task` and adds it
to task queue of Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.process_manager.Worker`, used by
Python Multiprocessing :py:class:`~unidist.core.backends.pymp.core.actor.Actor`.

API
===

.. autoclass:: unidist.core.backends.pymp.core.actor.ActorMethod
:members:

.. _`multiprocessing.managers.BaseManager`: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.managers.BaseManager
Loading

0 comments on commit 9ae4347

Please sign in to comment.