Scheduling folding in Windows

Moderators: Site Moderators, FAHC Science Team

Post Reply
Envergure
Posts: 1
Joined: Mon Jul 15, 2019 1:08 am

Scheduling folding in Windows

Post by Envergure »

Hello,

I have a pretty powerful Windows 10 machine running Folding, and it makes my home office really hot. It's in an old townhouse without central air. To avoid this, I was wondering if there is a way to schedule folding to run from 10:00pm to 5:00am every day, and from 7:30am to 4:00pm on weekdays. Is it possible to set that up?

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

Re: Scheduling folding in Windows

Post by bruce »

Yes, there are many ways to schedule programs (including FAH) but none are specifically supported by those who distribute official versions of FAH's programs. It has been discussed elsewhere (including on this forum) but unfortunately you are on your own for finding that support.

Personally, I like the methods that involve sending telnet messages to FAHClient that contain the words like start/stop/fold/pause (along with other words) from simple jobs that run under the batch scheduler contained in your OS. The tools are all there, but it's up to you to use them to do what you want.
MeeLee
Posts: 1375
Joined: Tue Feb 19, 2019 10:16 pm

Re: Scheduling folding in Windows

Post by MeeLee »

If the software can set the state of WUs to 'finishing', it'd be the best option.
But if it just turns off the PC, it's no different than methods below (without installing software):


If you don't want to bother with software, here are some alternatives:

Just force your PC to go into, and come out of sleep // hibernation mode using task scheduler.
No need for special software.
This feature is available in Windows,
https://www.groovypost.com/howto/schedu ... matically/
https://www.thewindowsclub.com/wake-up- ... ep-windows

or use the 'crontab -e' command for Linux:
https://www.howtogeek.com/101288/how-to ... tab-files/

Pros:
You'll achieve your goal of turning on or off the PC at precise times.
You also don't need to be present at all at sleep or wake times; (just as long as you've verified that WUs restart without errors from hibernation or sleep mode).

Cons:
It's nearly impossible to time the shut down exactly when WUs are finished.
WUs can run from 0.5 to 5+ hours on modern hardware. When you shut down your PC at a fixed time, chances are you almost always will lose some of the quick return points on those WUs.
Between 0 to 15 minutes, or 1 to 2% of a WU will be discarded when you shut down a PC.
But when putting it into sleep or hibernation mode, those percentages won't be lost, though it may give errors (I don't know); so test it out if WUs can continue folding coming out of a sleep state.



Another solution (but you will also lose (bonus) points on your WUs) is to just plug your router into an AC timer plug.
By turning on or off your router, you can cut your PC's access to the internet.
The PC will continue to finish the WUs it's working on, so after the shutdown of the router, the PC might continue to work for another hour or two, until all WUs are finished.

The good thing is, as soon as you connect again to the internet, the WUs can be uploaded and you'll get immediate points; unlike the above, where the WUs still need to finish after turning on the PC.

The bad thing is, that FAH Client doesn't check when internet access is reestablished, and you will need to manually resume the WUs to start the upload and download.
Also, the PC might or might not have the option to go into sleep mode. I don't know if FAHControl is smart enough to keep the PC from entering into sleep mode when it's folding...
So chances are your PC will remain on (though not folding) for the remaining of the time, until reconnected with the internet.
This option is best when you are present when the PC needs to reconnect to the Internet. (like make it a custom to wake up on time, like when making a coffee, just restart WUs when the internet connection is online); while you don't need to be present when the system goes offline.
brett
Posts: 2
Joined: Sat Jul 25, 2020 10:53 pm

Re: Scheduling folding in Windows, macOS, and Linux

Post by brett »

I’m a bit late to this thread, but I’ve just written a guide for how to schedule FAHClient to run only at specific times. My approach configures the FAHClient to pause on start up, and then use scheduled tasks (using tsched, launchd, or systemd) to send pause and resume commands to FAHClient on a schedule. The link includes instructions for Windows, macOS, and Linux.

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

Re: Scheduling folding in Windows

Post by bruce »

I have not tested your code, but in reading your blog, it looks like it should work.

Thanks for your enhancement.
Post Reply