mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-11-16, 21:26   #1
spaz
 
Apr 2009

101002 Posts
Default Dynamic Throttling

So before I get yelled at I did read the recently posted throttling topic, but it didn't seem to provide the solution I was looking for.

My problem is this; I run mprime on my laptop, which is my current primary machine, but I don't want it running it all out (due to both heat and power issues). The processor is a Core 2 Duo P8700 (2.53 Ghz dual core) which can heat up a decent amount if run all out (~95 degrees Celsius). I enabled throttling, as discussed on the aforementioned thread, at 25% and 50% to observe performance.

Now maybe this is just me being naive but I had expected throttle to casue mprime to only use that percentage of the idle processor time. Instead it seems to run the processor all out at 2.53 Ghz for 5 seconds, stop working for 5 seconds then resume (this is at 50% throttle).

What I'm ideal looking for is a way to casue mprime to fill up idle processor time with out bumping up the clock speed, but to utilize the extra time available on the slower speeds. For example while writing this the processor is just at an easy 800 MHz (for each core) with an occasional kick to 1.6 GHz for a background process. Would it be possible to setup mprime to use a low priority thread as it does now with out escalating the processor speed? (and to let the processor still slow down when it normally would?)

And if that is stupid is there a way to switch mprime to a constant duty cycle, but not doing as much at once, instead of the 50% duty cycle it has with the throttle?

I do understand that being able to do this would result in slower computations (and I'm sorry) but this is my primary work machine for now so I can't just leave it sitting plugged in like some of my desktops (those can sit on at 100% all day ) And if this is a stupid/unclear idea let me know. (I can take criticism)
spaz is offline   Reply With Quote
Old 2009-11-16, 21:38   #2
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts
Default

I'm not sure if there's a way to do what you're asking, (more info on what exactly is underclocking the CPU when idle to save power/heat would help) but if the problem is running out of power when using the battery (as you mention near the end), you can uncheck the Options > Preferences > "Run program even when using laptop battery power" check box. Then it'll be full-on (plugged in) or full-off, (on battery power) and when you're using battery power, the automatic underclocking will still function to give the best life possible.

Last fiddled with by Mini-Geek on 2009-11-16 at 21:44
Mini-Geek is offline   Reply With Quote
Old 2009-11-16, 22:42   #3
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

1D6616 Posts
Default

Quote:
Originally Posted by spaz View Post
What I'm ideal looking for is a way to casue mprime to fill up idle processor time with out bumping up the clock speed, but to utilize the extra time available on the slower speeds.
AFAIK, the OS doesn't provide the hooks to do this.

As to your other question, there is no way to make the current version of mprime use a finer granularity of throttling.
Prime95 is offline   Reply With Quote
Old 2009-11-16, 23:22   #4
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

23×7×13 Posts
Default

Quote:
Originally Posted by Prime95 View Post
AFAIK, the OS doesn't provide the hooks to do this.

As to your other question, there is no way to make the current version of mprime use a finer granularity of throttling.
You could code a cpu scheduler but it doesn't really make sense. Fix your cooling and you will be fine.
joblack is offline   Reply With Quote
Old 2009-11-16, 23:59   #5
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103×113 Posts
Default

If you are running 2 copies and want to tweak your CPU utilization to more than 50% but less than 100%, a low-tech solution is to drop to running just one copy - memory-subsystem contention means that 1 copy usually provides 60% (sometimes more) the total throughput of 2 copies running simultaneously.

If that drops your CPU temperature back to within a safe range and you want a little more utilization, you could try running one one copy all-out and a 2nd throttled.
ewmayer is offline   Reply With Quote
Old 2009-11-17, 00:27   #6
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3·2,083 Posts
Default

Actually, this is possible to do on Linux. What you need to do is set your system's CPU throttling governor so that it won't "count" lowest-priority apps like mprime when deciding whether or not to throttle. This is an option in most distributions, and in fact some versions of Ubuntu had this as the default.

Right now I can't recall where I found this option before, but I think it was somewhere in the /sys directory. If I get the chance I'll reboot my machine (dual-boot) into Linux and see if I can find it.
mdettweiler is offline   Reply With Quote
Old 2009-11-17, 02:18   #7
spaz
 
Apr 2009

1416 Posts
Default

mdettweiler you are a genius! I Hadn't thought to look to see if there's a way to do that under linux itself I just assumed it had to be done within mprime.

So the solution is to take advantage of the fact that mprime utilizes nice so nicely. So to make it such that mprime can monopilize free processor time without escalating the cpu speed it to remove the nice programs from the calculations for when the speed should be changed. The critical change is located in;
Code:
/etc/sysconfig/cpuspeed
there's a section of that that looks like this;
Code:
### NICE PROCESS HANDLING ###
# Let background (nice) processes speed up the cpu
# default value: 0 (background process usage can speed up cpu)
# alternate value: 1 (background processes will be ignored)
IGNORE_NICE=0
by changing IGNORE_NICE to be 1 we ignore the nice process completely.

Refrences for this http://www.flatmtn.com/article/green-boinc was shere i found the reference to this. I also installed cpufrequtils before doing this change I don't believe that was necessary but it may have helped.

Only possible downside is some applications might have components set to low nice levels that don't get down fast enough cause they don't change the clock speed, but so far the system runs fine, and mprime is using all the free processor time without bumping up the clock spee (which still goes up and down on demand).

Again thanks for giving me advice on where to look, hoepit helps any one else in a similar situation.
spaz is offline   Reply With Quote
Old 2009-11-17, 04:57   #8
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3×2,083 Posts
Default

Quote:
Originally Posted by spaz View Post
mdettweiler you are a genius! I Hadn't thought to look to see if there's a way to do that under linux itself I just assumed it had to be done within mprime.

So the solution is to take advantage of the fact that mprime utilizes nice so nicely. So to make it such that mprime can monopilize free processor time without escalating the cpu speed it to remove the nice programs from the calculations for when the speed should be changed. The critical change is located in;
Code:
/etc/sysconfig/cpuspeed
there's a section of that that looks like this;
Code:
### NICE PROCESS HANDLING ###
# Let background (nice) processes speed up the cpu
# default value: 0 (background process usage can speed up cpu)
# alternate value: 1 (background processes will be ignored)
IGNORE_NICE=0
by changing IGNORE_NICE to be 1 we ignore the nice process completely.

Refrences for this http://www.flatmtn.com/article/green-boinc was shere i found the reference to this. I also installed cpufrequtils before doing this change I don't believe that was necessary but it may have helped.

Only possible downside is some applications might have components set to low nice levels that don't get down fast enough cause they don't change the clock speed, but so far the system runs fine, and mprime is using all the free processor time without bumping up the clock spee (which still goes up and down on demand).

Again thanks for giving me advice on where to look, hoepit helps any one else in a similar situation.
Yes, that was it, I'd just forgotten the path to the file that needed to be changed. Glad to be of service!

BTW, one thing you'll want to keep in mind: if I remember correctly, this option is reset every time the system is rebooted. That could just be something specific to the distribution I was using (Ubuntu), but I'd recommend keeping a close eye on it next time you reboot. If it does get reset, you may want to put a command to fix it in a shell script, then put the shell script in root's crontab to run at system startup.

Ironically enough, I came across this while looking for a solution to the exact opposite problem. Ubuntu, as of version 8.04, had the IGNORE_NICE option set to 1 by default, whereas earlier versions had it set to 0. It proved to be rather annoying how every time I rebooted my computer, I had to manually set it to "Performance" mode using the CPU Frequency Scaling Monitor applet to keep this from impacting the performance of my prime search applications (a rather sizeable slowdown--about half of full speed, as I recall). I believe I ended up going a different route to fix the problem in the end, but nontheless this was one of the possible solutions.
mdettweiler is offline   Reply With Quote
Old 2009-11-17, 09:52   #9
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

25·257 Posts
Default

http://cpufreqd.sourceforge.net/manp...d.conf.5.shtml

Quote:
ignore_nice, ignore_nice_load

Whether ‘nice’ processes should be considered as CPU usage by the governor. This is a boolean value (e.g. value is either 0 or 1). When set to 1 ‘nice’ processes will not be counted as CPU usage by the governor. Note: ‘ignore_nice’ was renamed to ‘ignore_nice_load’ in kernel version 2.6.16. Both names are accepted in cpufreqd.conf, regardless the version of the running kernel.
Xyzzy is offline   Reply With Quote
Old 2009-11-17, 16:39   #10
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

11000011010012 Posts
Default

Hmm...something interesting I just noticed about this. In Ubuntu (and presumably other Debian-based distros as well), there is no /etc/sysconfig/cpuspeed file--in fact, there's no /etc/sysconfig directory at all. That would explain why that pathname didn't quite ring a bell when I saw it in spaz's post.

After a little digging on Google, it seems that in Debian-based systems, the file is located at /etc/cpufreqd.conf. If it's not present (which seems to be the default in general) it's read from /etc/defaults/cpufreqd. However, I can't find either file on either of two different Ubuntu machines that I have access to, one running 8.04 and the other 9.04. Does anyone know where this file is supposed to be located on those distros?
mdettweiler is offline   Reply With Quote
Old 2009-11-17, 20:20   #11
Cruelty
 
Cruelty's Avatar
 
May 2005

31308 Posts
Default

I have a laptop with Ubuntu 9.04 installed, and I am using "CPU Frequency Scaling Monitor 2.26.1", which allows me to choose among several settings: 1.8 GHz, 1.2 GHz, 800 MHz, Conservative, Ondemand, Performance, Powersave
BTW: CPU = Core 2 Duo @ 1.8 GHz.

Last fiddled with by Cruelty on 2009-11-17 at 20:21
Cruelty is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
GPU throttling mattmill30 GPU Computing 0 2016-01-12 01:54
Remote control on proxied dynamic ip address henryzz Linux 5 2015-09-28 14:44
CPU throttling? pintoj Information & Answers 4 2009-06-18 17:32
i7 thermal throttling? fivemack Hardware 20 2009-03-20 23:49
which linux client should I use? static or dynamic linked one? nngs Software 2 2005-01-20 04:05

All times are UTC. The time now is 08:29.


Sat Jul 17 08:29:30 UTC 2021 up 50 days, 6:16, 1 user, load averages: 1.72, 1.67, 1.55

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.