This example explores the parallelism provided by the topology of a graph. To make the results as predictable as possible, use a graph that is explicitly parallel, as shown below:
source_nodeis serial, there is no parallelism provided from within the node. This ensures all parallelism observed is provided by the topology of the graph. Eight
source_nodesare connected to a
join_nodeand then to a
queue_node. In this graph, only the
source_nodesdo useful work. Because the parallelism is solely from the topology of the graph, one item per
source_nodeis enough to through the graph. Each
source_nodehas a weight of 1s(1e6). The results of scalability analysis of the graph are shown below.
The speedup is directly proportional to the number of threads.