Intel® Advisor Help

Reduce Scheduler Overhead using Lightweight Policy

The Flow Graph API allows you to apply lightweight policy for computational nodes such as function node, multifunction node, continue node, and async node. Enabling the lightweight policy helps reduce scheduling overhead. It can limit parallel execution of tasks, so apply this policy on a per-node basis after careful evaluation.

The lightweight policy indicates that the body of a node contains a small amount of work and, if possible, should be executed without the overhead of scheduling a task. By default, the async node has the lightweight policy enabled because it has small computation weight. All other computational nodes do not have the lightweight policy enabled when they are dragged and dropped into the canvas.

Use the lightweight policy in the following cases:

When validating a graph, the graph rule check automatically identifies nodes that can use the lightweight policy. If the above conditions are not met but the lightweight policy is set, the graph rule check recommends removing the lightweight policy for the corresponding node.

To display recommendations for applying the lightweight policy:

  1. Click the graph rule check icon on the toolbar to run the check.

  2. Go to the Analytics Report tab to see the results.

  3. Based on the results, set or disable the lightweight policy for certain nodes.

Another important attribute related to node execution policy is a buffer policy:

For example, by default, the async node is set to queueing_lightweight, and the Flow Graph Analyzer does not add any policy during code generation for async node. Setting buffer policy to rejecting for the async node adds rejecting_lightweight to the policy parameter of async node declaration during code generations.