100 Billion Digits:
Unless you’re using a browser that doesn’t support the .ogg audio format, you’re probably hearing numbers right now. These numbers are the digits of Pi, as being read by a script I wrote. Wait a few moments, every 100th digit will tell you how far into the digits you’re at.
Will this stream stop? Well, maybe after a few decades. This script is reading off 100 billion digits of Pi, and it took roughly 3 days for my computer to calculate.
How and Why
These digits aren’t being calculated on the fly, I’ve already computed them. This script is reading from a pre-generated 100 GB text file right now, which I got from the program y-cruncher. At the time of writing, the world record is 55 trillion digits so 100 billion isn’t exactly “impressive,” but it’s definitely the most I’ve ever computed.
The “why” of this project was pretty straightforward: I was procrastinating some homework. Calculating Pi to ridiculous accuracy is one of those things that feels so rewarding but has no real-world benefit to anyone, so it’s a fun pastime for me. At the end of it, I also have a super big text file, which can be fun for those very common circumstances where you need a super big text file (/s)
If you’re familiar with y-cruncher, I’ve attached my verification file below. This file outlines the time table and details of the computation. Overall, it was pretty inefficient, since I had to use mechanical hard drives configured under ZFS as SWAP:
Benchmark Validation File - DO NOT MODIFY! If you do, it will fail validation.
Validation Version: 1.3
Program: y-cruncher v0.7.8 Build 9506
Tuning: 08-NHM ~ Ushio
User: Zachary Kline
Operating System: Linux 4.19.0-10-amd64 x86_64
Processor(s):
Name: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
Logical Cores: 8
Physical Cores: 8
Sockets: 2
NUMA Nodes: 2
Base Frequency: 2,666,798,976 Hz
Motherboard:
Manufacturer:
Model:
Version:
Serial Number: Suppressed - Personally identifiable information is opt-in only.
Memory:
Usable Memory: 33,732,304,896 (31.4 GiB)
Total Memory: Unable to Detect
Constant: Pi
Algorithm: Chudnovsky (1988)
Decimal Digits: 100,000,000,000
Hexadecimal Digits: 83,048,202,373
Computation Mode: Swap Mode
Threading Mode: Push Pool -> 8 / ? (randomization on)
Working Memory: 30,667,804,416 (28.6 GiB)
Total Memory: 31,235,147,520 (29.1 GiB)
Logical Largest Checkpoint: 141,287,710,800 ( 132 GiB)
Logical Peak Disk Usage: 503,852,605,704 ( 469 GiB)
Logical Disk Bytes Read: 18,251,711,761,812 (16.6 TiB)
Logical Disk Bytes Written: 15,909,719,930,036 (14.5 TiB)
Configuration Dump:
{
Constant : {
Constant : "pi"
Algorithm : "chudnovsky"
}
ComputeSize : {
DecimalDigits : 100000000000
EnableHexDigits : "true"
}
Output : {
Path : ""
OutputEnable : "true"
DigitsPerFile : 0
}
OutputVerify : "true"
Mode : "swap"
Parallelism : {
TaskDecomposition : 8
Framework : "pushpool"
WorkerThreads : 0
Randomization : "true"
MaxSequentialDispatch : 64
}
Allocator : {
Allocator : "interleave"
Hashed : "true"
mbind : "false"
LockedPages : "attempt"
Nodes : [0 1]
}
Memory : 31235147520
Checkpointing : {
Enabled : "true"
PostCheckpointCommand : ""
}
FarMemoryTuning : {
BytesPerSeek : 1048576
ParallelAccess : "none"
}
FarMemoryConfig : {
Framework : "disk-raid0"
InterleaveWidth : 262144
BufferPerLane : 67108864
Checksums : "true"
RawIO : "true"
Lanes : [
{ // Lane 0
Path : ""
BufferAllocator : {
Allocator : "interleave"
Hashed : "true"
mbind : "false"
LockedPages : "attempt"
Nodes : [0 1]
}
WorkerThreadCores : []
WorkerThreadPriority : 2
}
]
}
}
Start Date: Fri Aug 28 21:41:11 2020
End Date: Tue Sep 1 04:05:10 2020
Total Computation Time: 255285.885 seconds
Start-to-End Wall Time: 282239.069 seconds
CPU Utilization: 204.89 % + 0.53 % kernel overhead
Multi-core Efficiency: 25.61 % + 0.07 % kernel overhead
Last Decimal Digits:
8614936178 2910791153 4443607291 9665696203 7329712945 : 99,999,999,950
9536515199 6948432428 3185077669 0674614692 0191295669 : 100,000,000,000
Last Hexadecimal Digits:
adf23df916 c2d4167875 8e2bede8c6 e87a5d957b 00c7f252fd : 83,048,202,350
e55d87142f 94e93e4f54 d1a
SHA256-dec(100,000,000,001 - 100,000,000,100): 50df006a7c52e6938c29f7c35dbd77a3f9300861995589396b645db7ec5c526f
Dec Counts: {10000104750,9999937631,10000026432,9999912396,10000032702,9999963661,9999824088,10000084530,10000157175,9999956635}
Hex Counts: {5190463595,5190542120,5190400156,5190579414,5190473644,5190543626,5190553436,5190490649,5190531295,5190465184,5190552279,5190555609,5190559606,5190442901,5190498764,5190550095}
Dec Hash: Floor(|x| * 10^dec) mod (2^61 - 1) = 1508666899694937228
Hex Hash: Floor(|x| * 16^hex) mod (2^61 - 1) = 288288873083286541
Spot Check: Good through 100,000,000,000
Timer Sanity Check: Disabled due to checkpoint restart
Frequency Sanity Check: Disabled in this version of y-cruncher
Reference Clock: kvm-clock
Reference Clock 0: 0
Reference Clock 1: 110,299,406
Reference Clock 2: 1,304,744
Is Debugger Present: Unknown
Is Contiguous: No
ECC Recovered Errors: 0
Colors: Yes
Event Log:
Fri Aug 28 21:41:11 2020 0.104 Working Memory
Fri Aug 28 21:41:32 2020 20.555 Working Memory: 28.6 GiB (locked, spread: ?)
Fri Aug 28 21:41:32 2020 20.555 Twiddle Tables
Fri Aug 28 21:41:34 2020 22.345 Twiddle Tables: 477 MiB (locked, spread: ?)
Fri Aug 28 21:41:34 2020 22.345 I/O Buffers
Fri Aug 28 21:41:34 2020 22.552 I/O Buffers: 64.0 MiB (locked, spread: ?)
Fri Aug 28 21:41:34 2020 22.552 Begin Computation
Fri Aug 28 21:41:34 2020 22.552 Series CommonP2B3... 7,051,366,947 terms (Expansion Factor = 3.122)
Fri Aug 28 21:41:34 2020 22.552 Series: A ( 36 ) 0.000%
Fri Aug 28 21:41:34 2020 22.728 Series: A ( 35 ) 0.002%
Fri Aug 28 21:41:35 2020 23.248 Series: A ( 34 ) 0.005%
Fri Aug 28 21:41:35 2020 23.826 Series: E ( 33 ) 0.009%
Fri Aug 28 21:41:36 2020 24.458 Series: E ( 32 ) 0.013%
Fri Aug 28 21:41:37 2020 25.151 Series: E ( 31 ) 0.016%
Fri Aug 28 21:41:38 2020 26.148 Series: E ( 30 ) 0.022%
Fri Aug 28 21:41:39 2020 27.443 Series: E ( 29 ) 0.028%
Fri Aug 28 21:41:41 2020 29.253 Series: E ( 28 ) 0.037%
Fri Aug 28 21:41:43 2020 31.658 Series: E ( 27 ) 0.049%
Fri Aug 28 21:41:46 2020 34.961 Series: E ( 26 ) 0.064%
Fri Aug 28 21:41:51 2020 39.411 Series: E ( 25 ) 0.084%
Fri Aug 28 21:41:57 2020 45.532 Series: E ( 24 ) 0.110%
Fri Aug 28 21:42:06 2020 54.165 Series: E ( 23 ) 0.144%
Fri Aug 28 21:42:17 2020 65.898 Series: E ( 22 ) 0.189%
Fri Aug 28 21:42:33 2020 81.367 Series: E ( 21 ) 0.248%
Fri Aug 28 21:42:54 2020 102.700 Series: E ( 20 ) 0.325%
Fri Aug 28 21:43:25 2020 133.279 Series: E ( 19 ) 0.426%
Fri Aug 28 21:44:03 2020 171.887 Series: E ( 18 ) 0.558%
Fri Aug 28 21:45:00 2020 228.766 Series: E ( 17 ) 0.732%
Fri Aug 28 21:46:14 2020 302.760 Series: E ( 16 ) 0.959%
Fri Aug 28 21:47:59 2020 407.210 Series: E ( 15 ) 1.258%
Fri Aug 28 21:50:14 2020 542.165 Series: E ( 14 ) 1.650%
Fri Aug 28 21:53:20 2020 728.425 Series: E ( 13 ) 2.163%
Fri Aug 28 21:57:42 2020 990.418 Series: E ( 12 ) 2.837%
Fri Aug 28 22:03:35 2020 1343.376 Series: E ( 11 ) 3.720%
Fri Aug 28 22:11:25 2020 1813.798 Series: E ( 10 ) 4.879%
Fri Aug 28 22:22:51 2020 2499.219 Series: S ( 9 ) 6.399%
Fri Aug 28 22:40:53 2020 3581.323 Series: S ( 8 ) 8.394%
Fri Aug 28 23:30:37 2020 6565.574 Series: S ( 7 ) 11.013%
Sat Aug 29 00:39:58 2020 10726.946 Series: S ( 6 ) 14.453%
Sat Aug 29 02:20:19 2020 16748.091 Series: S ( 5 ) 18.973%
Sat Aug 29 06:25:30 2020 31459.076 Series: S ( 4 ) 24.918%
Sat Aug 29 11:41:01 2020 0.000 --- Resuming From Checkpoint ---
Sat Aug 29 11:41:01 2020 0.100 Working Memory
Sat Aug 29 11:41:15 2020 14.077 Working Memory: 28.6 GiB (locked, spread: ?)
Sat Aug 29 11:41:15 2020 14.077 Twiddle Tables
Sat Aug 29 11:41:16 2020 14.851 Twiddle Tables: 477 MiB (locked, spread: ?)
Sat Aug 29 11:41:16 2020 14.851 I/O Buffers
Sat Aug 29 11:41:16 2020 14.917 I/O Buffers: 64.0 MiB (locked, spread: ?)
Sat Aug 29 11:41:16 2020 14.918 Resuming Computation
Sat Aug 29 11:41:16 2020 14.918 Series CommonP2B3... 7,051,366,947 terms (Expansion Factor = 3.122)
Sat Aug 29 11:41:16 2020 14.918 Series: S ( 4 ) 24.918%
Sat Aug 29 13:48:56 2020 7675.074 Series: S ( 3 ) 32.747%
Sat Aug 29 18:34:25 2020 24803.906 Series: S ( 2 ) 43.076%
Sun Aug 30 01:53:56 2020 51175.261 Series: S ( 1 ) 56.749%
Sun Aug 30 14:18:17 2020 95835.710 Series: S ( 0 ) 74.970%
Mon Aug 31 05:27:52 2020 150411.139 Finishing Series
Mon Aug 31 05:58:09 2020 152227.782 Large Division
Mon Aug 31 11:38:53 2020 172671.681 InvSqrt(10005)...
Mon Aug 31 15:18:28 2020 185846.303 Large Multiply
Mon Aug 31 18:03:25 2020 195743.888 Verify Large Multiply
Mon Aug 31 18:17:16 2020 196575.225 Writing Hexadecimal Digits
Mon Aug 31 18:34:15 2020 197594.226 Base Converting
Tue Sep 1 00:06:06 2020 217504.640 Writing Decimal Digits
Tue Sep 1 00:25:02 2020 218640.434 Verifying Base Conversion
Tue Sep 1 03:50:04 2020 230942.734 Verifying Binary Output
Tue Sep 1 03:53:53 2020 231172.049 Verifying Decimal Output
Tue Sep 1 03:59:44 2020 231522.692 Verifying Hexadecimal Output
Tue Sep 1 04:05:10 2020 231849.223 End Computation
----
Checksum0: c2f41b22da0222079d32eac979b0f44ef8c60e22292cfe525fab4f16135a0988d48ae4427bdcfccabd3fe5fb7862b0f0ab94e01fb7456c47db6fa7fd9eef57c0
Checksum1: 010eb547434fe40209c054a0b0341f5fa648a4ff4c58a448b326d4ebf805aed0c2938ddc81b58c16090a736d13bff348276e9eecf50cd0bb19a9598146cdd8d2