Multithreaded Client Uses CPU resources despite renice to 19

Moderators: Site Moderators, PandeGroup

Multithreaded Client Uses CPU resources despite renice to 19

Postby Lyuokdea4 » Tue Feb 14, 2012 1:36 am

Hi All,

Running folding at home on of my larger machines (2x Intel Nehalem 5570) running Ubuntu 11.10 I am currently running:

./FahCore_a3.exe -dir work/ -nice 19 -suffix 03 -np 16 -checkpoint 15 -verbose -lifeline 14167 -version 634

and the process is reniced to 19.

However, even when running 16 different 1 CPU jobs (for my actual work) - Folding at home continues to use about 6 CPUs continuously (according to top) slowing down the other jobs.

I'd like to keep using this, but I need it to not interfere with my processes. Is there any way to automatically have FaH stop when other processes are running? I can always run kill -STOP if I notice the problem, but there are several users of this computer, so I don't want to put it on them.

Thanks,

~Lyuokdea
Lyuokdea4
 
Posts: 2
Joined: Tue Feb 14, 2012 1:30 am

Re: Multithreaded Client Uses CPU resources despite renice t

Postby PinHead » Tue Feb 14, 2012 3:08 am

Have you tried just running the client with the -smp switch, instead of launching the core? The client seems to get out of the way fairly quick.

./FAH634 -smp

I think you have to make FAH634 executable first. chmod +x FAH634
PinHead
 
Posts: 368
Joined: Tue Jan 24, 2012 3:43 am

Re: Multithreaded Client Uses CPU resources despite renice t

Postby 7im » Tue Feb 14, 2012 4:28 am

Hello Lyuokdea4, welcome to the forum. I've read where the SMP client may never back off all the way to use 0 processors.

You would need to run 8 CPU clients instead. The CPU client does back off all the way, and runs at the lowest priority, giving up all free CPU cycles to other programs.
How to provide enough information to get helpful support
Tell me and I forget. Teach me and I remember. Involve me and I learn.
User avatar
7im
 
Posts: 15237
Joined: Thu Nov 29, 2007 4:30 pm
Location: Arizona

Re: Multithreaded Client Uses CPU resources despite renice t

Postby bruce » Wed Feb 15, 2012 9:37 am

FAH uses the resources given to it by your Operating System. That OS contains a task scheduler than considers many factors, including "nice" If you're not happy with the way with the way Ubuntu 11.10 scheduler manages work, you'll find many technical discussions in the Linux development forums. Some OSs also have alternate scheduling methodology which (perhaps) you can be download and instal on your system. Use at your own risk.

The perfect scheduler has not been written yet.
bruce
 
Posts: 21420
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Multithreaded Client Uses CPU resources despite renice t

Postby Lyuokdea4 » Mon Feb 20, 2012 8:01 pm

Hi All,

I wrote a small python program in order to pause Folding at Home automatically if the total load on the system gets too high, and then restart it when the load falls off again. It's pretty dirty (I'm not a great programmer) - but seems to do the trick. I'll post it up here in case anybody else needs it. You'll have to change the minimum and maximum load to fit the system you want to run on (I have 16 processors on mine, which is what I used to decide to turn off if the load exceeded 18 (with FaH running) and to turn back on if it dipped under 5.

Code: Select all
import os
import commands
import sys
import time
state = 1 ##FaH is currently running

while(1):
        load = float(commands.getoutput("cat /proc/loadavg | awk '{ print $1 }'"))
        if(load > 18.00): ##if the load gets too high, turn off FaH
                command = "ps aux | grep 'FahCore_a3' | awk '{print $4}'"
                ram = commands.getoutput(command)
                ram_array = ram.split('\n')
                command = "ps aux | grep 'FahCore_a3' | awk '{print $2}'"
                pid = commands.getoutput(command)
                pid_array = pid.split('\n')
                counter = 0
                for x in range(0, len(ram_array)):
                        if (float(ram_array[x]) > 0.1): ##This is the actual Fah client, which always uses some ram
                                command = "kill -STOP " + pid_array[x]
                                os.system(command)
                                state = 0 ##the system is currently turned off
        if(load < 5.00): ##if the load gets too high, turn off FaH
                command = "ps aux | grep 'FahCore_a3' | awk '{print $4}'"
                ram = commands.getoutput(command)
                ram_array = ram.split('\n')
                command = "ps aux | grep 'FahCore_a3' | awk '{print $2}'"
                pid = commands.getoutput(command)
                pid_array = pid.split('\n')
                counter = 0
                for x in range(0, len(ram_array)):
                        if (float(ram_array[x]) > 0.1): ##This is the actual Fah client, which always uses some ram
                                command = "kill -CONT " + pid_array[x]
                                os.system(command)
                                state = 1 ##the system is currently turned off

        time.sleep(15)
Lyuokdea4
 
Posts: 2
Joined: Tue Feb 14, 2012 1:30 am

Re: Multithreaded Client Uses CPU resources despite renice t

Postby gregd » Wed Apr 11, 2012 5:53 pm

For those using F@H on OSX and having the same kind of CPU usage listed above, I would recommend to use both the renice command and cputhrottle (www .willnolan. com/cputhrottle/cputhrottle .html).
Code: Select all
~$ sudo renice 10 -p FaH_PID
~$ sudo cputhrottle FaH_PID 100

100 means 100% of 1 CPU, so you can change the value to 200 or 400 to use 2 or 4 CPUs, and FaH_PID is the PID of the Fah_Core_a3 process.
(sorry for the strange link with spaces, the rules for posting URLs are a bit strict).
gregd
 
Posts: 1
Joined: Wed Apr 11, 2012 5:14 pm


Return to Linux CPU V6 Client

Who is online

Users browsing this forum: No registered users and 1 guest

cron