Skip to content

A serial, a multithreaded and two parallel programs for the estimation of Pi using the Monte Carlo Method. Using matplotlib, plotted the estimated value to visualize the convergence. Parallelized using OpenMP and MPI. Currently working on MPI Cluster.

Notifications You must be signed in to change notification settings

mrigankdoshy/monte-carlo-simulation-pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Monte Carlo Simulation for Pi

Contains the following:

1. A serial approach to the estimation of Pi using the Monte Carlo Method (C++)

demo demo

2. A Multithreaded estimation of Pi based on the Monte Carlo Method (C++)

3. Using matplotlib, plots the estimated value of Pi using Monte Carlo Method (Python)

10000 Iterations demo

100000 Iterations demo

10000 Iterations Zoomed demo

4. A parallel computing version that estimates Pi using the Monte Carlo Method in OpenMP (C)

To use OpenMP

/usr/local/opt/llvm/bin/clang -fopenmp -L/usr/local/opt/llvm/lib main.c -o a

./a

demo demo

5. A parallel computing version that estimates Pi using the Monte Carlo Method in MPI (C)

To use MPI

The best performance is achieved when the number of nodes is equal to number of cores. E.g.:

$HOME/opt/usr/local/bin/mpicc -o pi ./mpi_pi.c

$HOME/opt/usr/local/bin/mpirun -np 4 ./pi

MPI

demo

MPI Reduction

demo

MPI Send & Receive

demo

About

A serial, a multithreaded and two parallel programs for the estimation of Pi using the Monte Carlo Method. Using matplotlib, plotted the estimated value to visualize the convergence. Parallelized using OpenMP and MPI. Currently working on MPI Cluster.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published