Page 1 of 1
F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 6:08 am
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!
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 7:48 am
by bruce
That feature is not built into the client. Some folks have written their own scripts within their OS.
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 7:27 pm
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)?
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 7:32 pm
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
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 9:36 pm
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
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)
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 9:53 pm
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
Re: F@H Scheduled start and finished times?
Posted: Thu Apr 02, 2020 11:37 pm
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.
Re: F@H Scheduled start and finished times?
Posted: Fri Apr 03, 2020 6:24 am
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.
Re: F@H Scheduled start and finished times?
Posted: Sun Apr 12, 2020 9:03 pm
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?
Re: F@H Scheduled start and finished times?
Posted: Mon Apr 13, 2020 1:44 am
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.
Re: F@H Scheduled start and finished times?
Posted: Mon Apr 13, 2020 3:25 am
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.