Using Magick++ pixel interface on multiple threads (OpenMP)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
shar10dul
Posts: 4
Joined: 2010-01-18T14:03:16-07:00
Authentication code: 8675309

Using Magick++ pixel interface on multiple threads (OpenMP)

Post by shar10dul »

Hi,

ImageMagick version - 5.5.7
Platform - Aix
I have been trying to use Magick++ Pixel interface to modify the pixels of an image in parallel.
However it always gives me an segmentation fault. I have tried using both mpi and openmp and it gives a segmentation fault in both the cases.
Each of the threads have a pixel pointer of their own and access a segment of the image (via pixel::get() ).
However trying to modify the pixels throws a segmentation fault.

Do you guys have an idea of what might be wrong. The programs run fine when i run them using 1 thread.

Thanks,
Shardul
Gui_tou[]
Posts: 1
Joined: 2012-01-12T09:23:51-07:00
Authentication code: 8675308

Re: Using Magick++ pixel interface on multiple threads (Open

Post by Gui_tou[] »

Hi Shardul,

Same thing here. Executing this simple piece of code creates a segmentation fault.

Code: Select all

#pragma omp parallel 
{
      Magick::Image image(Magick::Geometry(800, 600), Magick::ColorRGB(1,0,0));
}
It seems to be a conflict between my use of openMP and the use of Magick+. Disabling openMP when compiling the library (./configure --disable-openmp) fixes it.
I'm running on OSX10.7 with ImageMagick-6.7.4-4

If anyone has an other idea to fix this bug I would be glad to hear it because disabling the use of openMP inside imageMagick cannot be called a nice solution.

Regards,
Guitou
Post Reply