Skip to content

FMI: LS: Variable interface Bypass-Mode for performance increase #4

@timrulebosch

Description

@timrulebosch

General principle of operation:

  1. FMU defines a typedef containing bypass variables (i.e. those variables which will see a performance increase).
  2. FMU defines/set/calculates the VRef of bypassed variables to the offset of those variables in the "bypass" typedef.
  3. FMU allocates an instance of the "bypass" typdef and assigns to a pointer variable.
  4. Legacy Get/Set operates against the "bypass" instance using the VRef: pointer + offset.
  5. FMU defines a variable which gives the "bypass" pointer (i.e. using uint64).
  6. Importer requests the "bypass" pointer and accesses variables directly using the VRef of those variables: pointer + offset.
  • Alternative (to 6):
    • FMU exports (optionally) a known symbol representing the bypass pointer.
    • The importer attempts to locate that symbol, the presence of which indicates that bypass-mode is supported.

Noteworthy items:

  • FMU may define variables in blocks according to type, allowing importer to use vectorization when accessing variables.
  • Ownership of variable memory belongs with FMU.
  • Existing constraints for Get/Set interface applies; during do_step() model only access, otherwise only importer access (and so on).
  • Pointer variables may need to be references (void**) so that they can be reallocated. Annotations should indicate that, as well as associating a variable that indicates the size of that allocated resource (if required, for instance, a dynamic resizing buffer).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions