Discussion:
convert sometimes hangs on multi-core
Alexander Lehmann
2010-04-08 07:43:11 UTC
Permalink
Hi there,

while I was trying to perform some batch conversion of images I experienced
several hangs of the command-line tool "convert" where both CPUs of my dual-core
machine would go up to a 100% usage and nothing would happen. However,
explicitly disabling one CPU helped circumvent the problem. With only one CPU,
the batch conversion runs fine.

I've used convert like this:

convert "$INPUTFILE" -separate -swap 0,2 -combine "$OUTPUTFILE"

Whether convert hangs or not does not depend on a particular file. BTW, I'm on
Mac OS X 10.6.3, using a Dual Core MacBook Pro.

Regards,
Alexander
d***@imagemagick.org
2010-04-08 12:26:43 UTC
Permalink
Post by Alexander Lehmann
explicitly disabling one CPU helped circumvent the problem.
Add --disable-openmp to the configure script command line and rebuild and
reinstall ImageMagick. If you installed from Mac Ports, use the
MAGICK_THREAD_LIMIT environment variable set to 1. To only use 1 processor
all the time, set MAGICK_THREAD_LIMIT inside the policy.xml file.

If the problem is memory contention, you can add -limit area 80mb to your
command line to force the pixel cache to disk rather than memory.
Alexander Lehmann
2010-04-08 12:57:34 UTC
Permalink
On 08.04.10 14:26,
Post by d***@imagemagick.org
Post by Alexander Lehmann
explicitly disabling one CPU helped circumvent the problem.
Add --disable-openmp to the configure script command line and rebuild and
reinstall ImageMagick. If you installed from Mac Ports, use the
MAGICK_THREAD_LIMIT environment variable set to 1. To only use 1 processor
all the time, set MAGICK_THREAD_LIMIT inside the policy.xml file.
If the problem is memory contention, you can add -limit area 80mb to your
command line to force the pixel cache to disk rather than memory.
Thank you very much for your quick answer. In fact I'm using fink instead of Mac
Ports and have already set up ImageMagick's configuration process to disable
OpenMP as well as OpenCL. Works like a charm now!

Continue reading on narkive:
Loading...