holoscan::AppDriver
holoscan::AppDriver
Constructors
AppDriver
Destructor
~AppDriver
Methods
run
run_async
options
status
Note that the application status is not updated when the application is running locally.
fragment_scheduler
all_fragment_port_map
submit_message
process_message_queue
schedule
Get the schedule of the application.
The schedule is a map of fragment names to worker IDs.
This will be empty until after check_fragment_schedule has been called.
Returns: The schedule of the application.
terminate_all_workers
Terminate all workers and close all worker connections.
set_status
Allow AppDriverServiceImpl to set the app status.
handle_driver_start
Start the fragment services.
handle_driver_shutdown
Handle driver shutdown for fragment services.
Returns: true if all services shut down successfully, false if any failures occurred
setup_signal_handlers
need_to_update_port_names
Check if update_port_names needs to be called.
update_port_names
Correct the port names of the given fragment graph edge.
This takes cases where a source operator has only one port and only the operator name was specified during add_flow. This function will append the ”.<port_name>” to the operator name. The same sort of appending of the port name is also done for any target operators having only a single input port.
collect_connections
Collect fragment connections.
Port names of the fragment graph edges are corrected during this process (via update_port_names).
correct_connection_map
Correct connection map.
connection_map_ is initialized with the default IP (0.0.0.0) and port (zero-based index). This function corrects the connection map by replacing the default IP and port with the real IP and port (using index_to_ip_map_ and index_to_port_map_).
connect_fragments
Connect target fragments with UCX connector.
check_configuration
Check the configuration of the application.
This function checks if the application is running locally or remotely and sets the corresponding flags. This also calls the application’s compose() function to compose the application.
collect_resource_requirements
Get the system resource requirement of the fragment.
parse_resource_requirement
Overload 1
Overload 2
Overload 3
Parse the system resource requirement from the given YAML node.
check_fragment_schedule
Check the fragment schedule to ensure that all fragments are scheduled to run.
check_worker_execution
Check if the all workers have finished execution.
launch_app_driver
Run the application in driver mode.
Even if the application is running locally, we launch the driver to provide the health check service if need_health_check_ is true.
launch_app_worker
Run the application in worker mode.
launch_fragments_async
Launch fragments asynchronously.
update_root_fragments
Helper method to update root fragments after a fragment is terminated.
Static methods
get_bool_env_var
Retrieves a boolean value from an environment variable.
This function fetches the value of a named environment variable and converts it to a boolean. The conversion is case-insensitive and accepts “true”, “1”, or “on” as true, any other values are considered false. If the environment variable is not set or its value is not recognized as ‘true’, the function returns a default value.
This function uses std::getenv() to access environment variables. The environment variable to look up is specified by the ‘name’ parameter. The value of the environment variable is converted to a lower-case string, and compared to the known ‘true’ strings.
The function does not throw an exception if the environment variable is not found or if the value does not match any of the expected ‘true’ strings.
Returns: true if the environment variable is set and its value is recognized as ‘true’, and false otherwise. If the environment variable is not set, the function returns ‘default_value’.
Parameters
The name of the environment variable to look up.
The value to return if the environment variable is not set or its value does not match any of the known ‘true’ strings. The default is ‘false’.
get_int_env_var
Retrieves an integer value from an environment variable.
Returns: The value of the environment variable, converted to an integer. If the environment variable is not set or its value is not a valid integer, the function returns ‘default_value’.
Parameters
The name of the environment variable to look up.
The value to return if the environment variable is not set or its value is not a valid integer. The default is 0.
parse_memory_size
Parses a string representing a memory size and returns its value in bytes.
This method takes a string in the format of “XGi” or “XMi”, where X is a numerical value, and Mi/Gi represents Mebibytes/Gibibytes. The method converts this string into an equivalent memory size in bytes.
The string is case-insensitive, meaning that “1gi” is considered equivalent to “1Gi”.
The string is expected to represent a positive integer followed by either “M” or “G”, signifying mebibytes or gibibytes, respectively. If the string does not follow this format, the behavior is undefined.
Returns: The memory size represented by size_str, converted into bytes. For example, if size_str is “1Gi”, the return value will be 1,073,741,824 (1024 * 1024 * 1024). If size_str is “500Mi”, the return value will be 524,288,000 (500 * 1024 * 1024).
Parameters
A string representing a memory size in mebibytes or gibibytes. For example, “1Gi” represents one gibibyte and “500Mi” represents 500 mebibytes.
set_ucx_to_exclude_cuda_ipc
Set UCX_TLS to disable cuda_ipc transport.
Will check the UCX_TLS environment variable. If it is not already set, it sets UCX_TLS=^cuda_ipc to exclude this transport method. If it is already set and cuda_ipc is not excluded, a warning will be logged.
exclude_cuda_ipc_transport_on_igpu
Disable CUDA interprocess communication (IPC) if the fragment is running on an iGPU.
Tegra devices do not support CUDA IPC.
Calls set_ucx_tls_to_exclude_cuda_ipc if we are running on iGPU.