Skip to content

This tutorial covers how to write a parallel program to calculate π using the Monte Carlo method with MPI and OpenMP

Notifications You must be signed in to change notification settings

olcf/Serial-to-Parallel--Monte-Carlo-Pi

Repository files navigation

Serial to Parallel: A Monte Carlo Operation

This tutorial covers how to write a parallel program to calculate π using the Monte Carlo method with MPI and OpenMP.

####Compiling and Running Before you start, you will need to edit the submit scripts (submit.pbs and mpisubmit.pbs) and the Makefile and replace with the correct project ID. Once done, you need to load the PGI programming environment

module load PrgEnv-pgi

To compile and submit the serial version, you need to run: make serial

  • For the MPI_Reduce verion: make mpi
  • For the MPI Send/Recv verion: make mpisr
  • For the OpenMP version: make omp
  • For the hybrid OpenMP/MPI version: make mpiomp

The output should look something like:

Wed Sep 18 11:02:27 EDT 2013
Pi: 3.140800
Application 3587838 resources: utime ~0s, stime ~0s, Rss ~3444, inblocks ~4534, outblocks ~11970

The tutorial from which this code is from can be found on the OLCF website at: https://www.olcf.ornl.gov/tutorials/monte-carlo-pi/

About

This tutorial covers how to write a parallel program to calculate π using the Monte Carlo method with MPI and OpenMP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published