#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] |
100 | 0.77 |
400 | 4.8 |
1600 | 28 |
3200 | 78 |
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)
Change History (7)
by , 9 years ago
Attachment: | TestStrongComponentJacobians.mo added |
---|
by , 9 years ago
comment:1 by , 9 years ago
Summary: | calculateStrongComponentJacobians is slow, scales badly and cannot be switched off → calculateStrongComponentJacobians is slow and scales badly |
---|
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.
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.