Opened 9 years ago

Last modified 7 years ago

#3418 new defect

Bad performance of Spice3BenchmarkFourBitBinaryAdder dominating MSL 3.2.1 tests

Reported by: Adrian Pop Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: Martin Sjölund, Rüdiger Franke, Niklas Worschech, Marcus Walther, Willi Braun

Description (last modified by Rüdiger Franke)

The one model Modelica.Electrical.Spice3.Examples.Spice3BenchmarkFourBitBinaryAdder dominates the time needed for testing MSL3.2.1 without producing good results.

The C runtime takes 6m40s to simulate that model. Afterwards the verification of 46/47 signals fails. Looking at the results, it appears possible that the C runtime doesn't appropriately adapt to the extreme short experiment(StopTime=1e-006, Interval=1e-009).

The C++ code generation takes 4m3s in the Templates phase (opposed to 20s for C code generation). C++ generates code for 171 algebraic loops (two code files for each of them). Many of the loops have a dimension of 1. See:

$ grep _dimAEq OMCpp*FourBit*Algloop*.cpp

Many of those are linear (checked Algloop 825, 920, 938, ...).

Shouldn't linear algebraic loops of dimension 1 be treated more efficiently?

Change History (6)

comment:1 by Rüdiger Franke, 9 years ago

Cc: Niklas Worschech Marcus Walther added
Description: modified (diff)
Summary: Handle static arrays with more than one dimension (matrices)Bad performance of Spice3BenchmarkFourBitBinaryAdder dominating MSL 3.2.1 tests

comment:2 by Niklas Worschech, 9 years ago

Maybe the problem is, that after the linear tearing the dimension of the new linear system is not checked. If the new system has the dimension one, it should not be generated a linear system for it.

comment:3 by Rüdiger Franke, 9 years ago

Cc: Willi Braun added
Component: Code GenerationBackend
Owner: changed from Lennart Ochel to somebody

Also linear systems of dim 2 should possibly be solved directly using Cramer's rule.

comment:4 by Martin Sjölund, 7 years ago

The performance of the C++ code generation got even worse:

Notification: Performance of Templates: time 165.7/210.4, allocations: 85.97 GB / 93.65 GB, free: 164.1 MB / 2.633 GB

For C, it's 3.5 seconds.

comment:5 by Niklas Worschech, 7 years ago

Is it possible to disable this test, until we fixed the problem for the code generation of 171 algebraic loops?

comment:6 by Martin Sjölund, 7 years ago

Not really for the library coverage. We run the C runtime version for pull requests but since a long time ago disabled cppruntime.

Note: See TracTickets for help on using tickets.