%% LATEX TWICE TO GET THE REFERENCES RIGHT
%%\documentstyle[12pt]{article}
\documentstyle[12pt,epsf,psfig]{article}

\newcommand{\postscript}[2]
 {\setlength{\epsfxsize}{#2\hsize}
  \centerline{\epsfbox{#1}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{theorem}{Theorem}
\newtheorem{itlemma}{Lemma}[section] %number by section (set in \em by default)
%%%same numbering counter as itlemmas:
\newtheorem{itproposition}[itlemma]{Proposition}
\newtheorem{itcorollary}[itlemma]{Corollary}
\newtheorem{itremark}[itlemma]{Remark}
\newtheorem{itnote}[itlemma]{Note}
\newtheorem{itobservation}[itlemma]{Observation}
\newtheorem{itdefinition}[itlemma]{Definition}
\newtheorem{itexercise}[itlemma]{Exercise}
\newtheorem{itexample}[itlemma]{Example}

\newenvironment{lemma}{\begin{itlemma}\rm}{\end{itlemma}} %no-italics
\newenvironment{remark}{\begin{itremark}\rm}{\end{itremark}} %no-italics
\newenvironment{observation}{\begin{itobservation}\rm}{\end{itobservation}} %no-italics
\newenvironment{corollary}{\begin{itcorollary}\rm}{\end{itcorollary}}
\newenvironment{proposition}{\begin{itproposition}\rm}{\end{itproposition}}
\newenvironment{definition}{\begin{itdefinition}\rm}{\end{itdefinition}}
\newenvironment{exercise}{\begin{itexercise}\rm}{\end{itexercise}}
\newenvironment{example}{\begin{itexample}\rm}{\end{itexample}}

\tolerance=1600 %allow some tolerance in extending after line.
\parskip=3pt plus 1pt minus 1pt
\overfullrule=0pt %no dark lines if overfull

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This are for choices.  They take 4 or 6 args
%% (carriage returns allowed in between}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\twoif}[4]{
\left\{ \begin{array}{ll}#1&#2\\#3&#4\end{array}\right.
}
\newcommand{\threeif}[6]{
\left\{ \begin{array}{ll}#1&#2\\#3&#4\\#5&#6\end{array}\right.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\partmlab#1#2#3#4#5#6#7#8{\bordermatrix{&#1&#2\cr#3&#5&#6\cr
                                        \noalign{\medskip}#4&#7&#8\cr}}
%% For 2by2 partitioned matrices; arguments are: two labels of top, side,
%% 4 entries (row by row).  If entries are themselves matrix or pmatrix,
%% better for readability of source to define first: \def\matrix1{...} etc.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\bigframebox}[1]{\framebox{\parbox{\smallerwidth}{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Warning: use \noindent before!
% AND IN TEXT, after begin doc, do:
% \newlength{\smallerwidth}  %for bigboxes
% \setlength{\smallerwidth}{\textwidth}
% \addtolength{\smallerwidth}{-8pt}        %MUST BE DONE AFTER begin doc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \beq {\begin{eqnarray}}
\def \eeq {\end{eqnarray}}
\def \beqn {\begin{eqnarray*}}
\def \eeqn {\end{eqnarray*}}

\newcommand{\rf}[1]{[\ref{#1}]}            %bibliographical references

\newcommand{\text}[1]{\hbox{\rm \ #1\ \/}}
\newcommand{\be}[1]{\begin{equation}\label{#1}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bl}[1]{\begin{lemma}\label{#1}}
\newcommand{\ble}[1]{\begin{lemmaex}\label{#1}}
\newcommand{\br}[1]{\begin{remark}\label{#1}}
\newcommand{\bn}[1]{\begin{note}\label{#1}}
\newcommand{\bo}[1]{\begin{observation}\label{#1}}
\newcommand{\bt}[1]{\begin{theorem}\label{#1}}
\newcommand{\bd}[1]{\begin{definition}\label{#1}}
\newcommand{\bp}[1]{\begin{proposition}\label{#1}}
\newcommand{\bc}[1]{\begin{corollary}\label{#1}}
\newcommand{\bfact}[1]{\begin{fact}\label{#1}}
\newcommand{\ber}[1]{\begin{exercise}\label{#1}}
\newcommand{\bex}[1]{\begin{example}\label{#1}}
\newcommand{\bem}[1]{\begin{example}\label{#1}}    %Yes, 2 different ones...
\newcommand{\ec}{\mybox\end{corollary}}
\newcommand{\efact}{\mybox\end{fact}}
\newcommand{\eer}{\mybox\end{exercise}}
\newcommand{\eex}{\mybox\end{example}}
\newcommand{\eem}{\mybox\end{example}}
\newcommand{\el}{\mybox\end{lemma}}
\newcommand{\ele}{\mybox\end{lemmaex}}
\newcommand{\er}{\mybox\end{remark}}
\newcommand{\en}{\mybox\end{note}}
\newcommand{\eo}{\mybox\end{observation}}
\newcommand{\et}{\qed\end{theorem}}
\newcommand{\ed}{\mybox\end{definition}}
\newcommand{\ep}{\mybox\end{proposition}}
\newcommand{\epr}{\end{proof}}
\newcommand{\bpr}{\begin{proof}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  These are just for statements, no "qed" box is put in.
%%  (Also for when I have to finish something after a displayed equation
%%        or itemized.)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\ecs}{\end{corollary}}
\newcommand{\eers}{\end{exercise}}
\newcommand{\eexs}{\end{example}}
\newcommand{\eems}{\end{example}}
\newcommand{\els}{\end{lemma}}
\newcommand{\eles}{\end{lemmaex}}
\newcommand{\ers}{\end{remark}}
\newcommand{\ens}{\end{note}}
\newcommand{\eos}{\end{observation}}
\newcommand{\ets}{\end{theorem}}
\newcommand{\eds}{\end{definition}}
\newcommand{\eps}{\end{proposition}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\qed}{\hfill \halmos} %put \qed at right margin
\newcommand{\mybox}{\hfill $\Box$} %put \qed at right margin (white square)

%%%\newcommand{\pmat}[2]{\left( \begin{array}{#1} #2 \end{array} \right) }
%%%use as e.g. \pmat{cc}{ a&b\\ a &c }  Note 'cc' for 2 Centered cols
%%%can also use \pmatrix{ a&b\cr a &c \cr} for plainTeX standard construct
%%%\setcounter{page}{27} should set the CURRENT page to 27

\def \R {\bb R} % reals
\def \C {\bb C} % complexes
\def \Z {\bb Z} % integers
\def \X {\bb X} % for this paper only!
\def \inter {{\rm int \,}}
\def \rank {{\rm rank \,}}
%%%\def \inf {{\rm inf \,}}  %better in Latex -- subscripts OK!
%%%\def \min {{\rm min \,}}
\def \im {{\rm im \,}}
\def \ker {{\rm ker \,}}
\def \norm #1{\Vert #1 \Vert}
\def \ip #1\by #2{\langle #1 , #2 \rangle}
\def \Sone {{\bf S}^1} % circle
\def \wigglearrow {\sim \mkern -6mu >}

\def \today {\ifcase \month \or January\or February\or  
  March\or April\or May\or June\or July\or August\or 
  September\or October\or November\or December\fi\   
  \number \day, \number \year}                       
\newcommand{\comment}[1]{}
\newcommand{\halmos}{\rule{1ex}{1.4ex}}
%%%alternative to \qed (see below)
\newenvironment{proof}{\noindent {\em Proof}.\ }{\hspace*{\fill}$\halmos$\medskip}

%%%\def\qed{\kern 1em \vrule height .5em width .5em depth 0em}
%%%(I now use new qed: in right margin)

\def\vbar{\mathchoice{\vrule height6.3ptdepth-.5ptwidth.8pt\kern-.8pt}
   {\vrule height6.3ptdepth-.5ptwidth.8pt\kern-.8pt}
   {\vrule height4.1ptdepth-.35ptwidth.6pt\kern-.6pt}
   {\vrule height3.1ptdepth-.25ptwidth.5pt\kern-.5pt}}
\def\fudge{\mathchoice{}{}{\mkern.5mu}{\mkern.8mu}}
\def\bbc#1#2{{\rm \mkern#2mu\vbar\mkern-#2mu#1}}
\def\bbb#1{{\rm I\mkern-3.5mu #1}}
\def\bba#1#2{{\rm #1\mkern-#2mu\fudge #1}}
\def\bb#1{{\count4=`#1 \advance\count4by-64 \ifcase\count4\or\bba A{11.5}\or
   \bbb B\or\bbc C{5}\or\bbb D\or\bbb E\or\bbb F \or\bbc G{5}\or\bbb H\or
   \bbb I\or\bbc J{3}\or\bbb K\or\bbb L \or\bbb M\or\bbb N\or\bbc O{5} \or
   \bbb P\or\bbc Q{5}\or\bbb R\or\bbc S{4.2}\or\bba T{10.5}\or\bbc U{5}\or
%%%   \bbb P\or\bbc Q{5}\or\bbb R\or\bba S{8}\or\bba T{10.5}\or\bbc U{5}\or
   \bba V{12}\or\bba W{16.5}\or\bba X{11}\or\bba Y{11.7}\or\bba Z{7.5}\fi}}
%
%
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
%%% read as: theFOOTNOTE (i.e. the command  executed when doing a footnote) is
%%% now to be set as a FOOTNOTESYMBOL (type of number) value of counter
%%% FOOTNOTE (Instead of Roman).  See LaTeX manual pp.91-92 as well as 175.
\def\bi{\begin{itemize}}
\def\ei{\end{itemize}}
\def\ben{\begin{enumerate}}
\def\een{\end{enumerate}}
\def\st{\, | \,}

\newcommand{\myboxineq}{\eqno\Box} %put \qed at margin (white square) in eqn
\newcommand{\qedineq}{\eqno\halmos} %put \qed at margin in eqn

\topmargin -0.5in %default is 0.0, i.e. 1 inch from top.  Now it is 0.5
\textheight 9in
\oddsidemargin 0.25in %more reasonable margins!  (This is 1.25; can use <0 too)
\evensidemargin 0.25in %(same as above)
\textwidth 6.25in %(could use also -.5,-.5,7.5 for instance)
\tolerance=1600 %allow some tolerance in extending after line.
\parskip=3pt plus 1pt minus 1pt
\overfullrule=0pt %no dark lines if overfull

%%%% FROM HERE, macros special for paper
\def\mm{m}
\def\pp{p}
\def\proj{\pi _1} % projection on first group of coordinates
\def\x{u}  % vector argument
\def\SEC{(SEC)}
\def\SECo{(SEC$^0$)}
\def\INV{(INV)}
\def\Fp{{\cal F}_\pp}
\def\Fpm{{\cal F}_\pp^\mm}  %there is a 3,3 and a 2,1 in text

\def\Rm{\R^m}
\def\Rn{\R^n}
\newcommand{\ball}[2]{{\bb B}(#1,#2)}
\newcommand{\cball}[2]{\overline {\bb B} (#1,#2)}
\def\Fnm{{\cal F}_n^\mm}
\def\clos{{\rm clos\,}}
\def\inter{{\rm int\,}}

\def\CCF{compatible class of functions}
\begin{document}

\pagestyle{empty}
\begin{flushright}
{\it MPI-C Example - cps615-Fall97}
\end{flushright}

\vspace{1cm}
\vspace{1cm}

\hrule
\hrule
\hrule
\hrule
\hrule
\hrule
\hrule
\hrule
\hrule
\hrule
\vspace{.05cm}
\hrule
\vspace{.25cm}
{\bf 
Computation of $\pi$ and volume of hypersphere via Monte Carlo
techniques.
}
\vspace{.25cm}
\hrule
\vspace{.05cm}
\hrule
\hrule
\hrule
\hrule
\hrule
\vspace{1cm}

\begin{center}
Saleh Elmohamed\\
Northeast Parallel Architectures Center,\\
Syracuse University\\
Syracuse, NY 13244-4100\\
saleh@npac.syr.edu\\
\end{center}
\newpage
\pagestyle{empty}
\tableofcontents

\newpage

\pagestyle{plain}
\pagestyle{myheadings}
\markright{\it MPI-C Example - cps615-Fall97}
\section{The Problem and the Approach}
\setcounter{page}{1}

Using MPI and Monte Carlo methods, two things to be computed on the
IBM SP2 and the DEC AlphaCluster (Alphafarm):

\begin{itemize}
\item $\pi$ as the area of a circle of radius 1 in a 2-D space.
\item The volume of a d-dimensional hypersphere of radius 1. The
dimension is between $1$ and $10$. 
\end{itemize}
The easiest way to carry out this in parallel for Monte Carlo is to
generate separate events on separate processors. This will need
independent random sequences on each processor. This concept of
parallelism (using MPI) is referred to as ``farming'', that is to have
a master processor farming out the tasks to others (slaves) then
receiving and adding up the results from those processors.

\subsection{To Do This}
\begin{enumerate}
\item To compute the volume of the unit sphere, in a random manner,
and given the dimension, a bunch of darts are thrown at an area
between $0$ and $1$.
\item Determine the frequency of those darts that fell within this
area and those falling outside it. Then, within each processor given
this frequency and the numbers of tries, the average is computed. 
\item After computing the average or mean, the overall volume of the
sphere is easily computed. Essentially, we multiply this average by $2^{dim}$
giving us the overall volume.
\item Given the average, sphere darts, and per processor tries, we
compute the standard deviation.
\end{enumerate}

\section{Some MPI Basics}
{\underline{\it For more details, see the MPI tutorial by Ian
    Foster}}.

MPI can be introduced by just briefly describing six of its basic functions
which can be used to tackle a wide range of problems.
\begin{itemize}
\item MPI\_INIT$\;\;$:$\;\;$ Initiate an MPI computation.
\item MPI\_FINALIZE$\;\;$:$\;\;$ Terminate a computation.
\item MPI\_COMM\_SIZE$\;\;$:$\;\;$ Determine number of processes.
\item MPI\_COMM\_RANK$\;\;$:$\;\;$ Determine my process identifier.
\item MPI\_SEND$\;\;$:$\;\;$ Send a message.
\item MPI\_RECV$\;\;$:$\;\;$ Receive a message.
\end{itemize}
The functions MPI\_INIT and MPI\_FINALIZE are used to initiate and shut
down an MPI computation, respectively. MPI\_INIT must be called before any
other MPI function and must be called exactly once per process. No further
MPI functions can be called after MPI\_FINALIZE. The functions
MPI\_COMM\_SIZE and MPI\_COMM\_RANK   determine the number of 
processes in the current computation and the integer identifier assigned to
the current process, respectively.

\subsection{More on the Six MPI Basic Functions}
The following states in some details the function parameters.

\begin{itemize}
\item {\bf MPI\_INIT}(int *argc , char ***argc)$\;\;$:$\;\;$ {\it Initiate
    a computation}. ``argc'' and ``argv'' are required only in C
  language binding, where they are the main program's arguments.
\item {\bf MPI\_FINALIZE}()$\;\;$:$\;\;$ {\it Shut down a computation}.
\item {\bf MPI\_COMM\_SIZE}(comm, size)$\;\;$:$\;\;$ {\it Determine the
    number of processes in a computation}.
\begin{enumerate}
\item Input: {\it comm} $\;\;\;\;$ communicator (Type:
  handle).
\item Output: {\it size} $\;\;\;\;$ number of processes in
  the group of comm (Type: integer).
\end{enumerate}
\item {\bf MPI\_COMM\_RANK}(comm, PID)$\;\;$:$\;\;$ {\it Determine the
    identifier of the current process}.
\begin{enumerate}
\item Input: {\it comm} $\;\;\;\;$ communicator (Type:
  handle).
\item Output: {\it PID} $\;\;\;\;$ process ID in the group
  of comm (Type: integer).
\end{enumerate}
\item {\bf MPI\_SEND}(buf, count, datatype, dest, tag,
  comm)$\;\;$:$\;\;$ {\it Send a message}.
\begin{enumerate}
\item Input: {\it buf} $\;\;\;\;$ address of send buffer (Type:
  choice).
\item Input: {\it count} $\;\;\;\;$ number of elements to send (Type:
  integer $\ge$ 0).
\item Input: {\it datatype} $\;\;\;\;$ datatype of send buffer
  elements (Type: handle).
\item Input: {\it dest} $\;\;\;\;$ process ID of destination process
  (Type: integer).
\item Input: {\it tag} $\;\;\;\;$ message tag (Type: integer).
\item Input: {\it comm} $\;\;\;\;$ communicator (Type: handle).
\end{enumerate}
\item {\bf MPI\_RECV}(buf, count, datatype, source, tag, comm,
  status)$\;\;$:$\;\;$ {\it Receive a message}.
\begin{enumerate}
\item Output: {\it buf} $\;\;\;\;$ address of receive buffer (Type:
  choice).
\item Input: {\it count} $\;\;\;\;$ size of receive buffer in elements
  (Type: integer $ge$ 0).
\item Input: {\it datatype} $\;\;\;\;$ dataype of receive buffer
  elements (Type: handle).
\item Input: {\it source} $\;\;\;\;$ process ID of source process or
  {\bf MPI\_ANY\_SOURCE} (Type: integer).
\item Input: {\it tag} $\;\;\;\;$ message tag, or {\bf MPI\_ANY\_TAG}
  (Type: integer).
\item Input: {\it comm} $\;\;\;\;$ communicator (Type: handle).
\item Output: {\it status} $\;\;\;\;$ status object (Type: status).
\end{enumerate}
\end{itemize}

\section{The Program}

\begin{verbatim}
#include        <stdio.h>
#include        <mpi.h>
#include        <stddef.h>
#include        <ctype.h>
#include        <stdlib.h>
#include        <math.h>
#include        <malloc.h>
#include        <errno.h>

#define sphere_dim   10      /** the number of dimensions of the sphere  ***/
#define per_processor_tries  15000000

#define NUM_PROC   6        /* SP2 number of processors. */

void srand48();
double drand48();
double pow();
double sqrt();

/*-----------------------------*/
double compute_mean(int n, int *monte_carlo_array)
{
  int i;
  double temp_mean = 0.0;

  for (i = 1; i <= n; i++)
    {
      temp_mean += ((double) monte_carlo_array[i]);
    }
  temp_mean /= ((double) n);
  return ((double) temp_mean);
}

/*-----------------------------*/
double compute_std(int n, int *monte_carlo_array, int mean)
{
  int i; 
  double temp_stdev = 0.0;

  for (i = 1; i <= n; i++)
    {
      temp_stdev += pow((double) monte_carlo_array[i] - mean, 2.0);
    }
  temp_stdev /= ((double) n);
  return((double) sqrt(temp_stdev));
}


/*-----------------------------*/
/*-----------------------------*/
void main(int argc, char *argv[])
{
  int Procs;                      /* Number of processors */
  int my_rank;                    /* Processor number */
  int i, j;
  int *sphere_darts;              /* Based on MC probability, it stores (0,1) 
                                    depending on whether dart thrown 
                                    lands inside the circle or outside it ... */
  double volume;
  double pi;
  double mean;
  double stand_dev;
  double temp_stdev;
  double sphere_volume[NUM_PROC];      /* volume computed for all procs. */
  double stand_dev_array[NUM_PROC];    /* std computed for all procs. */
  double temp_sphere_radius = 0.0;
  MPI_Status status;
                                      
  MPI_Init(&argc, &argv);                   /* Activate the system for MPI. */

  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);  /* Get my process rank. */

  MPI_Comm_size(MPI_COMM_WORLD, &Procs);    /* Find out how many
                                               processes are being used. */

  srand48 ((long) my_rank);                 /* Initialize the
                                               generator. */
                                            /* Dynamic allocation for
                                                     the darts array. */
  sphere_darts =
    (int *) malloc((per_processor_tries + 1) * sizeof(int));

/*** Step [1]: Compute a single point per try for each dimension ***/

  for(i=1; i <= per_processor_tries; i++)
    {
      temp_sphere_radius = 0.0;
      for(j=1; j <= sphere_dim; j++)
        {
          temp_sphere_radius += pow(drand48(), 2.0);
        }
      if(temp_sphere_radius <= 1.0)
        {
          sphere_darts[i] = 1;
        }
      else
        {
          sphere_darts[i] = 0;
        }
    }

/*** Step [2]: Compute the mean. ***/
  mean = 
    (double) compute_mean(per_processor_tries, sphere_darts);

/*** Step [3]: Compute the sphere's volume. ***/
  volume = 
    (double) mean * pow(2.0, sphere_dim);

/*** Step [4]: Compute the standard deviation. ***/
  stand_dev = 
    (double) compute_std(per_processor_tries, sphere_darts, mean);


/*** Step [5]: Send/Receive global data ***/
/*** Processor (0) acts as to coordinate results/outputs 
     coming from other processors.      ***/

  if(my_rank == 0)
    {
      sphere_volume[0] = volume;
      stand_dev_array[0] = stand_dev;
      for(i=1; i < Procs; i++)
       {
         MPI_Recv(&(sphere_volume[i]),1,MPI_DOUBLE,i,0,MPI_COMM_WORLD,&status);
         MPI_Recv(&(stand_dev_array[i]),1,MPI_DOUBLE,i,0,MPI_COMM_WORLD,&status);

         printf("In processor: %d  sphere volume: %25.16e \n",i,sphere_volume[i]);
       }
   }
   else
     {
       MPI_Send(&volume,1,MPI_DOUBLE,0,0,MPI_COMM_WORLD);
       MPI_Send(&stand_dev,1,MPI_DOUBLE,0,0,MPI_COMM_WORLD);
     }

/**---[6]-----
  Processor (0) adds up the overall results sent from other processors....
  Get the final totals to be printed.... 
 ----------**/

  if(my_rank == 0)
    {
      temp_stdev = 0.0;
      volume = 0.0;
      for(i=0; i < Procs; i++)
        {
          volume += sphere_volume[i];
          temp_stdev += stand_dev_array[i];
        }
      volume /= ((double) Procs);
      stand_dev = (double) temp_stdev /((double) Procs);
      printf("======================Output======================\n");
      printf("Final values averaged over all the nodes: \n");
      printf("Volume of sphere of dimension %d  is  %25.16e \n",sphere_dim, volume);
      printf("Standard dev. is %25.16e \n", stand_dev);
      printf("Total number of points is %d \n", 4*per_processor_tries);
      if(sphere_dim == 2)
        printf("In dimension 2, Volume of the Sphere = Pi = %25.16e \n", volume);
      printf("==================================================\n");
    }
  MPI_Finalize();
}
\end{verbatim}

\section{Output and Some Analysis}
\subsection{On the IBM SP2 at NPAC}

The program was run on 5 and 6 processors of the SP2 (on node smerlin8).
\begin{itemize}
\item Number of processors = 5, d = 1, and number of tries throwing the dart
per each processor = 1000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    2.0000000000000000e+00 
In processor: 2  sphere volume:    2.0000000000000000e+00 
In processor: 3  sphere volume:    2.0000000000000000e+00 
In processor: 4  sphere volume:    2.0000000000000000e+00 
======================Output======================
Final values averaged over all the nodes:
Volume of sphere of dimension 1  =    2.0000000000000000e+00 
Standard dev. =    0.0000000000000000e+00 
Total number of points = 4000000 
==================================================
\end{verbatim}

\item Number of processors = 5, d = 2, and number of tries throwing the dart
per each processor = 1000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1411440000000002e+00 
In processor: 2  sphere volume:    3.1398839999999999e+00 
In processor: 3  sphere volume:    3.1394160000000002e+00 
In processor: 4  sphere volume:    3.1431320000000000e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1411000000000002e+00 
Standard dev. =    8.8615741473554410e-01 
Total number of points = 4000000 
In dimension 2, Volume of the Sphere = Pi =    3.1411000000000002e+00 
==================================================
\end{verbatim}

\item Number of processors = 5, d = 7, and number of tries throwing the dart
per each processor = 1000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    4.7267840000000003e+00 
In processor: 2  sphere volume:    4.7116800000000003e+00 
In processor: 3  sphere volume:    4.7279359999999997e+00 
In processor: 4  sphere volume:    4.7183359999999999e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 7  =     4.7131648000000004e+00 
Standard dev. =    1.9188923531217861e-01 
Total number of points = 4000000 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 1, and number of tries throwing the dart
per each processor = 1000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    2.0000000000000000e+00 
In processor: 2  sphere volume:    2.0000000000000000e+00 
In processor: 3  sphere volume:    2.0000000000000000e+00 
In processor: 4  sphere volume:    2.0000000000000000e+00 
In processor: 5  sphere volume:    2.0000000000000000e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 1  =     2.0000000000000000e+00 
Standard dev. =    0.0000000000000000e+00 
Total number of points = 4000000 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 2, and number of tries throwing the dart
per each processor = 1000000. The result:
\begin{verbatim}
In processor: 1  sphere volume:    3.1411440000000002e+00 
In processor: 2  sphere volume:    3.1398839999999999e+00 
In processor: 3  sphere volume:    3.1394160000000002e+00 
In processor: 4  sphere volume:    3.1431320000000000e+00 
In processor: 5  sphere volume:    3.1390280000000002e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1407546666666666e+00 
Standard dev. =    8.8610869792726266e-01 
Total number of points = 4000000 
In dimension 2, Volume of the Sphere = Pi =    3.1407546666666666e+00 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 2, and number of tries throwing the dart
per each processor = 2000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1406459999999998e+00 
In processor: 2  sphere volume:    3.1398180000000000e+00 
In processor: 3  sphere volume:    3.1404239999999999e+00 
In processor: 4  sphere volume:    3.1417660000000001e+00 
In processor: 5  sphere volume:    3.1406220000000000e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1407073333333333e+00 
Standard dev. =    8.8610204066175047e-01 
Total number of points = 8000000 
In dimension 2, Volume of the Sphere = Pi =    3.1407073333333333e+00 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 2, and number of tries throwing the dart
per each processor = 125000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1407680000000000e+00 
In processor: 2  sphere volume:    3.1335039999999998e+00 
In processor: 3  sphere volume:    3.1397119999999998e+00 
In processor: 4  sphere volume:    3.1435520000000001e+00 
In processor: 5  sphere volume:    3.1393439999999999e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1391253333333329e+00 
Standard dev. =    8.8587874336042460e-01 
Total number of points = 1000000 
In dimension 2, Volume of the Sphere = Pi =    3.1391253333333329e+00 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 2, and number of tries throwing the dart
per each processor = 5000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1411951999999999e+00 
In processor: 2  sphere volume:    3.1404776000000001e+00 
In processor: 3  sphere volume:    3.1416480000000000e+00 
In processor: 4  sphere volume:    3.1414152000000000e+00 
In processor: 5  sphere volume:    3.1407568000000001e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1410263999999999e+00 
Standard dev. =    8.8614705125688842e-01 
Total number of points = 20000000 
In dimension 2, Volume of the Sphere = Pi =    3.1410263999999999e+00 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 2, and number of tries throwing the dart
per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1415256000000000e+00 
In processor: 2  sphere volume:    3.1416418666666668e+00 
In processor: 3  sphere volume:    3.1417400000000000e+00 
In processor: 4  sphere volume:    3.1417970666666668e+00 
In processor: 5  sphere volume:    3.1412760000000000e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 2  =     3.1416205333333340e+00 
In dimension 2, Volume of the Sphere = Pi =    3.1416205333333340e+00 
Standard dev. =    8.8623085745658214e-01 
Total number of points = 60000000 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 3, and number of tries throwing the dart
per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    4.1895882666666671e+00 
In processor: 2  sphere volume:    4.1881754666666664e+00 
In processor: 3  sphere volume:    4.1893680000000000e+00 
In processor: 4  sphere volume:    4.1884314666666667e+00 
In processor: 5  sphere volume:    4.1894895999999999e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 3  =     4.1889440000000002e+00 
Standard dev. =    7.2361453667788045e-01 
Total number of points = 60000000 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 4, and number of tries throwing the dart
per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    4.9361525333333329e+00 
In processor: 2  sphere volume:    4.9358111999999998e+00 
In processor: 3  sphere volume:    4.9372469333333333e+00 
In processor: 4  sphere volume:    4.9339968000000001e+00 
In processor: 5  sphere volume:    4.9351776000000003e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 4  =     4.9352831999999998e+00 
Standard dev. =    5.5538742738227653e-01 
Total number of points = 60000000 
==================================================
\end{verbatim}

\item Number of processors = 6, d = 5, and number of tries throwing the dart
per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    5.2669461333333336e+00 
In processor: 2  sphere volume:    5.2643178666666666e+00 
In processor: 3  sphere volume:    5.2696256000000004e+00 
In processor: 4  sphere volume:    5.2649280000000003e+00 
In processor: 5  sphere volume:    5.2634026666666669e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 5  =     5.2649898666666672e+00 
Standard dev. =    4.0562411396017578e-01 
Total number of points = 60000000 
==================================================
\end{verbatim}

\item For number of processors = 6, d = 10, and number of tries 
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    2.5612970666666666e+00 
In processor: 2  sphere volume:    2.5308501333333333e+00 
In processor: 3  sphere volume:    2.5466197333333334e+00 
In processor: 4  sphere volume:    2.5597269333333332e+00 
In processor: 5  sphere volume:    2.5714687999999999e+00 
======================Output======================
Final values averaged over all the nodes: 
Volume of sphere of dimension 10  =     2.5534691555555553e+00 
Standard dev. =    4.9936023394631844e-02 
Total number of points = 60000000 
==================================================
\end{verbatim}
\end{itemize}

\subsection{On the IBM SP2 at Cornell}

\begin{itemize}
\item For number of processors = 99, d = 2, and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1415256000000000e+00 
In processor: 2  sphere volume:    3.1416418666666668e+00 
In processor: 3  sphere volume:    3.1417400000000000e+00 
In processor: 4  sphere volume:    3.1417970666666668e+00 
In processor: 5  sphere volume:    3.1412760000000000e+00 
In processor: 6  sphere volume:    3.1408645333333332e+00 
In processor: 7  sphere volume:    3.1423858666666669e+00 
In processor: 8  sphere volume:    3.1413562666666666e+00 
In processor: 9  sphere volume:    3.1417328000000002e+00 
In processor: 10  sphere volume:    3.1416514666666666e+00 
In processor: 11  sphere volume:    3.1421445333333335e+00 
In processor: 12  sphere volume:    3.1411626666666668e+00 
In processor: 13  sphere volume:    3.1415314666666667e+00 
In processor: 14  sphere volume:    3.1415069333333334e+00 
In processor: 15  sphere volume:    3.1416928000000000e+00 
In processor: 16  sphere volume:    3.1422088000000001e+00 
In processor: 17  sphere volume:    3.1416285333333334e+00 
In processor: 18  sphere volume:    3.1413362666666669e+00 
In processor: 19  sphere volume:    3.1416802666666666e+00 
In processor: 20  sphere volume:    3.1412365333333332e+00 
In processor: 21  sphere volume:    3.1427573333333334e+00 
In processor: 22  sphere volume:    3.1419306666666666e+00 
In processor: 23  sphere volume:    3.1419778666666667e+00 
In processor: 24  sphere volume:    3.1424242666666666e+00 
In processor: 25  sphere volume:    3.1413288000000001e+00 
In processor: 26  sphere volume:    3.1419272000000000e+00 
In processor: 27  sphere volume:    3.1419472000000002e+00 
In processor: 28  sphere volume:    3.1416909333333334e+00 
In processor: 29  sphere volume:    3.1418285333333333e+00 
In processor: 30  sphere volume:    3.1412749333333334e+00 
In processor: 31  sphere volume:    3.1415058666666669e+00 
In processor: 32  sphere volume:    3.1422290666666668e+00 
In processor: 33  sphere volume:    3.1417304000000001e+00 
In processor: 34  sphere volume:    3.1414701333333332e+00 
In processor: 35  sphere volume:    3.1415237333333335e+00 
In processor: 36  sphere volume:    3.1422141333333333e+00 
In processor: 37  sphere volume:    3.1416458666666665e+00 
In processor: 38  sphere volume:    3.1408664000000002e+00 
In processor: 39  sphere volume:    3.1419906666666666e+00 
In processor: 40  sphere volume:    3.1419010666666667e+00 
In processor: 41  sphere volume:    3.1410634666666666e+00 
In processor: 42  sphere volume:    3.1415189333333333e+00 
In processor: 43  sphere volume:    3.1420866666666667e+00 
In processor: 44  sphere volume:    3.1416911999999999e+00 
In processor: 45  sphere volume:    3.1412064000000002e+00 
In processor: 46  sphere volume:    3.1416797333333335e+00 
In processor: 47  sphere volume:    3.1413327999999998e+00 
In processor: 48  sphere volume:    3.1420016000000000e+00 
In processor: 49  sphere volume:    3.1416405333333333e+00 
In processor: 50  sphere volume:    3.1413133333333332e+00 
In processor: 51  sphere volume:    3.1420557333333332e+00 
In processor: 52  sphere volume:    3.1421077333333334e+00 
In processor: 53  sphere volume:    3.1419248000000000e+00 
In processor: 54  sphere volume:    3.1427527999999998e+00 
In processor: 55  sphere volume:    3.1417975999999999e+00 
In processor: 56  sphere volume:    3.1418314666666665e+00 
In processor: 57  sphere volume:    3.1415951999999998e+00 
In processor: 58  sphere volume:    3.1408834666666667e+00 
In processor: 59  sphere volume:    3.1416882666666668e+00 
In processor: 60  sphere volume:    3.1418208000000001e+00 
In processor: 61  sphere volume:    3.1413810666666668e+00 
In processor: 62  sphere volume:    3.1411482666666668e+00 
In processor: 63  sphere volume:    3.1415101333333335e+00 
In processor: 64  sphere volume:    3.1414149333333334e+00 
In processor: 65  sphere volume:    3.1417359999999999e+00 
In processor: 66  sphere volume:    3.1417373333333334e+00 
In processor: 67  sphere volume:    3.1420295999999999e+00 
In processor: 68  sphere volume:    3.1417114666666666e+00 
In processor: 69  sphere volume:    3.1419965333333333e+00 
In processor: 70  sphere volume:    3.1409448000000002e+00 
In processor: 71  sphere volume:    3.1412682666666667e+00 
In processor: 72  sphere volume:    3.1413309333333332e+00 
In processor: 73  sphere volume:    3.1407919999999998e+00 
In processor: 74  sphere volume:    3.1403986666666666e+00 
In processor: 75  sphere volume:    3.1408970666666667e+00 
In processor: 76  sphere volume:    3.1400815999999998e+00 
In processor: 77  sphere volume:    3.1410554666666668e+00 
In processor: 78  sphere volume:    3.1420488000000000e+00 
In processor: 79  sphere volume:    3.1423095999999999e+00 
In processor: 80  sphere volume:    3.1412666666666667e+00 
In processor: 81  sphere volume:    3.1418354666666666e+00 
In processor: 82  sphere volume:    3.1418133333333333e+00 
In processor: 83  sphere volume:    3.1412362666666667e+00 
In processor: 84  sphere volume:    3.1410485333333331e+00 
In processor: 85  sphere volume:    3.1416599999999999e+00 
In processor: 86  sphere volume:    3.1415616000000002e+00 
In processor: 87  sphere volume:    3.1419320000000002e+00 
In processor: 88  sphere volume:    3.1417890666666666e+00 
In processor: 89  sphere volume:    3.1411170666666668e+00 
In processor: 90  sphere volume:    3.1412925333333335e+00 
In processor: 91  sphere volume:    3.1417799999999998e+00 
In processor: 92  sphere volume:    3.1412674666666667e+00 
In processor: 93  sphere volume:    3.1417717333333335e+00 
In processor: 94  sphere volume:    3.1416143999999999e+00 
In processor: 95  sphere volume:    3.1416045333333331e+00 
In processor: 96  sphere volume:    3.1416800000000000e+00 
In processor: 97  sphere volume:    3.1417269333333335e+00 
In processor: 98  sphere volume:    3.1413749333333332e+00 
In processor: 99  sphere volume:    3.1418970666666666e+00 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 2  =     3.1416106266666679e+00 
Standard dev. =    8.8622945836246425e-01 
Total number of points = 60000000 
In dimension 2, Volume of the Sphere = Pi =    3.1416106266666679e+00 
===================================================
\end{verbatim}

\item For number of processors = 199, d = 2, and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1413013333333333e+00 
In processor: 2  sphere volume:    3.1397520000000001e+00 
In processor: 3  sphere volume:    3.1396853333333334e+00 
In processor: 4  sphere volume:    3.1417253333333335e+00 
In processor: 5  sphere volume:    3.1406693333333333e+00 
In processor: 6  sphere volume:    3.1422666666666665e+00 
In processor: 7  sphere volume:    3.1436773333333332e+00 
In processor: 8  sphere volume:    3.1428186666666669e+00 
In processor: 9  sphere volume:    3.1401279999999998e+00 
In processor: 10  sphere volume:    3.1373333333333333e+00 
In processor: 11  sphere volume:    3.1418453333333334e+00 
In processor: 12  sphere volume:    3.1415866666666665e+00 
In processor: 13  sphere volume:    3.1431040000000001e+00 
In processor: 14  sphere volume:    3.1415999999999999e+00 
In processor: 15  sphere volume:    3.1408320000000001e+00 
In processor: 16  sphere volume:    3.1421946666666667e+00 
In processor: 17  sphere volume:    3.1392213333333334e+00 
In processor: 18  sphere volume:    3.1413333333333333e+00 
In processor: 19  sphere volume:    3.1446853333333333e+00 
In processor: 20  sphere volume:    3.1395573333333333e+00 
In processor: 21  sphere volume:    3.1425679999999998e+00 
In processor: 22  sphere volume:    3.1425626666666666e+00 
In processor: 23  sphere volume:    3.1415013333333333e+00 
In processor: 24  sphere volume:    3.1421573333333335e+00 
In processor: 25  sphere volume:    3.1423626666666666e+00 
In processor: 26  sphere volume:    3.1413840000000000e+00 
In processor: 27  sphere volume:    3.1399733333333333e+00 
In processor: 28  sphere volume:    3.1415146666666667e+00 
In processor: 29  sphere volume:    3.1410586666666669e+00 
In processor: 30  sphere volume:    3.1434613333333332e+00 
In processor: 31  sphere volume:    3.1398986666666668e+00 
In processor: 32  sphere volume:    3.1429066666666667e+00 
In processor: 33  sphere volume:    3.1432533333333335e+00 
In processor: 34  sphere volume:    3.1428053333333335e+00 
In processor: 35  sphere volume:    3.1431146666666665e+00 
In processor: 36  sphere volume:    3.1404079999999999e+00 
In processor: 37  sphere volume:    3.1415120000000001e+00 
In processor: 38  sphere volume:    3.1392000000000002e+00 
In processor: 39  sphere volume:    3.1413120000000001e+00 
In processor: 40  sphere volume:    3.1408133333333335e+00 
In processor: 41  sphere volume:    3.1426266666666667e+00 
In processor: 42  sphere volume:    3.1430159999999998e+00 
In processor: 43  sphere volume:    3.1436506666666668e+00 
In processor: 44  sphere volume:    3.1403360000000000e+00 
In processor: 45  sphere volume:    3.1424720000000002e+00 
In processor: 46  sphere volume:    3.1406506666666667e+00 
In processor: 47  sphere volume:    3.1434160000000002e+00 
In processor: 48  sphere volume:    3.1443040000000000e+00 
In processor: 49  sphere volume:    3.1415120000000001e+00 
In processor: 50  sphere volume:    3.1418346666666666e+00 
In processor: 51  sphere volume:    3.1396106666666665e+00 
In processor: 52  sphere volume:    3.1416879999999998e+00 
In processor: 53  sphere volume:    3.1419626666666667e+00 
In processor: 54  sphere volume:    3.1425440000000000e+00 
In processor: 55  sphere volume:    3.1420080000000001e+00 
In processor: 56  sphere volume:    3.1429066666666667e+00 
In processor: 57  sphere volume:    3.1419493333333333e+00 
In processor: 58  sphere volume:    3.1377920000000001e+00 
In processor: 59  sphere volume:    3.1405573333333332e+00 
In processor: 60  sphere volume:    3.1407866666666666e+00 
In processor: 61  sphere volume:    3.1417519999999999e+00 
In processor: 62  sphere volume:    3.1425413333333334e+00 
In processor: 63  sphere volume:    3.1405493333333334e+00 
In processor: 64  sphere volume:    3.1402586666666665e+00 
In processor: 65  sphere volume:    3.1448559999999999e+00 
In processor: 66  sphere volume:    3.1398186666666668e+00 
In processor: 67  sphere volume:    3.1415039999999999e+00 
In processor: 68  sphere volume:    3.1428080000000000e+00 
In processor: 69  sphere volume:    3.1426880000000001e+00 
In processor: 70  sphere volume:    3.1388186666666669e+00 
In processor: 71  sphere volume:    3.1425066666666668e+00 
In processor: 72  sphere volume:    3.1410986666666667e+00 
In processor: 73  sphere volume:    3.1422800000000000e+00 
In processor: 74  sphere volume:    3.1406426666666665e+00 
In processor: 75  sphere volume:    3.1420266666666667e+00 
In processor: 76  sphere volume:    3.1398746666666666e+00 
In processor: 77  sphere volume:    3.1401146666666668e+00 
In processor: 78  sphere volume:    3.1402960000000002e+00 
In processor: 79  sphere volume:    3.1444186666666667e+00 
In processor: 80  sphere volume:    3.1431306666666665e+00 
In processor: 81  sphere volume:    3.1421519999999998e+00 
In processor: 82  sphere volume:    3.1395680000000001e+00 
In processor: 83  sphere volume:    3.1415706666666665e+00 
In processor: 84  sphere volume:    3.1403253333333332e+00 
In processor: 85  sphere volume:    3.1397653333333335e+00 
In processor: 86  sphere volume:    3.1428240000000001e+00 
In processor: 87  sphere volume:    3.1406186666666667e+00 
In processor: 88  sphere volume:    3.1428639999999999e+00 
In processor: 89  sphere volume:    3.1413039999999999e+00 
In processor: 90  sphere volume:    3.1446426666666665e+00 
In processor: 91  sphere volume:    3.1397759999999999e+00 
In processor: 92  sphere volume:    3.1416559999999998e+00 
In processor: 93  sphere volume:    3.1407600000000002e+00 
In processor: 94  sphere volume:    3.1422880000000002e+00 
In processor: 95  sphere volume:    3.1404133333333335e+00 
In processor: 96  sphere volume:    3.1404933333333331e+00 
In processor: 97  sphere volume:    3.1424586666666667e+00 
In processor: 98  sphere volume:    3.1428053333333335e+00 
In processor: 99  sphere volume:    3.1424986666666666e+00 
In processor: 100  sphere volume:    3.1447120000000002e+00 
In processor: 101  sphere volume:    3.1429893333333334e+00 
In processor: 102  sphere volume:    3.1412533333333332e+00 
In processor: 103  sphere volume:    3.1406693333333333e+00 
In processor: 104  sphere volume:    3.1450453333333335e+00 
In processor: 105  sphere volume:    3.1418826666666666e+00 
In processor: 106  sphere volume:    3.1394266666666666e+00 
In processor: 107  sphere volume:    3.1408266666666669e+00 
In processor: 108  sphere volume:    3.1398799999999998e+00 
In processor: 109  sphere volume:    3.1403546666666666e+00 
In processor: 110  sphere volume:    3.1419893333333335e+00 
In processor: 111  sphere volume:    3.1419146666666666e+00 
In processor: 112  sphere volume:    3.1409786666666668e+00 
In processor: 113  sphere volume:    3.1415813333333333e+00 
In processor: 114  sphere volume:    3.1420800000000000e+00 
In processor: 115  sphere volume:    3.1378720000000002e+00 
In processor: 116  sphere volume:    3.1406586666666665e+00 
In processor: 117  sphere volume:    3.1413146666666667e+00 
In processor: 118  sphere volume:    3.1424453333333333e+00 
In processor: 119  sphere volume:    3.1423706666666669e+00 
In processor: 120  sphere volume:    3.1400746666666666e+00 
In processor: 121  sphere volume:    3.1416773333333334e+00 
In processor: 122  sphere volume:    3.1406453333333335e+00 
In processor: 123  sphere volume:    3.1398933333333332e+00 
In processor: 124  sphere volume:    3.1397626666666665e+00 
In processor: 125  sphere volume:    3.1435439999999999e+00 
In processor: 126  sphere volume:    3.1423120000000000e+00 
In processor: 127  sphere volume:    3.1391173333333335e+00 
In processor: 128  sphere volume:    3.1429173333333331e+00 
In processor: 129  sphere volume:    3.1433680000000002e+00 
In processor: 130  sphere volume:    3.1421706666666664e+00 
In processor: 131  sphere volume:    3.1399919999999999e+00 
In processor: 132  sphere volume:    3.1410506666666667e+00 
In processor: 133  sphere volume:    3.1415920000000002e+00 
In processor: 134  sphere volume:    3.1438693333333334e+00 
In processor: 135  sphere volume:    3.1403386666666666e+00 
In processor: 136  sphere volume:    3.1405146666666668e+00 
In processor: 137  sphere volume:    3.1408053333333332e+00 
In processor: 138  sphere volume:    3.1431840000000002e+00 
In processor: 139  sphere volume:    3.1414640000000000e+00 
In processor: 140  sphere volume:    3.1412826666666667e+00 
In processor: 141  sphere volume:    3.1425973333333332e+00 
In processor: 142  sphere volume:    3.1394213333333334e+00 
In processor: 143  sphere volume:    3.1414986666666667e+00 
In processor: 144  sphere volume:    3.1415813333333333e+00 
In processor: 145  sphere volume:    3.1410586666666669e+00 
In processor: 146  sphere volume:    3.1413333333333333e+00 
In processor: 147  sphere volume:    3.1395520000000001e+00 
In processor: 148  sphere volume:    3.1416773333333334e+00 
In processor: 149  sphere volume:    3.1443759999999998e+00 
In processor: 150  sphere volume:    3.1409573333333332e+00 
In processor: 151  sphere volume:    3.1406000000000001e+00 
In processor: 152  sphere volume:    3.1415546666666665e+00 
In processor: 153  sphere volume:    3.1412906666666665e+00 
In processor: 154  sphere volume:    3.1411973333333334e+00 
In processor: 155  sphere volume:    3.1404213333333333e+00 
In processor: 156  sphere volume:    3.1438613333333332e+00 
In processor: 157  sphere volume:    3.1426880000000001e+00 
In processor: 158  sphere volume:    3.1418453333333334e+00 
In processor: 159  sphere volume:    3.1420720000000002e+00 
In processor: 160  sphere volume:    3.1404320000000001e+00 
In processor: 161  sphere volume:    3.1422746666666668e+00 
In processor: 162  sphere volume:    3.1409146666666667e+00 
In processor: 163  sphere volume:    3.1448293333333335e+00 
In processor: 164  sphere volume:    3.1400986666666668e+00 
In processor: 165  sphere volume:    3.1440586666666666e+00 
In processor: 166  sphere volume:    3.1424693333333331e+00 
In processor: 167  sphere volume:    3.1411760000000002e+00 
In processor: 168  sphere volume:    3.1412586666666669e+00 
In processor: 169  sphere volume:    3.1409973333333334e+00 
In processor: 170  sphere volume:    3.1415866666666665e+00 
In processor: 171  sphere volume:    3.1394426666666666e+00 
In processor: 172  sphere volume:    3.1419146666666666e+00 
In processor: 173  sphere volume:    3.1417253333333335e+00 
In processor: 174  sphere volume:    3.1441759999999999e+00 
In processor: 175  sphere volume:    3.1406559999999999e+00 
In processor: 176  sphere volume:    3.1415120000000001e+00 
In processor: 177  sphere volume:    3.1402986666666668e+00 
In processor: 178  sphere volume:    3.1409813333333334e+00 
In processor: 179  sphere volume:    3.1415066666666664e+00 
In processor: 180  sphere volume:    3.1413359999999999e+00 
In processor: 181  sphere volume:    3.1408213333333332e+00 
In processor: 182  sphere volume:    3.1417733333333335e+00 
In processor: 183  sphere volume:    3.1427360000000002e+00 
In processor: 184  sphere volume:    3.1422853333333332e+00 
In processor: 185  sphere volume:    3.1405706666666666e+00 
In processor: 186  sphere volume:    3.1429146666666665e+00 
In processor: 187  sphere volume:    3.1413280000000001e+00 
In processor: 188  sphere volume:    3.1434906666666667e+00 
In processor: 189  sphere volume:    3.1411893333333332e+00 
In processor: 190  sphere volume:    3.1401279999999998e+00 
In processor: 191  sphere volume:    3.1435786666666665e+00 
In processor: 192  sphere volume:    3.1400826666666668e+00 
In processor: 193  sphere volume:    3.1415039999999999e+00 
In processor: 194  sphere volume:    3.1415999999999999e+00 
In processor: 195  sphere volume:    3.1420400000000002e+00 
In processor: 196  sphere volume:    3.1418159999999999e+00 
In processor: 197  sphere volume:    3.1431546666666668e+00 
In processor: 198  sphere volume:    3.1422240000000001e+00 
In processor: 199  sphere volume:    3.1425733333333334e+00 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 2  =     3.1415759066666684e+00 
Standard dev. =    8.8622454157659336e-01 
Total number of points = 6000000 
In dimension 2, Volume of the Sphere = Pi =   3.1415759066666684e+00 
==================================================
\end{verbatim}
\item For number of processors = 15, d = 2,  and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    3.1413013333333333e+00 
In processor: 2  sphere volume:    3.1397520000000001e+00 
In processor: 3  sphere volume:    3.1396853333333334e+00 
In processor: 4  sphere volume:    3.1417253333333335e+00 
In processor: 5  sphere volume:    3.1406693333333333e+00 
In processor: 6  sphere volume:    3.1422666666666665e+00 
In processor: 7  sphere volume:    3.1436773333333332e+00 
In processor: 8  sphere volume:    3.1428186666666669e+00 
In processor: 9  sphere volume:    3.1401279999999998e+00 
In processor: 10  sphere volume:    3.1373333333333333e+00 
In processor: 11  sphere volume:    3.1418453333333334e+00 
In processor: 12  sphere volume:    3.1415866666666665e+00 
In processor: 13  sphere volume:    3.1431040000000001e+00 
In processor: 13  sphere volume:    3.1431040000000001e+00 
In processor: 14  sphere volume:    3.1415999999999999e+00 
In processor: 15  sphere volume:    3.1408320000000001e+00 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 2  =     3.1411980000000002e+00 
Standard dev. =    8.8617123388282970e-01 
Total number of points = 6000000 
In dimension 2, Volume of the Sphere = Pi =   3.1411980000000002e+00 
==================================================
\end{verbatim}
\end{itemize}

\subsection{On the DEC Alphafarm at NPAC}

\begin{itemize}
\item For number of processors = 6, d = 10, and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    5.9425757376346609e-15 
In processor: 2  sphere volume:   6.5412564949452123e-171 
In processor: 3  sphere volume:    2.2273740004984490e-71 
In processor: 4  sphere volume:    9.9486068699108852e-20 
In processor: 5  sphere volume:   8.9898882728044620e-192 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 10 =     9.9044587061722677e-16 
Standard dev. =    4.9768857535395401e-02 
Total number of points = 6000000 
==================================================
\end{verbatim}

\item For number of processors = 8, d = 10, and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    5.9425757376346609e-15 
In processor: 2  sphere volume:   6.5412564949452123e-171 
In processor: 3  sphere volume:    2.2273740004984490e-71 
In processor: 4  sphere volume:    9.9486068699108852e-20 
In processor: 5  sphere volume:   8.9898882728044620e-192 
In processor: 6  sphere volume:    2.0122109172643826e-79 
In processor: 7  sphere volume:    1.0164258037417514e-24 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 10  =     7.4283440308997327e-16 
Standard dev. =    4.9899811519611537e-02 
Total number of points is 6000000 
==================================================
\end{verbatim}

\item For number of processors = 4, d = 10, and number of tries
throwing the dart per each processor = 15000000. The result:

\begin{verbatim}
In processor: 1  sphere volume:    5.9425757376346609e-15 
In processor: 2  sphere volume:   6.5412564949452123e-171 
In processor: 3  sphere volume:    2.2273740004984490e-71 
======================Output======================
The overal final values averaged over all processors: 
Volume of sphere of dimension 10  =     1.4856439344086652e-15 
Standard dev. =    4.9808855902648087e-02 
Total number of points = 6000000 
==================================================
\end{verbatim}
\end{itemize}

Keeping the number of processors and number of tries per processor
fixed, as we increase the dimension of the sphere, its volume
increases as well while the standard deviation decreases. We also
observe that as we keep increasing the dimension, the volume reverses
direction and start to decrease as shown above when using dimension (d
$= 10$). Unlike the volume, the standard deviation seems always to
decrease as we increase the dimension.

\end{document}
