#include #include int main(argc, argv) int argc; char **argv; { int myid, numprocs; char name[256]; int resultlen; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); if(myid==0) printf("This program is running on %d processes\n", numprocs); MPI_Get_processor_name(name, &resultlen); MPI_Barrier(MPI_COMM_WORLD); printf("From Process-%d/%d: Hello MPI world! I am running on %s \n ", myid,numprocs, name); MPI_Finalize(); return 0; }