Opened 14 years ago

Last modified 7 years ago

#1451 assigned defect

Backend scaling for simple array-equation — at Version 2

Reported by: Martin Sjölund Owned by: Patrick Täuber
Priority: high Milestone: Future
Component: Backend Version:
Keywords: Cc: Martin Sjölund, Henning Kiel

Description (last modified by Francesco Casella)

Scales to the power of 3.5... Horrible

n=50 0.231s
n=100 2s
n=150 9s
n=200 27s
n=10000 115 days

class A
  function fn
    input Real t;
    input Integer n;
    output Real out[n];
  algorithm
    out := {i*t for i in 1:n};
  end fn;
  parameter Integer n = 4000;
  Real r[n];
equation
  r = fn(time, n);
end A;

Change History (2)

comment:1 by Dietmar Winkler, 9 years ago

Cc: Frenkel TUD added; Jens Frenkel removed
Milestone: Future

comment:2 by Francesco Casella, 7 years ago

Cc: Henning Kiel added; Frenkel TUD removed
Component: Backend
Description: modified (diff)
Owner: changed from Martin Sjölund to Patrick Täuber
Status: newassigned

Update: with 1.12.0beta2, the current performance using OMEdit is

nTime backend (s)Memory matching and sorting (MB)Memory total(MB)
1000 1.4 97 400
2000 3.1 376 650
3000 5.7 819 850
4000 10.4 1451 2250

Matching and sorting takes the lion's share of memory allocation. Above n = 4000 the memory consumption blows up and the PC just hangs.

Good news: scaling in terms of time is now definitely better than O(N3.5), and it is possible to get up to n = 4000

Bad news: the memory allocation by the matching and sorting algorithm grows as O(N2) and is really huge. Why should over 1GB be spent to analyze a system with 4000 equations?

Note: See TracTickets for help on using tickets.