Skip to main content

Pi in the sky: Calculating a record-breaking 31.4 trillion digits of Archimedes’ constant on Google Cloud


Pi in the sky: Calculating a record-breaking 31.4 trillion digits of Archimedes’ constant on Google Cloud

Ever since the ancient Babylonians, people have been calculating the digits of π, the ratio of the circumference of a circle to its diameter that starts as 3.1415… and goes on forever. In honor of Pi Day, today March 14 (represented as 3/14 in many parts of the world), we’re excited to announce that we successfully computed π to 31.4 trillion decimal places—31,415,926,535,897 to be exact, or π * 1013. This has broken a GUINNESS WORLD RECORDS TM title , and the first time the record was broken using the cloud, proving Google Cloud’s infrastructure works reliably for long and compute-heavy tasks.


We achieved this feat using y-cruncher, a Pi-benchmark program developed by Alexander J. Yee, using a Google Compute Engine virtual machine cluster. 31.4 trillion digits is almost 9 trillion digits more than the previous world record set in November 2016 by Peter Trueb. Yee independently verified the calculation using Bellard's formula and BBP formula. Here are the last 97 digits of the result.
6394399712 5311093276 9814355656 1840037499 3573460992
1433955296 8972122477 1577728930 8427323262 4739940
You can read more details of this record from y-cruncher's perspective in Yee’s report.
A constant race

Granted, most scientific applications don’t need π beyond a few hundred digits, but that isn’t stopping anyone; starting in 2009, engineers have used customized personal computers to calculate trillions of digits of π. In fact, the race to calculate more π digits has only accelerated as of late, with computer scientists using it as a way to test supercomputers, and mathematicians to compete against one another.

However, the complexity of Chudnovky's formula—a common algorithm for computing π—is O(n (log n)3). In layman’s terms, this means that the time and resources necessary to calculate digits increase more rapidly than the digits themselves. Furthermore, it gets harder to survive a potential hardware outage or failure as the computation goes on.For our π calculation, we decided to go to the cloud. Using Compute Engine, Google Cloud’s high-performance infrastructure as a service offering, has a number of benefits over using dedicated physical machines. First, Compute Engine’s live migration feature lets your application continue running while Google takes care of the heavy lifting needed to keep our infrastructure up to date. We ran 25 nodes for 111.8 days, or 2,795 machine-days (7.6 machine-years), during which time Google Cloud performed thousands of live migrations uninterrupted and with no impact on the calculation process.

Running in the cloud also let us publish the computed digits entirely as disk snapshots. In less than an hour and for as little as $40/day, you can copy the snapshots, work on the results, and dispose of the computation resources. Before cloud, the only feasible way to distribute such a large dataset was to ship physical hard drives.
Then there are the general benefits of running in the cloud: availability of a broad selection of hardware, including the latest Intel Skylake processors with AVX-512 support. You can scale your instances up and down on demand, and kill off when you are done with them, only having paid for what you used.
Here are additional details about the program:




Pi Day 2019 blog post diagram.png




2019-03-11 pi graphic_02.png
An overview of our π cluster architecture

Cluster design
We selected an n1-megamem-96 instance for the main computing node. It was the biggest virtual machine type available on Compute Engine that provided Intel Skylake processors at the beginning of the project. The Skylake generation of Intel processors supports AVX-512, which are 512-bit SIMD extensions that can perform floating point operations on 512-bit data or eight double-precision floating-point numbers at once.
Currently, each Compute Engine virtual machine can mount up to 64 TB of Persistent Disks. We used the iSCSI protocol to remotely attach Persistent Disks to add additional capacity. The number of nodes were decided based on y-cruncher's disk benchmark performance. We selected n1-standard-16 for the iSCSI target machines to ensure sufficient bandwidth between the computing node and the storage as the network egress bandwidth and Persistent Disk throughput are determined by the number of vCPU cores.
How to get your hands on the digits
Our pi.delivery service provides a REST API to access the digits on the web. It also has a couple of fun experiments that lets you visualize and listen to π.
To make it easier for you to use these digits in your own work, we have made the resulting π digits available as snapshots on Google Cloud Platform. Each snapshot contains a single text file with the decimal digits and you can create a new Persistent Disk based on these images. We provide both XFS and NTFS disk formats to accommodate Linux and Windows operating systems respectively. The snapshots are located in the us multi-region.
You need to join the pi-31415926535897 Google Group to gain access. It will cost approximately $40 per day to keep the cloned disk in one of the us-central1, us-west1, and us-east1 regions in your project. We will keep the snapshots until March 14, 2020. The snapshots are available at the following locations.
To create a new disk named pi314-decimal-digits-xfs in your project based on the XFS snapshot, for example, type the following command:
gcloud compute disks create pi314-decimal-digits-xfs --source-snapshot https://www.googleapis.com/compute/v1/projects/pi-31415926535897/global/snapshots/decimal-digits-xfs
Remember to delete the disk once you're done with it to avoid unexpected charges.
gcloud compute disks delete pi314-decimal-digits-xfs
Please refer the restoring a non-boot disk snapshotsection and the gcloud compute disks createhttps://cloud.google.com/sdk/gcloud/reference/compute/disks/create command help for more instructions on how to use these images.
Coming full circle
The world of math and sciences is full of records just waiting to be broken. We had a great time calculating 31.4 trillion π digits, and look forward to sinking our teeth into other great challenges. Until then, let's celebrate the day with fun experiments. Our Pi Day Celebration cloud experiment on our Showcase experiments website lets you generate a custom art piece from digits of π that you pick. And if you’re going to Google Cloud Next '19 in San Francisco, come to our deep-dive technical sessionhttps://cloud.withgoogle.com/next/sf/sessions?session=CMP300 together with Alexander Yee to discuss details and insights from this experiment, interact with the Showcase experiment and watch a live experiment with the π digits inside the DevZone.

Comments

Popular posts from this blog

25 Simple and Free SEO Tools to Instantly Improve Your Marketing [Updated for 2019](Digital Marketing)

25 Simple and Free SEO Tools To instantly Improve Your Marketing [Updated for 2019] 1.  Google PageSpeed Insights Check the speed and usability of your site on multiple devices Enter a URL, and this tool will test the loading time and performance for desktop and for mobile, plus identify opportunities to improve (and pat you on the back for what you’re doing well). The mobile results also come with a user experience score, grading areas like tap targets and font sizes. Alternatives:  Pingdom ,  WebPageTest , and  GTmetrix 2.  Moz Local Listing Score See how your local business looks online Moz crunches data from more than 10 different sources—including Google, Yelp, and Facebook—to score your brick-and-mortar business on  how it looks online . Results come complete with actionable fixes for inconsistent or incomplete listings. 3.  Keywordtool.io Hundreds of keyword ideas based on a single keyword Enter a ke...

Top 10 Best Websites For Jobs(The Best Job Sites 2019) for Job

There are thousands of job sites on the web, but the best job boards and  job search engine sites  have search tools that are quick and easy to use and allow you to search based on the type of job you're looking for, your location, and other criteria.  Some of the best job sites are traditional job boards, like Monster, Dice, and CareerBuilder. Others, like Indeed.com, allow you to search many job boards, company career sites, associations, and other sources of job postings. You can even search directly on Google to find job opportunities. There are also sites that focus on certain types of positions or match you with employers. These sites are worth incorporating into your  job search , because not all employers list on every website, even though it may seem that way. Don't limit yourself to just one job website, because each job site only lists jobs from particular websites or companies.  LinkUp.com , for example, only lists jobs direct...

The Main Difference Between Facebook and LinkedIn(professional vs social networking sites) every professional should know about these sites

Two popular social networking sites are LinkedIn and Facebook. While both are designed to connect people online, the two sites represent different types of connections with very different options and features. 1   Facebook, Inc. is an American online social media and social networking service company. It is based  in Menlo Park, California. Its was founded by Mark Zuckerberg , along with fellow Harvard College  students and roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes Founded :  February 2004,  Cambridge, Massachusetts, United States CEO :  Mark Zuckerberg Headquarters :  Menlo Park, California, United States CFO :  David Wehner Stock price :  FB   (NASDAQ)   US$ 161.89   +1.85 (+1.16%) 22 Feb, 4:00 pm GMT-5 -  Disclaimer Founders :  Mark Zuckerberg ,  Andrew McCollum ,  Eduardo Saverin ,  Dustin Moskovitz ,  C...