Suggestion: separate options for idle and working

Moderators: Site Moderators, FAHC Science Team

Schmich
Posts: 7
Joined: Sun Apr 10, 2011 6:31 pm

Suggestion: separate options for idle and working

Post by Schmich »

Hello,
I am simply suggesting to have different settings depending if the computer is idling or not. I am constantly changing between Idle Full, Light, Off depending on if I'm on the computer and what I do. Many times I even forget to remove Off or change Light to Idle Full. To me, a significant amount of folding is lost (of course totally negligible to this whole project). However maybe I'm not the only one with this issue? It would make things simpler and more automated to me at least.

Two mocks in case my explaining is terrible:http://imgur.com/a/Y9JlT

Thanks
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Suggestion: separate options for idle and working

Post by bruce »

Your mockup shows the Chrome NaCl client. If you're suggesting this for that client, I doubt anything will come of it [and, of course, I could be wrong]. Simplicity is one of the hallmarks of that client and additional features tend to increase the complexity. Personally, I find that NaCl runs just fine whether my system is idle or not.

If you run the V7 client, there are several options available which can be managed through the Advanced Control front-end (FAHControl).

If you happen to run both NaCl for your CPUs and V7 for your GPU(s), I think you'd need 14 options, not just 7 which is a :( idea.
PantherX
Site Moderator
Posts: 7020
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: Suggestion: separate options for idle and working

Post by PantherX »

Welcome to the F@H Forum Schmich,

Regarding your tweaking of Web Control for V7, development decided that it was getting complex for new donors. Generally speaking, the default Medium works best for most users since by default, the CPU Slot has a very low priority so virtually all other applications running will be given preference over the CPU Slot. Moreover, the Medium prevents GPU from folding (if configured) while the system is being used since it may introduce screen lag which is could be very noticeable.

Is there a specific reason for you to constantly change the power levels? We could help you optimize your set-up if you provide us with details.
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
Schmich
Posts: 7
Joined: Sun Apr 10, 2011 6:31 pm

Re: Suggestion: separate options for idle and working

Post by Schmich »

Thanks for your swift replies and sorry for my late one. I had very busy days right after posting and forgot that I finally bothered suggesting this.

I'm running V7. The NaCl was only because it was easy to make a mock-up explaining what I meant. I've gone in the Advanced section and used what I understand (most things). However if there are special configs/flags then I can probably learn more.

I have a few reasons that I change my power settings a few times to a dozen times a day.

[*]I want the computer to be fully utilized when I'm away
[*]For gaming or video editing or other demanding things I don't want the computer to fold at all
[*]When doing casual things on the computer I want folding to be on Light or Medium

I feel ashamed of my stupidity though. I'm not the biggest folder but I've been folding for many many years. Those power changes are part of my daily routine! Yet it's only now when I analyse and write it up, I realise that I shouldn't turn "Off" folding when I eg. game but merely just put it on Idle! My main issue is that when I go out for several hours (sometimes days) that I have left it on "Off" when I want my computer to be fully working.

The second issue is when it's left on Light/Medium and the computer is actually idling. Maybe you take a shower, make/eat dinner, go out etc. Those things can be anything from 20mins to several hours every single day. Assuming that most people don't have a folding farm and that I'm not a rare case I would say it could be a decent amount of possible folding lost.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Suggestion: separate options for idle and working

Post by bruce »

Schmich wrote:
  • I want the computer to be fully utilized when I'm away
  • For gaming or video editing or other demanding things I don't want the computer to fold at all
  • When doing casual things on the computer I want folding to be on Light or Medium
I suspect that you may be putting a lot of effort into maximizing your contribution in ways that actually don't help (much?). Making too many adjustments can reduce your productivity.

When you change settings, it almost always causes a minor loss of progress. The WU resumes work from the most recent checkpoint, not from the current amount of progress. (In general, you don't know when checkpoints happen.) Obviously if that minor loss exceeds the benefit you gain by temporarily running faster, you shouldn't bother making the change.

For the sake of simplicity, suppose we're only talking about CPU processing.

Suppose I'm folding with half of my CPU-cores because I wanted to leave plenty of resources for what I was doing. I plan to take a shower. I adjust the slider (or change a setting with FAHControl) to use all of my CPU-cores while I'm gone. Later, I come back and reset it to use half of the CPU-cores.

There are a couple of possibilities.
1) I'll be gone 20 minutes.
2) I'll be gone 2 hours.

A) The FAHCore just wrote a checkpoint.
B) The most recent checkpoint was 14.9 minutes ago.

I'm assuming checkpoints are every 15 minutes (most common for CPUs) and I'm measuring progress in what half your cores produce in X minutes.

Case 1A.
* Don't restart: 20 minutes work with half the cores will be completed and the WU will continue from that point when I get back.
* Restart with twice as many cores: During 15 minutes, twice as much progress will be accomplished. The restart 5 minutes later will be wasted because it restarts from the (then) most recent checkpoint.
*** 30 minutes work is greater than 20, so restarting twice was a net benefit of 5 minutes.

Case 1B.
* Don't restart: Again, 20 minutes work will be accomplished.
* Restart with twice as many cores: THe first restart will dump 14.9 minutes work. The second restart will dump 5x2 minutes work, and 15x2 minutes work will be recorded for a net of 15.1 minutes actual progress
*** 15.1 is less than the 20 minutes which could have been accomplished by not restarting resulting in a loss of 4.9 minutes of progress.

Case 2. Very similar to case 1 except that much longer is spent at double speed, so restarting is a good thing to do.

GPU processing has similar issues, but they're not identical. The frequency that checkpoints occur depends on the project AND on the speed of your GPU so it does get more complicated.

Anyway, if you can establish acceptable level of foreground performance that blends some folding with other things (depending on what things you're talking about) that avoids making unnecessary changes, it's probably a good thing to do. Most people find that CPU folding does not impact foreground activity because it runs at a lower priority that almost anything they do. The impact of GPU folding while doing other things is greater, which is why the default is to run GPU folding only when idle. Only through experimentation can you decide what's right for you.
PantherX
Site Moderator
Posts: 7020
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: Suggestion: separate options for idle and working

Post by PantherX »

Can you please post your log file (viewtopic.php?f=24&t=26036) so that we can see what your hardware is and what F@H settings are configured?

Assuming that you have a decent system, here is what I would do:
1) Use Advanced Control (AKA FAHControl) to set GPU Slot to always idle by right-clicking the GPU Slot and select "On Idle"
2) Limit the number of CPUs manually to ensure that daily applications (excluding video editing, gaming, other CPU intensive applications) run flawlessly by opening up Advanced Control (AKA FAHControl) -> Configure -> Slots Tab -> Select CPU Slot -> Click Edit -> Replace -1 with a suitable value
3) When attempting to run any CPU intensive application, right-click the F@H icon in the notification tray and select pause. When you have finished the CPU intensive application, right-click the F@H icon in the notification tray and select Pause again to toggle it off

What I find is that 1 or 2 CPUs are sufficient for my daily programs to run so in effect, rather than remembering to change the Folding Power Level multiple times a day, you just have to remember to toggle pause on or off from the notification tray. Moreover, when the slots are pause, the icon changes so you also have a visual change which may make it easy for you to remember if you have opted to show the F@H icon always in the notification tray area (http://www.7tutorials.com/how-customize ... ation-area).

The only drawback with this method is if the CPU intensive work is over and the system is idle, F@H will not run. This depends on if you leave the CPU applications working overnight or not. A workaround for this is that you toggle Pause off and also select "On Idle" for the CPU slot. Thus, whenever the CPU intensive application is over, F@H will run. However, once you return to the system, you can then unselect "On Idle" option (via the Advanced Control) for the CPU Slot and it will resume work while you are using your daily applications.
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
jrweiss
Posts: 707
Joined: Tue Dec 04, 2007 6:56 am
Hardware configuration: Ryzen 7 5700G, 22.40.46 VGA driver; 32GB G-Skill Trident DDR4-3200; Samsung 860EVO 1TB Boot SSD; VelociRaptor 1TB; MSI GTX 1050ti, 551.23 studio driver; BeQuiet FM 550 PSU; Lian Li PC-9F; Win11Pro-64, F@H 8.3.5.

[Suspended] Ryzen 7 3700X, MSI X570MPG, 32GB G-Skill Trident Z DDR4-3600; Corsair MP600 M.2 PCIe Gen4 Boot, Samsung 840EVO-250 SSDs; VelociRaptor 1TB, Raptor 150; MSI GTX 1050ti, 526.98 driver; Kingwin Stryker 500 PSU; Lian Li PC-K7B. Win10Pro-64, F@H 8.3.5.
Location: @Home
Contact:

Re: Suggestion: separate options for idle and working

Post by jrweiss »

bruce wrote:When you change settings, it almost always causes a minor loss of progress. The WU resumes work from the most recent checkpoint, not from the current amount of progress. (In general, you don't know when checkpoints happen.) Obviously if that minor loss exceeds the benefit you gain by temporarily running faster, you shouldn't bother making the change.
Is it not practicable to have the client write a checkpoint whenever the client is Paused or the settings are changed? I think a few seconds of write time is worth the potential of lost work...
Ryzen 7 5700G, 22.40.46 VGA driver; MSI GTX 1050ti, 551.23 studio driver
Ryzen 7 3700X; MSI GTX 1050ti, 551.23 studio driver [Suspended]
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Suggestion: separate options for idle and working

Post by bruce »

jrweiss wrote:Is it not practicable to have the client write a checkpoint whenever the client is Paused or the settings are changed? I think a few seconds of write time is worth the potential of lost work...
It is not. It's variable, and is generally more than just a few seconds of write time. Checkpoints can only be made at specific points in the analysis. Waiting for the next time one of those specific points is scheduled to occur has been deemed unreasonable since it may take "too long."

The original question that I saw asked for a checkpoint before a shutdown and obviously if FAH prevents your OS from rebooting for a (undefined) "long" time, we will have impatient people intentionally crashing their OS because "it must be hung." (I don't have actual numbers to give you.)
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Suggestion: separate options for idle and working

Post by Joe_H »

This would not be practical at this time. The checkpoints are written by the FAHCore processes, the client just manages downloads and uploads as well as starting and stopping the folding processes. Getting a checkpoint written every time a pause or change is made would require rewriting all folding cores to add that functionality. In addition, different folding cores write checkpoints under different circumstances. Some write one at a time interval that can be set through the client and passed to the core process. Other cores write a checkpoint after a certain amount of progress, for example after every percent or several percent. Bruce has given a couple other reasons it is not possible.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
sweetleon
Posts: 5
Joined: Fri May 29, 2020 2:48 pm
Hardware configuration: MacBook Pro (Retina, 15-inch, Late 2013)
CPU: 2.3 GHz Quad-Core Intel Core i7
Memory: 16 GB 1600 MHz DDR3
Graphics: NVIDIA GeForce GT 750M 2 GB
Intel Iris Pro 1536 MB

Re: Suggestion: separate options for idle and working

Post by sweetleon »

I realize this is a very old thread, but as a new user I found it bc I wanted to do the same exact thing: have different settings for Idle and Working, and not have to change them manually all the time. Is that available now? (I gather that this thread concluded that checkpoints at arbitrary times isn't viable, but I can't see why dual settings wouldn't be viable.) Thanks!

Image
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Suggestion: separate options for idle and working

Post by Joe_H »

This suggestion has come up repeatedly, and has been requested on the development site as an enhancement . There have been many other items that have taken priority, I do not have any idea if this enhancement will ever make the cut. You can tell from how old this topic is how long it has been requested.

The provided option so far is that the client does take commands several ways, so scripts can be written to do the changes for you. There is also a documented API, anyone who wanted this enough could have written a replacement to FAHControl that would check for differences between "Idle" and "Working". No one has to my knowledge.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
sweetleon
Posts: 5
Joined: Fri May 29, 2020 2:48 pm
Hardware configuration: MacBook Pro (Retina, 15-inch, Late 2013)
CPU: 2.3 GHz Quad-Core Intel Core i7
Memory: 16 GB 1600 MHz DDR3
Graphics: NVIDIA GeForce GT 750M 2 GB
Intel Iris Pro 1536 MB

Re: Suggestion: separate options for idle and working

Post by sweetleon »

Thanks, @Joe_H!

I can't quite figure out how to use the API or command-line to change from, say, Full Power to Light. If someone can tell me how to do that, I'm pretty sure I can accomplish what I want by combining it with this crontab command for detecting idleness on my Mac: https://apple.stackexchange.com/a/106968.
sweetleon
Posts: 5
Joined: Fri May 29, 2020 2:48 pm
Hardware configuration: MacBook Pro (Retina, 15-inch, Late 2013)
CPU: 2.3 GHz Quad-Core Intel Core i7
Memory: 16 GB 1600 MHz DDR3
Graphics: NVIDIA GeForce GT 750M 2 GB
Intel Iris Pro 1536 MB

Re: Suggestion: separate options for idle and working

Post by sweetleon »

Looks like I can accomplish what I need with the info at https://github.com/FoldingAtHome/fah-co ... Client-API. I'll post here once I figure something out!
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Suggestion: separate options for idle and working

Post by bruce »

I think the thing you're looking for is the telnet interface. All functions that can be adjusted in either FAHClient or WebClient are accomlished by that GUI program passing messages to FAHClient. Start the equivalent of a tellnet client and connect to 127.0.0.1 36330. There's a help file so interface is self-documenting. Once you figure out what you want to do, you can set up a script to do whatever you've done interactively.

It really helps if you perform the operations with FAHControl first such as starting a folding slot or adjusting the number of CPU threads that are running. The POWER slider simply selects predefined combinations whereas FAHControl gives you munch more flexibility.
sweetleon
Posts: 5
Joined: Fri May 29, 2020 2:48 pm
Hardware configuration: MacBook Pro (Retina, 15-inch, Late 2013)
CPU: 2.3 GHz Quad-Core Intel Core i7
Memory: 16 GB 1600 MHz DDR3
Graphics: NVIDIA GeForce GT 750M 2 GB
Intel Iris Pro 1536 MB

Re: Suggestion: separate options for idle and working

Post by sweetleon »

Thanks for pointing me at those resources, Bruce & Joe_H! With your help, I've got something working pretty well on my MacBook. However, it's not a cross-platform solution for Windows & Linux, and even if it were the setup is probably too complex for most users.

Do you know who I could contact to get access to build such a solution into the Folding@Home myself? I'm an experienced software engineer, and my hunch is that it'll be easier to implement in FAHclient for everyone than it was to build this solution for myself and Mac power users.

To get the same setup ON A MAC ONLY run the following script in Terminal.app.

Code: Select all

cat > "$HOME/FoldingAtHomeIdle.sh" <<- EOSH
#!/bin/sh
# set the power of Folding@Home based on whether the computer is idle

# based on https://apple.stackexchange.com/a/106968
IDLE_TIME=$(/usr/sbin/ioreg -c IOHIDSystem|awk '/HIDIdleTime/{printf "\%i",$NF/1000000000;exit}')
if (test $IDLE_TIME -ge 300); then
	if (pmset -g assertions | grep -q 'PreventUserIdleSystemSleep *0'); then
		POWER=full
	else
		POWER=medium
	fi
else
	POWER=light
fi

echo option power $POWER > /dev/tcp/127.0.0.1/36330
echo "`date`	$POWER	$IDLE_TIME" >> "/tmp/`basename $0`.output"
EOSH

(crontab -l; echo; echo '# set the power level of Folding@Home based on whether the system is idle'; echo '* * * * * "${HOME}/FoldingAtHomeIdle.sh"') | crontab -
Post Reply