Author Topic: CPU wars  (Read 3226 times)

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: CPU wars
« Reply #30 on: 7 May 2006, 18:09 »
Quote
[Draconishinobi@livecd Downloads]$ gcc -Wall -o cpuwars.o cpuwars.c cpuwars.c: In function

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
Re: CPU wars
« Reply #31 on: 7 May 2006, 20:43 »
the main() structure has a variable called totaldigits

it's set to 6000 because I wanted to play around with the code  and wanted it to execute fast.

20000 would be a better test.  Time taken seems to be non linear with digits.

TeXMeX, the cc and gcc do the same thing on a linux system.

The -Wall just show warnings.  You really don't need it because it's a simple program.  If anyone knows how to get rid of the warning, please tellme.

-O2 will optimize to level 2 and speed the code execution up.

-march= will optimize the code specifically for your processor.  For example

gcc -march=i686 -O2 -o cpuwars2 cpuwars2.c

should theoretically produce the fastest running binary for an i686 architecture.  

 

Comparisons for optimization levels should probably be done and different totaldigits...

Remember, your cpu cache is very important for floating point calculations.  A fast CPU with a small cache can be outperformed by a slower cpu with a large cache.    If you know what it is, post it.
In brightest day, in darkest night, no evil shall escape my sight....

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: CPU wars
« Reply #32 on: 7 May 2006, 20:56 »
Yup, :D

Quote
[Draconishinobi@livecd Downloads]$ gcc -O2 -Wall -o cpuwars2.o cpuwars2.c cpuwars2.c: In function

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
Re: CPU wars
« Reply #33 on: 7 May 2006, 21:02 »
Very cool

And interestingly enough, your system clock and the cpu time agree completely.  It actually did take 37 seconds to grind thorugh 20000 digits of Pi.
In brightest day, in darkest night, no evil shall escape my sight....

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: CPU wars
« Reply #34 on: 7 May 2006, 21:08 »
Hmmm ... could it be that some systems calculate smaller numbers of digits of pi faster than others, but then slow down as the numbers of digits increases ? So then how many digits of pi would be a useful benchmark for all systems ? Or would a graph of times at all numbers of digits be more useful ?

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
Re: CPU wars
« Reply #35 on: 8 May 2006, 04:13 »
Quote from: H_TeXMeX_H
Hmmm ... could it be that some systems calculate smaller numbers of digits of pi faster than others, but then slow down as the numbers of digits increases ? So then how many digits of pi would be a useful benchmark for all systems ? Or would a graph of times at all numbers of digits be more useful ?


Very very interesting idea.  I think it is worth looking into, because the Intel chip processed the 6000 digits much faster than the athlon, but the 20000 calculations were comparable.

Like I said before, nobody survives in the semiconductor world by selling a chip that in general is twice slower than the competition for the same money, but I would expect one chip to excel in certain limited situations (and similarly the other one to excel in other limited situations).  




It would be trivial to modify the program to compute multiple lengths of Pi and report them all at once, given the way that I structured the Pi benchmark into a subroutine that takes numdigits as an argument and returns seconds.

I could do it later this week if one of you doesn't have time.

Some different types of calcuilations would really be cool... I'd love to see matrix inversion results.  If we used Octave like I suggested, Toadlife's PC would probably kick the crap out of all the rest of ours because Octave is multithreaded and would use both his cores to solve the problem.
In brightest day, in darkest night, no evil shall escape my sight....

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: CPU wars
« Reply #36 on: 8 May 2006, 07:15 »
Well ... I don't think I know enough about benchmarking to actually write anything useful ... sorry