Skip to content

Commit

Permalink
remove n_io_process (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
aresnow1 authored Apr 23, 2023
1 parent 6c56257 commit d4ace47
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
27 changes: 0 additions & 27 deletions python/xoscar/backends/indigen/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

from __future__ import annotations

from typing import Dict

from ...backend import BaseActorBackend, register_backend
from ..context import IndigenActorContext
from .driver import IndigenActorDriver
Expand All @@ -25,30 +23,6 @@
__all__ = ["IndigenActorBackend"]


def build_pool_kwargs(n_process: int, kwargs: Dict):
n_io_process = kwargs.pop("n_io_process", 0)
if n_io_process:
n_process += n_io_process

labels = kwargs["labels"]
envs = kwargs["envs"]
external_address_schemes = kwargs["external_address_schemes"]
enable_internal_addresses = kwargs["enable_internal_addresses"]
# sub-pools for IO(transfer and spill)
for _ in range(n_io_process):
if envs: # pragma: no cover
envs.append(dict())
labels.append("io")
if external_address_schemes:
# just use main process' scheme for IO process
external_address_schemes.append(external_address_schemes[0])
if enable_internal_addresses:
# just use main process' setting for IO process
enable_internal_addresses.append(enable_internal_addresses[0])

return n_process, kwargs


@register_backend
class IndigenActorBackend(BaseActorBackend):
@staticmethod
Expand All @@ -72,7 +46,6 @@ async def create_actor_pool(
from ..pool import create_actor_pool

assert n_process is not None
n_process, kwargs = build_pool_kwargs(n_process, kwargs)
return await create_actor_pool(
address, pool_cls=MainActorPool, n_process=n_process, **kwargs
)
3 changes: 1 addition & 2 deletions python/xoscar/backends/test/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from __future__ import annotations

from ...backend import register_backend
from ..indigen.backend import IndigenActorBackend, build_pool_kwargs
from ..indigen.backend import IndigenActorBackend
from .pool import TestMainActorPool


Expand All @@ -33,7 +33,6 @@ async def create_actor_pool(
from ..pool import create_actor_pool

assert n_process is not None
n_process, kwargs = build_pool_kwargs(n_process, kwargs)
return await create_actor_pool(
address, pool_cls=TestMainActorPool, n_process=n_process, **kwargs
)

0 comments on commit d4ace47

Please sign in to comment.