Page 1 of 1

Running FAH and Boinc. I need some configuring...

Posted: Sun Apr 04, 2010 3:22 pm
by teekay
Hello all! I am currently crunching for both FAH and BOINC on a single-cpu linux system. I would like to give some priority to FAH, so I'd like BOINC to work whenever the folding@home client is not working on a WU (no WUs available, internet disconnect etc). Is there some sort of bash script or anything that I can use to achieve that?

Thanks in advance! :D

Re: Running FAH and Boinc. I need some configuring...

Posted: Sun Apr 04, 2010 4:45 pm
by PantherX
Welcome to the Forum teekay

I am not sure about Linux but on Windows, you can set the Priority of F@H to higher as the default is idle. If you want to have manual control over F@H, you can use the - oneunit flag so F@H will download one WU, process it, upload it and then exit.

Re: Running FAH and Boinc. I need some configuring...

Posted: Sun Apr 04, 2010 5:28 pm
by dimilunatic
That's a brilliant idea, teekay! My programming knowledge is quite limited, but a good solution would be to make a script that would detect cpu usage of less than -let's say- 50% and then launch the BOINC client at 80% cpu usage. When the f@h client starts, cpu usage will come to 100% and the script would pause BOINC.

In short:
If cpu usage <= 50%, launch BOINC to maximum final cpu usage = 80%.
If cpu usage > 80%, pause BOINC.

Did that actually make sense? :P

Re: Running FAH and Boinc. I need some configuring...

Posted: Sun Apr 04, 2010 11:38 pm
by codysluder
I have not used BOINC recently, but it used to use "log" priority, so setting FAH to "low" will not give FAH priority over BOINC; they'll be at equal priority. If you really want to give priority to FAH, you'll need a 3rd party app that can set priority to "below normal" ever time a new WU starts.

Re: Running FAH and Boinc. I need some configuring...

Posted: Sat Apr 10, 2010 3:13 pm
by Rattledagger
teekay wrote:Hello all! I am currently crunching for both FAH and BOINC on a single-cpu linux system. I would like to give some priority to FAH, so I'd like BOINC to work whenever the folding@home client is not working on a WU (no WUs available, internet disconnect etc). Is there some sort of bash script or anything that I can use to achieve that?

Thanks in advance! :D
Since it's single-core, this is fairly easily done, but I'll still make a few assumptions at the start:
a: You do want to run both FAH and one or more BOINC-projects, and don't intend to use BOINC just as "backup" in case FAH is down. (backup would really need for FAH to release a FAH-BOINC-application to work very well).
b: Each FAH-wu takes N hours to run, something that generally isn't true but still assumes this.
c: The deadline of BOINC-work is so long that you reliably can finish FAH-wu before continuing on BOINC-work.
d: I'll assuming 50/50 split between FAH and BOINC, but can easily use different variations.

How to configure FAH-client:
I don't run Linux, so don't know exact setup for Linux, but atleast it will be something similar to the following batch-file that's usable under windows:

Code: Select all

:batchfile_start
call fah_client.exe -oneunit
sleep 86400
goto batchfile_start
This batchfile will loop indefinitely, and will sleep for 24 hours before re-starting FAH-client. (atleast under windows, you'll need to get yourself a sleep-application yourself).
For Linux, would guess it's to remove the "call", and use ./fah_client.exe or something similar instead.
Also, no idea how to re-loop a batch-file under Linux, someone else will probably know this...

As for the actual FAH-client, in other regards than running client with a batch-file, configure this as if you're not running BOINC.


How to configure BOINC-client:
After installation of BOINC-client, locate it's data-directory. (this is listed at start of message-log after client-start).
In the BOINC data-directory, make a file called cc_config.xml (under windows, use notepad or similar, not a word-processor). Linux atleast once-upon-a-time did have vi, but likely there's "better" options available now. :wink:

cc_config.xml should atleast include the following lines:

Code: Select all

<cc_config>
<options>
   <exclusive_app>FahCore_78.exe</exclusive_app>
   <exclusive_app>FahCore_a1.exe</exclusive_app>
</options>
</cc_config>
After saving cc_config.xml, to start using it, either re-start BOINC-client, or goto Advanced view, Advanced, Read config file.


The important part is to list all the different <exclusive_app>, there are more than the 2 I've listed, just add these on new line(s). Also, for Linux would guess it's called differently...
Please note, the application is case-sensitive, and you must include the .exe-extension (on windows).

The big advantage of using the FAH-cores as exclusive apps instead of the FAH-client is, the FAH-cores will exit when the wu is finished, and BOINC can continue running while FAH-client would otherwise sit idle doing file-upload. In case of FAH-client having problems downloading work, BOINC will continue crunching.

Also, another advantage by using <exclusive_app> instead of setting FAH to "low" priority is, by running "low" you'll still use some cpu-resources on BOINC. Also, atleast on windows, running "low" can interfere with other work you'll do on computer, something that won't happen if FAH is configured as "idle".

By using <exclusive_app>, FAH will get 100% of cpu-resources when new FAH-wu finished downloading, while BOINC will get 100% of cpu-resources when FAH-science-core aren't running.


BTW, as indicated, can also use the same method for SMP-client, but there's been atleast one disadvantage with the old a1-core, if you've got more than 4 real or HT-cores, chances are you'll not exit both at the same time.

In theory it's also possible to use <exclusive_gpu_app>, in case runs windows and wants tol run both FAH-GPU-client and BOINC-GPU-application, but atleast in my experience FAH had a tendency to error-out if used the fah_core as exclusive. Using the FAH-GPU-client would possible work better in this regard, but in case of problems downloading work it's still not a very good option.