Page 1 of 1

openmp in libmagickcore-6.q16-2:amd64

Posted: 2016-07-06T13:09:10-07:00
by jhammerman
Hi ImageMagick Users,

We are trying to use imagemagick libraries within our code. I cannot post convert -version output since the imagemagick userspace binaries are not installed in the docker container that runs the application.

The code itself is multi-threaded. At a certain load, userspace CPU utilization spikes. the performance of the machine drops off accordingly. I believe that contention among the threads (possibly causing high processor cache miss rates) is the culprit.

In /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/config-Q16/configure.xml which came with the package, we find -fopenmp under CFLAGS. Is it reasonable to assume that libmagickcore-6.q16-2:amd64 was compiled with openmp support?

Is it recommended to disable openmp if you are writing your own multi-threaded application?

Thanks so much all,
Joseph Hammerman

Re: openmp in libmagickcore-6.q16-2:amd64

Posted: 2016-07-07T04:01:56-07:00
by magick
Type `identify -version'. If OpenMP is enabled, you'll see 'OpenMP' associated with the Features tag.

You can change the number of threads that ImageMagick utilizes with the `-limit threads` command-line option or set the MAGICK_THREAD_LIMIT environment variable. Try setting the threads to 2 then 1. You can also remove multi-threading support completely. Download the source, add --disable-openmp to the configure script command-line and rebuild / reinstall ImageMagick.