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.
CPU usage abnormal
-
- Posts: 4
- Joined: 2012-02-22T00:04:06-07:00
- Authentication code: 8675308
CPU usage abnormal
Last edited by li375268037 on 2012-02-23T19:02:11-07:00, edited 1 time in total.
-
- Posts: 4
- Joined: 2012-02-22T00:04:06-07:00
- Authentication code: 8675308
Re: CPU usage abnormal
mem usage is normal about 0.8%
Re: CPU usage abnormal
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.
-
- Posts: 4
- Joined: 2012-02-22T00:04:06-07:00
- Authentication code: 8675308
Re: CPU usage abnormal
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.
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
Try setting the threads policy. The default is to use all the cores. You could set it to 1, to only use one core.
-
- Posts: 4
- Joined: 2012-02-22T00:04:06-07:00
- Authentication code: 8675308
Re: CPU usage abnormal
i just tried, it doesn't work.<policy domain="resource" name="thread" value="1"/>. the experiment result indicates just CPU usage abnormal(1300-1500%).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.
If i configure IM with --disable-openmp, the CPU usage is about 100%. Parhaps it's the solution?