MPI 可执行文件和共享标准输入

MPI executable and sharing stdin

我正在使用 MPI 编写我的第一个程序。我习惯了 openMP 但这似乎更难..!

我现在面临一个问题,数据作为 stdin 传递。我 运行 我的程序使用以下内容:

cat DATAfile | mpirun -n 8 ./a.out

我看到的是只有 rank 0 线程有一个非空的 stdin。可以一开始就分享吗?由于它由 sting 个对象组成,因此使用 MPI 指令将其传递到内部会很麻烦。

编辑:在文档中找到我想要的: http://www.open-mpi.org/~jsquyres/www.open-mpi.org/doc/v1.3/man1/mpirun.1.php

添加 -stdin all 即可。

cat DATAfile | mpirun -n 8 -stdin all ./a.out

抱歉打扰...

最后,答案在文档中: http://www.open-mpi.org/~jsquyres/www.open-mpi.org/doc/v1.3/man1/mpirun.1.php

cat DATAfile | mpirun -n 8 -stdin all ./a.out