我正在我的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服务器。