11 January 2012

47. A step on the way to compiling the omnibook apci drivers on debian testing

First, see here:
http://sourceforge.net/projects/omnibook/
http://home.comcast.net/~rickrich1/toshiba-1115-s103/omnibook.txt

I have an old toshiba satellite a205 which has a fan that turns on at 50 degrees and turns off at 45 degrees. It's a much too narrow range, so the fan is starting up every two minutes or so -- having it turn off at 40 degrees would probably make more sense. To this effect I wanted to see if I could get apci fan support.

In the end I don't seem to have succeeded, but here's what I did manage to do, and what happened:

Go:
Install build-essential and the kernel headers for your kernel

git clone git://omnibook.git.sourceforge.net/gitroot/omnibook/omnibook
cd omnibook/

vim polling.c
comment out lines 128:
//        cancel_rearming_delayed_workqueue(omnibook_wq, &omnibook_poll_work);

and 191 using // :
//            cancel_rearming_delayed_workqueue(omnibook_wq, &omnibook_poll_work);

Run:
sudo make load

Read through doc/INSTALL, then


WARNING:
Some say that loading with the wrong ectype can be bad for you computer. My guess is that things will be fine as long as you don't put the computer on heavy load while trying the method below out so that you don't risk burning anything.

OK, time to try the shotgun approach:
var=1 && sudo rmmod omnibook && sudo modprobe omnibook ectype=$var && ls /proc/omnibook

Do this with values of var from 1-16. See which one gives the 'best' support. For me most things showed up for all ectypes between 1 and 10, but only ectype=1 show fan_policy

Next do cat /proc/omnibook/fan , cat /proc/omnibook/display, cat /proc/omnibook/battery etc. to see whether the settings seem to correspond to reality.

ectypes
I can't find the original document which details the different ectypes and the corresponding laptop models. Your best guess is to do like I did above (just trying randomly) or to google for omnibook and ectype and see which model is closer to yours.

Making omnibook load on boot:
vim /etc/modules
add a line saying
omnibook

and the create a file called omnibook.conf under /etc/modprobe.d
In /etc/modprobe.d/omnibook.conf you put a single line:
options modprobe ectype=12

cat /proc/omnibook/fan_policy gives

Fan off temperature:         0 C
Fan on temperature:          0 C
Fan level 2 temperature:     0 C
Fan level 3 temperature:     0 C
Fan level 4 temperature:     0 C
Fan level 5 temperature:     0 C
Fan level 6 temperature:    10 C
Fan level 7 temperature:    108 C
Minimal temperature to set: 25 C
Maximal temperature to set: 95 C

Those are the same values as in fan_policy.c (in the source code we downloaded). It seems that the way to change the values is that you should recompile, which is easy enough but also a bit scary. Haven't played with it yet.


Here's tree /proc/omnibook :

/proc/omnibook
├── ac
├── battery
├── blank
├── display
├── dmi
├── fan
├── fan_policy
├── hotkeys
├── lcd
├── temperature
├── touchpad
└── version

0 directories, 12 files



Here's the dmesg | grep omni output:

[    8.792966] omnibook: Driver version 2.20090707-trunk.
[    8.792969] omnibook: Forced load with EC type 1.
[    8.793055] omnibook: Feature range f86be5c0 - f86beac0
[    8.793058] omnibook: Testing feature ac at address f86be5c0
[    8.793060] omnibook: Begin table match of ac feature.
[    8.793063] omnibook: Attempting backend ec init.
[    8.793066] omnibook: Returning table entry nr 0.
[    8.793068] omnibook: Match succeeded: continuing with ac.
[    8.793072] omnibook: Testing feature battery at address f86be600
[    8.793075] omnibook: Begin table match of battery feature.
[    8.793077] omnibook: Attempting backend ec init.
[    8.793079] omnibook: Returning table entry nr 0.
[    8.793082] omnibook: Match succeeded: continuing with battery.
[    8.793086] omnibook: Testing feature blank at address f86be640
[    8.793088] omnibook: Begin table match of blank feature.
[    8.793090] omnibook: Attempting backend i8042 init.
[    8.793093] omnibook: Returning table entry nr 1.
[    8.793095] omnibook: Match succeeded: continuing with blank.
[    8.793098] omnibook: LCD backlight turn off at console blanking is enabled.
[    8.793102] omnibook: Testing feature bluetooth at address f86be680
[    8.793105] omnibook: Testing feature cooling at address f86be6c0
[    8.793107] omnibook: Testing feature display at address f86be700
[    8.793110] omnibook: Begin table match of display feature.
[    8.793112] omnibook: Attempting backend ec init.
[    8.793114] omnibook: Returning table entry nr 2.
[    8.793116] omnibook: Match succeeded: continuing with display.
[    8.795163] omnibook: Testing feature dock at address f86be740
[    8.795166] omnibook: Testing feature dump at address f86be780
[    8.795168] omnibook: Testing feature fan at address f86be7c0
[    8.795171] omnibook: Begin table match of fan feature.
[    8.795173] omnibook: Attempting backend ec init.
[    8.795176] omnibook: Returning table entry nr 0.
[    8.795178] omnibook: Match succeeded: continuing with fan.
[    8.795182] omnibook: Testing feature fan_policy at address f86be800
[    8.795184] omnibook: Begin table match of fan_policy feature.
[    8.795187] omnibook: Attempting backend ec init.
[    8.795189] omnibook: Returning table entry nr 0.
[    8.795191] omnibook: Match succeeded: continuing with fan_policy.
[    8.795195] omnibook: Testing feature hotkeys at address f86be840
[    8.795197] omnibook: Begin table match of hotkeys feature.
[    8.795200] omnibook: Attempting backend i8042 init.
[    8.795202] omnibook: Returning table entry nr 0.
[    8.795204] omnibook: Match succeeded: continuing with hotkeys.
[    8.795207] omnibook: Enabling all hotkeys.
[    8.799296] omnibook: Testing feature dmi at address f86be880
[    8.799300] omnibook: dmi feature has no backend table, io_op not initialized.
[    8.799304] omnibook: Testing feature version at address f86be8c0
[    8.799307] omnibook: version feature has no backend table, io_op not initialized.
[    8.799311] omnibook: Testing feature lcd at address f86be900
[    8.799314] omnibook: Begin table match of lcd feature.
[    8.799317] omnibook: Attempting backend ec init.
[    8.799319] omnibook: Returning table entry nr 2.
[    8.799322] omnibook: Match succeeded: continuing with lcd.
[    8.799326] omnibook: Testing feature muteled at address f86be940
[    8.799329] omnibook: Testing feature key_polling at address f86be980
[    8.799332] omnibook: Testing feature temperature at address f86be9c0
[    8.799334] omnibook: Begin table match of temperature feature.
[    8.799337] omnibook: Attempting backend ec init.
[    8.799339] omnibook: Returning table entry nr 0.
[    8.799341] omnibook: Match succeeded: continuing with temperature.
[    8.799347] omnibook: Testing feature touchpad at address f86bea00
[    8.799350] omnibook: Begin table match of touchpad feature.
[    8.799352] omnibook: Attempting backend i8042 init.
[    8.799355] omnibook: Returning table entry nr 0.
[    8.799357] omnibook: Match succeeded: continuing with touchpad.
[    8.799361] omnibook: Testing feature wifi at address f86bea40
[    8.799363] omnibook: Testing feature throttling at address f86bea80
[    8.799366] omnibook: Enabled features: ac battery blank display fan fan_policy hotkeys dmi version lcd temperature touchpad.

46. A VERY rough approach to "benchmarking" gromacs (unscientific) on debian

Here's a comparison between different hardware and binaries which were built as described in http://verahill.blogspot.com/2012/01/debian-testing-64-wheezy-compiling.html

The simulation in question is a 100,000 step 100 ps simulation of a carbonate ion in water. Check back later for more details.

grompp -f carbonate.mdp -c carbonate.pdb -p carbonate.top -o carbonate.tpr
time mdrun -v -deffnm carbonate



Conclusions: 1) Double precision is slower by 25-35 % than single precision. 2) On a single machine there's no gain in using mpi. 3) Sadly, it appears that  intel i5-2400 X4 3.1GHz is more expensive than AMD Phenom II X6 3.1GHz for a reason.



Machines:
Be -- Phenom II X6, 8Gb RAM.
B --   Athlon X3 3.1 GHz 3 core, 4Gb RAM
Ta -- Optiplex 990 (i5 2400 3.1 GHz 4 core, 8Gb RAM). This machine was running a full gnome3/gnome-shell desktop at the same time as the tests were carried out. Take the results with a grain of salt.

Using mdrun (no mpi, single precision)
-------------------------------
Run   Be (6)     Ta (4)   B ( 3)
-------------------------------
1       1m27s    1m1s    1m48s
2       1m28s    1m1s    1m46s
3       1m35s    1m1s    1m47s
4       1m32s    1m1s    1m47s
5       1m33s    1m1s    1m47s


Using mdrun_dd (no mpi, double precision)
-------------------------------
Run   Be (6)     Ta (4)   B ( 3)
-------------------------------
1       1m49s    1m15s    2m25s
2       1m47s    1m15s    2m26s
3       1m51s    1m15s    2m26s
4       1m59s    1m15s    2m24s
5       1m58s    1m15s    2m26s



Using mdrun_mpi (mpi, single precision)

Machine: Be (Phenom II X6, 8Gb RAM).
(5 cores doesn't work)
---------------------------------
Cores/Run:   1            2      
---------------------------------
1                  4m11s   4m13s
2                  2m12s   2m15s
3                  1m46s   1m43s
4                  1m31s   1m31s
5                  ----------------
6                  1m28s   1m35s

Machine: Ta (Optiplex 990 (i5 3.1 GHz 4 core, 8Gb RAM).
---------------------------------
Cores/Run:   1            2           3
--------------------------------
1                  3m20s   3m20s   3m20s
2                  1m39s   1m38s   1m40s
3                  1m12s   1m13s   1m12s
4                  1m01s   1m01s   1m00s


Machine: Athlon X3 3.1 GHz 3 core, 4Gb RAM.
---------------------------------
Cores/Run:   1            2           3
--------------------------------
1                  4m32s   4m33s   4m36s
2                  2m28s   2m28s   2m27s
3                  1m49s   1m50s   1m49s

Using mdrun_ddmpi (mpi, double precision):

Machine: Phenom II X6, 8Gb RAM.
---------------------------------
Cores/Run:   1            2    
---------------------------------
1                  5m23s   5m25s
2                  2m56s   2m54s
3                  2m11s   2m11s
4                  1m56s   1m57s
5                  -----------------
6                  1m51s   1m52s

Machine: Optiplex 990 (i5 3.1 GHz 4 core, 8Gb RAM).
---------------------------------
Cores/Run:   1            2           3
--------------------------------
1                  4m14s   4m13s   4m13s
2                  2m09s   2m09s   2m10s
3                  1m33s   1m33s   1m33s
4                  1m16s   1m16s   1m16s


Machine: Athlon X3 3.1 GHz 3 core, 4Gb RAM.
---------------------------------
Cores/Run:   1            2           3
--------------------------------
1                  5m01s   5m52s   5m50s
2                  3m17s   3m17s   3m18s
3                  2m31s   2m31s   2m31s



10 January 2012

45. Compiling gromacs with mpich2 ver 1.2 on debian testing

If you are using mpich2 1.2.1.1-5 -- read the ** comment. Otherwise don't worry.
** In my example I've used mpich2 ver 1.2.1.1-5 -- install mpich2 and libmpich2-dev version 1.2.1.1-5 according to http://verahill.blogspot.com/2012/01/debian-testing-64-wheezy-nwhchem.html -- do everything in between "Edit these two files.." and "exitif you want the same system as I've used. **

Start here:
This is basically a condensed and annotated version of http://www.gromacs.org/Downloads/Installation_Instructions

Have a look at
http://www.gromacs.org/Downloads
to see what file to download

Also, you may want to do
sudo apt-get install build-essential gfortran fftw3

Next, use the console:

mkdir ~/tmp
cd ~/tmp

wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.5.5.tar.gz

tar -xvf gromacs-4.5.5.tar.gz

aptitude search fftw
I have libfftw3-3 so I'll pull libfftw3-dev
sudo apt-get install libfftw3-dev

cd gromacs-4.5.5/

create buildconf.sh and put the following in it to build four different versions of gromacs L
(without mpi and single precision, with mpi and single precision (_mpi), without mpi and double precision (_dd), with mpi and double precision (_ddmpi)).
Change N in make -jN to equal the number of cores+1, in my case six cores => N=7, so -j7.
##########################
./configure --with-fft=fftw3
make -j7
sudo make install
 ./configure --with-fft=fftw3 --enable-mpi --program-suffix=_mpi 
make -j7 mdrun
sudo make install

make distclean

./configure --with-fft=fftw3 --disable-float --program-suffix=_dd
make -j7
sudo make install
 ./configure --with-fft=fftw3 --enable-mpi --disable-float --program-suffix=_ddmpi 
make -j7 mdrun
sudo make install
##########################

Then run
sh buildconf.sh

Next, in ~/.bashrc put

PATH=$PATH:/usr/local/gromacs/bin

or, to install for everyone, put the above line in /etc/profile (and then do source /etc/profile)

Then run
source ~/.bashrc

You can download a test set from http://www.gromacs.org/Downloads/Test-Set
Currently the newest one is ftp://ftp.gromacs.org/pub/tests/gmxtest-4.0.4.tgz

Or using git, if you have that installed:
git clone git://git.gromacs.org/regressiontests.git