What's new
  • Please do not post any links until you have 3 posts as they will automatically be rejected to prevent SPAM. Many words are also blocked due to being used in SPAM Messages. Thanks!

FahCore_A2 2.10 Performance Fix

geokilla

Well-known member
Joined
Aug 11, 2008
Messages
3,760
Location
Toronto
Credits go to tear on folding forum. Thought I'd share this with you guys. I managed to get an extra theoretical 300PPD on my AMD Athlon X2 2.65Ghz.
tear said:
Updated: November 4th, 2009

Posting here for easy access now that we've polished the guidelines -- extra credit goes to weedacres and uncle fuzzy -- thanks!

There's a performance degradation in A2 2.10 core people have been observing on Dual-Core setups.
Degradation varies from several to thirty (30) percent (compared to A2 2.08). Details in a very, very long thread.

It's been determined that adding MPICH_NO_LOCAL=1 environment variable makes the degradation go away for majority of users.

How to apply?

1) Notfred's (VM or not), option A (easy application, extra action required at every VM/PC boot)

 Please do the following when booting:



 NOTE:  MPICH_NO_LOCAL=1 has to be added at every VM/PC boot-up; if you'd like to avoid it please see
     option B below
 NOTE:  if you ever decide to start client manually you will need to export the variable prior to starting the client
     (see details)


2) Notfred's (VM appliance only but see notes below), option B (not-so-easy application, zero maintenance)

 Please do the following:




 Then reboot the VM. After the reboot you may wish to confirm you did all right:



 NOTE:  once you modify syslinux.cfg file, MPICH_NO_LOCAL=1 will be applied by the bootloader automagically
     at every boot-up
 NOTE:  if you ever decide to start client manually you will need to export the variable prior to starting the client
     (see details)
 NOTE:  make sure to create a backup copy of your whole VM before performing operations described here --
     a mistake may render your VM unable to boot
 NOTE:  if you use USB notfred's you'll need to locate syslinux.cfg file and add MPICH_NO_LOCAL=1 at the end
     of APPEND line(s)


3) Regular Linux installation

 Please do the following:
Code:
export MPICH_NO_LOCAL=1
 and start the client normally.


 If you had followed Stanford's Linux Installation Instructions for the SMP client and created "fah" script, revised instructions are located below:
Code:
echo "export MPICH_NO_LOCAL=1" > fah
echo "./fah6 -smp -verbosity 9 $* &" >> fah
chmod +x fah

4) Additional information

 With MPICH_NO_LOCAL=1 FahCore uses non-localhost IP address for communication;
 what it means is you need to make sure this address (check ,,netstat -tnp | grep FahCore''
 when folding) is not permanently taken down.
 On typical Linux installation (with NetworkManager) that could happen if somebody
 permanently (2h+) disconnected Ethernet cable or DHCP server assigned you a different
 IP address.

 What does the variable do? From mpich README:
Code:
Shared-memory optimizations are enabled by default to improve
performance for multi-processor/multi-core platforms. They can be   
disabled (at the cost of performance) either by setting the
environment variable MPICH_NO_LOCAL to 1, (...)
 <side note>Don't let "at the cost of performance" scare you, just try it out.</side note>

 On the system side it makes FahCore go back to TCP sockets (by default A2 2.10
 uses UNIX domain sockets) for inter-process communication.

 Now.. why it helps? It's really hard to guess given black box nature of FahCore; it
 also goes beyond my present knowledge. Whatever it is, it messes with kernel
 scheduling (kernel code path with more might_sleep()s or something) so processes
 that have actual work to do get CPU time more often than others.

 If previous paragraph made you think Linux is broken -- please don't. It's not.
 By adding discussed variable we're just hiding original problem that actually
 lies in the FahCore.



Thanks everyone for testing and feedback!


tear
 
Last edited:

SugarJ

Moderator
Staff member
Folding Team
Joined
Jan 17, 2008
Messages
7,158
Location
Langley, BC
So far I have no clue how to edit inside of Notfreds........

When you boot your VM, click inside the window. Type the above. You have to press something to get your mouse and keyboard out of the VM, don't recall what, but it shows at the bottom of the window.
 

Sagath

Moderator
Staff member
Folding Team
Joined
Feb 7, 2009
Messages
4,451
Location
Edmonton, AB
When you boot your VM, click inside the window. Type the above. You have to press something to get your mouse and keyboard out of the VM, don't recall what, but it shows at the bottom of the window.
CTRL + ALT will get you your mouse back.

I might try this on my 2-core and see if I notice any PPD increase the next time its close to finishing up a WU
 

4DoorGTZ

Well-known member
Joined
Mar 23, 2007
Messages
732
Location
Calgary, AB
Could be a fluke or related to something else, but I just tried this on my dual core laptop. 771-->998ppd not bad!
 

geokilla

Well-known member
Joined
Aug 11, 2008
Messages
3,760
Location
Toronto
I need to figure out a way on how to make the following work automatically.

*) If you're a proficient notfred's user you can add MPICH_NO_LOCAL=1 at the end
  of APPEND line in fold64 section (so you don't need to enter it manually at every
  boot) of syslinux.cfg file
I can't find the syslinux.cfg file.
 

Nademon

Well-known member
Joined
Oct 13, 2008
Messages
303
Location
Toronto
Just tried it and my PPD on that client went from 2500 or so up to 2952ppd. Seems to work and it hasn't affected my GPU ppd. Nice find!
 

chrisk

Folding Captain
Joined
Jul 12, 2008
Messages
7,560
Location
GTA, Ontario
You're not the only one who can't find the file...
There is a "syslinux" file in "fold123a\\c\Bin" folder. It is not labeled as a cfg file though, and notepad opens it as a mostly garbled file. I did not look through allm the characters but take a look at that file.
 
Top