program hello_world
include 'mpif.h'
integer ierr
integer myrank, size

    call MPI_INIT ( ierr )
    print *, "Hello world"

    call MPI_Comm_rank(MPI_COMM_WORLD, myrank, ierr);
    call MPI_Comm_size(MPI_COMM_WORLD, size, ierr);

    if ( myrank ==0 ) then
       print *, "Hello World! I am rank ",myrank," of ", size
    else if ( myrank ==1 ) then
       print *, "Hola! I am rank ",myrank," of ", size
    else 
       print *, " I am rank ",myrank," of ", size
    end if

call MPI_FINALIZE ( ierr )

end program hello_world
