include "mpiSim.f90" program main include "useSim.f90" ! process 0 sends a message to process 1, and process 1 receives it. ! testing rank limits running of code to a particular process. ! include 'mpif.h' Integer :: rank, mpierror, status(MPI_STATUS_SIZE) Real :: a(100) a = 1.0 call MPI_INIT(mpierror) ! Get the rank: call MPI_COMM_RANK(MPI_COMM_WORLD, rank, mpierror) ! Process 0 sends, process 1 receives: if( rank == 0)then call MPI_SEND( a, 100, MPI_REAL, 1, 17, MPI_COMM_WORLD, mpierror) if(mpierror /= 0) then write(*,*) "mpi_send error" stop endif else if ( rank == 1 )then call MPI_RECV( a, 100, MPI_REAL, 0, 17, MPI_COMM_WORLD, status, & mpierror ) if(mpierror /= 0) then write(*,*) "mpi_recv error" stop endif endif call MPI_FINALIZE(mpierror) END