Map Reduce Programs

pi:

A map/reduce program that estimates Pi using a quasi-Monte Carlo method.

To run:

bin/hadoop jar hadoop-examples-*.jar pi <a> <b>

And the parameters are:
    <a>         The number of mappers.
    <b>         The number of digits after decimal.

Input:

This program does not take any input.

Just give the command as,

bin/hadoop jar <path to jar file> jar pi 10 100000

Output:

Estimated value of Pi is 3.14159256000000000000

Screenshots:

piqpi

 

bbp:

A map/reduce program that uses Bailey-Borwein-Plouffe to compute exact digits of Pi.

To run:

bin/hadoop jar hadoop-examples-*.jar bbp <startDigit> <nDigits> <nMaps> <out-dir>

Input:

This program does not take any input.

Just give the command as,

bin/hadoop jar <path to jar file> jar bbp 1 16 10 <path to output dir.>

Output:

The output is stored in the output dir. as,

Pi = 0x3.243F6A8885 A308D3
Total number of hexadecimal digits is 16.

Pi = 3.1415926535 897932
Total number of decimal digits is 16.

Screenshots:

bbp bbpr

 

distbbp:

A map/reduce program that uses a BBP-type formula to compute exact bits of Pi.

To run:

bin/hadoop jar <path to jar file> DistBbp <b> <nThreads> <nJobs> <type> <nPart> <remoteDir> <localDir>
 

And the parameters are:

  <b> The number of bits to skip, i.e. compute the (b+1)th position.
  <nThreads> The number of working threads.
  <nJobs> The number of jobs per sum.
  <type> ‘m’ for map side job, ‘r’ for reduce side job, ‘x’ for mix type.
  <nPart> The number of parts per job.
  <remoteDir> Remote directory for submitting jobs.
  <localDir> Local directory for storing output files.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s