New World Record for Calculating Pi: 31.4 Trillion Digits

New World Record for Calculating Pi: 31.4 Trillion Digits

The Bailey–Borwein–Plouffe formula allows for the extraction of any specific hexadecimal or binary digit of pi without calculating the preceding ones (the current record was set using the Chudnovsky algorithm, see below).

A Google Compute Engine cluster calculated the most digits of pi over 121 days on 25 virtual machines, setting a new world record of 31.4 trillion digits after the decimal point. This is the first time public cloud software has been used for calculations of pi at this magnitude.

The record will be credited to Emma Haruka Iwao from Google's High-Performance Computing division, who utilized Google Cloud infrastructure for the calculations. The previous world record was held by Peter Trub in 2016, who calculated it to 22.4 trillion digits. on a specially made server, which was also sponsored by the employer.

Like Trub, the Google engineer used y-cruncher for the calculations. This program utilizes the Chudnovsky algorithm, a fast algorithm for calculating pi. Back in the 80s, the Chudnovsky brothers used it to calculate a billion digits after the decimal point.

The algorithm is based on the rapidly converging property of the hypergeometric series:

New World Record for Calculating Pi: 31.4 Trillion Digits

Emma Haruka Iwao became fascinated with the "magical" number after learning about it in math class at school. writes Wired. In university, one of her professors, Daisuke Takahashi, was a record-holder for the most digits calculated using a supercomputer. Today, nearly any interested engineer with access to serious computational resources and sufficient disk storage (to store the calculation results) can set a record. The program created in 2009, y-cruncher , is designed for calculating mathematical constants such as pi. It supports massive multithreading and trillion-digit ranges. This program has effectively commoditized the computation of constants.

"You need a quite powerful computer to break a world record," says Ivao. "You can't do this on a store-bought machine, which is why people used to build custom machines." In September 2018, Ivao started considering how the computing process would technically work beyond the record range. It quickly became clear that the main issue would be the amount of data required for storage. In the end, the calculated result amounted to 170 terabytes. Instead of building a custom server like previous attempts, she utilized Google Cloud infrastructure.

New World Record for Calculating Pi: 31.4 Trillion DigitsIvao spun up 25 virtual machines: "But instead of pressing that virtual machine button 25 times, I automated it," she explains. "You can do this in a couple of minutes, but if you need that many computers, it could take several days to set everything up." Then, continuously for 121 days, Ivao managed the y-cruncher work on those 25 virtual machines.

To ensure accurate calculations, the virtual machines needed to run continuously. The engineer set up a monitoring system that would alert her if something went wrong, such as a sudden failure on one of the virtual machines. Just one outage—even for a couple of minutes—could jeopardize the entire computation process without backup.

"There are backup systems in the cruncher and Google Cloud, and I configured them so that you can instantly take snapshots of these disks without stopping the computations," says Ivao. These data were then copied and stored externally, on other disks, as snapshots.

"At the beginning, there were several parameters I adjusted, such as how much data you could read or write at once, and how the boundaries would change as the workload increased," Ivao says.

As the number of digits increased, the file sizes grew larger, and the complexity of calculations rose nonlinearly. This significantly complicated the initial estimation when Ivao was trying to figure out what resource capacity of virtual machines she would need for the project.

The calculations and result verification are now complete: y-cruncher incorporates two basic algorithms — one for calculating pi and another for verification. The verification algorithm runs in parallel with the computation, but it calculates only one digit, allowing the record to be officially registered.

Theoretically, a new world record can be set simply by taking the previous file and applying the Bailey–Borwein–Plouffe formula to calculate one more digit. However, this likely contradicts the rules for registering such world records: each contender probably has to start the calculation from scratch. Alternatively, improving the previous achievement by N% is not feasible using the Bailey–Borwein–Plouffe formula.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster