program main include 'mpif.h' integer error integer my_id integer num_procs call MPI_Init ( error ) call MPI_Comm_rank ( MPI_COMM_WORLD, my_id, error ) if ( my_id == 0 ) then call MPI_Comm_size ( MPI_COMM_WORLD, num_procs, error ) print, ' ' print, 'HELLO_WORLD - Master process:' print, ' A FORTRAN77 program using MPI.' print, ' ' print, ' The number of processes is ', num_procs print, ' ' else print, ' ' print, ' Process ', my_id, ' says "Hello, world!"' end if call MPI_Finalize ( error ) stop end