﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3668	Memory allocation of the back-end and code generation grows quadratically with the system size	Francesco Casella	Willi Braun	"Consider the attached test package: it has one large algebraic system of equations driven by a scalar differential equation.

I have used these settings, which include some that are essential for the efficient handling of the large algebraic system:

{{{
setCommandLineOptions(""--preOptModules-=clockPartitioning 
--postOptModules-=detectJacobianSparsePattern --postOptModules+=wrapFunctionCalls 
--disableLinearTearing --removeSimpleEquations=new
--indexReductionMethod=uode --tearingMethod=omcTearing 
-d=dumpSimCode,gcProfiling,execstat,nogen,initialization,backenddaeinfo,discreteinfo,stateselection"");

simulate(LargeAlgebraic.M_2000, method = ""rungekutta"", stopTime = 1,
         numberOfIntervals = 10, simflags = ""-lv LOG_STATS,LOG_LS -ls=klu""); 
}}}


Under Windows, the size of memory allocated by the back-end and code generation phases grows approximately as O(N^2^), N being the size of the algebraic system:

|| N    || Memory (MB) ||
||2000  || 260  ||
||4000  || 1000 ||
||6000  || 2000 ||

Note that the number of non-zero elements in the incidence matrix of the system grows as O(N), as there are 3 non-zero elements in each row.

This is not sustainable for systems that have more than a few thousands unknowns.
"	defect	assigned	high	Future	Backend	v1.9.4-dev-nightly			andrea.bartolini@…
