holoscan::Executor
holoscan::Executor
Base class for all executors.
An Executor that manages the execution of a Fragment on a physical node. The framework provides a default Executor that uses a GXF Scheduler to execute an Application.
Constructors
Executor
From raw pointer
Deleted overloads
Construct a new Executor object.
Parameters
The pointer to the fragment of the executor.
Destructor
~Executor
Assignment operators
operator=
Methods
run
Run the graph.
Parameters
The reference to the graph.
run_async
Run the graph asynchronously.
Returns: The future object.
Parameters
The reference to the graph.
interrupt
Interrupt the execution.
Returns: true if the interrupt was successful (graph was running), false if the graph was not running (already stopped or not started).
wait
Wait for the execution to complete.
This method blocks until the graph execution (started by run_async or interrupted by interrupt()) completes. Should be called after interrupt() to ensure the scheduler has fully stopped before performing cleanup operations.
Only call this if interrupt() returned true. Calling wait() when the graph is not running can cause issues with concurrent cleanup.
fragment
Set the pointer to the fragment of the executor
Get a pointer to Fragment object
Set the pointer to the fragment of the executor.
Parameters
The pointer to the fragment of the executor.
context
Set the context
Get the context
Set the context.
Parameters
The context.
owns_context
Get whether the context is owned by the executor.
Returns: true if the context is owned by the executor. Otherwise, false.
context_uint64
Overload 1
Overload 2
extension_manager
Get the extension manager.
Returns: The shared pointer of the extension manager.
exception
Set the exception
Get the stored exception
Set the exception.
This method is called by the framework to store the exception that occurred during the execution of the fragment. If the exception is set, this exception is rethrown by the framework after the execution of the fragment.
Parameters
The exception to store.
initialize_fragment
Initialize the fragment_ in this Executor.
This method is called by run() to initialize the fragment and the graph of operators in the fragment before execution.
Returns: true if fragment initialization is successful. Otherwise, false.
initialize_operator
Initialize the given operator.
This method is called by Operator::initialize() to initialize the operator.
Depending on the type of the operator, this method may be overridden to initialize the operator. For example, the default executor (GXFExecutor) initializes the operator using the GXF API and sets the operator’s ID to the ID of the GXF codelet.
Returns: true if the operator is initialized successfully. Otherwise, false.
Parameters
The pointer to the operator.
initialize_scheduler
Initialize the given scheduler.
This method is called by Scheduler::initialize() to initialize the operator.
Depending on the type of the scheduler, this method may be overridden to initialize the scheduler. For example, the default executor (GXFExecutor) initializes the scheduler using the GXF API and sets the operator’s ID to the ID of the GXF scheduler.
Returns: true if the scheduler is initialized successfully. Otherwise, false.
Parameters
The pointer to the scheduler.
initialize_network_context
Initialize the given network context.
This method is called by NetworkContext::initialize() to initialize the operator.
Depending on the type of the network context, this method may be overridden to initialize the network context. For example, the default executor (GXFExecutor) initializes the network context using the GXF API and sets the operator’s ID to the ID of the GXF network context.
Returns: true if the network context is initialized successfully. Otherwise, false.
Parameters
The pointer to the network context.
initialize_fragment_services
Initialize the fragment services for the executor.
This method is called during executor initialization to set up any required fragment services.
Depending on the type of executor, this method may be overridden to initialize specific fragment services. For example, the default executor (GXFExecutor) may initialize fragment services using the GXF API.
Returns: true if the fragment services are initialized successfully. Otherwise, false.
add_receivers
Add the receivers as input ports of the given operator.
This method is to be called by the Fragment::add_flow() method to support for the case where the destination input port label points to the parameter name of the downstream operator, and the parameter type is ‘std::vector<holoscan::IOSpec*>’. This finds a parameter with with ‘std::vector<holoscan::IOSpec*>’ type and create a new input port with a specific label (‘parameter name:index’. e.g, ‘receivers:0’).
Returns: true if the receivers are added successfully. Otherwise, false.
Parameters
The reference to the shared pointer of the operator.
The name of the receivers whose parameter type is ‘std::vector<holoscan::IOSpec*>’.
The reference to the vector of input port labels to which the input port labels are added. In the case of multiple receivers, the input port label is updated to ‘parameter name:index’ (e.g. ‘receivers’ => ‘receivers:0’).
The reference to the vector of IOSpec pointers.
add_control_flow
Add a control flow between two operators.
This method is called by Fragment::add_flow() to add a control flow between two operators.
Returns: true if the control flow is added successfully. Otherwise, false.
Parameters
The shared pointer to the upstream operator.
The shared pointer to the downstream operator.