About Multithreading and convert

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Shakin
Posts: 8
Joined: 2012-04-09T02:49:35-07:00
Authentication code: 8675308

About Multithreading and convert

Post by Shakin »

Hi All

I run convert.exe with "-limit thread" key and number of threads, that equals number of processor cores on my PC.
The problem is: in my Visual Studio Debugger I connect to the convert.exe process and try to see the threads. There is none. Can not I see them or is it really so?
A larger question is - How can I effectively use threads with convert utility. I have big volume of files to convert and performance is important.

Thank you, in advance
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: About Multithreading and convert

Post by Bonzo »

I do not know if this thread is of interest: viewtopic.php?f=1&t=20896
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: About Multithreading and convert

Post by anthony »

Your IM may not be compiled with openMP enabled.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Shakin
Posts: 8
Joined: 2012-04-09T02:49:35-07:00
Authentication code: 8675308

Re: About Multithreading and convert

Post by Shakin »

anthony wrote:Your IM may not be compiled with openMP enabled.
"convert -version" says it is. Here is the output:

Version: ImageMagick 6.7.6-5 2012-04-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: About Multithreading and convert

Post by anthony »

Note that multiple treads only actually exist for short period of time what IM is processing an image. Generally one thread per row to the thread limit.

TO see them you may need a very large image while appliing a very slow operation, like a large convolution.
For example -gaussian 1000x1 (blur is a 2-pass linear convultion, gaussian is a full 1 pass 2-dimentional convolution then much much slower).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Shakin
Posts: 8
Joined: 2012-04-09T02:49:35-07:00
Authentication code: 8675308

Re: About Multithreading and convert

Post by Shakin »

anthony wrote:Note that multiple treads only actually exist for short period of time what IM is processing an image. Generally one thread per row to the thread limit.

TO see them you may need a very large image while appliing a very slow operation, like a large convolution.
For example -gaussian 1000x1 (blur is a 2-pass linear convultion, gaussian is a full 1 pass 2-dimentional convolution then much much slower).

And I suspect that it does not work while converting PDF files into any other format. Is this right? Does not multithreading in Image Magic apply to converting PDF files?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: About Multithreading and convert

Post by anthony »

ImageMagick does not itself convert PDF. It passs that task to Ghostscript.

It may read a PDF file from a pipeline, saving into a temporary before passing to Ghostscript, but other than that, it leaves it up to ghostscript to do the conversion to a raster image.


See IM Examples, Text Handling, PS/PDF
http://www.imagemagick.org/Usage/text/#postscript
Ghostscript
http://www.imagemagick.org/Usage/text/#ghostscript

Also see... A word about Vector Image formats.
http://www.imagemagick.org/Usage/formats/#vector
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Shakin
Posts: 8
Joined: 2012-04-09T02:49:35-07:00
Authentication code: 8675308

Re: About Multithreading and convert

Post by Shakin »

Thank you. It's been useful.
Post Reply