Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] iof, readline, lost stdin buffering
From: Will Portnoy (will.portnoy_at_[hidden])
Date: 2008-04-04 17:34:11

The source file is attached, and compile instructions are on the first
line. The program takes input from readline(), does mpi stuff (spawn
and merge), and prints the line index and line length to the terminal.

To reproduce, compile with should_merge set to true, then paste the
contents of main.cpp into the program (main.cpp just happens to be the
right length). You'll see that the text appears on the terminal, only
the first line is received by readline(), and the rest diappears. Now
paste a few lines (e.g. 5) of main.cpp, and note that each line is
returned from readline().

Compile with should_merge set to false, and you can paste the entire
contents of main.cpp, and each line will be returned by readline().

There may be timing issues. The first std::cout seems to be
necessary, and doing too much in the while loop prevents the
reproduction. It seems a bit nondeterministic.

Thank you for looking at it. I hope it reproduces for you.


On Fri, Apr 4, 2008 at 10:32 AM, Jeff Squyres <jsquyres_at_[hidden]> wrote:
> On Apr 3, 2008, at 5:52 PM, Will Portnoy wrote:
> >> Do you mean that you are starting it via ./my_mpi_program?
> >
> > Yes.
> This is quite odd; OMPI shouldn't be interfering much in this scenario
> -- our IO forwarding stuff mostly comes into play when mpirun is used.
> However, I'd like to understand what's going on here. Could you send
> me a small sample app that shows the problem?
> --
> Jeff Squyres
> Cisco Systems
> _______________________________________________
> users mailing list
> users_at_[hidden]