Matlab processing time
dhlucke
I've been sitting here all day waiting for this damn numeric integration to finish. It's really starting to kill me.
There's only so much time I can waste on THGC...
So my question is, how big a difference does anyone notice each time they upgrade? I'm currently doing only a trillion steps and I would think it would go a lot faster than this. Running at a Ghz it shouldn't take this long at all. How big a difference would another Ghz make?
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red>
There's only so much time I can waste on THGC...
So my question is, how big a difference does anyone notice each time they upgrade? I'm currently doing only a trillion steps and I would think it would go a lot faster than this. Running at a Ghz it shouldn't take this long at all. How big a difference would another Ghz make?
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red>
22
answers
Last reply
More about matlab processing time

Let me be more general since I'm not trying to focus on a brand. I just can't stand it taking this long.
I'm basically just numerically integrating a function that can't be integrated any other way. The problem is that the numbers are both HUGE and TINY, and I have to add up a series of calculations in a matrix that really should have as many entries as possible. So first I'm creating this matrix and then I have to add up all these massive and tiny numbers. Anything under a million calculations gives me an incomplete result. I'm trying for a trillion, but that takes way too long considering I run the program a number of times with different variables each time.
I have no idea if Matlab is optimized for a specific processor or dual processors.
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red> 
This sounds like a singlethreaded integer application. You would likely see a huge improvement if you moved to a highend Pentium 4 system. If you do not have the money for a 2GHz then I suggest you grab a Pentium 4 1.6A and overclock by about 50%. You should see some nice results.
Raystonn
= The views stated herein are my personal views, and not necessarily the views of my employer. = 
The new P4 A "Northwood" provides extra cache which significantly improves the P4's overall ALU performance. You may want to look into investing in a 2GHz P4. If you are calculating with floating point types, I recommend the Athlon XP as it has superior floating point performance.
AMD technology + Intel technology = Intel/AMD Pentathlon IV; the <b>ULTIMATE</b> PC processor 
Huge and tiny? Floating point or integer? Does matlab resort to BCD math? How large would they potentially get, and how much precision do you need for the infinitesimally small numbers?
If it's BCD math, you'll need integer processing power more than anything. If matlab uses floatingpoint math extensively, the range and precision required is liable to force it to forego SSE/SSE2 and use 80bit floating point instead (in which case, you need an Athlon or an Alpha).
<i>If a server crashes in a server farm and no one pings it, does it still cost four figures to fix?<P ID="edit"><FONT SIZE=1><EM>Edited by kelledin on 03/05/02 09:57 PM.</EM></FONT></P> 
(I meant going up a GHz by Athlon standards, P4 standards, P3 standards, etc. 1GHz is different amounts of performance to different processors, of course.)
I'd tend to agree with Raystonn on getting a 1.6A and overclocking it.
Mines at a 55% overclock at the moment, retail heatsink.
If you like, I can run part of the program (or a similar program), and tell you how fast it is?
<font color=orange>Quarter</font color=orange> <font color=blue>Pounder</font color=blue> <font color=orange>Inside</font color=orange>
Don't step in the sarcasm! 
I doubt that it’s the same Matlab that I used back in the day. (12 years ago, lets check) Yup same thing, its interpreted. I quote from <A HREF="http://www.mathworks.com/products/tech_computing/modsim.shtml" target="_new"> http://www.mathworks.com/products/tech_computing/modsim.shtml</A> 3rd paragraph. “Since MATLAB is an interpreted language” So basically you’re running at 1/3 speed if that. If you code it yourself thus creating what Matlab refers to as a “user written routine” you should be able to get a tremendous speedup.
What matrices are you solving? 
I'm actually not really using any of the built in functions or anything for this though. I'm just looping through the same calculation a million+ times, sticking the result in a matrix called x and then summing up all the elements of x. Basic numeric integration. The problem is the number of elements and their sizes. At the end I multiply it by a constant.
My result is supposed to be something between 10^49 and 10^39.
I think I'll take Fatburger up on his offer and send it to him since the program is tiny but repetitious. It will be interesting if it's a nice boost in speed.
First I sleep though. G'night.
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red> 
Too bad, and I can't get xMPEG 4.2a working either. My patient little Northwood is sitting here with hardly anything to do :frown:
<font color=orange>Quarter</font color=orange> <font color=blue>Pounder</font color=blue> <font color=orange>Inside</font color=orange>
Don't step in the sarcasm! 
I actually just found a built in numeric integration function that is making this a lot easier and a lot faster (so far). I'm not sure we'll have anything to test later, but I'm sure we could find something...
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red> 
I love this sig. It gets everyone all uncomfortable. LOL
Back to my Matlab dilemma...
I have to integrate from 0 to 912E8, but since I would then be dividing by zero I was just going to do it from some insanely small number to 912E8. Matlab won't let me go any smaller than 1E6 on my lower limit though due to some kind of recursion problem. Thus, my lower limit can't get any smaller than my upper limit. I'm stuck for the time being, but my calculation time is down to less than a second with my new found code. My other option is to integrate from 912E8 to infinity, but that isn't any nicer.
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red> 

The problem is that the numbers are both HUGE and TINY...

The first thing our comp.sci. prof told us was that the algorithm has to be efficient, the machine doesn't matter. "You can always buy a machine that's twice as fast!", he said.
The hardest thing is to write an efficient algorithm, and for a loop of over 10^12 iterations, this is definitely your problem. Then there's the question whether you should try and solve this yourself, or if you should rely on people who has worked intensively on algorithms in numerical math and written optimized code. I suggest you take a look at what's available. I have such a suggestion here (below). Numerical integration has so many pitfalls, and only certain integration methods work for stiff problems, some only for linear problems, etc.
As for your problem: HUGE and TINY numbers in a numerical integration: sounds like a "stiff differential equation"; is this right? In that case, there is a very good piece of code available from LLNL (Lawrence Livermore Natl. Labs), called LSODA, which is part of the Ordinary Diff. Eqn. package ODEPACK (http://www.llnl.gov/CASC/odepack/). This code is written in Fortran, so I hope you have Linux, or perhaps a Fortran compiler for your OS.
LSODA (and similarily LSODE) solves STIFF ODE's, and automatically determines whether in fact your problem is stiff or not. Easy to run, and very fast.
As far as MATLAB is concerned: love it, great for fast implementation of all sorts of num. math stuff, but don't use it for big forloops. Of course, if you vectorize your code, MATLAB is great, but Fortran 90 can do that, too! Loops, however, use Fortran for scientific computation: easy and fast. Matlab is interpreted code: it does linebyline, and cannot compete with Fortran. I have tested loops on the two and found a speed increase with Fortran of over idon'tevenwannasayit times faster.
I can give you more info on LSODA if this is of any help to you.
digikid
Related Resources
Ask a new question
Read More
CPUs
Font
Related Resources
 ALi Magik 1 Driver Update
 UKgamer compares ATI IGP9100 to 2 addin cards.
 Time Setting on Mitel System
 Power question
 Duron 850 or 1 ghz
 How do you pronounce SiS?
 More reasons VIA sux!
 EB posts Chat log from Rage3D about Control Center
 Spybot 1.4 Integrated Updater Question
 Are you part of the Gaming Ghetto?
 Urgent
 Is it time to upgrade my HIS 9800XT
 Stability of 15ns and 8ns PC100
 Upgrading from integrated X4500, Help please!