Computing PI Competition

Here is the plan. I have wrote a multi threaded way of computing pi and I want to use it as a way to test our CPU's. Follow this link to get the code. After you have compiled it and installed the required software time how long it takes for you to compute after entering the command ./findPI 10000000 10000000.
@FaunCB

2 Likes

What processors do you want me to do? PPC, C2D, Pentium M, P3, P4, 32 bit? 64 bit?

Like, maybe run it on a ps3? :D?

~/Desktop/CalculatePI-master$ make
gcc pi.c -o findPI -lpthread -lgmpxx -lgmp
pi.c:4:17: fatal error: gmp.h: No such file or directory
 #include <gmp.h>
                 ^
compilation terminated.
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

:U I think I broke it?

Nope never mind. Ok so I got this.

~/Desktop/CalculatePI-master$ ./findPI 8 8
addition thread 
substraction thread 
307915339419742616051

Lemme know what all you want that ran on.

gmp-devel (or gmp-dev depending on platform) for anyone else needing it to compile.

No I got it. It looks like its only using 2 of my 4 cores.

From the code it looks like it only ever makes two threads so that would make sense.?

You working on this with him?

Nah i was just looking at the code.

    /*Initial Setup*/
    pthread_t tid;
    pthread_t tid1;

Only two threads are initiated. Granted by C is basic atm, but pretty sure it only makes two threads, does the calculation and returns.

Neat. K.

@chiefshane if you wanna play with something really cool have a look at running a cluster and making that do this, or, get a parallella / cluster some pi's. Could get some interesting results.

Also this is going in the benchmark list kek

I don't have a time the power just went out. Assume 12 minutes.

1 Like

Anything works, I might take a while so just list what you are running it on and the time it takes.

1 Like

Yep I am using two threads for this, it may be possible to use more threads. The infinite series I am using is simple enough that adding more threads wouldnt take much effort.

I will do it myself after I find a way to time it when I return to my apartment today.

Have you run it yet?
I just started mine 9:30 central time

No the power has been freaking out all day I'll do it tomorrow I think. Fucking storms.

you need a UPS it sounds like.

No its called a power outage.

I also don't have 8000 dollars for a proper UPS.

I dont even know how much they cost. I have one, not sure the quality that my dad used to own when he owned a mower shop. The business closed down and the bank to position of all the stuff so during the chaos I took some stuff including the UPS for my own personal use lol.

1 Like