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


1 #include "mpi.h"
2 #include <math.h>
3 int main (argc, argv)
4 int argc; char *argv[];
5 {
6 int n, myid, numprocs, i, rc;
7 double PI25DT = 3.14159265358979323842643;
8 double mypi, pi, h, sum, x, a;
9
10 MPI_Init(&argc, &argv);
11 MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
12 MPI_Comm_rank (MPI_COMM_WORLD, &myid);

in Table To:


© 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