LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Carlo Carloni Calame (carlo.carloni.calame_at_[hidden])
Date: 2004-10-05 04:29:44


Dear Pierre,

yes, I think it's a lam-mpi 7.1 (and 7.1.1) problem. With previous
versions, redirection worked fine. As you suggest, I'll try with a
simple C code...

               Carlo

On Tue, 2004-10-05 at 10:51, Pierre Valiron wrote:
> Dear Carlo,
>
> I see nothing wrong in your your not-so-silly code.
>
> I tried it on my pc (LAM 7.0.4 + Intel Fortran) and redirection works
> nicely (as it should). I added
> write(6,*) a
> before the MPI_finalize and I get:
>
> $ mpirun -np 2 a.out < 1.dat
> 0.00000000000000D+000 (unitialized for proc 1)
> 3.00000000000000 (correct for proc 0)
>
> while 1.dat contains the number 3.
>
> The obvious conclusion is that the input redirect is broken on lam 7.1.1,
> at least for Forttran users.
>
> May be a similar test should be carried on in C (I am too old to learn
> this strange language) to get a further hint about the problem.
>
> Pierre.
>
>
>
> On Tue, 5 Oct 2004, Carlo Carloni Calame wrote:
>
> > Dear lam-mpi users and developers,
> >
> > I have some problems when running a program with mpirun and reading
> > standard input from a file. If I compile the following silly fortran
> > code
> >
> > program read_variable
> > implicit double precision (a-h,o-z)
> > include 'mpif.h'
> >
> > call MPI_init(ie)
> > call MPI_comm_rank(MPI_COMM_WORLD,myid,ie)
> >
> > if (myid.eq.0) read*,a
> >
> > call MPI_finalize(ie)
> > stop
> > end
> >
> > with the command mpif77 "mpif77 sillycode.f -o sillycode" and I give the
> > commands
> >
> > echo 1 > inputfile
> > mpirun -np 2 ./sillycode < inputfile
> >
> > the program still waits reading from the terminal. If I understand
> > correctly in the mpirun man page, such a redirection can be done.
> > I booted lam-mpi with the command "lamboot -v lamhosts", where the file
> > lamhosts contains this line "mycomputer cpu=2".
>