Autosuspend of FAH if specific ext process becomes active?

If you're new to FAH and need help getting started or you have very basic questions, start here.

Moderators: Site Moderators, FAHC Science Team

Post Reply
Tuna_Ertemalp
Posts: 68
Joined: Sun Mar 22, 2020 8:54 pm
Hardware configuration: OS:Win10
GPUs: EVGA

CPU (cores), RAM, (GPU Core OC, Mem OC): GPU(s), Motherboard:

* AMD Ryzen 5 3600 (6C), 32G DDR4-2400, (+0,+0): 3090 FTW3 ULTRA, Gigabyte AB350M-D3H-CF
* Intel Core i7 5960X (8C), 32G DDR4-2400, (+0,+0): 3090 XC3 ULTRA HYBRID, ASUS X99-M WS
* Intel Core i7 5960X (8C), 32G DDR4-2400, (+100,+200): 2x 3090 FTW3 ULTRA, ASUS X99-E WS/USB 3.1
* Intel Core i7 970 (6C), 24G DDR3-1333, (+0,+0): 2x 3080 FTW3 ULTRA HYBRID, ASUS RAMPAGE III GENE
* Intel Core i7 5960X (8C), 16G DDR4-2400, (+100,+0): 1080 Ti FTW3 + HYBRID KIT, ASRock X99 OC Formula/3.1
* AMD Ryzen 7 2700X (8C), 16G DDR4-2666, (+100,+200): 3090 FTW3 ULTRA HYBRID, ASRock B450M Pro4
* AMD Ryzen TR 1950X (16C), 32G DDR4-2133, (+100,+200): 3x 3090 XC3 ULTRA HYBRID, ASRock X399 Taichi
* Intel Core i7 5960X (8C), 64G DDR4-2133, (+100,+0): 1080 Ti FTW3 + HYBRID KIT, 2x 1080 Ti SC2 HYBRID, MSI X99A XPOWER AC
Location: Seattle, WA, USA

Autosuspend of FAH if specific ext process becomes active?

Post by Tuna_Ertemalp »

One of my hosts is a Windows Media Center (yes, still running Win7) with a 4-tuner card, recording cable TV. As such, it is only busy when there is recording/viewing, therefore largely idle. I'd like to run FAH on it 100% at FULL, but that ends up affecting the recording quality as well as viewing. Before I converted my hosts from BOINC to FAH recently, on this machine, I was able to use BOINC's cc_config.xml to define:

<exclusive_app>ehrec.exe</exclusive_app>
<exclusive_gpu_app>ehrec.exe</exclusive_gpu_app>
<exclusive_app>ehshell.exe</exclusive_app>
<exclusive_gpu_app>ehshell.exe</exclusive_gpu_app>

So, every time there was an activation of WMC, from the host PC or from a WMC Extender, the BOINC process would get into a PAUSE status for the CPU and GPU.

I am looking to finding something like this for FAH. Is it possible?

If not, I guess I could write a CMD that starts on Windows boot and looks for active eh*.exe processes every 60 seconds, and somehow pauses any running FAH processes, and then unpauses them if no eh*.exe was found to be active. If that is the only way, does someone know a cmdline for FAH on WIndows that would tell it to PAUSE/FOLD?

Thanks
Tuna
Small things make quality, but quality is no small thing. (Adapted from Henry Royce talking about perfection, not quality)
8 Win10 PCs/22 slots: 8x CPUs (3xAMD+5xIntel=68C/122T), 14x NVIDIA EVGA GPUs (8x 3090, 2x 3080, 4x 1080Ti) [Details in my profile]
Image
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Autosuspend of FAH if specific ext process becomes activ

Post by Joe_H »

Something like this is not built into the F@h client, but the software does have the ability to accept commnnds from a script. Several scripts have been posted here over the years.

The options are to use the telnet connection on port 36330 at local IP 127.0.0.1, use the FAHClient command from the command line to send commands, or program an app using the API - https://github.com/FoldingAtHome/fah-co ... Client-API. The last is a bit more involved.

Using a telnet connection you will get a command prompt. There is not much documentation beyond the help command, but it can be used to pause and start folding.

For the second, the documentation can be seen by using 'FAHClient --help'. The most useful function for your purposes will probably be 'FAHClient --send' with some command to start or stop.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Tuna_Ertemalp
Posts: 68
Joined: Sun Mar 22, 2020 8:54 pm
Hardware configuration: OS:Win10
GPUs: EVGA

CPU (cores), RAM, (GPU Core OC, Mem OC): GPU(s), Motherboard:

* AMD Ryzen 5 3600 (6C), 32G DDR4-2400, (+0,+0): 3090 FTW3 ULTRA, Gigabyte AB350M-D3H-CF
* Intel Core i7 5960X (8C), 32G DDR4-2400, (+0,+0): 3090 XC3 ULTRA HYBRID, ASUS X99-M WS
* Intel Core i7 5960X (8C), 32G DDR4-2400, (+100,+200): 2x 3090 FTW3 ULTRA, ASUS X99-E WS/USB 3.1
* Intel Core i7 970 (6C), 24G DDR3-1333, (+0,+0): 2x 3080 FTW3 ULTRA HYBRID, ASUS RAMPAGE III GENE
* Intel Core i7 5960X (8C), 16G DDR4-2400, (+100,+0): 1080 Ti FTW3 + HYBRID KIT, ASRock X99 OC Formula/3.1
* AMD Ryzen 7 2700X (8C), 16G DDR4-2666, (+100,+200): 3090 FTW3 ULTRA HYBRID, ASRock B450M Pro4
* AMD Ryzen TR 1950X (16C), 32G DDR4-2133, (+100,+200): 3x 3090 XC3 ULTRA HYBRID, ASRock X399 Taichi
* Intel Core i7 5960X (8C), 64G DDR4-2133, (+100,+0): 1080 Ti FTW3 + HYBRID KIT, 2x 1080 Ti SC2 HYBRID, MSI X99A XPOWER AC
Location: Seattle, WA, USA

Re: Autosuspend of FAH if specific ext process becomes activ

Post by Tuna_Ertemalp »

Joe_H wrote:...The options are to use ... the FAHClient command from the command line to send commands, ...
... the documentation can be seen by using 'FAHClient --help'. The most useful function for your purposes will probably be 'FAHClient --send' with some command to start or stop.
Yup! Thanks for the pointers.

I have just put together this script that I called watch_fahclient.cmd and am gonna try put it into my Windows Startup folder. This is my first attempt, not heavily tested yet, so it might have issues. Just throwing it out there for now... Yes, it has the side-effect that currently it'll override any manual PAUSE, and UNPAUSE it in about a minute if WMC is not running in the background. I deemed it to be okay for my purposes. It probably can be fixed by using some file to store whether it was paused because of this script and querying FAHClient's status during checks and apply some logic to not override a manual PAUSE (or manual FOLD during an automatic Pause), but... Meh.

Code: Select all

rem un-REM the following if you want to disable this script without taking it out of the Startup folder
rem goto :EOF

REM Make sure this window is minimized to avoid clutter
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /K "cmd /C ^"%~dpnx0^""
set minimized=
goto :EOF
:minimized

set minimized=
set ProcessListToCheck=EHrec.exe EHshell.exe

REM Script to watch [%ProcessListToCheck%] to pause FAHClient if any one of them is running

REM Wait for 2 minutes for everything to start on boot and between checking for active FAHClient
:FAHClientFound1
timeout /t 120

:redoAll

REM Make sure FAHClient.exe is running
tasklist | findstr /i FAHClient.exe
goto FAHClientFound%ERRORLEVEL%

:FAHClientFound0
set ProcessListHit=
for %%p in (%ProcessListToCheck%) do (
   call :checkProcess %%p
)

if "%ProcessListHit%"=="" (
   FAHClient --send-unpause
) else (
   echo ***** FAHClient paused due to [%ProcessListHit%] running
)

REM Wait for 1 minute between checks
timeout /t 60
goto :redoAll

:checkProcess
REM Is %1 still running?
tasklist | findstr /i %1
goto processFound%ERRORLEVEL%

:processFound0
REM %1 is running: pausing FAHClient.
FAHClient --send-pause
set ProcessListHit=%ProcessListHit% %1
goto :EOF

:processFound1
goto :EOF
Small things make quality, but quality is no small thing. (Adapted from Henry Royce talking about perfection, not quality)
8 Win10 PCs/22 slots: 8x CPUs (3xAMD+5xIntel=68C/122T), 14x NVIDIA EVGA GPUs (8x 3090, 2x 3080, 4x 1080Ti) [Details in my profile]
Image
Post Reply