holoscan.schedulers
此模块为底层 C++ API 调度器提供 Python API。
- class holoscan.schedulers.EventBasedScheduler
基类:
holoscan.gxf._gxf.GXFScheduler
、holoscan.core._core.Component
、holoscan.gxf._gxf.GXFComponent
基于事件的多线程调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- worker_thread_numberint
工作线程数。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- namestr,可选
调度器的名称。
属性
args
与组件关联的参数列表。 description
描述组件的 YAML 格式字符串。 fragment
调度器所属的片段。 gxf_cid
GXF 组件 ID。 gxf_cname
组件的名称。 gxf_context
组件的 GXF 上下文。 gxf_eid
GXF 实体 ID。 gxf_typename
组件的 GXF 类型名称。 id
组件的标识符。 name
调度器的名称。 clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout worker_thread_number 方法
add_arg
(*args, **kwargs)重载函数。 gxf_initialize
(self)初始化组件。 initialize
(self)调度器的初始化方法。 setup
(self, arg0)调度器的设置方法。 - __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
基于事件的多线程调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- worker_thread_numberint
工作线程数。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- namestr,可选
调度器的名称。
- add_arg(*args, **kwargs)
重载函数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
向组件添加参数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
向组件添加参数列表。
- property args
与组件关联的参数列表。
- 返回
- arglistholoscan.core.ArgList
- property clock
- property description
描述组件的 YAML 格式字符串。
- property fragment
调度器所属的片段。
- 返回
- nameholoscan.core.Fragment
- property gxf_cid
GXF 组件 ID。
- property gxf_cname
组件的名称。
- property gxf_context
组件的 GXF 上下文。
- property gxf_eid
GXF 实体 ID。
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
初始化组件。
- property gxf_typename
组件的 GXF 类型名称。
- 返回
- str
组件的 GXF 类型名称。
- property id
组件的标识符。
标识符最初设置为
-1
,并在组件初始化后变为有效值。使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。
- 返回
- idint
- initialize(self: holoscan.core._core.Scheduler) → None
调度器的初始化方法。
- property max_duration_ms
- property name
调度器的名称。
- 返回
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
调度器的设置方法。
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- property worker_thread_number
- class holoscan.schedulers.GreedyScheduler
基类:
holoscan.gxf._gxf.GXFScheduler
、holoscan.core._core.Component
、holoscan.gxf._gxf.GXFComponent
贪婪调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- check_recession_period_msfloat,可选
当所有操作器在当前迭代中都未准备好运行时,调度器将等待的最长持续时间(以毫秒为单位)。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- namestr,可选
调度器的名称。
属性
args
与组件关联的参数列表。 description
描述组件的 YAML 格式字符串。 fragment
调度器所属的片段。 gxf_cid
GXF 组件 ID。 gxf_cname
组件的名称。 gxf_context
组件的 GXF 上下文。 gxf_eid
GXF 实体 ID。 gxf_typename
组件的 GXF 类型名称。 id
组件的标识符。 name
调度器的名称。 check_recession_period_ms clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout 方法
add_arg
(*args, **kwargs)重载函数。 gxf_initialize
(self)初始化组件。 initialize
(self)调度器的初始化方法。 setup
(self, arg0)调度器的设置方法。 - __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
贪婪调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- check_recession_period_msfloat,可选
当所有操作器在当前迭代中都未准备好运行时,调度器将等待的最长持续时间(以毫秒为单位)。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- namestr,可选
调度器的名称。
- add_arg(*args, **kwargs)
重载函数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
向组件添加参数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
向组件添加参数列表。
- property args
与组件关联的参数列表。
- 返回
- arglistholoscan.core.ArgList
- property check_recession_period_ms
- property clock
- property description
描述组件的 YAML 格式字符串。
- property fragment
调度器所属的片段。
- 返回
- nameholoscan.core.Fragment
- property gxf_cid
GXF 组件 ID。
- property gxf_cname
组件的名称。
- property gxf_context
组件的 GXF 上下文。
- property gxf_eid
GXF 实体 ID。
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
初始化组件。
- property gxf_typename
组件的 GXF 类型名称。
- 返回
- str
组件的 GXF 类型名称。
- property id
组件的标识符。
标识符最初设置为
-1
,并在组件初始化后变为有效值。使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。
- 返回
- idint
- initialize(self: holoscan.core._core.Scheduler) → None
调度器的初始化方法。
- property max_duration_ms
- property name
调度器的名称。
- 返回
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
调度器的设置方法。
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- class holoscan.schedulers.MultiThreadScheduler
基类:
holoscan.gxf._gxf.GXFScheduler
、holoscan.core._core.Component
、holoscan.gxf._gxf.GXFComponent
多线程调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- worker_thread_numberint
工作线程数。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- check_recession_period_msfloat,可选
当操作器尚未准备好运行时,调度器将等待的最长持续时间(以毫秒为单位)。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- strict_job_thread_pinningbool,可选
为 true 时,操作器绑定到的线程不允许运行任何其他操作器。为 false 时,如果绑定的操作器未处于 READY 状态,则另一个操作器可以在该线程上运行。
- namestr,可选
调度器的名称。
属性
args
与组件关联的参数列表。 description
描述组件的 YAML 格式字符串。 fragment
调度器所属的片段。 gxf_cid
GXF 组件 ID。 gxf_cname
组件的名称。 gxf_context
组件的 GXF 上下文。 gxf_eid
GXF 实体 ID。 gxf_typename
组件的 GXF 类型名称。 id
组件的标识符。 name
调度器的名称。 check_recession_period_ms clock max_duration_ms spec stop_on_deadlock stop_on_deadlock_timeout worker_thread_number 方法
add_arg
(*args, **kwargs)重载函数。 gxf_initialize
(self)初始化组件。 initialize
(self)调度器的初始化方法。 setup
(self, arg0)调度器的设置方法。 - __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, strict_job_thread_pinning: bool = False, name: str = 'multithread_scheduler') → None
多线程调度器
- 参数
- fragmentFragment
条件将与之关联的片段
- clockholoscan.resources.Clock 或 None,可选
调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock。
- worker_thread_numberint
工作线程数。
- stop_on_deadlockbool,可选
如果启用,当所有实体都处于等待状态,但没有周期性实体来打破僵局时,调度器将停止。当可以通过外部参与者更改调度条件时(例如,手动清除队列),应禁用此项。
- check_recession_period_msfloat,可选
当操作器尚未准备好运行时,调度器将等待的最长持续时间(以毫秒为单位)。
- max_duration_msint,可选
调度器将执行的最长持续时间(以毫秒为单位)。如果未指定(或提供负值),调度器将运行到所有工作完成为止。如果存在周期性术语,则意味着应用程序将无限期运行。
- stop_on_deadlock_timeoutint,可选
调度器将等待这段时间,然后确定它处于死锁状态并应停止。如果在等待期间有作业进入,它将重置。负值表示不因死锁而停止。此参数仅在 stop_on_deadlock=true” 时适用。
- strict_job_thread_pinningbool,可选
为 true 时,操作器绑定到的线程不允许运行任何其他操作器。为 false 时,如果绑定的操作器未处于 READY 状态,则另一个操作器可以在该线程上运行。
- namestr,可选
调度器的名称。
- add_arg(*args, **kwargs)
重载函数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
向组件添加参数。
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
向组件添加参数列表。
- property args
与组件关联的参数列表。
- 返回
- arglistholoscan.core.ArgList
- property check_recession_period_ms
- property clock
- property description
描述组件的 YAML 格式字符串。
- property fragment
调度器所属的片段。
- 返回
- nameholoscan.core.Fragment
- property gxf_cid
GXF 组件 ID。
- property gxf_cname
组件的名称。
- property gxf_context
组件的 GXF 上下文。
- property gxf_eid
GXF 实体 ID。
- gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None
初始化组件。
- property gxf_typename
组件的 GXF 类型名称。
- 返回
- str
组件的 GXF 类型名称。
- property id
组件的标识符。
标识符最初设置为
-1
,并在组件初始化后变为有效值。使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。
- 返回
- idint
- initialize(self: holoscan.core._core.Scheduler) → None
调度器的初始化方法。
- property max_duration_ms
- property name
调度器的名称。
- 返回
- namestr
- setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None
调度器的设置方法。
- property spec
- property stop_on_deadlock
- property stop_on_deadlock_timeout
- property worker_thread_number