Bailey - Borwain - Pluff formula, which allows you to extract any specific hexadecimal or binary digit of pi without calculating the previous ones (the current record was set on the Chudnovsky algorithm, see under the cut)
Computing cluster Google Compute Engine for 121 days on 25 virtual machines calculated the largest number of digits in the number pi, setting a new world record: 31,4 trillion decimal places. This is the first time that public cloud software has been used to calculate pi of this magnitude.
The record will be in the name of Emma Haruka Iwao of Google's High Performance Computing division. It was she who used the Google Cloud infrastructure for computing. The previous world record was set by Peter Trub in 2016, he calculated the number to 22,4 trillion digits. , which was also sponsored by the employer.
Like Trub, a Google engineer used y-cruncher to calculate. This program uses , a fast algorithm for calculating pi. Back in the 80s themselves with its help, a billion decimal places were calculated.
In turn, the algorithm is based on the fast convergence property of the hypergeometric series:
Emma Haruka Iwao became fascinated with the "magic" number after learning about it in a math class at school, Wired. At the university, one of her professors, Daisuke Takahashi, held the record for the most number of digits calculated using a supercomputer. Today, a record can be set by almost any interested engineer who has access to serious computing resources and large disk storage (to store the result of calculations). Program created in 2009 designed to calculate mathematical constants such as pi. It supports massive multithreading and trillion ranges. This program actually commoditized constant calculations.
“You need a pretty big computer to break the world record,” says Iwao. “You can’t do it on a computer from a store, so people used to build custom cars.” In September 2018, Iwao began looking at how the process of computing in a range beyond the record range would technically work. It immediately became clear that the main problem would be the amount of data to store. As a result, it turned out that the calculated result takes 170 terabytes. Instead of building a custom server, like her predecessors, the girl used the Google Cloud infrastructure.
Iwao brought up 25 virtual machines: “But instead of pressing that virtual machine button 25 times, I automated it,” she explains. “You can do it in a couple of minutes, but if you need so many computers, then it will take several days to set everything up.” Iwao then ran y-cruncher on those 121 virtual machines continuously for 25 days.
For the correctness of calculations, virtual machines had to work constantly. The engineer set up a monitoring system that would alert her if something went wrong, such as a sudden crash on one of the virtual machines. Just one failure - even for a couple of minutes - could jeopardize the entire computing process, if not for backup.
“Cruncher and Google Cloud have backup systems, and I set them up so that you can instantly make copies of these drives without stopping computing,” says Iwao. This data was then copied and stored externally, on other disks, as snapshots.
“In the beginning, there were a few settings that I changed, such as how much data you could read or write at one time, and how the bounds would change as you get bigger,” says Iwao.
With an increase in the number of digits, the volume of files became larger, and the complexity of calculations increased non-linearly. This made the initial calculation very difficult when Iwao was trying to figure out how much virtual machine resource she would need for the project.
Now both the calculations and the verification of the result are completed: two basic algorithms are built into y-cruncher - one for calculating pi itself, and the other for checking. The verification algorithm works in parallel with the calculation, but only calculates one digit, so the record can be officially registered.
Theoretically, a new world record could be set by simply taking the previous file and applying the Bailey-Borwain-Pluff formula to calculate another number. But this certainly contradicts the rules for registering such world records: most likely, each applicant must start the calculation from the beginning. As an option: improve the previous achievement by N%, which cannot be done using the Bailey - Borwain - Pluff formula.
Source: habr.com
