Cornell Theory Center

MPI Example Programs: Calculating pi


Table of Contents


Quick Summary

There are two example programs for calculating pi:


Description of Problem


Parallel Implementation


Instructions for Compiling and Running dboard_pi

  1. Copy the needed files to your working directory. You may copy the files from within your browser, or use the cp command. Some browsers add or replace characters when files are copied.

    Tutorial directory: /usr/local/doc/www/Edu/Tutor/MPI/Templates/pi/dboard/

    Files:

  2. Compile using the make file:

    For Fortran:


    For C:

  3. Specify how many nodes to run on (choose n <= 4):

  4. Execute the master program:


Instructions for Compiling and Running int_pi

Before proceeding, you might want to review the talks Overview of Distributed Memory Programming, Message Passing Libraries and Compiling and Running MPI Programs.
  1. First, copy the source files to your current working directory. You may copy lab and solution files from within your browser, or use the cp command. Some browsers add or replace characters when files are copied.

    Tutorial directory: /usr/local/doc/www/Edu/Tutor/MPI/Templates/pi/int/

    Files:


  2. Compile the code:
    or, use the make file:

  3. Specify how many nodes to run on:

  4. Execute the master program:


Cleanup

Some or all of the following files will be left in your directory, and should be removed to save space:
[CTC Home Page] [Search] [Education] [Resources]
[Copyright Statement] [Feedback] [Tutorials] [IBM SP Documentation]

URL http://www.tc.cornell.edu/Edu/Tutor/MPI/Templates/pi/
updated June 12, 1996