Page 1 of 1

Console Client Improvement Suggestion

Posted: Mon Sep 20, 2010 11:53 pm
by David_Wheeler
Having done some serious hardware swapping and optimization in the last few days, I have been starting and stopping console clients quite a lot in various operating systems:
  • SMP on Windows 7
    GPU on Windows 7
    SMP onGentoo Linux
    GPU on Wine on Linux
In most cases, the restarts are OK. I can't remember any GPU failures, but the SMP restarts can be a bit of a gamble.

Also, I've been trying to the right thing and start the clients -oneunit, but sometimes I forget and have to shutdown the client just after it gets a new work unit.

Since the console clients are reading and writing to the file system anyway, a quick and dirty fix for those of us who don't want to get another work unit but forgot -oneunit might be: at the point where the -oneunit check is done, also check for the existence of a file called oneunit.txt and stop if it exists with an appropriate log file message.

Shouldn't take more than a couple of lines of code.

Re: Console Client Improvement Suggestion

Posted: Tue Sep 21, 2010 12:09 am
by 7im
This has been a common request, especially for the beta SMP client which has had historical issues in this regard, while noting the GPU and CPU clients do not.

Since the v6 client has stopped development due to the v7 client being in development, this won't change in v6. And because this is a common request, let's hope this problem is addressed in the v7 client when it eventually comes out. ;)

Re: Console Client Improvement Suggestion

Posted: Tue Sep 21, 2010 4:34 am
by David_Wheeler
OK, scripting it is then :

Code: Select all

#!/bin/bash

for (( ; ; ))
do
        nice -n 19 fah6 -smp -verbosity 9 -oneunit

        if [ -f ./oneunit.txt ]
        then
                echo "oneunit.txt found, exiting"
                break
        fi
done

Code: Select all

#!/bin/bash

for (( ; ; ))
do
        nice -n 19 wine Folding\@home-Win32-GPU.exe -advmethods -verbosity 9 -gpu 1 -oneunit -forcegpu nvidia_g80

        if [ -f ./oneunit.txt ]
        then
                echo "oneunit.txt found, exiting"
                break
        fi
done

Code: Select all

@Echo Off
pushd D:\Apps\FAHSMP

:TOP
echo **** Create oneunit.txt in the client directory to stop the client when the current work unit finishes ****
D:\Apps\FAHSMP\[email protected] -smp 10 -bigadv -verbosity 9 -oneunit

if errorlevel 1 goto ERRORHANDLER

if exist oneunit.txt goto FINISH
goto TOP

:ERRORHANDLER
echo **** Client error : %ERRORLEVEL% ****
goto STOP

:FINISH
echo oneunit.txt found, deleting
del oneunit.txt

:STOP
echo Folding client script finished
popd

Re: Console Client Improvement Suggestion

Posted: Tue Sep 21, 2010 7:50 pm
by Napoleon
Nice workaround, now why didn't I think of that? Since I'm already using .bat file to launch the client from Command Prompt on Win7, I modified my script accordingly.

EDIT: while I was at it, I figured I might try to add some crude error handling as well. I'd like the option of stopping the (SMP) client if it encounters some error (EUE, UNSTABLE_MACHINE etc). At a glance, couldn't find any info on the client return codes at the WIKI, though. Is it always 0, no matter what?

Code: Select all

@echo off
pushd Desktop\FAHSMP

:START
echo **** INSERT oneunit.txt FILE ON DESKTOP TO STOP THE CLIENT AFTER UNIT IS FINISHED ****
Folding@home-Win32-x86 -oneunit
if errorlevel 1 goto ERRORHANDLING
if exist ..\oneunit.txt goto ONEUNIT
goto START

:ERRORHANDLING
echo **** THE CLIENT EXITED WITH ERRORLEVEL %ERRORLEVEL%, EXITING SCRIPT ****
goto STOP

:ONEUNIT
echo **** FILE oneunit.txt FOUND ON DESKTOP, EXITING SCRIPT ****
goto STOP

:STOP
if exist ..\oneunit.txt del ..\oneunit.txt
popd