June
27th 2008
CPU speed and FLOPS

Posted under Computer & Programming

You might have read my post, Prime numbers and Ruby, and wondered why the program used a huge amount of time, and even after 25 hours of computing, the program did not have an answer. The code of the program is really not that advanced, but when the input number is a big prime number, the number of calculations needed is huge.

I do want to run the program again, with the same number. I have also tried to make a similar program in C++, but unfortunately, that version of the program won’t even accept the input number to be that big. Anyway, I thought if I should run it again, I might want to do some thinking and try to figure out how much time my computer will use, and then I need the amount of FLOPS the computer is capable of. My CPU is a Intel Celeron at 1.60 GHz. I have tried to figure out how many FLOPS I can expect, but I haven’t found out anything clever. If anyone know how to calculate this, I would be grateful.

Anyway, with the number I typed in, I have found out that I need roughly 68 630 000 000 000 (could be wrong) floating point operations to be able to say that the number I wanted to check is a prime number. The CPUs in the PlayStation 3 runs at 218 GFLOPS (218 000 000 000 FLOPS), which would mean that the PS3 would need approximately 315 seconds, which is 5 minutes and 15 seconds. That’s right. And that is for the PS3, which is much faster than my computer! The PS3 is actually so powerful that the University of Bergen have bought five of them to use them in education and to to heavy calculations. They connected the five PS3s together, to make use of the power and have one machine capable of one teraFLOPS. Their last supercomputer was capable of 0.7 teraFLOPS.

Basically, I have found out that my computer will use an awful lot of time to finish the calculations, but I will do it. I’m actually pretty excited to find out how much time is needed.

4 Responses to “CPU speed and FLOPS”

  1. Prasan on 22 Sep 2008 at 7:06 pm #

    Just came across your site. I was searching for a way to calculate FLOPS too.. I found out that the supercomputers are tested using something called linpack.
    http://www.netlib.org/linpack/
    its uses fotran to calculate some linear equations in order to find out how many floating point calculations your CPU does.
    An easier way to do the same would be to download becnhnt.zip from:
    http://community.compuserve.com/n/pfx/forum.aspx?tsn=1&nav=messages&webtag=ws-pchardware&tid=159933&redirCnt=1

    run the runall.bat file and after a few runs it would create a file called Linpack.txt
    check that to find out how many MFLOPS your CPU does.
    It gives you other benchmarks too, but if you want a universal way so you can compare it with other CPUs/copmuters check the linpack file.

  2. Lai Alexander on 20 Oct 2008 at 1:52 am #

    Thank you very much. This looks very interesteing. MFLOPS are megaFLOPS, right?

    I’ve had the program run a few times now, and the results are somewhat varying. I’ll do some more tests to see if I can get better results. Now they are between 150 and 700 MFLOPS.

    Thanks again!

    Correction: The non-optimised shows about 150 MFLOPS and the optimised shows about 700 MFLOPS.

  3. Prasan on 20 Oct 2008 at 3:32 am #

    Yeah.. there are two types of test.. optimised and non-optimised..
    If you read up more on them.. The optimization is done based on the type of CPU architecture you have..
    I think the optimized results make more sense.. as that gives the true potential of the CPU..

  4. Lai Alexander on 20 Oct 2008 at 10:23 pm #

    Yeah, that sounds right. According to my calculations, it would have taken about 26 and a half hour to find out that the number was a prime. Keep in mind that this could be way off, because the number of FLOPS needed could be wrong.

    I will look into linpack some more, I think it might be differences on the various versions of the benchmarking program, which are optimised for different OS’ and different CPU architectures. I think.

Trackback URI | Comments RSS

Leave a Reply