How to run a FAH Client on Linux

FAIR WARNING: These instructions were finalized in April 2005. Some updates have been made but there are links that may not work and the whole thing might be gibberish by now(i.e., it will not work). I do not know when I will finish updating. FAH now has instructions online. Read the " Installation Guides List for Linux " for, possibly, more up to date information. In particular, there are now information for uniprocessor(classic single core, single processor system) and multi-CPU(SMP, multi-core single processor, multi-processor or multi-core and multi-processor ) clients that were not available.

There is, still, after well over five years, only a Console Client for Linux but there are 3rd party addons to view some of the folding graphics. There is, also, still no installer. The information below is based on the version 5.02(in 2005), FAH502. However, currently the version is 6.29(JUL 2010) so make adjustments for naming as needed.
1) Download the FAH client and place it to a separate folder as this client will create a set of files and folders when it is started;
*1a) Hint: A good place to keep folding is in "/home". So, e.g., mkdir /home/FAH
*1b) If you have a multi-processor system or wish to use hyperthreading, you will need a separate directory for each. So, e.g., mkdir /home/FAH1 /home/FAH2
and continue with /home/FAH[# of processors]. Do not run multiple clients on a single, non-hyperthreaded CPU!

2) After successful retrieve of the client set the binary as executable;
*2a) Hint: Download anywhere you want and move the FAH client & chmod at same time. E.g., from the same dir as where the download is located, in a shell, execute:
#> chmod +x FAH502-Linux.exe & mv FAH502-Linux.exe /home/FAH/FAH502-Linux.exe
In the case of multiple clients to be run with multi-processor capable systems, e.g., with 2 processors:
#> chmod +x FAH502-Linux.exe & cp FAH502-Linux.exe /home/FAH1/FAH502-Linux.exe & mv FAH502-Linux.exe /home/FAH2/FAH502-Linux.exe
**Special Hint for hyperthreaded(or multi-processor) systems.**
One way to do it all (for 2 CPUs or 2 FAH clients on one hyperthreading CPU):
Open a shell or at terminal prompt(#> ), execute these:
#> mkdir /home/fah1 /home/fah2
#> cd /home/fah1
#> wget http://www.stanford.edu/group/pandegroup/release/FAH502-Linux.exe
#> chmod +x FAH502-Linux.exe & cp FAH502-Linux.exe /home/fah2/FAH502-Linux.exe
#> ./FAH502-Linux.exe
(Enter a user name & use team number 12501, :). )
Open another terminal/shell
#> cd /home/fah2
#> ./FAH502-Linux.exe
(Enter a user name & use team number 12501, :). )
When the installer gets to the question about "Advanced Options", answer Yes.
You can accept the defaults until it gets to machine ID, which must be changed. Enter number 2 and you are off and running with both CPUs Folding! (Yes, leave the shells open...)

NB! The document sometimes refers to the older FAH3* but the instructions apply to the FAH Linux Console client version in general, so it will not be updated everytime a new client is released.
NB! All following examples must be run at command prompt (such as console/konsole/xterm/...).Example:

NB: FAH MUST be started in dedicated directory!
BAD EXAMPLE - NEVER USE IT:

/home/FAH/FAH502-Linux.exe

GOOD EXAMPLE:

cd /home/FAH

./FAH502-Linux.exe

"BAD EXAMPLE" will make FAH "home" directory "who-knows-what".

**** Important: Read the FAH license! ****

To read the license run:

cd /home/FAH>

./FAH502-Linux.exe -license | less

There are several ways of running the FAH client:

A)

To get FAH Linux Console client to run manually.

The easiest way is to fire up a console, change to FAH dedicated folder You created and run a FAH executable.

Example:

cd /folding

./FAH3Console-Linux.exe

First time You run FAH client it will ask You a couple of configuration parameters:

User name [Anonymous]?

Team Number[0]?

Ask before fetching/sending work [no]?

Use proxy [no]?

Change advanced options [no] (yes/no)?

NB: To change the configuration later on You must run the client with -config switch:

./FAH3Console-Linux.exe -config

After the configuration, client should fetch a Work Unit (WU), proper Core for it and start counting finished frames:

[17:41:13] Finished a frame (75)

[17:42:43] Finished a frame (76)

[17:44:14] Finished a frame (77)

To stop the client press CTRL+C.

B)

To get the FAH Linux Console client run as background service.

I)

After previous steps (download and manual run) add couple lines of code to the end of rc.local (/etc/rc.d/rc.local) file:

cd /folding

./FAH3Console-Linux.exe >/dev/null 2>&1 &

NB: This script will run FAH under root privileges as rc.local file will be run under root privileges
(all created files/folders will be under root privileges, too).
To overcome this and to run FAH as regular user ( RegularUser must be set to one of user who is present on this system ):

If You ran first-time-run as root or as some other user than RegularUser then You must change FAH folder privileges:

su -

chown -R RegularUser.RegularUser /folding

Only bad thing is that there is no easy (as easy as pressing [CRTL+C]) way to stop this client anymore.
As FAH will start up several processes then there is nothing else to do than hunt down and kill these processes. To make our life a little easier FAH client will die if the running cores die (should be a rule but not always...):

cd /folding

kill -15 $(ps -C $(ls *Core_*.exe) -o pid=)

Note: This is a "polite" termination (waiting FAH client&cores to finish their job) but if ps -ax should still show some cores running (newer cores may have this bug) then use a forced termination (no more waiting...):

cd /folding

kill -9 $(ps -C $(ls *Core_*.exe) -o pid=)

Attention! As FAH and Core different versions tend to respond differently to
"killing" of these then it may be advisable to issue the same kind of "kill
routines" to FAH client itself, too:

killall -15 FAH3Console-Linux.exe

and if it will not die (check it with "/sbin/pidof FAH3Console-Linux.exe") then:

killall -9 FAH3Console-Linux.exe

Note:
To get a FAH client to run on multi cpu machine, You must install as many FAH clients to separate directories as there are processors in Your machine and You need to configure Your clients to use different Machine IDs (look to "Configuring the client").
NB: Never copy FAH files between separate clients as the usual outcome is more often bad than good.

Configuring the client

NB: Changes to config of FAH Client MUST BE considered as donator WISHES!
There are exeptions such as Team Number, User Name and such but settings involving project/WU selection are strictly only a wish not a absolute choices donator can make. Reference:http://forum.folding-community.org/viewtopic.php?p=19672#19672

There are some command line switches in FAH and to get the list of these You must feed FAH something it will not understand (such as '-?'):

-forceasm &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Force core assembly optimizations to be used if available

-advmethods &nbsp Use new advanced scientific menthods (beta)

-freeBSD &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Make brandelf system call on downloaded cores.

Please note the above recognized flags and try again.

Press any key to exit.

After a "any key" it will terminate.

Using the configuration switches:

-config

cd /folding

./FAH3Console-Linux.exe -config

You will get the following. Helpful hints are in blocked [italics] and any suggested responses are in italics:
Note: FAH Heading is presented first. It is always at the top of the log and will not be repeated after this presentation.

Note: Please read the license agreement (FAH3Console-Linux.exe -license).
Further use of this software requires that you have read and accepted this agreement.

User name [Anonymous]? [ Type in name You like to be associated with.
Use http://folding.stanford.edu/download.html section "How do I choose a username?". ]

Team Number[0]? [ Same here but as this is a number then look
http://folding.stanford.edu/cgi-bin/searchteamstats for existing teams or
http://folding.stanford.edu/cgi-bin/createteam to start new one...
http://forum.folding-community.org/viewtopic.php?t=1751 ]

Change advanced options [no] (yes/no)? [ To get a more out of FAH client then You should answer 'yes'. ]

Client Type [no-pref] (no-pref/fah/gah)? [ no-pref = FAH client will get the WUs of whatever project are available/urgent;
fah = You wish to get the WUs from FAH projects;
gah = You wish to get the WUs from GAH projects;

Note: this is more complicated issue like it should not be - to get counted for GAH WUs in GAH stats (not in FAH stats) the team number must be equal or greater than 100000.

"Client Type" selection by user will get You "mostly" WUs from these type of projects not that You must get these always. ]

Explanation and answer for this type of questions by MstrBlstr:[beginquote]

This issue has been discussed in the following thread. The project pref in

the advanced option was designed so the donator could specify a preferred

project. The AS will, however, assign work from the other project if there

is no work currently available for the donators preferred project or it can

not get work from one of the donators preferred project servers.

This was implemented so that the donators system would not waste CPU cycles if it could not get the preferred work requested by the donor.

Both projects are good ones and are both doing good for the science as the

information from one helps to better understand the other.

If, however, as a donor you simply do not wish to get any units from the other project there is the option to run the older versions of the clients that only assign work for that project.

This is acceptable, as you the donor should have the choice. It is encouraged however that you run the newest version of the client as they are constantly expanding it and receive better results science wise.

Disable highly optimized assembly code [no] (no/yes)? [ This is a opposite of -forceasm as this will disable Gromacs optimizations. ]

Ignore deadline information (mainly useful if system clock frequently has errors)? [no] (no/yes)? [ As WUs from newer projects do incorporate the deadline checking there is a need for reliable system clock, but when system clock can not be trusted
(dead battery maybe?) then it is advisable to ignore the system clock. ]

Machine ID (1-4) [1]? [ This is useful for multi CPU machines where in order to run a FAH client on every CPU You must configure each client with different Machine ID value (every client MUST be run under separate directories, too). ]

After these configure steps it will start the "crunching" of WUs.To stop the client press [CTRL+C].

-forceasm

As Gromacs incorporates some/heavy SSE/3DNow/??? optimizations, the calculations may go (terribly) wrong or core may crash or ... and FAH client may decide that optimization is to blame of this and will turn off the optimizations. Usual "crunching" penalty of this type of event is quite heavy (50% on AMD Athlon XP) and if You think it is a false alarm (each "crash" must be studied carefully and using this switch "just in case" do not make any good to FAH project!) then use this switch to turn these optimizations back on.

Note: Tinker or GAH cores do not have any settable optimization so this switch does have no effect in case of these.