08-09-2017, 06:28 AM
(This post was last modified: 08-09-2017, 06:49 AM by MarkHaysHarris777.)
Greetings; well, you knew this was coming !
In 1973, one year before I graduated from high school, Jean Guilloud and Martin Bouyer calculated 1,000,000+ digits of PI on a CDC 7600 in 23.3 hours ! For those of you who need reminding, this was the Seymour Cray-designed supercomputer which was Control Data´s competition against the IBM 360 model 195. This occurred a mere 44 years ago at the end of the Apollo era; most of you were probably not even alive then.
I have replicated Guilloud and Bouyerś work on both the Rock64 and PineA64 supercomputers in less than 1/2 hour!
To accomplish this we need to make some adjustments to our Python script which is listed below; very short and sweet :
pi-fast-calc.py
To run the codes above use:
time python pi-fast-calc.py 1000100 >PI_1000_K.txt
I scrubbed the output slightly by removing the first digit ¨3¨ and truncating the number at precisely 1,000,000 digits after the decimal point. The file size is therefore 1000001 including the line end or file end marker. The signature for the millionth digit after the decimal point is 779458151
The times as well the md5 and sha checksums have been included; and I have appended the one million digits obtained from the Rock64 & PineA64.
The Rock64 runs slightly faster, as well the Rock64´s LPDDR3 memory is also slightly faster; consequently the Rock64 beat the PineA64 by about 3 minutes sixteen seconds. You can compare your digits with the appended file, or you can run md5sum or shasum against the actual digits to see if your calculation is similar.
To get the digits run tar against the tarball appended below: first rename the file from PI_1000_K.bmp to PI_1000_K.tar.xz ! (this trick is needed because the forum hates tarballs)
tar -xzvf PI_1000_K.tar.xz
To get the md5sum , or shasum , run :
md5sum PI_1000_K.txt
shasum PI_1000_K.txt
Hint: To download the attachment right click and select ¨save link as...¨
In 1973, one year before I graduated from high school, Jean Guilloud and Martin Bouyer calculated 1,000,000+ digits of PI on a CDC 7600 in 23.3 hours ! For those of you who need reminding, this was the Seymour Cray-designed supercomputer which was Control Data´s competition against the IBM 360 model 195. This occurred a mere 44 years ago at the end of the Apollo era; most of you were probably not even alive then.
I have replicated Guilloud and Bouyerś work on both the Rock64 and PineA64 supercomputers in less than 1/2 hour!
To accomplish this we need to make some adjustments to our Python script which is listed below; very short and sweet :
pi-fast-calc.py
Code:
import sys
digits = int(sys.argv[1]) if len(sys.argv) > 1 else 100000
def mpz(n): return n
#from gmpy2 import mpz
def atan(pp, qq):
def bs(a, b):
if b == a + 1:
if a == 0: return (1, 1, 1)
p = mpz(1-2*a)
q = mpz((2*a+1) * qq * qq)
return (p, q, p)
m = (a+b) // 2
(Pa, Qa, Ta) = bs(a, m)
(Pb, Qb, Tb) = bs(m, b)
return (Pa*Pb, Qa*Qb, Pa*Tb + Qb*Ta)
from math import log10
(p, q, t) = bs(0, int((digits+9) / log10(qq*qq)))
return 4 * pp * mpz(10) ** (digits+9) * t // q // qq
pi = atan(44, 57)
pi += atan(7, 239)
pi += atan(-12, 682)
pi += atan(24, 12943)
print(pi // 10**9)
To run the codes above use:
time python pi-fast-calc.py 1000100 >PI_1000_K.txt
I scrubbed the output slightly by removing the first digit ¨3¨ and truncating the number at precisely 1,000,000 digits after the decimal point. The file size is therefore 1000001 including the line end or file end marker. The signature for the millionth digit after the decimal point is 779458151
The times as well the md5 and sha checksums have been included; and I have appended the one million digits obtained from the Rock64 & PineA64.
Code:
user 21m34.615s
rock64 PI_1000_K.txt f776c92eb9b3865128f39e2a096497e9 md5
user 24m50.170s
pineA64 PI-1000-K.txt 51ecf7f4a842bbcef9c5f3a7bbc9022482ef4d89 sha
The Rock64 runs slightly faster, as well the Rock64´s LPDDR3 memory is also slightly faster; consequently the Rock64 beat the PineA64 by about 3 minutes sixteen seconds. You can compare your digits with the appended file, or you can run md5sum or shasum against the actual digits to see if your calculation is similar.
To get the digits run tar against the tarball appended below: first rename the file from PI_1000_K.bmp to PI_1000_K.tar.xz ! (this trick is needed because the forum hates tarballs)
tar -xzvf PI_1000_K.tar.xz
To get the md5sum , or shasum , run :
md5sum PI_1000_K.txt
shasum PI_1000_K.txt
Hint: To download the attachment right click and select ¨save link as...¨
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )