Calculation management
Expression fast calculations: Calculation Management
The GeoDMS treats a model as a dependency tree of data items: every item declares, through its Expression, which source data and other items it is calculated from. The engine manages this tree, so the modeller never specifies a calculation order.
lazy evaluation
Calculations are demand driven. Only the items that are actually requested (viewed in the GUI, exported, or updated from the command line) are calculated, together with the suppliers they depend on. Items that nothing asks for are never computed.
incremental updates
Within a session, a calculation that occurs in several places is shared by all of them (see calculation cache), and a calculated result is reused for as long as it stays in memory: while something still needs it, or longer when it is marked with KeepData. Results are invalidated only by changes in:
- the direct or indirect expressions used to calculate them;
- the source data they are derived from.
After such a change, only the invalidated part of the tree is recalculated; other results are reused as far as they are still in memory. See Update Mechanism for a description of this incremental update mechanism. Results that should persist between sessions can be written to disk explicitly, see Strategic decoupling.
optimization of the calculation process
In determining how to calculate the requested results, the engine also:
- rewrites calculation rules symbolically to remove redundant calculation steps;
- optimizes the path of calculation steps (for example in the trade-off between calculating each country per year or each year per country);
- splits pre- and post-processing steps off from the core calculations;
- processes large domains in segments/tiles, in parallel where possible (see GeoDMS Default Tiling).