-
Notifications
You must be signed in to change notification settings - Fork 23
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
Size of the mechanism and speed of the simulation #436
Comments
For my own education, could you confirm you're referring to the case where the .fac file is very large? In that case, I'd hope there's something we can do, but I'm not sure right now. You'd need to identify which species must stay zero based upon the mechanism and initial conditions, to be able to remove them from the matrix. That's probably easier to do in pre-processing, except that it's dependent on the initial conditions, not just the .fac file. So your Does that make sense? It sounds feasible but there are some design choices to be made, and it's a reasonable amount of work to get right. (I guess the mechanism is in a way a directed graph, with the nodes being species, node-weights being the species concentration, edges the reactions, and the edge-weights the rates (but the rates can depend directly on other species (nodes)). I'm not sure how to best handle that.) |
Yes I think that's right. But to be honest the "zero values" hypothesis is just that. I don't know what controls the speed of the simulation. I guess we need to do some testing and use some sort of progiling tool. That being said, I am intrigued by the "graph" option. It could have interesting applications, so we may want to keep it in mind in any case. |
On the general speed, have you experimented with changing the optimisation flag? |
I haven't. This problem was actually reported by another user. I think the general point here is to understand why this happening.
You would expect the difference in runtime to be not that much different, but it is not the case, and I think it may be good to know why. It may give some clues as to how to speed the model generally (ie, identify the bottlenecks). |
Sure, yes I don't doubt there's an issue there. The use of |
I honestly don't know enough to make a call here :) I think in general if we can speed it up without sacrificing accuracy it is a good thing. Is it maybe all part of the same package of issues we generally called numeric stability? See notes at #265, #340 (comment), #384 (comment) etc... |
|
Then yes. I don't particularly care if the compilation is a tad longer :) |
I just tested it on my Mac - Just to make sure there is a real effect, I ran some of the testcases (with many more steps than normal), and timed just the run (so ignoring the compile, which stays below 5s for all of them). I think for several of these, the I/O will be the limiting factor, which the optimisation does very little about, so the 1.2-3x speedups here would very likely actually be an underestimate of the speedup in more realistic setups.
I will open a PR to set the default to |
The model is very slow when the entire MCM is used as chemical mechanism, as opposed to just a subset of it. It takes up to 5 days to run a 3 hours simulation (although this depends on the type of machine, obviously).
Possible cause: most of the species are zeros and/or unused.
The text was updated successfully, but these errors were encountered: