Basic HTML version of Foils prepared 19 September 98

Foil 53 Example C: Computing Pi

From MPI Message Passing Interface Computational Science for Simulations -- Fall Semester 1998. by Geoffrey C. Fox, Nancy McCracken


#include "mpi.h"
#include <math.h>
int main (argc, argv)
int argc; char *argv[];
{
int n, myid, numprocs, i, rc;
double PI25DT = 3.14159265358979323842643;
double mypi, pi, h, sum, x, a;
MPI_Init(&argc, &argv);
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank (MPI_COMM_WORLD, &myid);



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 11 1999