Supporting Covid-19 research with Folding@Home (English version)

2020.04.06

(Japanese version can be found here)

The coronavirus(Covid-19)is spreading all over the world and causes a lot of trouble to a lot of people. In order to flatten the curve and slowing down the speed of spreading, a lot of actions are already being taken, but to overcome the pandemic in the long run research is crucial.

When thinking of research, one might instantly imagine laboratories and suchlike, but there is more to it. For instance, in order to understand the 3-dimensional structure of viral proteins (protein folding), computer simulations are being used. And this needs a lot of computing power. With distributed systems it is possible to use a huge amount of individual machines, including personal computers, and combine their power. There are several projects that are actively using such distributed systems, and I would like to introduce one of them.

Outline of Folding@Home

Just as the name Folding@Home implies, you can contribute to protein folding research from home! It is a project from Stanford University, so it is both promising and trustworthy.

Supported platforms are Windows, MacOS and Linux, so basically anyone can join, which I think is a big plus for making it a great project. Also, since it is just running as a background process, you don't need to take care about it once it's installed.

Now, since this project came to life many years ago, it is not only about corona related research, but also about cancer, Alzheimer's etc. You cannot chose freely which research project you would like to support with your computing power, but if you just go with the default setting of "Any disease" (described below) projects will be distributed priority based, and since corona related projects have highest priority right now it is very likely that you will join such a project.

By default, you will join anonymously, but if you want to you can set a user name. By doing this, you can check to which degree you were able to contribute in total (you will receive points). Further, it is also possible to join as a team. Every team receives a unique ID, and all you need to do is specify this ID in your settings. A list of existing teams can be found here. Basically you can chose any team you want! Our team's (developers.io) ID is 257916( ^ω^ )

(You can scroll it to see the full member list)

Installing and settings

I will explain necessary steps for both Amazon EC2 and PC.

EC2 Instance

For simple computing power, spot instances are perfect. My AMI of choice for testing it out was Amazon Linux 2, so everything below is based on that.

① Login with SSH

② Install Folding@Home

$ wget https://download.foldingathome.org/releases/public/release/fahclient/centos-5.3-64bit/v7.4/fahclient-7.4.4-1.x86_64.rpm
$ wget https://download.foldingathome.org/releases/public/release/fahcontrol/centos-5.3-64bit/v7.4/fahcontrol-7.4.4-1.noarch.rpm
$ sudo rpm -i --nodeps fahclient-7.4.4-1.x86_64.rpm
$ sudo rpm -i --nodeps fahcontrol-7.4.4-1.noarch.rpm

It should run with only these steps! But let's check anyway just to be sure.

$ top
top - 11:19:19 up 1 day, 19:46,  1 user,  load average: 1,00, 1,00, 1,00
Tasks: 145 total,   2 running,  78 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,0 us,  0,0 sy, 12,5 ni, 87,4 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem : 15391720 total, 14490892 free,   212940 used,   687888 buff/cache
KiB Swap:        0 total,        0 free,        0 used. 14904740 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                                                                                    
16831 fahclie+  39  19  230364  61400  13028 R 100,0  0,4 234:41.75 FahCore_a7                                                                                                                                                                                                 
16827 fahclie+  39  19   96692   4472   4212 S   0,3  0,0   0:03.11 FAHCoreWrapper                                                                                                                                                                                             
    1 root      20   0  191096   5460   3980 S   0,0  0,0   0:03.29 systemd                                                                                                                                                                                                    
    2 root      20   0       0      0      0 S   0,0  0,0   0:00.04 kthreadd                                                                                                                                                                                                   
    4 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 kworker/0:0H                                                                                                                                                                                               
<abbreviated>

You can now leave it as it is, but in case you want to join a team etc. there are a few more settings to be done.

③ Update the configuration file /etc/fahclient/config.xml

Below are just the main settings:

  • GPU usage(true, false)
  • Power(light, medium, full)
  • WebControl Access(Specific IP address or a subnet in CIDR notation)
  • Username
  • Team ID
  • Slot settings(quantity, CPU or GPU)
<config>
    <!-- Folding Slot Configuration -->
    <gpu v='false'/>

    <!-- Slot Control -->
    <power v='FULL'/>

    <!-- HTTP Server -->
    <allow v='x.x.x.x'/>
    <web-allow v='127.0.0.1 x.x.x.x'/>

    <!-- User Information -->
    <team v='xxx'/>
    <user v='yyy'/>

    <!-- Folding Slots -->
    <slot id='0' type='CPU'/>
</config>

After updating settings, restart the service.

$ sudo /etc/init.d/FAHClient stop
Stopping fahclient ... OK
$ sudo /etc/init.d/FAHClient start
Starting fahclient ... OK

④ Open port 7396(If you want to remotely access the WebControl screen)

You need to open TCP port 7396 by altering inbound rules of appropriate security groups. Also be aware that it might also be necessary to update your firewall at home.

⑤ Open the web control

You can access the Web control in your browser at http://<IP of your EC2 instance>:7396/

It appears to not work properly with Chrome, so I recommend using a different browser. I tried Firefox and had no problems.

You can change a lot of settings with the configuration file above, but it surely is more convenient to do it from a GUI. Settings that can be done from the web control are listed below.

  • Power(light, medium, full)
  • Timing(While working, when idle)
  • User name
  • Team ID
  • Research you want to support(Any, Alzheimer's, Cancer, Huntington's, Parkinson's)

Also, what you're probably most curious about, you can see which project you're currently contributing to!

If "CORONAVIRUS PROJECT" is being displayed, you know that your current project indeed is a corona related project. If something else is being displayed, it may not be what you wanted, but that only means that all available corona projects are being distributed to other supporters at the moment. That is a good thing! Just let it run and wait, the next project might then be corona related. Thus, if you just stick with the default configuration of "Any disease", you can support corona related research.

Personal Computer

① Download Folding@Home

② Follow the given instructions depending on your operation system

Just like above, it should run with only these steps.

③ Settings

The web control can be accessed with your browser at http://localhost:7396 . Settings are the same as in ⑤ above.

Settings for slots, GPU etc. can be updated via FAHControl, which comes with the installation.

You can add CPU/GPU slots by just clicking "Add".

Lastly

Distributed systems are amazing, aren't they? Just by running Folding@Home, everyone can contribute to research on a variety of diseases. Especially research on the coronavirus, which affects so many people's lives, would be best to progress quickly. So let's join forces (and our computing power) and support research!