Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2006-03-17 11:33:38


As suspected, it was a component adding the -lpthread. The problem
is that the component in question is ROMIO and it does it because it
thinks that -lpthread is needed to make asynchronous I/O work
properly. Which is actually a possibility, depending on which
version of the Linux kernel you are using.

If you need asynchronous MPI-2 IO functions, I think you have to live
with the dependency on -lpthread. However, if you don't need MPI-2
IO functionality at all, you can configure Open MPI with --disable-io-
romio or if you can live without aio support for ROMIO, you can
configure Open MPI with --with-io-romio-flags='--disable-aio'.

I believe that disabling aio support in ROMIO will remove the pthread
dependency.

Brian

On Mar 17, 2006, at 10:57 AM, Greg Watson wrote:

> $ mpicc -showme
> gcc -I/usr/local/include -I/usr/local/include/openmpi -I/usr/local/
> include/openmpi/opal -I/usr/local/include/openmpi/orte -I/usr/local/
> include/openmpi/ompi -L/usr/local/lib -lmpi -lorte -lopal -lutil -
> lnsl -ldl -lbproc -lbproc -lbproc -lbproc -lbproc -lbproc -lpthread -
> lrt -Wl,--export-dynamic -lm -lutil -lnsl -ldl
>
> Looks like -lpthread is there...
>
> Thanks,
>
> Greg
>
> On Mar 17, 2006, at 8:33 AM, Brian Barrett wrote:
>
>> On Mar 17, 2006, at 10:17 AM, Greg Watson wrote:
>>
>>> I'm building OMPI 1.0.2a9 on a bproc machine (Yellow Dog Linux 4.0/
>>> ppc). It just has an ethernet interface, no fancy network.
>>>
>>> I've tried configuring as follows:
>>>
>>> ./configure --enable-static --disable-shared --without-threads --
>>> with-
>>> devel-headers
>>>
>>> and
>>>
>>> ./configure --enable-static --disable-shared --without-threads --
>>> without-mpi-threads --with-devel-headers
>>
>> The second one should be --disable-mpi-threads, but it really doesn't
>> matter - specifying --without-threads will automatically disable mpi
>> threads. So these are both correct for what you are trying to do.
>> Clearly, however, something else is going on :/.
>>
>>> In both cases, I'm still seeing the thread library linked in the
>>> final executable:
>>>
>>> $ mpicc -o testmpi testmpi.c
>>> $ ldd testmpi
>>> libutil.so.1 => /lib/libutil.so.1 (0x0f590000)
>>> libnsl.so.1 => /lib/libnsl.so.1 (0x0e850000)
>>> libdl.so.2 => /lib/libdl.so.2 (0x0fdc0000)
>>> libbproc.so.4 => /usr/lib/libbproc.so.4 (0x0fe50000)
>>> libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0fc40000)
>>> librt.so.1 => /lib/tls/librt.so.1 (0x0f660000)
>>> libm.so.6 => /lib/tls/libm.so.6 (0x30013000)
>>> libc.so.6 => /lib/tls/libc.so.6 (0x0fe70000)
>>> /lib/ld.so.1 => /lib/ld.so.1 (0x0ffd0000)
>>> $
>>
>> What does "mpicc -showme" show? If it includes something like -
>> pthread or -lpthread, can you send the config.log file from Open MPI?
>>
>> Since ldd doesn't list the OMPI libraries as dependencies, it's a
>> pretty good assumption that they were statically linked in (so at
>> least the --disable-shared part worked). Therefore, if mpicc doesn't
>> explicitly list -pthread or -lpthread, then the dependency is coming
>> from one of two places. Either the compiler is explicitly adding -
>> lpthread anyway (unlikely) or one of the other libraries that we
>> added a -l for does depend on pthreads for some reason. I can't
>> think off hand what we might add to cause this, so it might mean
>> searching through the list of libraries with ldd to see if one of
>> them includes a dependency on /lib/tls/libpthread.so.
>>
>>> Checking ompi_config.h shows:
>>>
>>> #define HAVE_PTHREAD_H 1
>>> #define OMPI_ENABLE_MPI_THREADS 0
>>> #define OMPI_ENABLE_PROGRESS_THREADS 0
>>> #define OMPI_HAVE_POSIX_THREADS 0
>>> #define OMPI_HAVE_SOLARIS_THREADS 0
>>> #define OMPI_THREADS_HAVE_DIFFERENT_PIDS 0
>>>
>>> If anyone can tell me what I'm doing wrong, it would be appreciated.
>>> I need to get this working for a demo on Monday.
>>
>> That looks like Open MPI's configure script disabled threads
>> support. The HAVE_PTHREAD_H should not be used to figure out if we
>> should use pthread support or not - it's only given to indicate
>> whether pthread.h exists as a useable header file.
>>
>> Brian
>>
>>
>> --
>> Brian Barrett
>> Open MPI developer
>> http://www.open-mpi.org/
>>
>>
>> _______________________________________________
>> devel mailing list
>> devel_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/devel
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel

-- 
   Brian Barrett
   Open MPI developer
   http://www.open-mpi.org/