MPI Basics
#include <stdio.h>
#include <mpi.h>
main(int argc, char *argv[])
{
int iproc, nproc;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Comm_rank(MPI_COMM_WORLD, &iproc);
printf("I am processor %d of %d\n", iproc, nproc);
MPI_Finalize();
}
Previous slide
Next slide
Back to first slide
View graphic version