Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要使用 mpirun 在多个节点上运行作业,我会这样做:
mpirun -np 2 -host myHost1,myHost2 -wdir path/to/wdir myProg
其中 -wdir 允许在两台主机上执行 myProg 之前更改目录。但是,如果各个主机上的目录不同怎么办?我可以做类似的事情吗
mpirun -np 2 -host myHost1,myHost2 -wdir path/to/wdir1,path/to/wdir2 myProg
谢谢!
您可以使用冒号运算符指定多个可执行文件、标志等。
对于您的示例,您会说:
mpirun -np 1 -host myHost1 -wdir path/to/wdir1 myProg : -np 1 -host myHost2 -wdir path/to/wdir2 myProg
编辑:
如果您尝试仅在一次执行中使用 gdb,这也是添加调试器的好方法。您可以执行以下操作:
mpiexec -n 1 gdb myapp : -n 7 myapp