Sign in with
Sign up | Sign in
Your question

Matlab processing time

Tags:
Last response: in CPUs
Share
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>

More about : matlab processing time

March 5, 2002 8:39:15 PM

Well, that depends. Is it a P4 GHz, a P3 GHz, an Athlon GHz, a G4 GHz, etc...

<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!
March 5, 2002 8:41:35 PM

What kind of computations are being done? Floating point? Integer? Is your application optimized for any specific processors? What processor are you using now?

-Raystonn


= The views stated herein are my personal views, and not necessarily the views of my employer. =
Related resources
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>
March 5, 2002 11:34:05 PM

This sounds like a single-threaded integer application. You would likely see a huge improvement if you moved to a high-end 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. =
March 5, 2002 11:34:13 PM

I'm running on a T bird 1 Ghz.

Tried the program on a P4 1.4 Ghz and that wasn't any better.

<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red>
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
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 floating-point math extensively, the range and precision required is liable to force it to forego SSE/SSE2 and use 80-bit 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>
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!
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?
March 6, 2002 3:42:58 AM

DH, if you send me the app(will it run in winxp) I will run it on a 2000xp and tell you how long it takes, then you will know what a faster proc will give you.

Im sure burger can do the same to show a nice NW OC.

"The Cash Left In My Pocket,The BEST Benchmark"
No Overclock+stock hsf=GOOD!
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>
March 6, 2002 4:17:04 AM

I will run it too if you would like.

"The Cash Left In My Pocket,The BEST Benchmark"
No Overclock+stock hsf=GOOD!
March 6, 2002 4:25:42 AM

Hey, a real-world head-to-head competition for the two procs; who could ask for more?

I thought a thought, but the thought I thought wasn't the thought I thought I had thought.
March 6, 2002 4:33:13 AM

IM not overclocking to the max, but this would give a good idea to dh about whether it would be better to buy a new axp or get a new system.

"The Cash Left In My Pocket,The BEST Benchmark"
No Overclock+stock hsf=GOOD!
March 6, 2002 2:04:37 PM

Bump

I would like to to see the results.

Jeff

Love my harware but where my B*tches
March 6, 2002 3:31:18 PM

dhlucke, email me at jwfatburger@attbi.com (home address). I'll run it tonight if you send it.

<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!
March 7, 2002 1:44:08 AM

Yes, I will do this, but right now I need to get the program working first. I think I did it wrong so I'm starting over.

<font color=red>If you were to have sex with your clone would that be considered incest or masturbation?</font color=red>
March 7, 2002 3:20:58 AM

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!
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>
March 7, 2002 11:53:29 PM

If you were to have sex with your clone would that be considered incest or masturbation?

Id say it would be SICK! Your clone is the same sex, unless yer into that =/

Jesus saves, but Mario scores!!!
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 912E-8, but since I would then be dividing by zero I was just going to do it from some insanely small number to 912E-8. Matlab won't let me go any smaller than 1E-6 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 912E-8 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>
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 pit-falls, 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 for-loops. 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 line-by-line, and cannot compete with Fortran. I have tested loops on the two and found a speed increase with Fortran of over i-don't-even-wanna-say-it times faster.
I can give you more info on LSODA if this is of any help to you.

digikid
!