简体   繁体   中英

ldd output showing shared object file whose function is not called

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM