Model running for days
3 views (last 30 days)
Show older comments
Hi, I know this is a very open question but the Monte Carlo simulation I built is getting so massive that the model is running for almost a week.
I have a 64bit PC with 8GB memory. Is there anything I can do to make the model run in just one day? Like, changing the data to an external server with more memory, getting a better computer, changing anything else? Any ideas?
Many thanks,
3 Comments
José-Luis
on 7 Jul 2016
As John, said, this is a question that cannot be intelligently answered without looking at your code. If the execution really needs to be sequential, then the gains from straight on application of the parallel computing toolbox might probably be minimal.
Answers (1)
John D'Errico
on 6 Jul 2016
We cannot possibly answer this intelligently. Yes, finding a faster, newer computer, with more memory, more RAM, etc, will help. A better drive, using a SSD will often improve things. Depending on how old the system is that you have, you MIGHT get a speedup of 2-4 times at most.
But the problem is, we do not know where/what is the bottleneck. So we cannot know what is your problem. Only you can learn that.
The point is, a HUGE amount of time can often be gained by something far easier to fix. Learn to speed your code up. Learn to use the profile tool. Crappy code is by far the most likely source of wasted CPU cycles. And if you don't know enough about MATLAB to know how to speed your code up, then very often you might be able to gain orders of magnitude in speed, just by writing better code. I have seen people do obscene things with code, not knowing any better. And many of them want to know if THEY should get a faster computer too. The point is, blaming slow code on a computer is easy when the person who wrote the code was the real culprit. (Sorry, but often true.)
So spend some time with the profile tool. Find the bottlenecks in your code. See how to speed them up. Well written code can almost always do far more for you than a faster computer.
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!