Building a Compiler Back End
The CSDL compiler back end must
- Provide a class named
Simulatorthat conforms to theSimulatorBaseAPI (see Developer API).- The
Simulatorclass should inherit fromSimulatorBase - The
Simulatorclass constructor must have aModelinstance as an unnamed argument and call theModel.definemethod. The user does not need to ever callModel.define.
- The
- Implement the entire Standard Library, and the partial derivatives for each standard operation.
- Implement the MAUD architecture.
- Not store a
Modelobject; i.e. deletion of theModelobject must be allowed after aSimulatorobject is constructed, imposing no additional memory overhead whenSimulator.runis called.
The CSDL compiler back end should
The Simulator class can be implemented in any language, as long as
there is a Python interface available.
For example, if Simulator is implemented in C++, the pybind11
library can expose the C++ class to Python.
The Model.sorted_nodes attribute contains all the nodes for a given
Model object, sorted in the reverse order of execution.
Each Operation and Subgraph node in Model.sorted_nodes contains
enough information to generate executable code for the entire model
specification.