Set folding to run at specific hours/days

Moderators: Site Moderators, FAHC Science Team

Post Reply
Tropical Snowman
Posts: 25
Joined: Sat Oct 18, 2025 2:08 pm

Set folding to run at specific hours/days

Post by Tropical Snowman »

Hello there,
is there a way to schedule Folding to run only during specific hours and days? For example, to take advantage of lower electricity rates, or to warm up during winter nights or avoid too much heat during summer.

In my case, the reason would be electricity rates and I'd like to set Folding to run from 23:00 (11 pm) to 16:00 (4 pm) next day; and full day on Sundays.

Thanks
jonault
Posts: 228
Joined: Fri Dec 14, 2007 9:53 pm

Re: Set folding to run at specific hours/days

Post by jonault »

There's nothing built into the client that does that. I think you could use automation features built into your OS together with command line commands to pause & resume folding on a schedule, but I haven't attempted it myself.
Mxyzptlk
Posts: 74
Joined: Wed Apr 08, 2020 8:55 pm
Hardware configuration: Lots... Look at my website: www.mxyzptlk.us
Location: California
Contact:

Re: Set folding to run at specific hours/days

Post by Mxyzptlk »

If you are running 7.6.21, you can us this to do that. But nothing for V8...

https://chromewebstore.google.com/detai ... ahoe?pli=1
I fold..... look at my folding setups here: https://mxyzptlk.us/about/
Tropical Snowman
Posts: 25
Joined: Sat Oct 18, 2025 2:08 pm

Re: Set folding to run at specific hours/days

Post by Tropical Snowman »

Mmmh, so nobody has ever requested that feature? Should I request it for the new release?
muziqaz
Posts: 2299
Joined: Sun Dec 16, 2007 6:22 pm
Hardware configuration: 9950x, 9950x3d, 7950x3d, 5950x, 5800x3d
7900xtx, RX9070, Radeon 7, 5700xt, 6900xt, RX550, Intel B580
Location: London
Contact:

Re: Set folding to run at specific hours/days

Post by muziqaz »

Tropical Snowman wrote: Sun Dec 14, 2025 7:13 pm Mmmh, so nobody has ever requested that feature? Should I request it for the new release?
How did you assume that no one requested that feature? :D
FAH Omega tester
Image
Joe_H
Site Admin
Posts: 8289
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Studio M1 Max 32 GB smp6
Mac Hack i7-7700K 48 GB smp4
Location: W. MA

Re: Set folding to run at specific hours/days

Post by Joe_H »

It has been a requested feature to be built into the client since the v7 days. But it is so far down the priority list for the one paid developer that I doubt it will ever be included. However the API for the v7 client was published, various people did create add-ons or scripts to do scheduling. The API for v8 has not been explicitly posted, but the client and web control are open source. I vaguely recall seeing mention that someone had created an alternate control for v7 that included scheduling.
Image
calxalot
Site Moderator
Posts: 1745
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Set folding to run at specific hours/days

Post by calxalot »

Some people are using whatever native scheduling exists on their OS with either fahctl or lufah.
calxalot
Site Moderator
Posts: 1745
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Set folding to run at specific hours/days

Post by calxalot »

Allow scheduling folding at certain times
https://github.com/FoldingAtHome/fah-we ... /issues/53
Mxyzptlk
Posts: 74
Joined: Wed Apr 08, 2020 8:55 pm
Hardware configuration: Lots... Look at my website: www.mxyzptlk.us
Location: California
Contact:

Re: Set folding to run at specific hours/days

Post by Mxyzptlk »

The feature is built into BOINC, no reason it shouldn't be in F@H. With the high cost of energy and time of use metering, I really don't understand why its not. Lack of the feature is literally preventing further people from actively folding.
I fold..... look at my folding setups here: https://mxyzptlk.us/about/
appepi
Posts: 142
Joined: Wed Mar 18, 2020 2:55 pm
Hardware configuration: HP Z600 (5) HP Z800 (3) HP Z440 (3) HP Z4G4 (3) ASUS Turbo GTX 1060, 1070, 1080, RTX 2060 (3) Dell GTX 1080 NVIDIA P1000 (2) K1200
Location: Sydney Australia

Re: Set folding to run at specific hours/days

Post by appepi »

This is one of a number of problems/ challenges with 8.4.9 that has led me to stay with 7.6.21 and use the scheduler in the Lar Systems app - see viewtopic.php?p=370490#p370490. Time of use electricity charging is increasingly common, and "Folding while I am using the computer anyway" seems to be decreasingly common, so it is surely time that scheduling was seen as a high priority.

Here in sunny AU the uptake of rooftop solar is such that oversupply of solar power at times has resulted in upcoming plans offering three "free" hours in the middle of the day, intended to help stabilise the overall system during the transition away from coal. This of course is handy for some folk and not so handy for others, but will certainly increase the variation in the costs of folding at different times of day for anyone who has to buy their electricity here. Most loads for most people are not so easy to adjust, but folding-only use is entirely discretionary and although none of my CPU's could fold anything in 3 hours, the 6 GPUs I usually run can do so. I already run the more efficient ones (RTX 2060s) for 9 "off peak" hours from 10pm to 7 am, and three others (2x GTX 1080, 1x GTX1070) for a single WU during the "off peak" hours, to stay within my notional Folding budget. The Lar Systems scheduler switches to "Finish and Stop" when the scheduled time ends (rather than "Pause") so occasionally I have to manually pause ill-behaved WUs, but luckily my current supply contract has a "shoulder" rate (=off peak +22%) from 7am to the start of "Peak" rates (=off peak +119%) at 2pm so a few hours of over-run don't matter much. The contract also replaces "peak" rates with "shoulder" rates on weekends, and I have to deal with that - if I want to- manually. Obviously this is not full automation of scheduling, but it works well enough for me.

I note that a programmed change from "Fold" status to either "Finish up and Stop" or "Pause" should be conditional, both for the good of science and the good of points. Obviously it is not good for anyone to Pause a job that is one minute away from completion, and not good for the Donor continue one (like a horrible project I complained about) that wanted to run for 14 more hours and even then would only award my 2060s with 60%-75% of their usual PPD. If part of the client setup were to be a relative electricity-rate profile, then it would be possible for Finish"/"Pause" decision to be made to be contingent on the Donor's choice of a cutoff on a suitable cost/benefit function based Scheduler times, and on predicted completion time and Cost/PPD with/without Pause. After all, the client IS running on a computer, and they are generally believed to be able to perform simple calculations. :eugeek:
Image
Tropical Snowman
Posts: 25
Joined: Sat Oct 18, 2025 2:08 pm

Re: Set folding to run at specific hours/days

Post by Tropical Snowman »

muziqaz wrote: Sun Dec 14, 2025 7:19 pm
Tropical Snowman wrote: Sun Dec 14, 2025 7:13 pm Mmmh, so nobody has ever requested that feature? Should I request it for the new release?
How did you assume that no one requested that feature? :D
Well, that was a question. Seems like many people agree it should be implemented.
Tropical Snowman
Posts: 25
Joined: Sat Oct 18, 2025 2:08 pm

Re: Set folding to run at specific hours/days

Post by Tropical Snowman »

calxalot wrote: Sun Dec 14, 2025 9:21 pm Some people are using whatever native scheduling exists on their OS with either fahctl or lufah.
Could you please provide an example? So that I copy it for my system. I'm on Windows 11, wouldn't know how to do it. I'm kind of a "casual" user, not a programmer or anything like that. Just like helping science. I'm okay with some cost even, but if I can keep the bill on the lower side that's certainly better.
Joe_H
Site Admin
Posts: 8289
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Studio M1 Max 32 GB smp6
Mac Hack i7-7700K 48 GB smp4
Location: W. MA

Re: Set folding to run at specific hours/days

Post by Joe_H »

Tropical Snowman wrote: Thu Dec 18, 2025 12:00 am
muziqaz wrote: Sun Dec 14, 2025 7:19 pm
Tropical Snowman wrote: Sun Dec 14, 2025 7:13 pm Mmmh, so nobody has ever requested that feature? Should I request it for the new release?
How did you assume that no one requested that feature? :D
Well, that was a question. Seems like many people agree it should be implemented.
No, some people agree, not "many".
Image
prcowley
Posts: 35
Joined: Thu Jan 03, 2019 11:03 pm
Hardware configuration: Op Sys: Linux Ubuntu Studio 25.04
Kernel: 6.14.0-34-generic (64-bit)
Processor: AMD Ryzen 7 7800X3D 8-Core Processor
Mem: 32 GB
GPU: NVIDIA GeForce RTX 4080 SUPER/PCIe/SSE2
Location: Gisborne, New Zealand

Re: Set folding to run at specific hours/days

Post by prcowley »

There is a utility program called fahctl (https://github.com/FoldingAtHome/fah-client-bastet) which is command line program that lets you start (fold) & pause and finish

Using crontab you could set up a start time "fahctl fold" and a stop time "fahctl pause"
I don't see any reason why this would not work, but I have not tried it myself.
Pete Cowley, Gisborne, New Zealand. The first city to see the light of the new day. :D
Image
calxalot
Site Moderator
Posts: 1745
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Set folding to run at specific hours/days

Post by calxalot »

Tropical Snowman wrote: Thu Dec 18, 2025 12:04 am
calxalot wrote: Sun Dec 14, 2025 9:21 pm Some people are using whatever native scheduling exists on their OS with either fahctl or lufah.
Could you please provide an example? So that I copy it for my system. I'm on Windows 11, wouldn't know how to do it. I'm kind of a "casual" user, not a programmer or anything like that. Just like helping science. I'm okay with some cost even, but if I can keep the bill on the lower side that's certainly better.
Install python from command shell.
This should offer to install python from the MS app store.
Note that lufah requires python 3.9 or later.

Code: Select all

python --version
Install lufah

Code: Select all

pip install pipx
pipx ensurepath
pipx install lufah
Use Windows Task Scheduler
The following was created by ChatGPT5 and has not been tested.
I am generally not a Windows user.

Create XML task definition files.
You will need to modify these examples for your needs.
It might be easiest to ask AI to create or modify these windows task manager xml files

lufah-fold-9pm.xml

Code: Select all

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4"
      xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">

  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2025-12-17T21:00:00</StartBoundary>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>

  <Principals>
    <Principal id="Author">
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>

  <Settings>
    <WakeToRun>true</WakeToRun>
    <StartWhenAvailable>true</StartWhenAvailable>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <Enabled>true</Enabled>
  </Settings>

  <Actions Context="Author">
    <Exec>
      <Command>lufah</Command>
      <Arguments>fold</Arguments>
    </Exec>
  </Actions>

</Task>
lufah-finish-8am.xml

Code: Select all

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4"
      xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">

  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2025-12-18T08:00:00</StartBoundary>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>

  <Principals>
    <Principal id="Author">
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>

  <Settings>
    <StartWhenAvailable>true</StartWhenAvailable>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <Enabled>true</Enabled>
  </Settings>

  <Actions Context="Author">
    <Exec>
      <Command>lufah</Command>
      <Arguments>finish</Arguments>
    </Exec>
  </Actions>

</Task>
Add tasks to scheduler

Code: Select all

schtasks /create /tn "Lufah Fold (9pm)" /xml lufah-fold-9pm.xml /f
schtasks /create /tn "Lufah Finish (8am)" /xml lufah-finish-8am.xml /f
There is a simple way to create tasks from command line,
but these tasks cannot wake system to run without using the Task Manager GUI to modify them.

Example to pause at 2pm

Code: Select all

schtasks /create ^
  /sc daily ^
  /st 14:00 ^
  /tn "Lufah Pause (2pm)" ^
  /tr "lufah pause" ^
  /f
Verify that task

Code: Select all

schtasks /query /tn "Lufah Pause (2pm)" /v /fo list
Every day but Sunday

Code: Select all

schtasks /create ^
  /sc weekly ^
  /d MON,TUE,WED,THU,FRI,SAT ^
  /st 14:00 ^
  /tn "Lufah Pause (2pm)" ^
  /tr "lufah pause" ^
  /f
Post Reply