在没有X11服务器的情况下运行MPI程序?

我正在我的Ubuntu Focal服务器(Open MPI 4.0.3)上本地测试简单的MPI程序。但是,无论我用mpirun运行什么,它都会产生令人讨厌的消息No protocol specified。该问题似乎与mpirun正在尝试连接到X服务器这一事实有关。如何禁用此行为,以便在未准备好X服务器的情况下使用mpirun?我主要使用SSH(纯文本格式,使用tmux)。

我正在做的事的例子:

ubuntu@iBug-Server:~$ cat test.c
#include <mpi.h>

int main(int argc,char **argv) {
    MPI_Init(&argc,&argv);
    // This is a stub program
    MPI_Finalize();
    return 0;
}
ubuntu@iBug-Server:~$ mpicc test.c
ubuntu@iBug-Server:~$ mpirun -np 2 a.out
No protocol specified
ubuntu@iBug-Server:~$

更新1:它似乎与LightDM和Xorg有关。 systemctl stop lightdm之后,不需要的消息消失了。另外,在图形终端(通过VNC或RDP(xrdp)连接,都可以工作)中运行Open MPI也会消除该消息,因为strace表明已成功连接到X服务器。

iCMS 回答:在没有X11服务器的情况下运行MPI程序?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1943935.html

大家都在问