holoscan.schedulers
This module provides a Python API to underlying C++ API Schedulers.
<a href="#holoscan.schedulers.EventBasedScheduler">holoscan.schedulers.EventBasedScheduler</a> |
Event-based multi-thread scheduler |
<a href="#holoscan.schedulers.GreedyScheduler">holoscan.schedulers.GreedyScheduler</a> |
Greedy scheduler |
<a href="#holoscan.schedulers.MultiThreadScheduler">holoscan.schedulers.MultiThreadScheduler</a> |
Multi-thread scheduler |
- class holoscan.schedulers.EventBasedScheduler
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFScheduler">holoscan.gxf._gxf.GXFScheduler</a>
,<a href="holoscan_python_api_core.html#holoscan.core.Component">holoscan.core._core.Component</a>
,<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFComponent">holoscan.gxf._gxf.GXFComponent</a>
Event-based multi-thread scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- worker_thread_numberint
The number of worker threads.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
Attributes
<a href="#holoscan.schedulers.EventBasedScheduler.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.schedulers.EventBasedScheduler.description">description</a>
YAML formatted string describing the component. <a href="#holoscan.schedulers.EventBasedScheduler.fragment">fragment</a>
Fragment that the scheduler belongs to. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_typename">gxf_typename</a>
The GXF type name of the scheduler. <a href="#holoscan.schedulers.EventBasedScheduler.id">id</a>
The identifier of the component. <a href="#holoscan.schedulers.EventBasedScheduler.name">name</a>
The name of the scheduler. clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout worker_thread_number Methods
<a href="#holoscan.schedulers.EventBasedScheduler.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.schedulers.EventBasedScheduler.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.schedulers.EventBasedScheduler.initialize">initialize</a>
(self)Initialize the scheduler. <a href="#holoscan.schedulers.EventBasedScheduler.setup">setup</a>
(self, arg0)setup method for the scheduler. - __init__(self: holoscan.schedulers._schedulers.EventBasedScheduler, fragment: holoscan.core._core.Fragment, *, clock: holoscan.resources._resources.Clock = None, worker_thread_number: int = 1, stop_on_deadlock: bool = True, max_duration_ms: int = - 1, stop_on_deadlock_timeout: int = 0, name: str = 'multithread_scheduler') → None
Event-based multi-thread scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- worker_thread_numberint
The number of worker threads.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
- add_arg(*args, **kwargs)
Overloaded function.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
Add an argument to the component.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property clock
- property description
YAML formatted string describing the component.
- property fragment
Fragment that the scheduler belongs to.
- Returns
- nameholoscan.core.Fragment
- property gxf_cid
The GXF component ID.
- property gxf_cname
The name of the component.
- property gxf_context
The GXF context of the component.
- property gxf_eid
The GXF entity ID.
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
Initialize the component.
- property gxf_typename
The GXF type name of the scheduler.
- Returns
- str
The GXF type name of the scheduler
- property id
The identifier of the component.
The identifier is initially set to
-1
, and will become a valid value when the component is initialized.With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.
- Returns
- idint
- initialize(self: holoscan.gxf._gxf.GXFScheduler) → None
Initialize the scheduler.
- property max_duration_ms
- property name
The name of the scheduler.
- Returns
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
setup method for the scheduler.
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- property worker_thread_number
- class holoscan.schedulers.GreedyScheduler
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFScheduler">holoscan.gxf._gxf.GXFScheduler</a>
,<a href="holoscan_python_api_core.html#holoscan.core.Component">holoscan.core._core.Component</a>
,<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFComponent">holoscan.gxf._gxf.GXFComponent</a>
Greedy scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- check_recession_period_msfloat, optional
The maximum duration for which the scheduler would wait (in ms) when all operators are not ready to run in the current iteration.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
Attributes
<a href="#holoscan.schedulers.GreedyScheduler.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.schedulers.GreedyScheduler.description">description</a>
YAML formatted string describing the component. <a href="#holoscan.schedulers.GreedyScheduler.fragment">fragment</a>
Fragment that the scheduler belongs to. <a href="#holoscan.schedulers.GreedyScheduler.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.schedulers.GreedyScheduler.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.schedulers.GreedyScheduler.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.schedulers.GreedyScheduler.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.schedulers.GreedyScheduler.gxf_typename">gxf_typename</a>
The GXF type name of the scheduler. <a href="#holoscan.schedulers.GreedyScheduler.id">id</a>
The identifier of the component. <a href="#holoscan.schedulers.GreedyScheduler.name">name</a>
The name of the scheduler. check_recession_period_ms clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout Methods
<a href="#holoscan.schedulers.GreedyScheduler.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.schedulers.GreedyScheduler.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.schedulers.GreedyScheduler.initialize">initialize</a>
(self)Initialize the scheduler. <a href="#holoscan.schedulers.GreedyScheduler.setup">setup</a>
(self, arg0)setup method for the scheduler. - __init__(self: holoscan.schedulers._schedulers.GreedyScheduler, fragment: holoscan.core._core.Fragment, *, clock: holoscan.resources._resources.Clock = None, stop_on_deadlock: bool = True, max_duration_ms: int = - 1, check_recession_period_ms: float = 0.0, stop_on_deadlock_timeout: int = 0, name: str = 'greedy_scheduler') → None
Greedy scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- check_recession_period_msfloat, optional
The maximum duration for which the scheduler would wait (in ms) when all operators are not ready to run in the current iteration.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
- add_arg(*args, **kwargs)
Overloaded function.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
Add an argument to the component.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property check_recession_period_ms
- property clock
- property description
YAML formatted string describing the component.
- property fragment
Fragment that the scheduler belongs to.
- Returns
- nameholoscan.core.Fragment
- property gxf_cid
The GXF component ID.
- property gxf_cname
The name of the component.
- property gxf_context
The GXF context of the component.
- property gxf_eid
The GXF entity ID.
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
Initialize the component.
- property gxf_typename
The GXF type name of the scheduler.
- Returns
- str
The GXF type name of the scheduler
- property id
The identifier of the component.
The identifier is initially set to
-1
, and will become a valid value when the component is initialized.With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.
- Returns
- idint
- initialize(self: holoscan.gxf._gxf.GXFScheduler) → None
Initialize the scheduler.
- property max_duration_ms
- property name
The name of the scheduler.
- Returns
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
setup method for the scheduler.
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- class holoscan.schedulers.MultiThreadScheduler
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFScheduler">holoscan.gxf._gxf.GXFScheduler</a>
,<a href="holoscan_python_api_core.html#holoscan.core.Component">holoscan.core._core.Component</a>
,<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFComponent">holoscan.gxf._gxf.GXFComponent</a>
Multi-thread scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- worker_thread_numberint
The number of worker threads.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- check_recession_period_msfloat, optional
The maximum duration for which the scheduler would wait (in ms) when an operator is not ready to run yet.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
Attributes
<a href="#holoscan.schedulers.MultiThreadScheduler.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.schedulers.MultiThreadScheduler.description">description</a>
YAML formatted string describing the component. <a href="#holoscan.schedulers.MultiThreadScheduler.fragment">fragment</a>
Fragment that the scheduler belongs to. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_typename">gxf_typename</a>
The GXF type name of the scheduler. <a href="#holoscan.schedulers.MultiThreadScheduler.id">id</a>
The identifier of the component. <a href="#holoscan.schedulers.MultiThreadScheduler.name">name</a>
The name of the scheduler. check_recession_period_ms clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout worker_thread_number Methods
<a href="#holoscan.schedulers.MultiThreadScheduler.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.schedulers.MultiThreadScheduler.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.schedulers.MultiThreadScheduler.initialize">initialize</a>
(self)Initialize the scheduler. <a href="#holoscan.schedulers.MultiThreadScheduler.setup">setup</a>
(self, arg0)setup method for the scheduler. - __init__(self: holoscan.schedulers._schedulers.MultiThreadScheduler, fragment: holoscan.core._core.Fragment, *, clock: holoscan.resources._resources.Clock = None, worker_thread_number: int = 1, stop_on_deadlock: bool = True, check_recession_period_ms: float = 5.0, max_duration_ms: int = - 1, stop_on_deadlock_timeout: int = 0, name: str = 'multithread_scheduler') → None
Multi-thread scheduler
- Parameters
- fragmentFragment
The fragment the condition will be associated with
- clockholoscan.resources.Clock or None, optional
The clock used by the scheduler to define the flow of time. If None, a default-constructed holoscan.resources.RealtimeClock will be used.
- worker_thread_numberint
The number of worker threads.
- stop_on_deadlockbool, optional
If enabled the scheduler will stop when all entities are in a waiting state, but no periodic entity exists to break the dead end. Should be disabled when scheduling conditions can be changed by external actors, for example by clearing queues manually.
- check_recession_period_msfloat, optional
The maximum duration for which the scheduler would wait (in ms) when an operator is not ready to run yet.
- max_duration_msint, optional
The maximum duration for which the scheduler will execute (in ms). If not specified (or if a negative value is provided), the scheduler will run until all work is done. If periodic terms are present, this means the application will run indefinitely.
- stop_on_deadlock_timeoutint, optional
The scheduler will wait this amount of time before determining that it is in deadlock and should stop. It will reset if a job comes in during the wait. A negative value means not stop on deadlock. This parameter only applies when stop_on_deadlock=true”,
- namestr, optional
The name of the scheduler.
- add_arg(*args, **kwargs)
Overloaded function.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
Add an argument to the component.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property check_recession_period_ms
- property clock
- property description
YAML formatted string describing the component.
- property fragment
Fragment that the scheduler belongs to.
- Returns
- nameholoscan.core.Fragment
- property gxf_cid
The GXF component ID.
- property gxf_cname
The name of the component.
- property gxf_context
The GXF context of the component.
- property gxf_eid
The GXF entity ID.
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
Initialize the component.
- property gxf_typename
The GXF type name of the scheduler.
- Returns
- str
The GXF type name of the scheduler
- property id
The identifier of the component.
The identifier is initially set to
-1
, and will become a valid value when the component is initialized.With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.
- Returns
- idint
- initialize(self: holoscan.gxf._gxf.GXFScheduler) → None
Initialize the scheduler.
- property max_duration_ms
- property name
The name of the scheduler.
- Returns
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
setup method for the scheduler.
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- property worker_thread_number