edit: Split from "Welcome to team 2630!"
Team TR Folding@home
by idchafee & Just Brew It!
This page is based on the tutorial produced by the original TR Folding evangelist, DiMaestro. Without him, TR would not be the folding juggernaut that it is. And a big thanks to all the members of The Tech Report F@h team for their help in editing this revision.
What is Folding?
Folding@home is a distributed client computing effort by Stanford University intended to help understand how proteins assemble or "fold." Exactly how proteins assemble themselves is a mystery, and why proteins sometimes fold improperly or "misfold" is also not fully understood. Many serious diseases are related to the misfolding of proteins, such as Alzheimer's, Parkinson's disease, Cystic Fibrosis, Mad Cow Disease, and several forms of cancer. By donating your CPU's spare cycles, you are contributing to an effort to understand how proteins fold, which is the first step to understanding how basic proteins work and how we might treat these diseases. When you are not using your computer, the processor will run simulations of different proteins and the way they assemble to better help scientists understand why they do what they do.
How can I help?
First, go to the Folding@home web site and download the latest client. The client comes in a variety of flavors. For the graphically minded, there is a screensaver client that will run whenever your screensaver is engaged, ensuring that the client won't run when you're using the computer. There is also a graphical client ("GC") available that will fold whenever the computer is on; it runs during the CPU's idle processing time. The GC puts an icon in the systray with an option to display a simulated picture of the protein as it's being folded. Finally, the newest addition to the F@h client family is a command-line version that you can set up to run as a system service under Windows NT/2K/XP, so that the client will run even if the machine in question is not logged in.
The F@h client is designed to be as unobtrusive as possible. The screensaver version runs only when the screensaver kicks in. The graphical and console versions run at a very low priority, and only consume CPU cycles which would otherwise be unused. You should not notice any significant impact on application performance of your system when running F@h.
I'm not using a Windows OS. Can I still help?
Fear not, there are Mac OS X and Linux clients for the alternative minded. Instructions on the Linux client are listed below.
Running F@h under Windows
Installing the graphical client
Installing the graphical client is fairly straightforward. Run the installer, and it will ask you a series of questions, like most installers. After the install, you can join The Tech Report's team by right clicking on the "red flower" icon in the system tray and selecting Configuration. This will bring up a small configuration screen for Folding@home. On that screen, enter 2630 for your team number. You can also change your name in this screen. Pick your name carefully; if you change it later on, the points you've accumulated under your original name won't transfer.
Installing the command line client as a service in Win2K/XP
Unike previous versions, the newest version of the command line client adds the capability to install F@h as a service under Win2K/XP, without the need for a 3rd-party service wrapper (e.g. FireDaemon). The Windows Service functionality is now built-in to the stock console F@h client!
After you've downloaded the client, create a directory to contain all of the files related to F@h (I usually create a folder called C:\Program Files\FAH), and put the downloaded client EXE there. If you have a HyperThreaded or dual-processor system, and want to get the highest possible throughput, create two different directories (e.g. FAH1 and FAH2), and put a copy of the folding client in each one. (Additional info about setting up HT/dually systems can be found in this forum thread).
Now go ahead and run the client -- browse to the folder you downloaded the client to, and double click on the client file: FAH504-Console.exe.
Once you start the client, the config screen will look like this:
The arrow points to the most important question that needs to be answered when using the command line version: Do you want to install this client as a service? Running as a service means that the client will start as soon as the machine boots (even if nobody is logged in). If you choose not to run as a service, you will need to start the client manually each time you log in, or add it to your Startup folder. Also make sure that you key in the username you have chosen for yourself, and the TR team number (2630).
The rest of the installation's questions should be answered based on your situation. One of the nice things about this version is that if you're installing F@h on a laptop, you can tell F@h to be inactive when the notebook is on battery power. To get the extra options (battery suspend, CPU usage requested, etc), you need to say yes to the advanced options choice.
Depending on your system, there are additional options which may be configured to maximize your throughput. Additional information about configuring advanced options and command line switches for the Windows F@h client can be found in this forum thread.
One last note: in the Windows Task Manager, you will see two processes. FAH504-Console.exe is the client which you downloaded and installed; it handles the communications with the main servers at Stanford, and manages the operation of F@h on your system. It runs at 'Normal' priority, but only becomes active when a work unit needs to be uploaded or downloaded. You will also see a process with a name like FahCore_xx.exe; this is the "core" program which does all the actual work of running the folding simulation. The core program will show as a 'Low' priority app, which means it will only consume CPU cycles which are not needed by anything else running on your system.
And now you're folding, Windows style!
Folding under Linux
The Linux Folding@home client is command line-based only (no graphical client or screen saver).
The following instructions assume that you will be working from a command shell (terminal window). In most distros, you can launch a terminal window from the GUI by selecting System Tools - Terminal from the menus. If you are new to Linux, please note that command and file names in Linux are all case sensitive. On the other hand, if you're a Linux veteran, just bear with me (most of the following will probably be painfully obvious to you).
Basic client installation
To install the Folding@home client on a Linux system, you need to do the following:
1. Create a subdirectory in your home directory to put the Folding@home files in. I like to name the directory something descriptive like folding.
2. Download the latest Linux client from Stanford's site and save it to the directory you created in step 1. The remaining instructions assume that you've downloaded the 5.04 client, FAH504-Linux.exe. If you have downloaded a newer client, substitute the appropriate file name in all of the instructions below.
3. Navigate to the folding directory (using the cd command), and enter the command: chmod +x FAH504-Linux.exe to mark the client as executable.
4. Run the client, and configure it. Assuming you are still in the folding directory, all you need to do is enter: ./FAH504-Linux.exe and the client should start. It prompts for your configuration options, just like the Windows console client does. Don't forget to enter 2630 as your team ID!
Once you have configured the client, it will continue to run in your terminal window. If you don't mind starting the client manually every time you log in, you're done. The client will stop when you log out; if you need to stop it manually for some reason, just hit ^C (control-C) in your terminal window. To start it up again, just navigate to your folding directory and enter: ./FAH504-Linux.exe If you'd like to automate things a bit more, read on...
Creating a script to launch the client in the background
You can easily create a script that will run the client as a background process. Using whatever plain text editor is bundled with your GUI (or vi if you're a seasoned UNIX hacker, or just plain masochistic), create the following text file:
#!/bin/bash
./FAH504-Linux.exe -forceasm >>folding.log 2>&1 &
I've included the -forceasm switch as an example; you can also specify any other switches you want to pass to the client. Save the above file to a short, easy to remember file name, like go. Also mark the file as executable, by entering the following command in your terminal window: chmod +x go. From now on, you can launch the client in the background simply by navigating to your folding directory, and typing: ./go
Running the client as a service
To have the folding client to start automatically when the system boots, you need to add it to your system's startup script. Under Redhat/Fedora, the startup script is located in the file /etc/rc.d/rc.local. This script is executed during system startup (well, actually during init level changes, but that discussion is beyond the scope of this article), after all other system initialization has been completed. Other distros may put it in a slightly different location, so if you don't see an rc.local script in the /etc/rc.d directory, you may need to poke around a bit, or do a little Googling to figure out where the appropriate file is located in your distro.
Once you've found the file, all you need to do is append the following line to the end of the rc.local script (you must be logged in as root to edit the rc.local script):
sudo -u joeblow sh -c "cd ~joeblow/folding; ./go"
(Substitute the actual name of the user under which the client is installed for joeblow.)
In a nutshell, this says "pretend we are user joeblow, go to his folding directory, and run the go script that is located there."
Odds and ends
OK, so you're running the Linux client in the background. Maybe you've even installed it as a service. How do you check on its status, or kill the client?
Checking on the status of the client is easy; just like the Windows version, everything the client does is logged in the FAHlog.txt file. You can examine the contents of that file to see what the client is doing. You can also use the tail -f command in a terminal window to continuously display the log file as it updates. The command:
cd ~/folding; tail -f FAHlog.txt
can be used in a terminal window to display a running log of what the client is doing, even if the client itself is running in the background.
The top command can be used in a terminal window to display a list of processes (similar to Windows' Task Manager). By default the display is sorted in descending order by CPU usage; unless the system is particularly busy, the Folding@home client should be near the top of the list.
To stop a client that is running as a background process or service, use the command:
killall FAH504-Linux.exe
You must be logged in as either the root user, or the user under which the client is running in order to kill it.
It's alive! AALLLIIVVVEEEE! .. Uh, now what?
Check your place in Team TR on the official Stanford stats page, or on the unofficial (but more detailed) EOC stats page. You are also invited to browse and post in our Distributed Computing Forum if you have any questions about how this stuff works or if you want to talk some smack about how you're going to own the rest of us. We welcome the competition.
Welcome to The Tech Report Folding Team!
edited & updated by farmpuma, 23 August 2007
html removed and/or converted by farmpuma, 26 February 2008