enable 0r disable OpenMP
enable 0r disable OpenMP
Hi there,
I recently installed imagemagick 6.8.6-6 using macports, on a mac running mountain lion 10.8.4. After running a few tests I noticed that 'convert' was only using 1 of the 8 threads available. I found a post on the imagemagick forum about OpenMP not being installed when installing IM using macports on Mountain Lion after running convert --version I could see OpenMP was not enabled. I then came across a mac installer http://cactuslab.com/imagemagick/ for IM and installed IM using the package. After installation I could see that OpenMP was installed using the package. After running a few test I noticed that the macports installed version was running faster on 1 thread than the version of IM using 8 threads!!!! Would you happen to know why this might be or how I can make IM have optimum performance?
Is there an easy way of enabling or disabling OpenMP without having to reinstall?
Many Thanks,
Nik
I recently installed imagemagick 6.8.6-6 using macports, on a mac running mountain lion 10.8.4. After running a few tests I noticed that 'convert' was only using 1 of the 8 threads available. I found a post on the imagemagick forum about OpenMP not being installed when installing IM using macports on Mountain Lion after running convert --version I could see OpenMP was not enabled. I then came across a mac installer http://cactuslab.com/imagemagick/ for IM and installed IM using the package. After installation I could see that OpenMP was installed using the package. After running a few test I noticed that the macports installed version was running faster on 1 thread than the version of IM using 8 threads!!!! Would you happen to know why this might be or how I can make IM have optimum performance?
Is there an easy way of enabling or disabling OpenMP without having to reinstall?
Many Thanks,
Nik
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: enable 0r disable OpenMP
see http://www.imagemagick.org/script/resou ... nvironment for setting the environment for speed and MAGICK_THREAD_LIMIT to change the threading. Also
viewtopic.php?f=2&t=20756&p=83407&hilit=thread#p83407
viewtopic.php?f=1&t=23772&p=100867&hili ... on#p100867
http://www.imagemagick.org/script/comma ... .php#limit
and
viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
viewtopic.php?f=2&t=20756&p=83407&hilit=thread#p83407
viewtopic.php?f=1&t=23772&p=100867&hili ... on#p100867
http://www.imagemagick.org/script/comma ... .php#limit
and
viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
Last edited by fmw42 on 2013-08-28T12:00:55-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: enable 0r disable OpenMP
I know nothing about Mac or threads, but "-limit threads 1" might do what you want. See references to "thread" on http://www.imagemagick.org/script/comma ... ptions.php
snibgo's IM pages: im.snibgo.com
Re: enable 0r disable OpenMP
Thanks for the tips guys, I will take a look at these properly tomorrow and try to implement. But why would a convert command that's using 8 threads run slower than the command just using 1 thread?
Thanks,
Nik
Thanks,
Nik
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: enable 0r disable OpenMP
Nik wrote:Thanks for the tips guys, I will take a look at these properly tomorrow and try to implement. But why would a convert command that's using 8 threads run slower than the command just using 1 thread?
Thanks,
Nik
Some unix platforms have been known to have problems with multi-threading using OpenMP. The IM developers would have to let you know more. But is this the same platform with all the same delegate libraries and the same version of IM?
Personally, I have not had this problem on my dual-core Mac Mini running OSX Snow Leopard.
But I also run IM differently that from MacPorts. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202 But in this configuration I have OpenMP disabled, but one can easily remove --disable-openmp
Re: enable 0r disable OpenMP
Hi,
like you I have IM installed on a mac running Snow leopard that has 2 quad cores and convert makes use of all 8 threads very efficiently. Can you answer why, when I install the same version of IM using macports on a mac running mountain Lion it doesn't install OpenMP like it does on the Snow Leopard machine and why, if I get a version of IM installed that does include OpenMP it runs a lot slower when making use of all 8 threads? Sorry to ask so many questions and if there's a better place for me to direct my questions please let me know.
I also have the latest version of IM installed on a machine running CentOS which did install OpenMP. The machine also seems to use all 8 threads efficiently like my Snow Leopard version. Could it just be an issue with multi threading in Mountain Lion?
When purchasing a machine to run IM would you say that it's better to buy a machine that's got the fastest processor possible rather than the amount of processors? Should I also invest in solid state drives? Does the amount of ram need to be considered also?
Many, Many thanks for taking the time to read and your thoughts,
Nik
like you I have IM installed on a mac running Snow leopard that has 2 quad cores and convert makes use of all 8 threads very efficiently. Can you answer why, when I install the same version of IM using macports on a mac running mountain Lion it doesn't install OpenMP like it does on the Snow Leopard machine and why, if I get a version of IM installed that does include OpenMP it runs a lot slower when making use of all 8 threads? Sorry to ask so many questions and if there's a better place for me to direct my questions please let me know.
I also have the latest version of IM installed on a machine running CentOS which did install OpenMP. The machine also seems to use all 8 threads efficiently like my Snow Leopard version. Could it just be an issue with multi threading in Mountain Lion?
When purchasing a machine to run IM would you say that it's better to buy a machine that's got the fastest processor possible rather than the amount of processors? Should I also invest in solid state drives? Does the amount of ram need to be considered also?
Many, Many thanks for taking the time to read and your thoughts,
Nik
Re: enable 0r disable OpenMP
YesWhen purchasing a machine to run IM would you say that it's better to buy a machine that's got the fastest processor possible rather than the amount of processors? Should I also invest in solid state drives? Does the amount of ram need to be considered also?
To me the only thing the IM project is not focusing on performance-wise is OpenCL/Cuda. RAM really depends on what size images you are processing- you don't want to start tapping into HD swap, but IMO 16GB is a good low standard. SSDs will improve speed also due to writing faster. Processors I'm not too sure about, but if you skimp on the gfx card you can upgrade the cpu. I'm sure the devs have more solid input though...
Re: enable 0r disable OpenMP
Thanks for your thoughts Holden,
Nik
Nik
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: enable 0r disable OpenMP
More functions are being implemented with OpenCL right now. I do not know which ones. see viewtopic.php?f=2&t=23263&p=100918&hilit=OpenCl#p100918holden wrote:To me the only thing the IM project is not focusing on performance-wise is OpenCL/Cuda.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: enable 0r disable OpenMP
[quote="NiK']like you I have IM installed on a mac running Snow leopard that has 2 quad cores and convert makes use of all 8 threads very efficiently. Can you answer why, when I install the same version of IM using macports on a mac running mountain Lion it doesn't install OpenMP like it does on the Snow Leopard machine and why, if I get a version of IM installed that does include OpenMP it runs a lot slower when making use of all 8 threads? Sorry to ask so many questions and if there's a better place for me to direct my questions please let me know.
Could it just be an issue with multi threading in Mountain Lion?[/quote]
I would post this on the Developers forum or Bugs forum to get the attention of the IM developer. I believe that he has IM running on Mountain Lion.
Perhaps it is a bad release from MacPorts.
Have you tried installing all your delegates via MacPorts and then Install IM from source as I did in one of the links I sent above?
Could it just be an issue with multi threading in Mountain Lion?[/quote]
I would post this on the Developers forum or Bugs forum to get the attention of the IM developer. I believe that he has IM running on Mountain Lion.
Perhaps it is a bad release from MacPorts.
Have you tried installing all your delegates via MacPorts and then Install IM from source as I did in one of the links I sent above?
Re: enable 0r disable OpenMP
Hi,
yes I did follow your previous post and installed the delegates using macports and then installed IM using configure. When I installed it this way OpenMP was installed and this is how I was able to do the timing difference between IM installed using macports (/opt/local/bin) running only 1 thread and the version manually installed that used all 8 threads.
I will add a post on the developers site.
Thanks again,
Nik
yes I did follow your previous post and installed the delegates using macports and then installed IM using configure. When I installed it this way OpenMP was installed and this is how I was able to do the timing difference between IM installed using macports (/opt/local/bin) running only 1 thread and the version manually installed that used all 8 threads.
I will add a post on the developers site.
Thanks again,
Nik
Re: enable 0r disable OpenMP
So, Do you guys recommend to enable OpenMP or disable OpenMP?
In which case we should do the reverse?
In which case we should do the reverse?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: enable 0r disable OpenMP
You will have to test your own OS to know which is best. It is typically better to run with OpenMP enabled. But some systems do work well with OpenMP.agriz wrote:So, Do you guys recommend to enable OpenMP or disable OpenMP?
In which case we should do the reverse?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: enable 0r disable OpenMP
On a Windows 7 laptop with two cores, IM with OpenMP, I find that simple converts taking under a second work faster with threads limited to 1. Longer jobs run faster without limiting threads.
snibgo's IM pages: im.snibgo.com
Re: enable 0r disable OpenMP
We have a thread tuning parameter such that an image needs to be a certain size before the algorithm is threaded. We'll adjust this parameter so that larger images are required before an algorithm is threaded. This should fix the Windows issue where some algorithms run faster when not threaded.