Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3681 closed defect (fixed)

calculateStrongComponentJacobians is slow and scales badly

Reported by: Francesco Casella Owned by: Willi Braun
Priority: critical Milestone:
Component: Backend Version: v1.9.4-dev-nightly
Keywords: Cc:

Description

The calculateStrongComponentJacobians function is slow and scales badly.

Run the attached test case. It contains N systems of 4 nonlinear equations, with 3 tearing variables each. These are the execution times reported on my pc for the calculateStrongComponentJacobians function applied to simulation equations

N Time [s]
1000.77
4004.8
160028
320078

The time scales more than proportionally, which seems weird. As the algorithm calculates the jacobians of N completely independent systems, the time should be strictly proportional to N.

For large enough numbers of system, each one takes 25 ms to compute the derivatives, which seems a bit too much, given that the functions involved are almost linear and very easy to differentiate.

Last, but not least, if I try to improve the compilation time by adding the --postOptModules-=calculateStrongComponentJacobians, the function is executed anyway.

Attachments (2)

TestStrongComponentJacobians.mo (676 bytes ) - added by Francesco Casella 9 years ago.
test.mos (1.0 KB ) - added by Francesco Casella 9 years ago.

Download all attachments as: .zip

Change History (7)

by Francesco Casella, 9 years ago

by Francesco Casella, 9 years ago

Attachment: test.mos added

comment:1 by Francesco Casella, 9 years ago

Summary: calculateStrongComponentJacobians is slow, scales badly and cannot be switched offcalculateStrongComponentJacobians is slow and scales badly

The reason why the function was executed anyway was that it was called for initialization, so the right flag is --initOptModules-=calculateStrongComponentJacobians.
I'm changing the summary accordingly.

The performance is still not very good, so I'll leave the ticket open.

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

in reply to:  description comment:4 by Francesco Casella, 9 years ago

Resolution: fixed
Status: newclosed

I have re-run the tests with the current nightly build on my pc using the Windows 64-bit version. The times now scale linearly, with time = N*10 ms. I am still convinced that this could be way faster, but at least the scaling issue is solved.

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

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.