个人工具

“UbuntuHelp:FoldingAtHome”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:FoldingAtHome}}
 
{{Languages|UbuntuHelp:FoldingAtHome}}
 
[http://folding.stanford.edu/ http://folding.stanford.edu/FAHlogoML.jpg]
 
[http://folding.stanford.edu/ http://folding.stanford.edu/FAHlogoML.jpg]
 
 
 
 
=== Overview ===
 
=== Overview ===
 
Folding@Home is a project from Stanford University that uses millions of networked PCs to form a supercomputer for protein folding simulations.  The client software is loaded on a PC, it contacts the central servers, and receives "work units".  The client then runs on spare CPU time, and uploads finished work units to the server.
 
Folding@Home is a project from Stanford University that uses millions of networked PCs to form a supercomputer for protein folding simulations.  The client software is loaded on a PC, it contacts the central servers, and receives "work units".  The client then runs on spare CPU time, and uploads finished work units to the server.
 
 
When proteins are created, they undergo a complex process known as folding, so-called because the protein molecule transforms from a long chain of amino acids to a complex shape (it "folds up").  The final shape of the protein is absolutely critical to determining its properties and function.  Scientists have created software to simulate the folding process to better understand how proteins work, which in turn makes it possible to develop new drugs, cure diseases, etc.
 
When proteins are created, they undergo a complex process known as folding, so-called because the protein molecule transforms from a long chain of amino acids to a complex shape (it "folds up").  The final shape of the protein is absolutely critical to determining its properties and function.  Scientists have created software to simulate the folding process to better understand how proteins work, which in turn makes it possible to develop new drugs, cure diseases, etc.
 
 
Folding@Home is a great way to make your computer do useful work even when you're not using it.  Since it runs at a very low priority, you should never realize it's running when you're using the computer to do your work.  Note that "using the computer" refers to doing heavy computations.  Generally, tasks like web browsing and word processing involve very little CPU usage, so the Folding@Home client will be running at near 100% even when doing those kinds of tasks.  It helps to leave your computer on at all times, but is not necessary, as the project will benefit from virtually any time that the client runs on your computer.
 
Folding@Home is a great way to make your computer do useful work even when you're not using it.  Since it runs at a very low priority, you should never realize it's running when you're using the computer to do your work.  Note that "using the computer" refers to doing heavy computations.  Generally, tasks like web browsing and word processing involve very little CPU usage, so the Folding@Home client will be running at near 100% even when doing those kinds of tasks.  It helps to leave your computer on at all times, but is not necessary, as the project will benefit from virtually any time that the client runs on your computer.
 
 
=== Installation ===
 
=== Installation ===
 
 
Two installers are mentioned here.  ''fah_install'' is an installer/init script that works with Debian systems (including Ubuntu).  ''finstall'' seems to be the all-purpose Unix installer.  You can also do things by hand, by just downloading the client and running it some directory.  I recommend ''fah_install'', but I'm biased because I wrote it <wink>.
 
Two installers are mentioned here.  ''fah_install'' is an installer/init script that works with Debian systems (including Ubuntu).  ''finstall'' seems to be the all-purpose Unix installer.  You can also do things by hand, by just downloading the client and running it some directory.  I recommend ''fah_install'', but I'm biased because I wrote it <wink>.
 
 
Before using either installer, you may want to pick a username and a team.  Neither is necessary, but having a unique username lets you know how much you are folding, and folding for a team adds to the fun.  Because you're a fan of Ubuntu, you probably want to fold for [https://wiki.ubuntu.com/FoldingAtHomeTeamUbuntu Team Ubuntu]; the team number is '''45104'''.  You can pick any username you want, but if you pick one that's already being used, that will make it impossible to track your score and will inflate someone else's score, which may or may not be welcome.  Search for unused names [http://folding.stanford.edu/download.html here].  The default for both username and team is anonymous.
 
Before using either installer, you may want to pick a username and a team.  Neither is necessary, but having a unique username lets you know how much you are folding, and folding for a team adds to the fun.  Because you're a fan of Ubuntu, you probably want to fold for [https://wiki.ubuntu.com/FoldingAtHomeTeamUbuntu Team Ubuntu]; the team number is '''45104'''.  You can pick any username you want, but if you pick one that's already being used, that will make it impossible to track your score and will inflate someone else's score, which may or may not be welcome.  Search for unused names [http://folding.stanford.edu/download.html here].  The default for both username and team is anonymous.
 
 
==== Running the client manually ====
 
==== Running the client manually ====
 
 
This is the simplest way.  You get the client from http://folding.stanford.edu/download.html, save it to some directory (you will want to make one specifically for F@H, because it makes a bunch of files), and run it.  The trouble is, you need to start it by hand.  It is far more convenient and correct to make it start at boot-time, because you shouldn't have to think about it.
 
This is the simplest way.  You get the client from http://folding.stanford.edu/download.html, save it to some directory (you will want to make one specifically for F@H, because it makes a bunch of files), and run it.  The trouble is, you need to start it by hand.  It is far more convenient and correct to make it start at boot-time, because you shouldn't have to think about it.
 
 
Say you put it in `$HOME/foldingathome`.  Then to start it, you will want to use
 
Say you put it in `$HOME/foldingathome`.  Then to start it, you will want to use
 
<pre><nowiki>
 
<pre><nowiki>
第28行: 第17行:
 
</nowiki></pre>
 
</nowiki></pre>
 
You must run the client from its directory, since it always looks for files in the current directory (and creates them if they don't exist).  The parentheses fork a new shell, the exec replaces the new shell process with the client (not strictly necessary), the redirect supresses output, and the ampersand puts the process into the background.  This all means you can safely close the terminal after starting the client this way.
 
You must run the client from its directory, since it always looks for files in the current directory (and creates them if they don't exist).  The parentheses fork a new shell, the exec replaces the new shell process with the client (not strictly necessary), the redirect supresses output, and the ampersand puts the process into the background.  This all means you can safely close the terminal after starting the client this way.
 
 
 
==== fah_install ====
 
==== fah_install ====
 
+
See [[UbuntuHelp:FoldingAtHome/Install]] for step-by-step instructions.
 
'''Edgy users:  Due to the change from bash to dash in Edgy, previous init scripts don't work.  The fix is easy: download the latest installer, untar it, and run <code><nowiki>sudo ./install.sh update</nowiki></code>.  It will replace the old init script with a new one.  You do not have to stop a running client to do this update, but it is probably a good idea to stop it anyway.  Please report any Edgy problems to the [http://ubuntuforums.org/showthread.php?t=101817 how-to thread].'''
 
'''Edgy users:  Due to the change from bash to dash in Edgy, previous init scripts don't work.  The fix is easy: download the latest installer, untar it, and run <code><nowiki>sudo ./install.sh update</nowiki></code>.  It will replace the old init script with a new one.  You do not have to stop a running client to do this update, but it is probably a good idea to stop it anyway.  Please report any Edgy problems to the [http://ubuntuforums.org/showthread.php?t=101817 how-to thread].'''
 
 
'''SMP Users:  The 6.00(beta1) version of the client needs a runtime option "-smp" in order to get SMP work units.  You must add CLIENT_OPTIONS="-smp" to `/etc/default/foldingathome`.  If you update with the latest version of `fah_install`, this will be done for you as long as you allow it to overwrite this file.'''
 
'''SMP Users:  The 6.00(beta1) version of the client needs a runtime option "-smp" in order to get SMP work units.  You must add CLIENT_OPTIONS="-smp" to `/etc/default/foldingathome`.  If you update with the latest version of `fah_install`, this will be done for you as long as you allow it to overwrite this file.'''
 
 
The following script will download the latest client from the Folding@Home website, and install it to <code><nowiki>opt/foldingathome</nowiki></code>, either in <code><nowiki>/</nowiki></code> or <code><nowiki>$HOME</nowiki></code>.  It will ask you to set up the client (the defaults are usually sufficient), and copy that configuration for every CPU in your machine.
 
The following script will download the latest client from the Folding@Home website, and install it to <code><nowiki>opt/foldingathome</nowiki></code>, either in <code><nowiki>/</nowiki></code> or <code><nowiki>$HOME</nowiki></code>.  It will ask you to set up the client (the defaults are usually sufficient), and copy that configuration for every CPU in your machine.
 
 
*https://help.ubuntu.com/community/FoldingAtHome?action=AttachFile&do=get&target=fah_install-20071014.tar.gz
 
*https://help.ubuntu.com/community/FoldingAtHome?action=AttachFile&do=get&target=fah_install-20071014.tar.gz
 
 
It is not possible to provide a .deb package for Folding@Home, because the client must be downloaded from Stanford's website.  This is to ensure the integrity of the research.  (Maybe it is possible to have a .deb; after all, this is how Macromedia Flash works.  The point is that the executable has to be downloaded from Stanford.)
 
It is not possible to provide a .deb package for Folding@Home, because the client must be downloaded from Stanford's website.  This is to ensure the integrity of the research.  (Maybe it is possible to have a .deb; after all, this is how Macromedia Flash works.  The point is that the executable has to be downloaded from Stanford.)
 
 
To install, download the tarball and do
 
To install, download the tarball and do
 
<pre><nowiki>
 
<pre><nowiki>
第57行: 第39行:
 
</nowiki></pre>
 
</nowiki></pre>
 
to install the client.
 
to install the client.
 
 
You can also install to your <code><nowiki>$HOME</nowiki></code>, in case you do not have root access to the computer.  Clearly, you would not have to prefix the command with sudo in this case.  If you install to your <code><nowiki>$HOME</nowiki></code>, a cron job will be created to start the client automatically.  If you install to the system, the client will automatically start when your computer boots up.
 
You can also install to your <code><nowiki>$HOME</nowiki></code>, in case you do not have root access to the computer.  Clearly, you would not have to prefix the command with sudo in this case.  If you install to your <code><nowiki>$HOME</nowiki></code>, a cron job will be created to start the client automatically.  If you install to the system, the client will automatically start when your computer boots up.
 
 
You can reconfigure the client using the supplied <code><nowiki>reconfigure</nowiki></code> script, which is placed in <code><nowiki>opt/foldingathome</nowiki></code>.  You can also give the client command line options in <code><nowiki>/etc/default/foldingathome</nowiki></code>.  See the README for more details.
 
You can reconfigure the client using the supplied <code><nowiki>reconfigure</nowiki></code> script, which is placed in <code><nowiki>opt/foldingathome</nowiki></code>.  You can also give the client command line options in <code><nowiki>/etc/default/foldingathome</nowiki></code>.  See the README for more details.
 
 
Should you choose to uninstall the client, it's easy. The first installation script contains an uninstalling script too. Just go to the directory fah_install and run <code><nowiki>install.sh</nowiki></code> with uninstall parameter. Use sudo to uninstall if you used sudo to install. The README file provides instructions for manual uninstall.
 
Should you choose to uninstall the client, it's easy. The first installation script contains an uninstalling script too. Just go to the directory fah_install and run <code><nowiki>install.sh</nowiki></code> with uninstall parameter. Use sudo to uninstall if you used sudo to install. The README file provides instructions for manual uninstall.
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ./install.sh uninstall
 
sudo ./install.sh uninstall
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== finstall ====
 
==== finstall ====
* Download the finstall script with wget:
+
# Download the finstall script with wget:
 
<pre><nowiki>
 
<pre><nowiki>
 
cd ~
 
cd ~
 
wget -c http://www.vendomar.ee/~ivo/finstall
 
wget -c http://www.vendomar.ee/~ivo/finstall
 
</nowiki></pre>
 
</nowiki></pre>
 
+
2.#2 Make the script runnable:
*#2 Make the script runnable:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
chmod +x finstall
 
chmod +x finstall
 
</nowiki></pre>
 
</nowiki></pre>
 
+
3.#3 Start it:
*#3 Start it:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
./finstall
 
./finstall
 
</nowiki></pre>
 
</nowiki></pre>
 
 
After the client is installed You can start/stop/... FAH client with ./foldingathome/folding script. For Example(s)
 
After the client is installed You can start/stop/... FAH client with ./foldingathome/folding script. For Example(s)
 
<pre><nowiki>
 
<pre><nowiki>
 
~/foldingathome/folding start
 
~/foldingathome/folding start
 
 
or
 
or
 
 
~/foldingathome/folding stop
 
~/foldingathome/folding stop
 
 
or
 
or
 
 
~/foldingathome/folding status
 
~/foldingathome/folding status
 
</nowiki></pre>
 
</nowiki></pre>
 
 
For me this was all I needed as it automatically created the init scripts I needed to start after reboot. However the init scripts don't seem to work for everyone, so if you need to do it manually:
 
For me this was all I needed as it automatically created the init scripts I needed to start after reboot. However the init scripts don't seem to work for everyone, so if you need to do it manually:
 
+
# Make a file called foldingathome in the /etc/init.d directory:
* Make a file called foldingathome in the /etc/init.d directory:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/init.d/foldingathome
 
gksudo gedit /etc/init.d/foldingathome
 
</nowiki></pre>
 
</nowiki></pre>
 
+
2.#2 Paste this in:
*#2 Paste this in:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
#!/bin/sh
 
#!/bin/sh
 
# /etc/init.d/foldingathome for Ubuntu
 
# /etc/init.d/foldingathome for Ubuntu
 
# Start the F@H service.
 
# Start the F@H service.
 
 
pushd /home/YOUR_USERNAME_HERE/foldingathome/
 
pushd /home/YOUR_USERNAME_HERE/foldingathome/
 
su YOUR_USERNAME_HERE -c "screen -d -m ./folding start"
 
su YOUR_USERNAME_HERE -c "screen -d -m ./folding start"
 
popd
 
popd
 
</nowiki></pre>
 
</nowiki></pre>
 
+
3.#3 Save and exit
*#3 Save and exit
+
4. Make a symlink into the /etc/rc2.d directory:
 
+
* Make a symlink into the /etc/rc2.d directory:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ln -s /etc/init.d/foldingathome /etc/rc2.d/S99fah
 
sudo ln -s /etc/init.d/foldingathome /etc/rc2.d/S99fah
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Here are a couple more hints to make things go smoother:
 
Here are a couple more hints to make things go smoother:
 
+
# Pick a username before you start, to see if your username is in use visit this page first [http://folding.stanford.edu/download.html]. There is a search box at the top that you can use to see if your selected username is in use.
* Pick a username before you start, to see if your username is in use visit this page first [http://folding.stanford.edu/download.html]. There is a search box at the top that you can use to see if your selected username is in use.
+
2. Have your team number ready, it is question two right after your username. You should use '''''45104''''' for this.
* Have your team number ready, it is question two right after your username. You should use '''''45104''''' for this.
+
3. If you have an old computer you should run deadlineless work units. To select the option to do this select yes when asked if you want to set advanced options, then continue to select the defaults until you are asked about deadlineless workunits and select yes.  ''Note: There are frequent shortages of the deadlineless WUs.  If you haven't gotten one for several days, you might as well ask for both deadlineless and normal WUs.''
* If you have an old computer you should run deadlineless work units. To select the option to do this select yes when asked if you want to set advanced options, then continue to select the defaults until you are asked about deadlineless workunits and select yes.  ''Note: There are frequent shortages of the deadlineless WUs.  If you haven't gotten one for several days, you might as well ask for both deadlineless and normal WUs.''
+
4. Finally here is a link to the original thread for using the finstall script from the folding community forums, it is where I found my answers and definitely the easiest way to get this working under Dapper Drake. [http://forum.folding-community.org/viewtopic.php?t=2283]
* Finally here is a link to the original thread for using the finstall script from the folding community forums, it is where I found my answers and definitely the easiest way to get this working under Dapper Drake. [http://forum.folding-community.org/viewtopic.php?t=2283]
+
 
+
 
=== Other Issues ===
 
=== Other Issues ===
 
==== Questions and Discussion ====
 
==== Questions and Discussion ====
 
For technical questions and bug reports, go to the [http://ubuntuforums.org/showthread.php?t=101817 HowTo forum thread].  For casual talk about Folding@Home, use the [http://ubuntuforums.org/showthread.php?t=102313 Ubuntu Team recruiting thread].
 
For technical questions and bug reports, go to the [http://ubuntuforums.org/showthread.php?t=101817 HowTo forum thread].  For casual talk about Folding@Home, use the [http://ubuntuforums.org/showthread.php?t=102313 Ubuntu Team recruiting thread].
 
 
==== Security ====
 
==== Security ====
 
Folding@Home is [http://folding.stanford.edu/faq.html#misc.security secure].  The Stanford team has gone to great lengths to ensure security, both for the integrity of their research and the safety of donors' computers.  However, the more secure the better.  The Gentoo ebuild for Folding@Home creates a new user foldingathome whose sole purpose is to run the client.  Now ''fah_install'' offers the same.  It creates a user whose account is disabled, and runs the client as this user when the init script is run as root, so the client is never run as root.
 
Folding@Home is [http://folding.stanford.edu/faq.html#misc.security secure].  The Stanford team has gone to great lengths to ensure security, both for the integrity of their research and the safety of donors' computers.  However, the more secure the better.  The Gentoo ebuild for Folding@Home creates a new user foldingathome whose sole purpose is to run the client.  Now ''fah_install'' offers the same.  It creates a user whose account is disabled, and runs the client as this user when the init script is run as root, so the client is never run as root.
 
 
==== Hyper Threading ====
 
==== Hyper Threading ====
 
For those with Hyper Threading CPUs, you probably know that an SMP kernel sees two processors. Then clearly, if you run two clients, you will get more work done than if you only run one (probably about 10-30% more). However, results that are done quickly are more useful than more results done slowly. The reason is that each work unit is a step in a giant simulation, with future steps depending on past ones. So the faster you get your work done, the faster the simulation can move along. Long story short, run one client for each ''physical'' CPU, not for each ''logical'' CPU. The installer should automatically count the number of CPUs in your system. See this [http://forum.folding-community.org/viewtopic.php?t=10427 post] in the Folding@Home forums.
 
For those with Hyper Threading CPUs, you probably know that an SMP kernel sees two processors. Then clearly, if you run two clients, you will get more work done than if you only run one (probably about 10-30% more). However, results that are done quickly are more useful than more results done slowly. The reason is that each work unit is a step in a giant simulation, with future steps depending on past ones. So the faster you get your work done, the faster the simulation can move along. Long story short, run one client for each ''physical'' CPU, not for each ''logical'' CPU. The installer should automatically count the number of CPUs in your system. See this [http://forum.folding-community.org/viewtopic.php?t=10427 post] in the Folding@Home forums.
 
 
==== Laptop Systems ====
 
==== Laptop Systems ====
 
Because the client runs at low priority, the client should not cause the CPU governor to kick up the frequency.  In other words, even though the client runs at 100% CPU usage, it should not cause the CPU frequency to go up, which keeps the fan slow and quiet.  If this is not the case, then the frequency governor should be reconfigured.
 
Because the client runs at low priority, the client should not cause the CPU governor to kick up the frequency.  In other words, even though the client runs at 100% CPU usage, it should not cause the CPU frequency to go up, which keeps the fan slow and quiet.  If this is not the case, then the frequency governor should be reconfigured.
 
 
'''Note: Feisty uses different default cpu governing method than Dapper (I don't know about Edgy).'''  Feisty uses a kernelspace governor whereas Dapper uses a userspace one (<code><nowiki>powernowd</nowiki></code>).  The consensus seems to be that kernelmode is the superior implementation.  The trouble is that the default is not to ignore nice'd processes (i.e. low priority processes like the folding@home client) in kernelmode, while <code><nowiki>powernowd</nowiki></code>'s default is to ignore nice'd processes in its calculations.  To get <code><nowiki>powernowd</nowiki></code> behavior, you must do the following:
 
'''Note: Feisty uses different default cpu governing method than Dapper (I don't know about Edgy).'''  Feisty uses a kernelspace governor whereas Dapper uses a userspace one (<code><nowiki>powernowd</nowiki></code>).  The consensus seems to be that kernelmode is the superior implementation.  The trouble is that the default is not to ignore nice'd processes (i.e. low priority processes like the folding@home client) in kernelmode, while <code><nowiki>powernowd</nowiki></code>'s default is to ignore nice'd processes in its calculations.  To get <code><nowiki>powernowd</nowiki></code> behavior, you must do the following:
 
<pre><nowiki>
 
<pre><nowiki>
第148行: 第106行:
 
</nowiki></pre>
 
</nowiki></pre>
 
To enable this behavior in the future, add the above (just the <code><nowiki>echo</nowiki></code> line, not the <code><nowiki>sudo</nowiki></code> one) to <code><nowiki>/etc/rc.local</nowiki></code>.  For more about manipulating frequency governors, look at this [http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_enable_your_CPU.27s_Power_Saving.2FFrequency_Scaling_features link].
 
To enable this behavior in the future, add the above (just the <code><nowiki>echo</nowiki></code> line, not the <code><nowiki>sudo</nowiki></code> one) to <code><nowiki>/etc/rc.local</nowiki></code>.  For more about manipulating frequency governors, look at this [http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_enable_your_CPU.27s_Power_Saving.2FFrequency_Scaling_features link].
 
 
There is a utility called <code><nowiki>cpulimit</nowiki></code> that will limit the CPU time of a given application.  Look at this [http://pykeylogger.sourceforge.net/wiki/index.php/Ubuntu:Chronicles#Folding.40Home_.5BFAH.5D_on_a_Laptop link] for a quick how-to.  If there is demand, I will add support for it to ''fah_install''.
 
There is a utility called <code><nowiki>cpulimit</nowiki></code> that will limit the CPU time of a given application.  Look at this [http://pykeylogger.sourceforge.net/wiki/index.php/Ubuntu:Chronicles#Folding.40Home_.5BFAH.5D_on_a_Laptop link] for a quick how-to.  If there is demand, I will add support for it to ''fah_install''.
 
 
One can configure ACPI (the power regulation subsystem) to stop the client when the system goes on battery power, and to start it again when the power cord is plugged back in.
 
One can configure ACPI (the power regulation subsystem) to stop the client when the system goes on battery power, and to start it again when the power cord is plugged back in.
 
 
===== Breezy and older =====
 
===== Breezy and older =====
 
 
Edit <code><nowiki>/etc/acpi/power.sh</nowiki></code>.  Inside the <code><nowiki>if [ $? = 0 ] && [ x$1 != xstop ]; then</nowiki></code> block, add
 
Edit <code><nowiki>/etc/acpi/power.sh</nowiki></code>.  Inside the <code><nowiki>if [ $? = 0 ] && [ x$1 != xstop ]; then</nowiki></code> block, add
 
<pre><nowiki>
 
<pre><nowiki>
第168行: 第122行:
 
fi
 
fi
 
</nowiki></pre>
 
</nowiki></pre>
 
 
===== Dapper and newer =====
 
===== Dapper and newer =====
 
 
Simply create two scripts in the relevant directories.
 
Simply create two scripts in the relevant directories.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo -i
 
sudo -i
第179行: 第130行:
 
exit
 
exit
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This assumes that the client has been installed for the entire system (as opposed to installing just for your user), which it should be if you are able to edit files in <code><nowiki>/etc</nowiki></code> in the first place!
 
This assumes that the client has been installed for the entire system (as opposed to installing just for your user), which it should be if you are able to edit files in <code><nowiki>/etc</nowiki></code> in the first place!
 
 
=== TeamUbuntu (45104) ===
 
=== TeamUbuntu (45104) ===
 
A competitive Folding@Home team called [https://wiki.ubuntu.com/FoldingAtHomeTeamUbuntu TeamUbuntu] exists to represent the Ubuntu community and to have some fun while doing good. The team number is '''45104'''. To join the team, simply enter 45104 when the setup dialog requests a team number.
 
A competitive Folding@Home team called [https://wiki.ubuntu.com/FoldingAtHomeTeamUbuntu TeamUbuntu] exists to represent the Ubuntu community and to have some fun while doing good. The team number is '''45104'''. To join the team, simply enter 45104 when the setup dialog requests a team number.
 
 
=== FAQ ===
 
=== FAQ ===
 
 
==== ''How do I uninstall?'' ====
 
==== ''How do I uninstall?'' ====
 
If you used ''fah_install'', the installer on this page, rerun the installation script with the "uninstall" option.  The README file has a detailed description of what the uninstall command does.  If you used ''finstall'', cd to <code><nowiki>$HOME/foldingathome</nowiki></code> and run <code><nowiki>./uninstallService</nowiki></code>. If you just downloaded it to some directory, just delete the client and the directory.  See also the next question about random files.
 
If you used ''fah_install'', the installer on this page, rerun the installation script with the "uninstall" option.  The README file has a detailed description of what the uninstall command does.  If you used ''finstall'', cd to <code><nowiki>$HOME/foldingathome</nowiki></code> and run <code><nowiki>./uninstallService</nowiki></code>. If you just downloaded it to some directory, just delete the client and the directory.  See also the next question about random files.
 
 
==== ''Why does F@H write files to random directories?'' ====
 
==== ''Why does F@H write files to random directories?'' ====
 
If you use ''fah_install'' or ''finstall'', it shouldn't.  That was half of the reason why those scripts were written.  The client writes a bunch of files to some directory, we'll call it the working directory or WD, if the WD doesn't have all of the files already.  So if you have no F@H files in the WD, the client will write them.  How do you figure out what the WD is?  It is the current directory of the shell that starts the client; in other words, it could be anything.  If you have a script of some sort that you wrote to start up the client, you need to <code><nowiki>cd</nowiki></code> to whatever directory you want all of those files to be written to before starting the client.
 
If you use ''fah_install'' or ''finstall'', it shouldn't.  That was half of the reason why those scripts were written.  The client writes a bunch of files to some directory, we'll call it the working directory or WD, if the WD doesn't have all of the files already.  So if you have no F@H files in the WD, the client will write them.  How do you figure out what the WD is?  It is the current directory of the shell that starts the client; in other words, it could be anything.  If you have a script of some sort that you wrote to start up the client, you need to <code><nowiki>cd</nowiki></code> to whatever directory you want all of those files to be written to before starting the client.
第196行: 第142行:
 
/path/to/FAH502-Linux.exe
 
/path/to/FAH502-Linux.exe
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== ''How do I find out how much I'm folding?'' ====
 
==== ''How do I find out how much I'm folding?'' ====
 
The client writes a log file in <code><nowiki>WD/FAHlog.txt</nowiki></code>.  For ''fah_install'', this is in <code><nowiki>/opt/foldingathome/#/FAHlog.txt</nowiki></code> or <code><nowiki>$HOME/opt/foldingathome/#/FAHlog.txt</nowiki></code>, where '#' is a digit from 1 to 9, but probably only 1 will exist unless you have a multiprocessor system.  If you use ''finstall'', it is in <code><nowiki>$HOME/foldingathome/CPU#</nowiki></code>.
 
The client writes a log file in <code><nowiki>WD/FAHlog.txt</nowiki></code>.  For ''fah_install'', this is in <code><nowiki>/opt/foldingathome/#/FAHlog.txt</nowiki></code> or <code><nowiki>$HOME/opt/foldingathome/#/FAHlog.txt</nowiki></code>, where '#' is a digit from 1 to 9, but probably only 1 will exist unless you have a multiprocessor system.  If you use ''finstall'', it is in <code><nowiki>$HOME/foldingathome/CPU#</nowiki></code>.
 
 
There is also a more concise progress file <code><nowiki>unitinfo.txt</nowiki></code>, in the same directory as <code><nowiki>FAHlog.txt</nowiki></code>.
 
There is also a more concise progress file <code><nowiki>unitinfo.txt</nowiki></code>, in the same directory as <code><nowiki>FAHlog.txt</nowiki></code>.
 
 
There are nice graphical programs that will display the information in these files, for example [http://sourceforge.net/project/screenshots.php?group_id=164311 Protein Think].  You can see how many points your current work unit is worth by looking up your protein on http://fah-web.stanford.edu/psummary.html
 
There are nice graphical programs that will display the information in these files, for example [http://sourceforge.net/project/screenshots.php?group_id=164311 Protein Think].  You can see how many points your current work unit is worth by looking up your protein on http://fah-web.stanford.edu/psummary.html
 
 
==== ''I don't seem to be making any progress.'' ====
 
==== ''I don't seem to be making any progress.'' ====
 
If the log looks something like this:
 
If the log looks something like this:
第216行: 第158行:
 
</nowiki></pre>
 
</nowiki></pre>
 
then you probably have everything set up correctly, and the problem is on Stanford's side.  Some people have encountered this when asking for deadlineless units, because there appears to be shortages of those.   
 
then you probably have everything set up correctly, and the problem is on Stanford's side.  Some people have encountered this when asking for deadlineless units, because there appears to be shortages of those.   
 
 
If you can't connect to the assignment server, then probably you're behind a firewall or proxy or something else that is preventing the connection.  Ask your network administrator how to get around this.  F@H can be set to use different TCP ports, but the default is 8080.
 
If you can't connect to the assignment server, then probably you're behind a firewall or proxy or something else that is preventing the connection.  Ask your network administrator how to get around this.  F@H can be set to use different TCP ports, but the default is 8080.
 
 
==== ''How do I backup my work?'' ====
 
==== ''How do I backup my work?'' ====
 
 
It's a good idea to stop folding before making your backup, though it isn't absolutely necessary.  Assuming you used ''fah_install'', then make a tarball of foldingathome directory.
 
It's a good idea to stop folding before making your backup, though it isn't absolutely necessary.  Assuming you used ''fah_install'', then make a tarball of foldingathome directory.
 
<pre><nowiki>
 
<pre><nowiki>
第226行: 第165行:
 
</nowiki></pre>
 
</nowiki></pre>
 
If you haven't modified the file <code><nowiki>/etc/default/foldingathome</nowiki></code>, then you don't need to add it.  Clearly, <code><nowiki>/opt/foldingathome</nowiki></code> would become <code><nowiki>/home/$USER/opt/foldingathome</nowiki></code> if you installed it in your home directory.
 
If you haven't modified the file <code><nowiki>/etc/default/foldingathome</nowiki></code>, then you don't need to add it.  Clearly, <code><nowiki>/opt/foldingathome</nowiki></code> would become <code><nowiki>/home/$USER/opt/foldingathome</nowiki></code> if you installed it in your home directory.
 
 
==== ''How do I restore my backup?'' ====
 
==== ''How do I restore my backup?'' ====
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cd /
 
cd /
 
sudo tar zxvf /path/to/fahbck.tar.gz
 
sudo tar zxvf /path/to/fahbck.tar.gz
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you somehow destroyed the <code><nowiki>/etc</nowiki></code> directory (e.g. you reinstalled the operating system), then use the installer with the "update" option to replace the init symlinks, so it can start automatically at boot time.
 
If you somehow destroyed the <code><nowiki>/etc</nowiki></code> directory (e.g. you reinstalled the operating system), then use the installer with the "update" option to replace the init symlinks, so it can start automatically at boot time.
 
 
=== Links ===
 
=== Links ===
 
* [http://folding.stanford.edu/ Folding@Home project home page]
 
* [http://folding.stanford.edu/ Folding@Home project home page]
第248行: 第183行:
 
* [http://fahstats.com/t.php?t=45104 Team Ubuntu statistics] at fahstats.com
 
* [http://fahstats.com/t.php?t=45104 Team Ubuntu statistics] at fahstats.com
 
* [http://folding.extremeoverclocking.com/team_summary.php?s=&t=45104 Team Ubuntu statistics] at folding.extremeoverclocking.com
 
* [http://folding.extremeoverclocking.com/team_summary.php?s=&t=45104 Team Ubuntu statistics] at folding.extremeoverclocking.com
 
 
 
----
 
----
 
[[category:CategoryDocumentation]]
 
[[category:CategoryDocumentation]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 17:17的版本

FAHlogoML.jpg

Overview

Folding@Home is a project from Stanford University that uses millions of networked PCs to form a supercomputer for protein folding simulations. The client software is loaded on a PC, it contacts the central servers, and receives "work units". The client then runs on spare CPU time, and uploads finished work units to the server. When proteins are created, they undergo a complex process known as folding, so-called because the protein molecule transforms from a long chain of amino acids to a complex shape (it "folds up"). The final shape of the protein is absolutely critical to determining its properties and function. Scientists have created software to simulate the folding process to better understand how proteins work, which in turn makes it possible to develop new drugs, cure diseases, etc. Folding@Home is a great way to make your computer do useful work even when you're not using it. Since it runs at a very low priority, you should never realize it's running when you're using the computer to do your work. Note that "using the computer" refers to doing heavy computations. Generally, tasks like web browsing and word processing involve very little CPU usage, so the Folding@Home client will be running at near 100% even when doing those kinds of tasks. It helps to leave your computer on at all times, but is not necessary, as the project will benefit from virtually any time that the client runs on your computer.

Installation

Two installers are mentioned here. fah_install is an installer/init script that works with Debian systems (including Ubuntu). finstall seems to be the all-purpose Unix installer. You can also do things by hand, by just downloading the client and running it some directory. I recommend fah_install, but I'm biased because I wrote it <wink>. Before using either installer, you may want to pick a username and a team. Neither is necessary, but having a unique username lets you know how much you are folding, and folding for a team adds to the fun. Because you're a fan of Ubuntu, you probably want to fold for Team Ubuntu; the team number is 45104. You can pick any username you want, but if you pick one that's already being used, that will make it impossible to track your score and will inflate someone else's score, which may or may not be welcome. Search for unused names here. The default for both username and team is anonymous.

Running the client manually

This is the simplest way. You get the client from http://folding.stanford.edu/download.html, save it to some directory (you will want to make one specifically for F@H, because it makes a bunch of files), and run it. The trouble is, you need to start it by hand. It is far more convenient and correct to make it start at boot-time, because you shouldn't have to think about it. Say you put it in `$HOME/foldingathome`. Then to start it, you will want to use

cd $HOME/foldingathome
(exec fah5 >& /dev/null &)

You must run the client from its directory, since it always looks for files in the current directory (and creates them if they don't exist). The parentheses fork a new shell, the exec replaces the new shell process with the client (not strictly necessary), the redirect supresses output, and the ampersand puts the process into the background. This all means you can safely close the terminal after starting the client this way.

fah_install

See UbuntuHelp:FoldingAtHome/Install for step-by-step instructions. Edgy users: Due to the change from bash to dash in Edgy, previous init scripts don't work. The fix is easy: download the latest installer, untar it, and run sudo ./install.sh update. It will replace the old init script with a new one. You do not have to stop a running client to do this update, but it is probably a good idea to stop it anyway. Please report any Edgy problems to the how-to thread. SMP Users: The 6.00(beta1) version of the client needs a runtime option "-smp" in order to get SMP work units. You must add CLIENT_OPTIONS="-smp" to `/etc/default/foldingathome`. If you update with the latest version of `fah_install`, this will be done for you as long as you allow it to overwrite this file. The following script will download the latest client from the Folding@Home website, and install it to opt/foldingathome, either in / or $HOME. It will ask you to set up the client (the defaults are usually sufficient), and copy that configuration for every CPU in your machine.

It is not possible to provide a .deb package for Folding@Home, because the client must be downloaded from Stanford's website. This is to ensure the integrity of the research. (Maybe it is possible to have a .deb; after all, this is how Macromedia Flash works. The point is that the executable has to be downloaded from Stanford.) To install, download the tarball and do

tar zxvf fah_install-20061219.tar.gz

This should extract the archive to a directory called fah_install/. Then

cd fah_install
less README

to read the documentation. Finally,

sudo ./install.sh install

to install the client. You can also install to your $HOME, in case you do not have root access to the computer. Clearly, you would not have to prefix the command with sudo in this case. If you install to your $HOME, a cron job will be created to start the client automatically. If you install to the system, the client will automatically start when your computer boots up. You can reconfigure the client using the supplied reconfigure script, which is placed in opt/foldingathome. You can also give the client command line options in /etc/default/foldingathome. See the README for more details. Should you choose to uninstall the client, it's easy. The first installation script contains an uninstalling script too. Just go to the directory fah_install and run install.sh with uninstall parameter. Use sudo to uninstall if you used sudo to install. The README file provides instructions for manual uninstall.

sudo ./install.sh uninstall

finstall

  1. Download the finstall script with wget:
cd ~
wget -c http://www.vendomar.ee/~ivo/finstall

2.#2 Make the script runnable:

chmod +x finstall

3.#3 Start it:

./finstall

After the client is installed You can start/stop/... FAH client with ./foldingathome/folding script. For Example(s)

~/foldingathome/folding start
or
~/foldingathome/folding stop
or
~/foldingathome/folding status

For me this was all I needed as it automatically created the init scripts I needed to start after reboot. However the init scripts don't seem to work for everyone, so if you need to do it manually:

  1. Make a file called foldingathome in the /etc/init.d directory:
gksudo gedit /etc/init.d/foldingathome

2.#2 Paste this in:

#!/bin/sh
# /etc/init.d/foldingathome for Ubuntu
# Start the F@H service.
pushd /home/YOUR_USERNAME_HERE/foldingathome/
su YOUR_USERNAME_HERE -c "screen -d -m ./folding start"
popd

3.#3 Save and exit 4. Make a symlink into the /etc/rc2.d directory:

sudo ln -s /etc/init.d/foldingathome /etc/rc2.d/S99fah

Here are a couple more hints to make things go smoother:

  1. Pick a username before you start, to see if your username is in use visit this page first [1]. There is a search box at the top that you can use to see if your selected username is in use.

2. Have your team number ready, it is question two right after your username. You should use 45104 for this. 3. If you have an old computer you should run deadlineless work units. To select the option to do this select yes when asked if you want to set advanced options, then continue to select the defaults until you are asked about deadlineless workunits and select yes. Note: There are frequent shortages of the deadlineless WUs. If you haven't gotten one for several days, you might as well ask for both deadlineless and normal WUs. 4. Finally here is a link to the original thread for using the finstall script from the folding community forums, it is where I found my answers and definitely the easiest way to get this working under Dapper Drake. [2]

Other Issues

Questions and Discussion

For technical questions and bug reports, go to the HowTo forum thread. For casual talk about Folding@Home, use the Ubuntu Team recruiting thread.

Security

Folding@Home is secure. The Stanford team has gone to great lengths to ensure security, both for the integrity of their research and the safety of donors' computers. However, the more secure the better. The Gentoo ebuild for Folding@Home creates a new user foldingathome whose sole purpose is to run the client. Now fah_install offers the same. It creates a user whose account is disabled, and runs the client as this user when the init script is run as root, so the client is never run as root.

Hyper Threading

For those with Hyper Threading CPUs, you probably know that an SMP kernel sees two processors. Then clearly, if you run two clients, you will get more work done than if you only run one (probably about 10-30% more). However, results that are done quickly are more useful than more results done slowly. The reason is that each work unit is a step in a giant simulation, with future steps depending on past ones. So the faster you get your work done, the faster the simulation can move along. Long story short, run one client for each physical CPU, not for each logical CPU. The installer should automatically count the number of CPUs in your system. See this post in the Folding@Home forums.

Laptop Systems

Because the client runs at low priority, the client should not cause the CPU governor to kick up the frequency. In other words, even though the client runs at 100% CPU usage, it should not cause the CPU frequency to go up, which keeps the fan slow and quiet. If this is not the case, then the frequency governor should be reconfigured. Note: Feisty uses different default cpu governing method than Dapper (I don't know about Edgy). Feisty uses a kernelspace governor whereas Dapper uses a userspace one (powernowd). The consensus seems to be that kernelmode is the superior implementation. The trouble is that the default is not to ignore nice'd processes (i.e. low priority processes like the folding@home client) in kernelmode, while powernowd's default is to ignore nice'd processes in its calculations. To get powernowd behavior, you must do the following:

sudo -i
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load

To enable this behavior in the future, add the above (just the echo line, not the sudo one) to /etc/rc.local. For more about manipulating frequency governors, look at this link. There is a utility called cpulimit that will limit the CPU time of a given application. Look at this link for a quick how-to. If there is demand, I will add support for it to fah_install. One can configure ACPI (the power regulation subsystem) to stop the client when the system goes on battery power, and to start it again when the power cord is plugged back in.

Breezy and older

Edit /etc/acpi/power.sh. Inside the if [ $? = 0 ] && [ x$1 != xstop ]; then block, add

# stop folding at home
if [[ -x /etc/init.d/foldingathome ]] ; then
/etc/init.d/foldingathome stop
fi

and inside the else block, add

if [[ -x /etc/init.d/foldingathome ]] ; then
/etc/init.d/foldingathome start
fi
Dapper and newer

Simply create two scripts in the relevant directories.

sudo -i
echo "/etc/init.d/foldingathome stop" > /etc/acpi/battery.d/fah.sh
echo "/etc/init.d/foldingathome start" > /etc/acpi/ac.d/fah.sh
exit

This assumes that the client has been installed for the entire system (as opposed to installing just for your user), which it should be if you are able to edit files in /etc in the first place!

TeamUbuntu (45104)

A competitive Folding@Home team called TeamUbuntu exists to represent the Ubuntu community and to have some fun while doing good. The team number is 45104. To join the team, simply enter 45104 when the setup dialog requests a team number.

FAQ

How do I uninstall?

If you used fah_install, the installer on this page, rerun the installation script with the "uninstall" option. The README file has a detailed description of what the uninstall command does. If you used finstall, cd to $HOME/foldingathome and run ./uninstallService. If you just downloaded it to some directory, just delete the client and the directory. See also the next question about random files.

Why does F@H write files to random directories?

If you use fah_install or finstall, it shouldn't. That was half of the reason why those scripts were written. The client writes a bunch of files to some directory, we'll call it the working directory or WD, if the WD doesn't have all of the files already. So if you have no F@H files in the WD, the client will write them. How do you figure out what the WD is? It is the current directory of the shell that starts the client; in other words, it could be anything. If you have a script of some sort that you wrote to start up the client, you need to cd to whatever directory you want all of those files to be written to before starting the client.

cd /working/directory
/path/to/FAH502-Linux.exe

How do I find out how much I'm folding?

The client writes a log file in WD/FAHlog.txt. For fah_install, this is in /opt/foldingathome/#/FAHlog.txt or $HOME/opt/foldingathome/#/FAHlog.txt, where '#' is a digit from 1 to 9, but probably only 1 will exist unless you have a multiprocessor system. If you use finstall, it is in $HOME/foldingathome/CPU#. There is also a more concise progress file unitinfo.txt, in the same directory as FAHlog.txt. There are nice graphical programs that will display the information in these files, for example Protein Think. You can see how many points your current work unit is worth by looking up your protein on http://fah-web.stanford.edu/psummary.html

I don't seem to be making any progress.

If the log looks something like this:

[19:39:55] + Attempting to get work packet
[19:39:55] - Connecting to assignment server
[19:39:57] - Successful: assigned to (171.64.122.133).
[19:39:57] + News From Folding@Home: Welcome to Folding@Home
[19:39:57] Loaded queue successfully.
[19:39:58] + Could not connect to Work Server
[19:39:58] - Error: Attempt #9 to get work failed, and no other work to do.

then you probably have everything set up correctly, and the problem is on Stanford's side. Some people have encountered this when asking for deadlineless units, because there appears to be shortages of those. If you can't connect to the assignment server, then probably you're behind a firewall or proxy or something else that is preventing the connection. Ask your network administrator how to get around this. F@H can be set to use different TCP ports, but the default is 8080.

How do I backup my work?

It's a good idea to stop folding before making your backup, though it isn't absolutely necessary. Assuming you used fah_install, then make a tarball of foldingathome directory.

sudo tar zcvf fahbck.tar.gz /opt/foldingathome/ /etc/default/foldingathome

If you haven't modified the file /etc/default/foldingathome, then you don't need to add it. Clearly, /opt/foldingathome would become /home/$USER/opt/foldingathome if you installed it in your home directory.

How do I restore my backup?

cd /
sudo tar zxvf /path/to/fahbck.tar.gz

If you somehow destroyed the /etc directory (e.g. you reinstalled the operating system), then use the installer with the "update" option to replace the init symlinks, so it can start automatically at boot time.

Links