program hello C hello world in FORTRAN implicit none include 'mpif.h' integer me, nprocs, ierr integer status(MPI_STATUS_SIZE) character msg(13) call MPI_INIT(ierr) call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr) call MPI_COMM_RANK(MPI_COMM_WORLD, me, ierr) IF (me .EQ. 0) THEN print *, 'I am master. I am sending the message.' call MPI_SEND('Hello World!', 13, MPI_CHARACTER, 1, 100, $ MPI_COMM_WORLD, ierr) ELSE print *, 'I am slave. I am receiving the message.' call MPI_RECV(msg, 13, MPI_CHARACTER, 0, 100, $ MPI_COMM_WORLD, status, ierr) print *, 'The message is: ', msg endif call MPI_FINALIZE(ierr) end