From d4ace47c1674de1171f4eba603058c65f3dc398d Mon Sep 17 00:00:00 2001 From: aresnow1 <109642806+aresnow1@users.noreply.github.com> Date: Sun, 23 Apr 2023 15:27:04 +0800 Subject: [PATCH] remove `n_io_process` (#21) --- python/xoscar/backends/indigen/backend.py | 27 ----------------------- python/xoscar/backends/test/backend.py | 3 +-- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/python/xoscar/backends/indigen/backend.py b/python/xoscar/backends/indigen/backend.py index bd9355a4..39229d69 100644 --- a/python/xoscar/backends/indigen/backend.py +++ b/python/xoscar/backends/indigen/backend.py @@ -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 @@ -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 @@ -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 ) diff --git a/python/xoscar/backends/test/backend.py b/python/xoscar/backends/test/backend.py index b4b7453f..5b249a50 100644 --- a/python/xoscar/backends/test/backend.py +++ b/python/xoscar/backends/test/backend.py @@ -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 @@ -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 )