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.

