F@H Scheduled start and finished times?

Moderators: Site Moderators, FAHC Science Team

Post Reply
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

F@H Scheduled start and finished times?

Post by napostrophe »

Hello.

With the recent COVID-19 effort I finally decided to get into Folding @ Home. Something I've been wanting to do since getting it up and running is schedule it to stop and start during off-times. Due to COVID-19 both myself and the two others I live with are up and working during the day in our office. When F@H is working my system is somewhat loud and puts out a non-insignificant amount of heat which can be kinda irritating to everyone in the space. As such, I was wondering if anyone knew any good ways to schedule F@H to start at some time and tell it to finish the WU it's currently on at another. This would hopefully tell the system to start folding overnight (once people stop working) and then stop in the morning (once people start working)

The limit of what I could find was a post from 2009 (with dead links) which just shut down F@H outright without waiting for the WUs to finish as far as I could tell (to be honest I am not the most knowledgeable with regards to how F@H works given that I just started).

Help would be greatly appreciated!
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: F@H Scheduled start and finished times?

Post by bruce »

That feature is not built into the client. Some folks have written their own scripts within their OS.
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

Re: F@H Scheduled start and finished times?

Post by napostrophe »

bruce wrote:That feature is not built into the client. Some folks have written their own scripts within their OS.
I was guessing that was the case. How would I go about making a script that could tell the client to finish (and not just outright kill the program)?
Neil-B
Posts: 2027
Joined: Sun Mar 22, 2020 5:52 pm
Hardware configuration: 1: 2x Xeon E5-2697v3@2.60GHz, 512GB DDR4 LRDIMM, SSD Raid, Win10 Ent 20H2, Quadro K420 1GB, FAH 7.6.21
2: Xeon E3-1505Mv5@2.80GHz, 32GB DDR4, NVME, Win10 Pro 20H2, Quadro M1000M 2GB, FAH 7.6.21 (actually have two of these)
3: i7-960@3.20GHz, 12GB DDR3, SSD, Win10 Pro 20H2, GTX 750Ti 2GB, GTX 1080Ti 11GB, FAH 7.6.21
Location: UK

Re: F@H Scheduled start and finished times?

Post by Neil-B »

If you post details of what operating system you are using someone may have a script they could let you have or to be able explain how to do it quickly :)
2x Xeon E5-2697v3, 512GB DDR4 LRDIMM, SSD Raid, W10-Ent, Quadro K420
Xeon E3-1505Mv5, 32GB DDR4, NVME, W10-Pro, Quadro M1000M
i7-960, 12GB DDR3, SSD, W10-Pro, GTX1080Ti
i9-10850K, 64GB DDR4, NVME, W11-Pro, RTX3070

(Green/Bold = Active)
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

Re: F@H Scheduled start and finished times?

Post by napostrophe »

Neil-B wrote:If you post details of what operating system you are using someone may have a script they could let you have or to be able explain how to do it quickly :)
Oh fair point :P

I'm running Windows 10 Pro Version 1909 Build 18363.752 (guessing anything that works on Windows 10 will work on pretty much any build or version number, but specifying anyways)
Neil-B
Posts: 2027
Joined: Sun Mar 22, 2020 5:52 pm
Hardware configuration: 1: 2x Xeon E5-2697v3@2.60GHz, 512GB DDR4 LRDIMM, SSD Raid, Win10 Ent 20H2, Quadro K420 1GB, FAH 7.6.21
2: Xeon E3-1505Mv5@2.80GHz, 32GB DDR4, NVME, Win10 Pro 20H2, Quadro M1000M 2GB, FAH 7.6.21 (actually have two of these)
3: i7-960@3.20GHz, 12GB DDR3, SSD, Win10 Pro 20H2, GTX 750Ti 2GB, GTX 1080Ti 11GB, FAH 7.6.21
Location: UK

Re: F@H Scheduled start and finished times?

Post by Neil-B »

I think the tricky bit will be the telling it to finish before stopping … Obviously Task Scheduler would be a crude solution but would stop WUs mid fold and then restart - this is sub optimal from the perspective of get the science done quickly (aka points) … Wouldn't surprise me to find someone (cleverer than I) could right a VB script or some such to trigger "Finish" at a time which should allow most WUs to complete before everyone turns up and the Fold at the time everyone should have left.

Someone may have already done something like this - or with quite a few people happy to help at the moment someone might take it on for fun :)
2x Xeon E5-2697v3, 512GB DDR4 LRDIMM, SSD Raid, W10-Ent, Quadro K420
Xeon E3-1505Mv5, 32GB DDR4, NVME, W10-Pro, Quadro M1000M
i7-960, 12GB DDR3, SSD, W10-Pro, GTX1080Ti
i9-10850K, 64GB DDR4, NVME, W11-Pro, RTX3070

(Green/Bold = Active)
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

Re: F@H Scheduled start and finished times?

Post by napostrophe »

So after doing a little more research, according to this reddit thread you can tell FAHclient to pause, unpause, and finish from command line using

Code: Select all

FAHClient --send-pause
FAHClient --send-unpause
FAHClient --send-finish
I will do a little testing to see if this actually works. If it does it's likely a script could very easily be made to automate this!

Edit: actually dug through the CMI documentation and found the following:

Code: Select all

--finish
     Finish all current work units, send the results, then exit.

--send
     Send all finished work units, then exit.

--send-finish [string]
     Finish a slot or all slots on an already running client

--send-pause [string]
     Pause a slot or all slots on an already running client

--send-unpause [string]
     Unpause a slot or all slots on an already running client
With these commands, making a script is very viable.
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

Re: F@H Scheduled start and finished times?

Post by napostrophe »

Update: Did it!

I made two batch scripts: one to tell it to finish folding and another to tell it to unpause.

Both of them log to a text file in the same folder the scripts are stored in. Each script was just three lines (one to log the script starting, one to run the command and log it, and one to log the script ending). Task Scheduler was relatively easy to use to tell it to run each of them at the desired times.

Something of note is that if you want to do this yourself, you may want to edit the properties of each task to enable the "Run whether user is logged on or not" setting (this will prevent a console from popping up when the script runs), enable the "Wake the computer to run this task" setting (this may not be necessary, but it wouldn't hurt to enable), and enable the "Run task as soon as possible after a scheduled start is missed" setting (I'm not entirely clear how this setting operates specifically, but my understanding is that it's explanatory in that it will try again if it missed the trigger time). I also set it to restart a few times if the task fails just in case.
shaggie76
Posts: 1
Joined: Sun Apr 12, 2020 8:51 pm

Re: F@H Scheduled start and finished times?

Post by shaggie76 »

Thank you -- I was looking for this -- but there's one thing I'm looking to add: I want to actually shut down my farm when the current active tasks are done (I use a BIOS scheduled event to wake the machines up when the electricity is cheap again).

So what I need to do is send-finish and then wait for any active tasks to end. I was thinking I could poll queue-info and sniff for matching strings but I couldn't see active tasks there. Has anyone figured out a neat way to do this?
napostrophe
Posts: 6
Joined: Thu Apr 02, 2020 6:00 am

Re: F@H Scheduled start and finished times?

Post by napostrophe »

shaggie76 wrote:Thank you -- I was looking for this -- but there's one thing I'm looking to add: I want to actually shut down my farm when the current active tasks are done (I use a BIOS scheduled event to wake the machines up when the electricity is cheap again).

So what I need to do is send-finish and then wait for any active tasks to end. I was thinking I could poll queue-info and sniff for matching strings but I couldn't see active tasks there. Has anyone figured out a neat way to do this?
Unless I misunderstand, I believe --finish will tell all work units to finish and then exits F@H when they're done. This doesn't shut down the systems, but you may be able to get something to catch F@H exiting and then tell the system to shut down.
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: F@H Scheduled start and finished times?

Post by PantherX »

napostrophe wrote:...Unless I misunderstand, I believe --finish will tell all work units to finish and then exits F@H when they're done. This doesn't shut down the systems, but you may be able to get something to catch F@H exiting and then tell the system to shut down.
That's correct. Finish will ensure that the current WU is completed and uploaded successfully to the Servers. It will not download a new WU unless you start folding again.
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
Post Reply