PROGRAM helloWorld2MPI

  INCLUDE 'mpif.h'
  ! Declare variables
  INTEGER RANK, SIZE, IERR
  
  ! Initialize MPI environment
  CALL MPI_INIT(IERR)
  ! Not checking for errors :)

  ! Get the rank
  CALL MPI_COMM_RANK(MPI_COMM_WORLD, RANK, IERR)
  ! Get the size
  CALL MPI_COMM_SIZE(MPI_COMM_WORLD, SIZE, IERR)
  ! Display the result
  PRINT *, "Processor", RANK, "of ", SIZE, & 
       "says, 'hello, world'"

  ! Finalize MPI environment
  CALL MPI_FINALIZE(IERR)
END PROGRAM helloWorld2MPI
