Model running for days
8 ビュー (過去 30 日間)
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?
回答 (1 件)
John D'Errico 2016 年 7 月 6 日
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.