Folding@Home

Discuss various technical topics not related to Mozilla.
cesarsalgado
Folder@Home
Posts: 137
Joined: November 11th, 2004, 9:24 am
Location: Galicia, Spain
Contact:

Re: Folding@Home

Post by cesarsalgado »

I am using the F@H client for Windows (version 7.3.6), and when I open the advanced control I see something like a progress bar with the title "folding power".

There you can switch among these options: off - idle light - idle - light - medium - full.

You can find a brief explanation of these options here: https://fah-web.stanford.edu/projects/F ... anceLevels

And remember the best place to find an answer on F@H topics is http://foldingforum.org/

Good luck!
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Folding@Home

Post by Frenzie »

Those settings don't seem to affect much either, but that's a separate thing. Currently it's set to medium, so while I'm using the computer it's using 100% of one core coupled with a nice value of 20 so it doesn't get in the way; it goes up to 100% of both cores if I don't touch my computer for a while. I'm not sure if light even does anything differently, but I guess it might wait a little longer before going to full strength.

The setting I'm talking about is in Configure > Advanced, but of course I am on Linux. However, I just realized I haven't actually tried restarting the service yet, which might be necessary for changes to take effect.

Anyway, the reason I ask is that I'm all for my CPU doing something useful while I leave it on, but I'm hardly looking for extra power consumption at higher clock speeds. Or am I looking at that incorrectly?
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Folding@Home

Post by LoudNoise »

Personally I would just keep it as it comes out of the box. I am assuming that the folks Stanford have both a pretty good idea of what is useful and what isn't intrusive.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Folding@Home

Post by Frenzie »

It's not intrusive except in the sense that in the long run it'll cause a higher electricity bill. That's good for neither my wallet nor the environment.

Edit: also it's summer, so not exactly conductive to decent room temperatures either.

Edit2: thanks to the linked forum I found fahlimit, which sort of works, but basically it's just stopping and continuing the process constantly, which is kinda weird and makes a graph of CPU use look like some kind of sine function. Better than nothing, I suppose. If I'm going to continue using F@H I think I've got a better idea: to make the CPU not exert itself for processes with a nice value of 20, which I think I might be able to do by talking directly to the Linux kernel. I'll check back if I'm successful without going through too much trouble.

Edit3: never mind the above. The repositories have a little application called cpulimit, which does the job perfectly. This is obviously preferable to a F@H-specific solution. I'll just have to write a little shell script around it to feed it PIDs from process names, and perhaps a little something in order to run it as a daemon.

Edit4: Well, look at that: http://ubuntuforums.org/showthread.php?t=992706 Doesn't quite fit my desktop needs, but easier to delete some stuff than to start from scratch.
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

The Linux Debian packages work fairly well and are using only 12% CPU at full setting on the slider.
I leave the Fahviewer off, do the cd FAHClient in a terminal after I open the Fahcontrol.
Fahcontrol picks the connection up when the "cd FAHClient" and "FAHClient" commands are performed in sequence, after connection is indicated move the folding power slider to full.
Shutdown is performed by moving the slider to off and watching the terminal for shutdown before closing the terminal and Fahcontrol.
Maybe it has something to do with the 32bit vs 64bit setup.
All three packages: Fahclient 7.3.6, Fahcontrol 7.3.6-1 and Fahviewer 7.3.6 show as installed in Synaptic though they didn't come from there.
Downloaded the .debs and used Gdebi to install but dpkg may work or should work just as well.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Folding@Home

Post by Frenzie »

Only 12%? Well, certainly not on mine. :) With its nice value of 20 I really have no issue with it gobbling up all of the extra CPU cycles, but I just don't want my processor to go up to faster clock speeds just for F@H.

Anyway, I had yet a better idea: people use automatic timeouts for monitors, as do I for the rare case I forget to turn it off, but I was thinking that doing the same for processors might actually be far less annoying. Here's my first shot at a CPU throttling script based on user activity:

Code: Select all

#!/bin/bash
#cpu-xidle-based-throttle.sh
#adapted from https://github.com/Sepero/temp-throttle
#depends on xprintidle and cpufreq-utils

CORES=$(nproc) # Get number of CPU cores.
echo -e "Number of CPU cores detected: $CORES\n"


set_gov() {
   for((i=0;i<CORES;i++)); do
      cpufreq-set -c $i -g $GOV
   done
}

throttle() {
   echo -n "throttle "
   GOV=powersave
   set_gov
}

unthrottle() {
   echo -n "unthrottle "
   GOV=ondemand
   set_gov
}

get_time() {
   # current idle time in ms
   IDLE=$(xprintidle)
   # Current hour of the day (0-23)
   HOUR=$(date +%H)
   
   if [ "$HOUR" -lt 9 ] || [ "$HOUR" -ge 23 ]
   then
      # if hour is less than 9 or greater than 23, timeout is only 2 minutes
      TIMEOUT=2
   else
      # otherwise the timeout is 10 minutes
      TIMEOUT=10
   fi
   
   #TIMEOUT to ms
   TIMEOUT=$((TIMEOUT*60000))
}

while true; do
   get_time
   if   [ "$IDLE" -gt "$TIMEOUT" ]; then # Throttle if idle time higher than timeout.
      throttle
   elif [ "$IDLE" -le "$TIMEOUT" ]; then # Unthrottle if idle time lower than timeout.
      unthrottle
   fi
   sleep 3
done


There are some obvious drawbacks to this approach, not in the least that my computer might throttle down to insufficient power while playing a movie (although that's actually fairly unlikely, but better safe than sorry). As such it might be better to tie it into

Code: Select all

xscreensaver-command -watch


But besides some minor issues like that to sort out, I think this makes an awful lot of sense.
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

Nice value for this system is set at 19, overclocking is set to auto but within some preset limits.
I wouldn't think one step of nice would make that much difference.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Folding@Home

Post by Frenzie »

It's at 19 now for me too; maybe it's because I put the CPU percentage slider back to full (although I definitely wouldn't expect the nice value to be affected by something called CPU percentage…)

Anyhoo, I expanded slightly upon my script so it keeps the CPU unthrottled while using VLC.

Code: Select all

#!/bin/bash
#cpu-xidle-based-throttle.sh
# Adapted from https://github.com/Sepero/temp-throttle
# Depends on xprintidle and cpufreq-utils.

# Interval at which the script checks whether to throttle or unthrottle in seconds.
INTERVAL=5
# User whose VLCs to check.
USER=yadayada

# Tmeout in seconds.
TIMEOUT_NIGHT=120
TIMEOUT_DAY=300

CORES=$(nproc) # Get number of CPU cores.
echo -e "Number of CPU cores detected: $CORES\n"


set_gov() {
   for((i=0;i<CORES;i++)); do
      cpufreq-set -c $i -g $GOV
   done
}

throttle() {
   echo -n "throttle "
   GOV=powersave
   set_gov
}

unthrottle() {
   echo -n "unthrottle "
   GOV=ondemand
   set_gov
}

get_time() {
   # Current idle time in ms.
   IDLE=$(xprintidle)
   # Current hour of the day (0-23).
   HOUR=$(date +%H)
   
   if [ "$HOUR" -lt 10 ] || [ "$HOUR" -ge 23 ]
   then
      # if hour is less than 9 or greater than 23, timeout is only 2 minutes
      TIMEOUT=$TIMEOUT_NIGHT
   else
      # otherwise the timeout is 10 minutes
      TIMEOUT=$TIMEOUT_DAY
   fi
   
   #TIMEOUT to ms
   TIMEOUT=$((TIMEOUT*1000))
   #echo -n $IDLE/$TIMEOUT/
}

get_playing() {
   pids=($(ps -u $USER -o pid= -o comm= |
           awk -v "name=vlc" '$2 == name {print $1}') )
   vlcs=

   for i in "${pids[@]}"
   do
      :
      # $i are the VLC process IDs. This will not work on the VLC 2.0.3 that comes with Wheezy, so a backport of 2.0.6 or 2.0.7 is required.
      vlcs=$vlcs$(su - $USER -c "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.vlc-$i /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'")
   done

   # Thanks to http://www.linuxquestions.org/questions/programming-9/bash-search-for-a-pattern-within-a-string-variable-448022/#post4261310
   case "$vlcs" in
   # searchString can be anywhere in thisString
      *"Playing"*) PLAYING=true ;;
 
      *) PLAYING=false ;;
   esac
   #echo -n $PLAYING/
}

while true; do
   get_playing
   if $PLAYING; then
      unthrottle
   else
      get_time
      if   [ "$IDLE" -gt "$TIMEOUT" ]; then # Throttle if idle time higher than timeout.
         throttle
      elif [ "$IDLE" -le "$TIMEOUT" ]; then # Unthrottle if idle time lower than timeout.
         unthrottle
      fi
   fi
   sleep $INTERVAL
done
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Folding@Home

Post by LoudNoise »

Frenzie wrote:It's not intrusive except in the sense that in the long run it'll cause a higher electricity bill. That's good for neither my wallet nor the environment..


Here's a test. Spend a month not running folding at home. Compare that electric bill with your current one. Spend a month turning off you computer when you are not using it. Compare that bill to both.

I would be willing to bet that the the folding at home/not folding at home bill is more or less the same. I would bet that turning off your computer when you are using it would be a bill win. You are over thinking the problem.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Folding@Home

Post by Frenzie »

The difference would probably be less than €3 per month even if I ran my computer 24/7, assuming about a 20W difference between low and high frequency, and about 20 cents per kWh (5 electricity, 15 cents distribution and network maintenance if I'm reading the chart correctly). No doubt the difference from turning the computer off more aggressively would be greater. But you're overlooking what I said about summer room temperature, and also something I left unstated: I might consider running this on my laptop, but it gets a fair bit hotter than my desktop under load, so I might want to keep that down even when plugged in. Besides, I've been wanting to look into DBUS for probably over a year now, but never got around to it. Although if I write something else that talks to DBUS, I think I'll probably use Python. Oh, and I could easily turn it around to always run in performance mode while running something in particular, who knows. It's just a starting point. Maybe one that'll just get dusty until I have a use for it years from now. :)
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

Couple of folding projects haven't seemed complete or fully working the way others do.
In the Control panel I've had two projects which came from the same legitimate IP but for some reason there is no IP shown in the panel for the collection server.
Looking at the server list it may show accepting or not accepting, no indication of project number.
Also looking at project description seems vague or general in vocabulary.
Not trying to be uncooperative but I dumped these for the reason of no collection server and vagueness of project description and loaded new ones from other more familiar servers which displayed the collection IP.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
bollix47
Folder@Home
Posts: 1195
Joined: November 1st, 2004, 2:43 pm
Location: Toronto, Canada

Re: Folding@Home

Post by bollix47 »

All work units are returned to the work server they came from. Some work servers have an additional collection server assigned in case there's a problem returning results to the work server. Not all work servers have a collection server assigned to them. The absence of a collection server on the GUI is not considered to be a problem.
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

Thank You, thought that may be the case but wasn't sure. #-o
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

Another small problem. Concise as possible.
Failed to pick up a work unit from a 143 server, numerous attempts, site shows working/accepting.
Washed the work directory and picked up an unsolicited unit from the 128 server but it also tried to install the A3 core
Automatic installation of the A3 core kept failing would not start 128 work unit.
Reset slots configuration to default, A3 core continued to fail and not institute.
Dumped the cores, A3 & A4 and dbs re-installed client, working at present.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Grumpus
Posts: 13238
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Folding@Home

Post by Grumpus »

The server @University of Virginia keeps putting the A3 core on my system and it doesn't work, keeps failing.
I am having to dump ev erything and restart.
I'm tired of having to fight with this to make it work right.
I thought I was helping, apparently I'm not.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
Post Reply