bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Pi Day

Fri Mar 14, 2014 3:49 am

I figured I ought to do something with the Pi for Pi day (3/14) so i installed Pi on my Pi,

sudo apt-get install pi

then i calculated Pi on the Pi to 3.141593 (rounded) million decimal places.

pi 3141593 > pimil.txt

The calculation took 132 seconds on my old Pi (256 MB version B) running at 1100 Mhz arm, 500 ram, and 500 core.

If you were to run a heavily overclocked Pi all day (on Pi day) calculating Pi, I think you could probably get close to calculating Pi-billion decimal places of Pi but I'm not sure if Pi would calculate that many digits of Pi on the Pi due to memory size constraints.

Bryan

User avatar
Douglas6
Posts: 5197
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, USA

Re: Pi Day

Fri Mar 14, 2014 4:06 am

Makes me think of that distributed SETI project. With 2.5 million Pis, we should have found ET by now.
If they weren't busy mining bitcoins, I guess.

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Fri Mar 14, 2014 2:14 pm

How many digits per day could a beowulf cluster of 314 Pi's calculate? The world may never know.

Turns out that my Pi runs out of memory after only 20 minutes or so and kills the process. So the max number of digits I can calculate is something like 20 million. The 512 MB Pi's could probably do quite a bit better.

Bryan

lazarus78
Posts: 236
Joined: Thu Jul 25, 2013 5:16 pm

Re: Pi Day

Fri Mar 14, 2014 6:25 pm

Douglas6 wrote:Makes me think of that distributed SETI project. With 2.5 million Pis, we should have found ET by now.
If they weren't busy mining bitcoins, I guess.
The Pis are actually very very VERY terrible for mining any type of cryptocoin, let alone bitcoin. It is literally a waste of power to even attempt it.

If you are talking about people who spend thousands of dollars on 6 GPU systems for mining, then yes, that is indeed also a waste of effort.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK

Re: Pi Day

Fri Mar 14, 2014 6:34 pm

Its getting to be a waste of money using dedicated ASICs to mine Bitcoin nowadays. It a lot cheaper to just buy it....

Ebay is awash with S/H Bitcoin ASICs at knock down rates.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
DougieLawson
Posts: 42483
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Pi Day

Fri Mar 14, 2014 6:37 pm

pluggy wrote:Its getting to be a waste of money using dedicated ASICs to mine Bitcoin nowadays. It a lot cheaper to just buy it....

Ebay is awash with S/H Bitcoin ASICs at knock down rates.
Is it?

http://www.raspberrypi.org/archives/6437
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK

Re: Pi Day

Fri Mar 14, 2014 6:44 pm

Cheap power, if you watch the video. Its not viable at consumer power prices.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Sat Jul 26, 2014 12:26 am

Just found a post on Mathematica about calculating pi and it looks like that speeds things up quite a bit.
Code below:

(*Clear Cache*)
ClearSystemCache[]

(*Calculate pi to 1 million decimal places and store the result*)
AbsoluteTiming[pi = N[Pi, 1000000];]


On the same setup as before I got:
pi million decimal places 38.4 seconds
2pi million decimal places 93.8 seconds
4pi million dp 241.4 seconds

Same memory limits seem to apply. Limit is somewhere around 20 million dp

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Sat Mar 14, 2015 8:56 pm

In honor of the special once a century pi day I repeated the above calc on a B+ with maximum memory allocated to the CPU. I got clear up to 5.654866 x 10^7 decimal places of pi. Calculation took 1662 seconds using a standard turbo mode at 900 Mhz. No other overclocking features were used.

Maybe next year I'll try with a B2

Gotta go make some pie

Bryan

adlambert

Re: Pi Day

Sat Mar 14, 2015 10:06 pm

lazarus78 wrote: The Pis are actually very very VERY terrible for mining any type of cryptocoin, let alone bitcoin. It is literally a waste of power to even attempt it.
For doing the actual crypto work you are correct. However, because low power Pis make ideal controller interfaces to the ASICs and run CGMiner very well and extremely stable. My CGMiner host is an old 256MB Model B. So, many thousands of Pis are in fact employed in crypto-coin mining supporting roles and are very good at it.
pluggy wrote: Its getting to be a waste of money using dedicated ASICs to mine Bitcoin nowadays. It a lot cheaper to just buy it....
Bitcoin prices over the last 2 weeks recovered to around £200, and this has caused a lot of ASICs to switch on, and pools have become very well populated again.

User avatar
solar3000
Posts: 1087
Joined: Sat May 18, 2013 12:14 am

Re: Pi Day

Sun Mar 15, 2015 11:19 pm

so did anything actually happen on pi day?
Antikythera

User avatar
DougieLawson
Posts: 42483
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Pi Day

Mon Mar 16, 2015 12:18 am

solar3000 wrote:so did anything actually happen on pi day?
Yep. A bunch of silly people who write their dates backwards (compared to EUR, JIS & ISO standards) fussed about the day of the month and the month of the year and got ever more silly at 9:26:53 on that same day.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
solar3000
Posts: 1087
Joined: Sat May 18, 2013 12:14 am

Re: Pi Day

Mon Mar 16, 2015 2:17 pm

DougieLawson wrote:
solar3000 wrote:so did anything actually happen on pi day?
Yep. A bunch of silly people who write their dates backwards (compared to EUR, JIS & ISO standards) fussed about the day of the month and the month of the year and got ever more silly at 9:26:53 on that same day.
There was no mention this Saturday in the new at all (USA).

As for dates, I use this format to name my files: YYYY-MM-DD. Sorts out just fine.

We should use this date: The date and time now is: 1426515396
Antikythera

User avatar
DougieLawson
Posts: 42483
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Pi Day

Mon Mar 16, 2015 2:36 pm

bertwert wrote: I do not like that date format, it makes no sense. :x
Their argument:
It is like saying March 14 2015 and you wouldn't say 14th of March 2015.

Uh yes I would....

Unfortunately 2015 doesn't have 14 months...
Here in Rightpondia we really do say "Saturday, 14th of March" it comes from the mouthful "The fourteenth day of March in the year of our Lord two thousand and fifteen" (from when we were just a bit more religious).

We can have our own Pi approximation day on 22nd July.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK

Re: Pi Day

Mon Mar 16, 2015 2:41 pm

Goddamned parochial yanks......

It really was the 14th of March, like today is the 16th of March.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Tue Mar 15, 2016 5:40 am

Pi day again. Gotta calculate pi. I ran the mathematica calculation on a B2 this year with 16MB video memory to maximize the CPU memory. The calculation only took 25% CPU so it is obviously not multi-threaded. No big deal since the calculation is still very much memory limited.

On a B2 this year. I got
pi million DP took 20.5 seconds
2pi million DP took 53.3 seconds
4pi million DP took 116 seconds
and 35pi million DP took 1527 seconds.

Looks like 35pi million decimal places (~110 million DP) is close to the memory limit on the B2. I haven't crashed the calculation yet though.

Finally, it is interesting to note that this thread is now in its third year. Three, as we all know, is a pretty good approximation for pi. Maybe we should just have a pi month in march so that the date formatting pedants can all breath a sigh of relief and live in harmony with the rest of us. In honor of that suggestion I think I'll go eat a small slice of pie (about 4.5%) such that the remaining pie will have a circumference equal to three times the diameter.

Heater
Posts: 19435
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi Day

Tue Mar 15, 2016 8:39 am

100 million digits of Pi? On a Pi 2B?

Easy.

Took about 56 minutes. You can check the results here:
http://devserv.rsmtech.fi/pi.txt.gz

I used gmp-chudnovsky, see attachment. Had to add a swap file. It was 1GB about a third of which got used. Probably not wise, or fast, to have a swap file on SD card.

Clustering a bunch of Pi, or any other machines, won't help. So far the best methods of calculating massive numbers of digits of Pi do not parallellize well. The current world record for calculating the digits of Pi stands at 13,300,000,000,000 digits. It was not done on a super computer, or cluster. No it was done on basically an off the shelf PC:
https://en.wikipedia.org/wiki/Chronolog ... _of_%CF%80

Super computers and clusters have not been able to touch this problem since 2009.

We have discussed this extensively here before. I think it was here: viewtopic.php?f=63&t=43867
Attachments
gmp-chudnovsky.c.gz
(5.18 KiB) Downloaded 94 times
Slava Ukrayini.

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Tue Mar 15, 2016 7:07 pm

Perhaps I was being too cute with the reporting format. The final calculation in the list (35pi million DP) comes to about 109.96 million decimal places. This calculated on Mathematica in 1527 second or 25.5 minutes. The calculation was done without swap. I doubt you would be able to get much further without a swap file. Perhaps next year I'll get around to doing a longer calc with swap. And then again, maybe not. The thread really isn't about calculating pi as much as it is about having some geeky fun on pi day.

Heater
Posts: 19435
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi Day

Tue Mar 15, 2016 7:33 pm

bryanandaimee,

Damn, you beat me :)
The thread really isn't about calculating pi as much as it is about having some geeky fun on pi day.
What more fun could a geek have on Pi day than setting his latest machine to calculating the digits of Pi ?

Aside from eating pie and drinking beer whilst he waits.

Except...this geek has the source code of the Pi algorithm and was curious how gmp works. Sadly the maths involved in the Chudnovsky algorithm goes way over my head.

Edit: Wait a minute how can you have .96 of a decimal place? Did you actually get an output from your calculation? Like in a file?
Slava Ukrayini.

User avatar
davidcoton
Posts: 7005
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Pi Day

Tue Mar 15, 2016 11:05 pm

Heater wrote:Edit: Wait a minute how can you have .96 of a decimal place?
You can't, in a normal world. But you can easily have 0.96 of a million decimal places. Obviously your slower process led to too much drinking of beer while you waited :lol:
Location: 345th cell on the right of the 210th row of L2 cache

Heater
Posts: 19435
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi Day

Tue Mar 15, 2016 11:45 pm

david,

Ah yes.

Sadly it can't be the beer that did it. My few remaining neurons are getting old and lonely.
Slava Ukrayini.

bryanandaimee
Posts: 32
Joined: Fri Sep 14, 2012 4:32 pm

Re: Pi Day

Wed Mar 15, 2017 5:37 am

Strangely my new Pi3 is not a great pi calculator.

I get 36 seconds for 3,141,593 decimal places vs. 20.5 seconds on the Pi2.

Perhaps an optimization issue?

User avatar
RaTTuS
Posts: 10828
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Pi Day

Wed Mar 15, 2017 8:08 am

bryanandaimee wrote:Strangely my new Pi3 is not a great pi calculator.

I get 36 seconds for 3,141,593 decimal places vs. 20.5 seconds on the Pi2.

Perhaps an optimization issue?
has your Pi3 got a heat sink on it ?
is it throttleing
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
bensimmo
Posts: 6095
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Pi Day

Wed Mar 15, 2017 9:24 am

How would 64bit Pi3 do and is there a VC4 Pi?

User avatar
jahboater
Posts: 8693
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Pi Day

Wed Mar 15, 2017 9:52 am

bensimmo wrote:How would 64bit Pi3 do and is there a VC4 Pi?
For: time pi 3141593 >/dev/null

Odroid C2: 25.7 sec (64-bit Cortex-A53 - same as Pi3)
Pi3: 61 sec (32-bit)
Pi0: 150.8 sec (32-bit)
Intel PC: 4.3 sec (64-bit)

Return to “General discussion”