#include #include #include #include /************************************************************ This is a simple hello world program. Each processor prints out it's rank and the size of the current MPI run (Total number of processors). ************************************************************/ int main(argc,argv) int argc; char *argv[]; { int myid, numprocs; FILE *f1; int i,resultlen; char myname[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); MPI_Get_processor_name(myname,&resultlen); printf("C says Hello from %4d on %s\n",myid,myname); /* printf("Numprocs is %d\n",numprocs); */ MPI_Finalize(); }