Hello

I have to compile a program (abinit) reading data from stdin and it
doesn't works.


  I made a simplified version of the program



PROGRAM TESTSTDIN

  use mpi
  integer ( kind = 4 ) error
  integer ( kind = 4 ) id
  integer ( kind = 4 ) p
  real ( kind = 8 ) wtime
  CHARACTER(LEN=255) a
  call MPI_Init ( error )
  call MPI_Comm_size ( MPI_COMM_WORLD, p, error )
  call MPI_Comm_rank ( MPI_COMM_WORLD, id, error )

  if ( id == 0 ) then
    PRINT*, "id0"
    READ(5,'(A)') a
  end if

  write ( *, '(a)' ) ' '
  write ( *, '(a,i8,a)' ) '  Process ', id, ' says "Hello, world!"'

  if ( id == 0 ) then
    write ( *, '(a)' ) 'READ from stdin'
    write ( *, '(a)' ) a
  end if
  call MPI_Finalize ( error )

  stop
end


I've tried openmpi 1.6.5 and 1.7.2
The fortran compiler is ifort (tried Version 14.0.0.080 Build 20130728
and Version 11.1    Build 20100806)
(c compiler is gcc, centos 6.x, infiniband stack from qlogic
infinipath-libs-3.1-3420.1122_rhel6_qlc.x86_64)

Trying with and without infiniband (qlogic card)

mpirun -np 8 ./teststdin < /tmp/a
forrtl: Bad file descriptor
forrtl: severe (108): cannot stat file, unit 5, file /proc/43811/fd/0
Image              PC                Routine            Line        
Source             
teststdin          000000000040BF48  Unknown               Unknown  Unknown



 mpirun -mca mtl ^psm -mca btl self,sm -np 8 ./teststdin < /tmp/a

 id0
  Process        0 says "Hello, world!"
READ from stdin
zer                                                                             
                                                                                
                                                                                
               

  Process        1 says "Hello, world!"
...



Is it a known problem ?

 Fabrice BOYRIE


Reply via email to