Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced minimum size for sparse linear and nonlinear solvers #7083

Closed
wants to merge 3 commits into from

Conversation

casella
Copy link
Contributor

@casella casella commented Jan 16, 2021

See discussion in ticket #6342

…t-in dense Newton/homotopy

solver is used in more cases during initialization, though with reasonable initialization time.
Copy link
Member

@AnHeuermann AnHeuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AnHeuermann
Copy link
Member

@casella Just in case you are not aware: You can fix the failing tests automatically by running e.g.

Andreas@DESKTOP-OSJIVA0 MINGW64 /D/workspace/OpenModelica/testsuite/simulation/modelica/linear_system
# ../../../rtest -b NPendulum40.mos

with MINGW, but check if it didn't change to much. You can find rtest in OpenModelica/testsuite.

@casella casella changed the title Reduced minimum size for sparse linear and nonlinear solvers to 10 Reduced minimum size for sparse linear and nonlinear solvers Jan 19, 2021
@casella
Copy link
Contributor Author

casella commented Jan 19, 2021

@casella Just in case you are not aware: You can fix the failing tests automatically by running e.g.

Andreas@DESKTOP-OSJIVA0 MINGW64 /D/workspace/OpenModelica/testsuite/simulation/modelica/linear_system
# ../../../rtest -b NPendulum40.mos

with MINGW, but check if it didn't change to much. You can find rtest in OpenModelica/testsuite.

Thank you for the info. I'd like to make sure that nothing actually got broken. Where exactly do I find the diff between the previous and actual test results? The log file is huge and I have some difficulties orienting myself in it.

@lochel lochel added the COMP/SimRT/C Issues and pull requests related to C simulation runtime. label Feb 10, 2021
@phannebohm
Copy link
Contributor

Poke!

All tests look fine, they just need to be updated because the prints changed.
The the failing tests in clang and gcc are identical so it's only 10.

You can Ctrl+F for "diff says" after expanding the test to find its diff. Is that what you mean?

Equation mismatch: diff says:
--- /tmp/omc-rtest-unknown/simulation/modelica/others/EngineV6_output.mos_temp8063/equations-expected2021-07-03 01:27:06.547536970 +0000
+++ /tmp/omc-rtest-unknown/simulation/modelica/others/EngineV6_output.mos_temp8063/equations-got2021-07-03 01:29:12.989324966 +0000
@@ -7,12 +7,20 @@
 ""
 There have been 1345 SCCs and now there are 686 SCCs.
 record SimulationResult
 resultFile = "EngineV6_output_res.mat",
 simulationOptions = "startTime = 0.0, stopTime = 1.01, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'EngineV6_output', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
-messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
+messages = "stdout            | info    | Using sparse solver for linear system 6,
+| | |       | because density of 0.176 remains under threshold of 0.200 and size of 27 exceeds threshold of 10.
+| | |       | The maximum density and the minimal system size for using sparse solvers can be specified
+| | |       | using the runtime flags '<-lssMaxDensity=value>' and '<-lssMinSize=value>'.
+stdout | info    | Using sparse solver for linear system 13,
+| | |       | because density of 0.155 remains under threshold of 0.200 and size of 25 exceeds threshold of 10.
+| | |       | The maximum density and the minimal system size for using sparse solvers can be specified
+| | |       | using the runtime flags '<-lssMaxDensity=value>' and '<-lssMinSize=value>'.
+LOG_SUCCESS | info    | The initialization finished successfully without homotopy method.
 LOG_SUCCESS       | info    | The simulation finished successfully.
 "
 end SimulationResult;
 ""
-561.4775584669958
+561.4775584670217
 ""
Equation mismatch: omc-diff says:
Failed 'L' 's'
Line 12: Text differs:
expected: messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
got:      messages = "stdout            | info    | Using sparse solver for linear system 

@casella
Copy link
Contributor Author

casella commented Jul 6, 2021

@phannebohm, this PR was a drastic solution, basically turning off tearing completely for linear systems. The idea was to use sparse solvers instead. The problem is that if you don't enable them explicitly, they won't be used, so the performance will become a lot worse. So, this PR is not really the ideal solution.

I think we should first check why strict tearing is not working as expected, see #6196 and fix that.

@casella casella closed this Nov 26, 2021
@casella casella deleted the bug_6342 branch November 26, 2021 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/SimRT/C Issues and pull requests related to C simulation runtime.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants