program main !*****************************************************************************80 ! !! MAIN is the main program for HELLO. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! use mpi integer error integer id integer p_num ! ! Initialize MPI. ! call MPI_Init ( error ) ! ! Get the number of processes. ! call MPI_Comm_size ( MPI_COMM_WORLD, p_num, error ) ! ! Get the individual process ID. ! call MPI_Comm_rank ( MPI_COMM_WORLD, id, error ) ! ! Only the master process prints this message. ! if ( id == 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'HELLO:' write ( *, '(a)' ) ' FORTRAN90 version' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' The number of processes is ', p_num write ( *, '(a)' ) ' ' end if ! ! Every process prints this message. ! write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Hello from process ', id ! ! Shut down MPI. ! call MPI_Finalize ( error ) stop end