next up previous index
Next: Greetings, Master Up: Fortran Interface Previous: Fortran Interface

Hello World

gustav@sp21:../MPI 18:32:17 !622 $ cat hello-1.f
PROGRAM hello_world

  INCLUDE "mpif.h"

  INTEGER :: ierror, resultlen
  CHARACTER(len=256) :: name = " "

  CALL mpi_init(ierror)
  CALL mpi_get_processor_name(name, resultlen, ierror)
  WRITE (*,*) TRIM(name), ': hello world'
  CALL mpi_finalize(ierror)

END PROGRAM hello_world
gustav@sp21:../MPI 18:32:21 !623 $ mpxlf90 -o hello-1 hello-1.f
** hello_world   === End of Compilation 1 ===
1501-510  Compilation successful for file hello-1.f.
gustav@sp21:../MPI 18:32:49 !624 $ poe hello-1 -procs 8
 sp17.ucs.indiana.edu: hello world
 sp19.ucs.indiana.edu: hello world
 sp20.ucs.indiana.edu: hello world
 sp22.ucs.indiana.edu: hello world
 sp23.ucs.indiana.edu: hello world
 sp24.ucs.indiana.edu: hello world
 sp40.ucs.indiana.edu: hello world
 sp21.ucs.indiana.edu: hello world
gustav@sp21:../MPI 18:33:06 !625 $



Zdzislaw Meglicki
2001-02-26