[mpich-discuss] mpiexec hanged up with large stdin

Yuheng Xie thinelephant at gmail.com
Tue Feb 28 09:40:13 CST 2012


Jeff,

Thank you for your reply! Although the MPI standard does not require it,
stdin/stdout and passing data through pipes are traditional conveniences in
Unix. I'd like MPICH2 improve on these besides performance. So, at present
it seems I have to generate temporary files before using my data.

--
Yuheng

2012/2/28 Jeff Hammond <jhammond at alcf.anl.gov>

> The MPI standard does not even require stdin to be supported, so it is
> entirely reasonable for an implementation to support it only up to
> some reasonable finite value.  If you were to run "cat /dev/random |
> mpiexec.gforker -n 2 ./test" that program would never return either.
>
> Since you are intending to use C++, why don't you modify your code to
> read from an istream associated with a proper input file rather than
> std::cin?  The source changes should be essentially trivial.
>
> Jeff
>
> On Tue, Feb 28, 2012 at 1:15 AM, Yuheng Xie <thinelephant at gmail.com>
> wrote:
> > Hi,
> >
> > I started using MPICH2 recently and found a problem about reading large
> file
> > (>64KB) from stdin. My program hanged up on the line MPI_Init(&argc,
> > &argv);. Could anyone help me? Thanks a lot.
> >
> > My program: test.cpp
> > #include <mpi.h>
> >
> > int main(int argc, char **argv)
> > {
> >     MPI_Init(&argc, &argv);
> >     MPI_Finalize();
> >
> >     return 0;
> > }
> >
> > Compile and run:
> > mpicxx test.cpp -o test
> > cat test.txt | mpiexec.gforker -n 2 ./test   # This is OK
> > cat test.txt | mpiexec.hydra -n 2 ./test   # When test.txt is larger than
> > 65536 bytes, this won't return.
> >
> > The MPICH2 was installed with following commands:
> > ./configure --prefix=/usr/local --enable-cxx
> > --enable-fast=O3,nochkmsg,notiming,ndebug --with-pm=hydra:mpd:gforker
> > --enable-smpcoll
> > make
> > sudo make install
> >
> >
> > _______________________________________________
> > mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> > To manage subscription options or unsubscribe:
> > https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> >
>
>
>
> --
> Jeff Hammond
> Argonne Leadership Computing Facility
> University of Chicago Computation Institute
> jhammond at alcf.anl.gov / (630) 252-5381
> http://www.linkedin.com/in/jeffhammond
> https://wiki.alcf.anl.gov/old/index.php/User:Jhammond
> https://wiki-old.alcf.anl.gov/index.php/User:Jhammond
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120228/16bb6c69/attachment.htm>


More information about the mpich-discuss mailing list