Matlab processing time
Tags:

CPUs
 Font
Last response: in CPUs
dhlucke
March 5, 2002 8:02:33 PM
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>
More about : matlab processing time
FatBurger
March 5, 2002 8:39:15 PM
Raystonn
March 5, 2002 8:41:35 PM
Related resources
 The microphone produces a buzz in realtime conversations  Forum
 D865Perl K soundcard  Forum
 What I want and don't want in a motherboard  Forum
 David Kirk's 'explanation' of the multclocks  Forum
 Integrated Subtitels  Forum
dhlucke
March 5, 2002 11:30:08 PM
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>
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>
Raystonn
March 5, 2002 11:34:05 PM
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. =
Raystonn
= The views stated herein are my personal views, and not necessarily the views of my employer. =
dhlucke
March 5, 2002 11:34:13 PM
AMD_Man
March 5, 2002 11:38:15 PM
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
AMD technology + Intel technology = Intel/AMD Pentathlon IV; the <b>ULTIMATE</b> PC processor
Kelledin
March 6, 2002 1:55:57 AM
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>
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>
FatBurger
March 6, 2002 1:56:11 AM
(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'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!
Schmide
March 6, 2002 3:41:30 AM
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..." target="_new"> http://www.mathworks.com/products/tech_computing/modsim...;/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?
What matrices are you solving?
Matisaro
March 6, 2002 3:42:58 AM
dhlucke
March 6, 2002 3:48:31 AM
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>
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>
Matisaro
March 6, 2002 4:17:04 AM
ath0mps0
March 6, 2002 4:25:42 AM
Matisaro
March 6, 2002 4:33:13 AM
jeffg007
March 6, 2002 2:04:37 PM
FatBurger
March 6, 2002 3:31:18 PM
dhlucke
March 7, 2002 1:44:08 AM
FatBurger
March 7, 2002 3:20:58 AM
dhlucke
March 7, 2002 3:45:59 AM
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>
<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red>
kief
March 7, 2002 11:53:29 PM
dhlucke
March 8, 2002 12:20:04 AM
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>
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>
digikid
March 21, 2002 7:20:00 AM

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
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
 Daul processing Forum
 ALi Magik 1 Driver Update Forum
 UKgamer compares ATI IGP9100 to 2 addin cards. Forum
 Time Setting on Mitel System Forum
 Power question Forum
 Duron 850 or 1 ghz Forum
 How do you pronounce SiS? Forum
 More reasons VIA sux! Forum
 EB posts Chat log from Rage3D about Control Center Forum
 Spybot 1.4 Integrated Updater Question Forum
 Are you part of the Gaming Ghetto? Forum
 Urgent Forum
 Is it time to upgrade my HIS 9800XT Forum
 Stability of 15ns and 8ns PC100 Forum
 Upgrading from integrated X4500, Help please! Forum
 More resources