Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HDFS >> mail # user >> Re: Pi Estimator failing to print output after finishing the job sucessfully


Copy link to this message
-
RE: Pi Estimator failing to print output after finishing the job sucessfully
You didn't do anything wrong, this is just a bug in the Pi application.  The application _should_ be able to divide two numbers and not require an exact decimal result.  Everything you need to know is in the first line of the error message.  Try it with 100 maps and 10 billion samples per map, which will produce an exact decimal result.  There's no way to have the same number of maps on each of 11 nodes and get an exact result.

Jeff

From: Gaurav Dasgupta [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2012 9:11 AM
To: [EMAIL PROTECTED]
Subject: Pi Estimator failing to print output after finishing the job sucessfully

Hi All,

I am running the Pi Estimator from hadoop-examples.jar in my 11 node CDH3u4 cluster.

Initially I ran the job for 10 maps and 1000000 samples per map and it ran fine and displayed the execution time and the pi value in the console.
Now again when I ran it for 88 maps and 1 trillion total samples (i.e., 11363636364 samples per map), it executed the job sucessfully, but at end gave the following error and could not display the "pi value" in the console:

java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
 at java.math.BigDecimal.divide(BigDecimal.java:1603)
 at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:313)
 at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342)
 at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
 at org.apache.hadoop.examples.PiEstimator.main(PiEstimator.java:351)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
 at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
 at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
Can anyone tell me where is it going wrong?
Note: My Hadoop cluster (CDH3u4) contains all the necessary patches.

Thanks,
Gaurav Dasgupta