[mpich-discuss] mpiexec hanged up with large stdin
Jeff Hammond
jhammond at alcf.anl.gov
Tue Feb 28 08:47:05 CST 2012
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
More information about the mpich-discuss
mailing list