ldd 输出显示其函数未被调用的共享对象文件

发布于 2024-08-29 14:10:26 字数 221 浏览 4 评论 0原文

我对 Open MPI 创建的可执行文件运行 ldd 命令。它显示了对 libpthread.so 的引用 使用 LD_PRELOAD 变量,我创建了自己的 pthread_create 实现,但从它的输出来看,MPI 实现似乎没有像我预期的那样调用 pthread_create 。 如果未使用 ldd,为什么会在输出中显示 pthread so 文件? Open MPI 是否不为每个节点使用单独的 MPI 线程来实现功能?

I ran ldd command on an executable created by Open MPI. It shows a reference to libpthread.so
Using LD_PRELOAD variable I created my own implementation of pthread_create, but from the it output it seems that MPI implementation is not calling pthread_create as I had expected.
Why does ldd show pthread so file in output if it is not being used?
does Open MPI not use a separate MPI thread for every node to implement the functionality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

若相惜即相离 2024-09-05 14:10:26

MPI 使用进程,而不是线程。因此,Open MPI 不会为每个节点使用单独的 MPI 线程。

MPI uses processes, not threads. So no, Open MPI will not use a separate MPI thread per node.

明月松间行 2024-09-05 14:10:26

如果二进制文件未使用 --as-needed 链接,那么它将获取对链接命令行上给出的每个库的引用,无论是否实际需要。将 -Wl,--as-needed 传递给 gcc,以便将选项传递给 ld。

If the binary is not linked with --as-needed then it will acquire a reference to every library given on the link command line, regardless of whether it is actually needed. Pass -Wl,--as-needed to gcc in order to have it pass the option to ld.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文