mpiexec and interactive read

Bryan Putnam bfp at purdue.edu
Thu May 15 11:16:32 EDT 2003


Hi,

I have a part of the famous "pi calculating" program below where node 0
reads some input from the terminal. If I run this program using for
example,

mpirun -np 4 -machinefile $PBS_NODEFILE prog

it runs normally, but when using

mpiexec -n 4 prog

the program doesn't appear to stop and wait at the read, and it complains
about reading the end of file.

We're using Linux RedHat 7.3 and the problem occurs when compiling with
both g77 and Portland pgf77. Any help appreciated!

Thanks,
Bryan

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 program read

      include 'mpif.h'

      double precision  mypi, pi, h, sum, x, f, a
      integer n, myid, numprocs, i, rc
      integer status(MPI_STATUS_SIZE)

      call MPI_INIT( ierr )
      call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
      call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
      print *, "Process ", myid, " of ", numprocs, " is alive"

 10   if ( myid .eq. 0 ) then
         write(6,98)
 98      format('Enter the number of intervals: (0 quits)')
         read(5,99) n
 99      format(i10)
      endif

      call MPI_FINALIZE(rc)
      stop
      end




More information about the mpiexec mailing list