Page 1 of 1

CPU usage abnormal

Posted: 2012-02-22T00:53:51-07:00
by li375268037
Hi, all
Environment: centos6.0, 16 cores, 8G mem
My lab want to use magick++ to sample local images(the number of images is about 70,000). i write an auto-processing program using c to sample the images. when run it by single thread, type top in command line, found that CPU usage is about 1400-1500%. when run it by multi-thread, CPU usage is however about 150-300%. After reading some articales on the forum, i re-install from the source configured with --disable-openmp, under single thread, CPU usage is about 90-200%, multi-thread is about 200-300%. Obviously time cost increase 3 times.
The work is done, but i want to know why. Or i can control it's CPU usage. Or i can use the IM effectively. it's just personal interests.
thanks all.

Re: CPU usage abnormal

Posted: 2012-02-22T01:01:29-07:00
by li375268037
mem usage is normal about 0.8%

Re: CPU usage abnormal

Posted: 2012-02-22T05:10:16-07:00
by magick
See MAGICK_THROTTLE @ http://www.imagemagick.org/script/resou ... nvironment. It periodically yields the CPU for at least the time specified in milliseconds. You can also set this value in the policy.xml configuration file.

Re: CPU usage abnormal

Posted: 2012-02-23T18:13:54-07:00
by li375268037
i modify the policy.xml in install dir,<policy domain="resource" name="throttle" value="10"/>
CPU usage is normal. But it's not the result i want. If there is a compatible way that cut down the
CPU usage and do not slow the process,cost more time
i just want to find out a acceptable way to use the IM. Forgive me that i only deep into IM only several weeks,
IM needs more detail knowlege to understand for me.
thank u, magick.

Re: CPU usage abnormal

Posted: 2012-02-23T19:05:15-07:00
by magick
Try setting the threads policy. The default is to use all the cores. You could set it to 1, to only use one core.

Re: CPU usage abnormal

Posted: 2012-02-23T19:39:50-07:00
by li375268037
magick wrote:Try setting the threads policy. The default is to use all the cores. You could set it to 1, to only use one core.
i just tried, it doesn't work.<policy domain="resource" name="thread" value="1"/>. the experiment result indicates just CPU usage abnormal(1300-1500%).
If i configure IM with --disable-openmp, the CPU usage is about 100%. Parhaps it's the solution?