C *****************************************************************************
C FILE: poe_hello.f
C DESCRIPTION:
C   Simple MPI program which prints a task's hostname and rank. 
C AUTHOR: 10/98 Blaise Barney
C LAST REVISED: 06/04/06 
C **************************************************************************

      program hello
      include 'mpif.h'

      integer  myrank, numtasks, len, ierr
      character procname(MPI_MAX_PROCESSOR_NAME)

      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)

      print *, 'Hello! From task ',myrank,' on host ',procname

      call MPI_FINALIZE(ierr)
      end
