Page 1 of 1

Shutdown after WU Complete and reported

Posted: Thu Apr 23, 2020 6:58 am
by alsutton
Is there a way to tell a client to complete and report the current WU(s) and not request a new one?

My machines are powered by solar and a battery, as well as being located somewhere where on an exceptionally hot day they can start to thermally throttle, so it'd be great to be able to put a hook into some code which requests the weather for the next day and shuts down some of them overnight once they've completed and reported their current work unit.

At the moment I'm blocking the fetching of new work units by putting the following into the hosts file;

Code: Select all

127.0.0.1 localhost assign1.foldingathome.org assign2.foldingathome.org
but it'd be great to do it in a "cleaner" way.

Re: Shutdown after WU Complete and reported

Posted: Thu Apr 23, 2020 8:46 am
by PantherX
Welcome to the F@H Forum alsutton,

You can use the Finish command which will instruct the client to finish folding the current WU and then not request any. Also, if you would like to fold X WUs and then pause the system, you can use this setting:

Code: Select all

  max-units <integer=0>
    Process at most this number of units, then pause.

Re: Shutdown after WU Complete and reported

Posted: Thu Apr 23, 2020 8:49 am
by Neil-B
At least one folder has recently written code to use the finish flag to ensure their kit isn't folding when they want it for work … They have it start after work hours and run a finish command a couple of hours before.

It should therefore be possible for you to code something that looks at your local weather forecast on the web and uses that to trigger a finish command if the weather is forecast to be too warm … but a simpler one would just be a script you set going in the evening if the forecast for the next day is "hot" that sends a finish command to the client at an appropriate time … What that time will be will be a judgement call on your part as it may depend on WU size and how quick your kit is.

If you search around the forums a bit you should find the topic from the folder who did this recently if you need advice … Will also depend a lot on what OS you are running as to how this might be best approached.

This thread may also give some clues viewtopic.php?f=106&t=33809&p=321395&hi ... vb#p321395

Re: Shutdown after WU Complete and reported

Posted: Thu Apr 23, 2020 1:06 pm
by klaus
I'd highly appreciate a possibilty of telling the client "Finish and Shutdown Windows".

I am also running on PV-Energy and would really like to let a job finish, submit and subsequently switch off my computer. A simple thing of environmental responsibility and money saving.

Regards
Klaus

Re: Shutdown after WU Complete and reported

Posted: Thu Apr 23, 2020 4:20 pm
by Joe_H
As mentioned, the client can be controlled through scripts. The client is accessible through the telnet protocol on port 36330 connecting to the local IP 127.0.0.1. You can connect directly using telnet or netcat to that address and port.

Or you can send commands using FAHClient --send as mentioned in the linked topic. Documentation is provided by FAHClient --help.

And finally you can program your own app to connect to for monitoring and controlling FAHClient - https://github.com/FoldingAtHome/fah-co ... Client-API.

Shutting down Windows is outside the scope of programming for the client itself, that would have to be handled by your own script.

Re: Shutdown after WU Complete and reported

Posted: Sun Apr 26, 2020 4:17 pm
by alsutton
Thanks for the tips. Much appreciated :).

Re: Shutdown after WU Complete and reported

Posted: Sun Apr 26, 2020 4:20 pm
by bruce
klaus wrote:I'd highly appreciate a possibilty of telling the client "Finish and Shutdown Windows".
This is areadly on the official list of proposed enhancements.

Re: Shutdown after WU Complete and reported

Posted: Mon Apr 27, 2020 8:33 pm
by Zangetsu
try viewtopic.php?f=108&t=34860
It's the script i'm using.