next up previous contents
Next: Finding out about the Up: Getting started Previous: Compiling and linking   Contents

Running MPI programs

mpirun -np 2 hello
mpirun is not part of the standard, but some version of it is common with several MPI implementations. The version shown here is for the MPICH implementation of MPI.
Another Example (Again no messsage-passing) (hello1.c):
#include <stdio.h> 
#include <mpi.h> 
main(argc, argv) 
int argc; 
char *argv[]; 
{ 
char name[BUFSIZ]; 
int length; 
MPI_Init(&argc, &argv); 
MPI_Get_processor_name(name, &length); 
printf("%s: hello world\n", name); 
MPI_Finalize(); 
}


Cem Ozdogan 2006-12-27