iaml.core_dispatcher¶
Singleton used by IAML to dispatch cores to process
Classes¶
Singleton used by IAML to dispatch cores to process |
Module Contents¶
- class iaml.core_dispatcher.CoreDispatcher(*args, **kwargs)¶
Singleton used by IAML to dispatch cores to process
- Parameters:
*args (tuple, optional) – Additional parameters.
**kwargs (dict, optional) – Additional parameters.
- manager: multiprocess.Manager | None = None¶
Manager used to dispatch cores to process (None when not available).
- books: list | multiprocess.managers.ListProxy¶
Booked cores registry.
- reset_books() None¶
Set all cpu cores as available
- property available_cores: set[int]¶
All cores minus booked ones
- Returns:
Set of available cpu cores
- affiliate(pids: list[int], core_number: int = 1) None¶
Run process with CPU affinity
- Parameters:
pids (list[int]) – Process to affiliate with CPU cores.
core_number (int, optional) – number of process to run (each process run the same target). Defaults to 1.