%% --------------------------------------------------------------  
%% (C)Copyright 2007                                               
%% International Business Machines Corporation                     
%% All Rights Reserved.                                            
%%                                                                 
%% Redistribution and use in source and binary forms, with or      
%% without modification, are permitted provided that the           
%% following conditions are met:                                   
%%                                                                 
%% - Redistributions of source code must retain the above copyright
%%   notice, this list of conditions and the following disclaimer. 
%%                                                                 
%% - Redistributions in binary form must reproduce the above       
%%   copyright notice, this list of conditions and the following   
%%   disclaimer in the documentation and/or other materials        
%%   provided with the distribution.                               
%%                                                                 
%% - Neither the name of IBM Corporation nor the names of its      
%%   contributors may be used to endorse or promote products       
%%   derived from this software without specific prior written     
%%   permission.                                                   
%%                                                                 
%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND          
%% CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,     
%% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF        
%% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE        
%% DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR            
%% CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    
%% SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT    
%% NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;    
%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)        
%% HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN       
%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR    
%% OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  
%% EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              
%% --------------------------------------------------------------  
%% PROLOG END TAG zYx                                              
This file is intended to explain the purpose of the PI code and the mechanics to run it.



Purpose: To serve as an example for using the new random number library functions. 
         The result is the calulation of PI using Monte Carlo simulations.


Mechanics: 
         The Makefile.define file selects float versus double and also selects which random number generator to use for the simulation.
         


Executable:  ppu/piMC_ppu





Files and Directories:


Makefile

Makefile.defines       : Controls single precision or double precision operations, and selects which random number generator to use to generate input
                         to the Monte Carlo simulation.

piMC.h                 : Contains control block description for data shared between PPU and SPU.

README.txt             : This file. 



ppu/
- Makefile

- piMC_ppu.c           : Sets up control block and launches SPU.





spu/
- Makefile

- calcPI_spu.c            : Reads control block data, generates random numbers, calculates PI using Monte Carlo simulatoin, updates control block, returns control to PPU.

- new_rand_functions.h    : Contains the functions _rand_minus1_to_1_d2() and _rand_0_to_1_d2()
