This executor executes a large dependency graph, making certain assumptions about its structure to speed up its evaluation. The assumptions are:
- A PRIMITIVE node can only depend on another PRIMITIVE node
- A SECURITY node can only depend on PRIMITIVE and SECURITY nodes
- A POSITION node can only depend on its SECURITY node
The executor works by stages.
1. It first executes all PRIMITIVES in a single batch, on a single machine.
2. It then executes all SECURITY and POSITION nodes. It divides the nodes into groups by computation target. If a SECURITY node (call it 'A') depends on another SECURITY node (call it 'B'), then B is executed in a first pass before A. If there is no such dependency, then A and B can execute in parallel.
POSITION nodes are evaluated at the same time as SECURITY nodes, on the same machine, as they always depend on a single SECURITY node only.
3. PORTFOLIO nodes are evaluated in a single batch, on a single machine.