我使用OpenMPI或MPICH进行编译了吗? [英] Did I compile with OpenMPI or MPICH?

查看:525
本文介绍了我使用OpenMPI或MPICH进行编译了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Linux机器上有一个可执行文件,我知道它是用OpenMPIMPICH库编译的.

I have an executable on my Linux box which I know has been compiled either with OpenMPI or MPICH libraries.

问题:如何确定哪个?

推荐答案

以下诊断过程假定MPICH/MPICH2和Open MPI为 您可能已链接的唯一可能的MPI实现.其他 (尤其是商业)MPI实现确实存在,并且可能有不同的实现 库名称和/或库符号.

The following diagnostic procedure assumes that MPICH/MPICH2 and Open MPI are the only possible MPI implementations that you may have linked with. Other (especially commercial) MPI implementations do exist and may have different library names and/or library symbols.

首先确定您是否动态链接:

First determine if you linked dynamically:

% ldd my_executable
        linux-vdso.so.1 =>  (0x00007ffff972c000)
        libm.so.6 => /lib/libm.so.6 (0x00007f1f3c6cd000)
        librt.so.1 => /lib/librt.so.1 (0x00007f1f3c4c5000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f1f3c2a7000)
        libc.so.6 => /lib/libc.so.6 (0x00007f1f3bf21000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1f3c969000)

如果在该列表中看到libmpich.so,则表明您已动态链接到 MPICH(或MPICH2).如果看到libmpi.so,则表明已与Open MPI链接.

If you see libmpich.so in that list, then you have dynamically linked to MPICH (or MPICH2). If you see libmpi.so then you have linked with Open MPI.

如果都不存在,则可能只是静态链接.在这种情况下 我们需要检查二进制文件以查找可区分的符号:

If neither is present, then you probably just linked statically. In that case we need to examine the binary to look for distinguishing symbols:

% ( nm my_executable | grep MPIR_Free_contextid >/dev/null ) && echo "MPICH"
% ( nm my_executable | grep ompi_comm_set_name >/dev/null ) && echo "Open MPI"

这篇关于我使用OpenMPI或MPICH进行编译了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆