C ***************************************************************************** C FILE: poe_hello.f C DESCRIPTION: C Simple MPI program which prints a tasks hostname and rank. Used for POE C exercise. C AUTHOR: 10/98 Blaise Barney C LAST REVISED: C ************************************************************************** program hello include 'mpif.h' integer myrank, numtasks, len, ierr character(50) procname call MPI_INIT( ierr ) call MPI_COMM_RANK (MPI_COMM_WORLD, myrank, ierr) call MPI_COMM_SIZE (MPI_COMM_WORLD, numtasks, ierr) if (myrank .eq. 0) then print *, 'Total number of tasks = ', numtasks endif call MPI_GET_PROCESSOR_NAME (procname, len, ierr) write(*,*)'Hello! From task ',myrank,' on host ',procname call MPI_FINALIZE(ierr) end