mpiexec and interactive read
Pete Wyckoff
pw at osc.edu
Thu May 15 11:54:17 EDT 2003
bfp at purdue.edu said on Thu, 15 May 2003 10:16 -0500:
> 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.
Mpiexec tries to connect the stdin of your interactive shell, or batch
process, to MPI id #0, by default. As Troy pointed out, if you want it
to talk to all processes you need to do something special. But for your
code I think just #0 will be sufficient.
If you have not applied a patch to PBS and restarted the pbs_mom on the
node where your code is run, this stdin redirection will not work. See
patch/pbs-2.3.12-mpiexec.diff and README for instructions on how to
apply it.
If that's not the problem, I'm not so sure. Run mpiexec with a few "-v"
flags (3 is lots) to watch exactly what the stdio handler says about
the input it gets from you and about sending it to the FORTRAN job.
Hopefully you're running your test inside an interactive batch job
("qsub -I"), where your shell serves as the input to the job. Inside a
non-interactive batch job, you would have to redirect some sort of input
to the process to get it to read anything, like "echo 27 | mpiexec
mycode". This is normal.
-- Pete
More information about the mpiexec
mailing list