Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2933 closed defect (fixed)

Problem with array reductions in code generation

Reported by: Francesco Casella Owned by: Mahder Alemseged Gebremedhin
Priority: high Milestone: 1.9.4
Component: Code Generation Version: trunk
Keywords: Cc: Mahder Alemseged Gebremedhin, Willi Braun, andrea.bartolini@…

Description

Please have a look at this test case in ThermoPower:
https://test.openmodelica.org/libraries/ThermoPower/files/ThermoPower.Test.WaterComponents.WaterPumps.err
The compiler generates this error:

[CodegenC.tpl:9712:24-9712:24:writable] Error: Template error: array reduction unable to generate code for element of unknown dimension sizes; type Real[:]: array(q_nom[i] ^ /*Real*/(j + -1) for j in 1:N)

For some reason, the size information is not propagated correctly all the way down to the code generation.

Change History (9)

comment:1 by Lennart Ochel, 10 years ago

Cc: Mahder Alemseged Gebremedhin added

comment:2 by Willi Braun, 10 years ago

Cc: Willi Braun added

comment:3 by Mahder Alemseged Gebremedhin, 10 years ago

Owner: changed from Lennart Ochel to Mahder Alemseged Gebremedhin
Status: newaccepted

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

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:6 by Francesco Casella, 9 years ago

Any progress on this issue?

comment:7 by Mahder Alemseged Gebremedhin, 9 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in 4300bd200d268d9e3377e47e8e9353a4c1dad384/OMCompiler

This was an issue in Code generation as well as FrontEnd. The code generation for reduction operations should probably be rewritten. It quite messy right now.

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.