Basic HTML version of Foils prepared 19 September 98

Foil 38 Hello World:C Example of Send and Receive

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


1 # All processes execute this program
2 #include "mpi.h"
3 main( int argc, char **argv )
4 {
  • char message[20];
  • int i, rank, size, tag=137; # Any value of tag allowed
  • MPI_Status status;
  • MPI_Init (&argc, &argv);
  • MPI_Comm_size(MPI_COMM_WORLD, &size) # Number of Processes
  • MPI_Comm_rank(MPI_COMM_WORLD, &rank); # Who is this process

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