屏幕与mpirun

时间:2011-09-13 13:37:02

标签: screen mpi

MPI工作正常:

$ mpirun -np 2 -H compute-0-0,compute-0-1 echo 1
1
1

然而,当通过屏幕启动时它不起作用:

$ rm -f screenlog.*
$ screen -L mpirun -np 2 -H compute-0-0,compute-0-1 echo 1
[screen is terminating]
$ cat screenlog.0 
mpirun: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

这没有用:

$ rm -f screenlog.*
$ screen -L `which mpirun` -xLD_LIBRARY_PATH -np 2 -H compute-0-0,compute-0-1 echo 1
[screen is terminating]
$ cat screenlog.0 
/share/apps/intel/openmpi/bin/mpirun: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

1 个答案:

答案 0 :(得分:1)

(这是一个Rocks群?)

显然,由于某种原因,你没有得到正确的$LD_LIBRARY_PATH

这不是一个非常干净的解决方案,但它应该有效:

$ screen -L env LD_LIBRARY_PATH=$LD_LIBRARY_PATH mpirun -np 2 \
  -H compute-0-0,compute-0-1 echo 1

我认为这是你试图用-xLD_LIBRARY_PATH选项做的事情,但我没有在documentation中看到我能找到的。

这就是你试图用-xLD_LIBRARY_PATH选项做的事情,但这只会从$LD_LIBRARY_PATH调用的进程中获取screen的值(并传递给它)到echo 1命令。到那时为时已晚。此外,man page表明应该有一个空格:-x LD_LIBRARY_PATH;我不知道是否需要。

是否有一些脚本要为MPI获取环境(包括$LD_LIBRARY_PATH)?它是在您的登录shell启动时自动获取的,还是您手动执行?您可能希望编写一个小的包装器脚本来源安装脚本,然后调用指定的命令。像(未经测试)的东西:

#!/bin/sh
. /share/apps/intel/openmpi/etc/setup.sh # probably not the right name
exec "$@"

将其另存为$HOME/bin/mpienv.sh,然后您可以使用:

$ screen -L mpienv.sh mpirun -np 2 -H compute-0-0,compute-0-1 echo 1
相关问题