astromatic / sextractor

Extract catalogs of sources from astronomical images
http://astromatic.net/software/sextractor
GNU General Public License v3.0
145 stars 42 forks source link

Multithreading support #26

Open fockez opened 2 years ago

fockez commented 2 years ago

I want to build a multithreading sextractor to accelerate the speed for large fov image. I tried to build the threaded atlas and fftw3, and enable-threads when configure. But still get single threaded version when I change the NTHREADS parameter. The same happens with mkl. I found that in configure, there is tow lines

# Deactivate multithreading for now
use_pthreads="no"

Seems that it never use threads. I commented this out, it starts to link the fftw_threads library, but will get the error undefined reference to `fftw_init_threads' But the libfftw3f_threads.so is actually there. I can compile with mkl, and show that it use xx threads, but in fact it is still single threaded.

So, how can I build these libs to support the multithreading, I am using the current code from github.

fockez commented 2 years ago

After compiled with threads, I use ldd to check the binary

        linux-vdso.so.1 (0x00007fffc9b45000)
        libtatlas.so => /home/pmo/local/atlas/lib/libtatlas.so (0x00007f39765cc000)
        libfftw3f.so.3 => /home/pmo/local/fftw3/lib/libfftw3f.so.3 (0x00007f397649e000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3976349000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3976170000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f397614f000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3977d19000)

The threaded code has been compiled into the same libfftw3f.so.3 But I still get the same performance, and no multi core used in the calculation.

rmathar commented 8 months ago

If the fftw package has been compiled without using the --enable-threads configuration option (https://www.fftw.org/fftw3_doc/Installation-and-Supported-Hardware_002fSoftware.html) the function fftw_init_threads is not in the *.so files. This can be checked a posteriori for example by looking into the file: /usr/lib64> objdump -T libfftw3f.so | fgrep thread There is nothing the sextractor package can do about this because it's in the hands of the package managers of fftw3 to en/disable that feature.