20 September 2013

517. Very briefly: Prime95 (GIMPS) on linux

I'm very unhappy about a newly built node which randomly crashes and reboots when running long jobs. More about that later, but here are the specs: FX 8350, 4x8 Gb RAM GSkill Ripjaws, ASRock FX990 Extreme3, Corsair GS700, MSI N210, ASUS NX1101 in an Antec GX700 case, running Wheezy with stock kernel (3.2.0-4 amd64).

I've tested the RAM using memtest86+  and found no errors, the rig uses a 700 W Corsair PSU which /should/ provide enough power, and I see no evidence of overheating based on a cronjob which runs every 2 minutes. Anyway, the first step in troubleshooting is finding a good way of reproducing the error reliably, and prime95 is what the windows overclockers use to stresstest.

Turns out prime95 (actually GIMPS) can run in a few different modes which tests different aspects of you system, which makes it sound like a pretty good program for my purposes.

See here for more information: http://www.mersenne.org/freesoft/

mkdir ~/tmp/mprime -p
cd ~/tmp/mprime
wget http://www.mersenne.info/gimps/p95v279.linux64.tar.gz
tar xvf p95v279.linux64.tar.gz
./mprime
Welcome to GIMPS, the hunt for huge prime numbers. You will be asked a few simple questions and then the program will contact the primenet server to get some work for your computer. Good luck! Attention OVERCLOCKERS!! Mprime has gained a reputation as a useful stress testing tool for people that enjoy pushing their hardware to the limit. You are more than welcome to use this software for that purpose. Please select the stress testing choice below to avoid interfering with the PrimeNet server. Use the Options/Torture Test menu choice for your stress tests. Also, read the stress.txt file. If you want to both join GIMPS and run stress tests, then Join GIMPS and answer the questions. After the server gets some work for you, stop mprime, then run mprime -m and choose Options/Torture Test. Join Gimps? (Y=Yes, N=Just stress testing) (Y): N Number of torture test threads to run (3): 2 Choose a type of torture test to run. 1 = Small FFTs (maximum FPU stress, data fits in L2 cache, RAM not tested much). 2 = In-place large FFTs (maximum heat and power consumption, some RAM tested). 3 = Blend (tests some of everything, lots of RAM tested). 11,12,13 = Allows you to fine tune the above three selections. Blend is the default. NOTE: if you fail the blend test, but can pass the small FFT test then your problem is likely bad memory or a bad memory controller. Type of torture test to run (3): 1 Accept the answers above? (Y): Y [Main thread Sep 20 11:06] Starting workers. [Worker #1 Sep 20 11:06] Worker starting [Worker #1 Sep 20 11:06] Setting affinity to run worker on any logical CPU. [Worker #2 Sep 20 11:06] Worker starting [Worker #2 Sep 20 11:06] Setting affinity to run worker on any logical CPU. [Worker #1 Sep 20 11:06] Beginning a continuous self-test to check your computer. [Worker #1 Sep 20 11:06] Please read stress.txt. Hit ^C to end this test. [Worker #2 Sep 20 11:06] Beginning a continuous self-test to check your computer. [Worker #2 Sep 20 11:06] Please read stress.txt. Hit ^C to end this test. [Worker #1 Sep 20 11:06] Test 1, 180000 Lucas-Lehmer iterations of M580673 using AMD K10 type-1 FFT length 28K, Pass1=112, Pass2=256. [Worker #2 Sep 20 11:06] Test 1, 180000 Lucas-Lehmer iterations of M580673 using AMD K10 type-1 FFT length 28K, Pass1=112, Pass2=256. CTRL+C
And so on.

19 September 2013

516. Potential energy diagrammes in latex using pgfplots

Given these recent posts, a post on how to represent reaction coordinates in latex was inevitable.

Note: a much prettier example is found here: https://quantumchemistryniser.wordpress.com/2013/05/25/potential-energy-profile-using-pgfplots/

However, I initially couldn't reproduce it, and after spending a few hours with pgfplots I wanted my own style anyway.


But first, a recap:
Once you've completely left office-like wordprocessors behinds and fully embraced the wonder of typesetting in LaTeX you find yourself wanting to produce more and more of the figures directly in latex, rather than simply importing figures.

While nothing beats gnuplot for plotting, and pov-ray (via e.g. gdis) for fancy figures and bkchem for simple 2d structures, there are some nice and simple latex packages that make life easier: I touch on a few in this post: http://verahill.blogspot.com.au/2012/07/debian-texlive-and-style-files-making.html

For chemical formulae, use mhchem -- I think it's standard in debian for texlive. It's indispensable. Also see http://www.ctan.org/pkg/mhchem

For very, very simple chemical structures you can look at chemfig -- I don't use it much though. http://www.ctan.org/tex-archive/macros/latex/contrib/chemfig/

For drawing simple MO diagrammes, modiagram is very pretty: http://www.ctan.org/pkg/modiagram

For drawing NMR pulse sequences there are a few options: http://verahill.blogspot.com.au/2013/08/499-briefly-drawing-nmr-sequences-using.html and http://verahill.blogspot.com.au/2013/08/498-briefly-drawing-nmr-pulse-sequences.html


A dead end: endiagram
It looks very promising, but it didn't work out for me: http://ctan.mirrorcatalogs.com/macros/latex/contrib/endiagram/

Installation:
mkdir ~/texmf/tex/latex/endiagram -p
cd ~/texmf/tex/latex/endiagram
wget http://ctan.mirrorcatalogs.com/macros/latex/contrib/endiagram/endiagram.sty
sudo texhash

You'll need siunitx and tikz as well, but it seems to come with a standard texlive install on debian. Out of the box I kept getting:

! Undefined control sequence.
<argument> \clist_count:N
\l__endiagram_points_clist

l.16 \ENcurve{1,4,0}

In the end I couldn't get it to work properly, even after installing l3kernel -- I don't think it would've been impossible to figure it out, but I was running out of patience.

The solution: pgfplots
So I kept looking, and found this: https://quantumchemistryniser.wordpress.com/2013/05/25/potential-energy-profile-using-pgfplots/

While I couldn't get it to work 'out of the box' (after deleting the nodes depending on the pdf files), I ended up reading the pfgplots manual: http://pgfplots.sourceforge.net/pgfplots.pdf

pgfplots is not meant for drawing potential energy diagrammes, but it can be made to do it -- it's 'dum' in the sense that it's not aware of what a PE diagram is, so you'll have to draw all objects expliticly. In the end, it's actually quite simple though.

I eventually ended up with these two examples:
The code is here:
\documentclass[10pt,a4paper]{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} %\begin{center} %\begin{tikzpicture}[scale=1.0] %\draw (0,0) --(1,2); %\end{tikzpicture} %\end{center} \begin{tikzpicture} \begin{axis}[ axis x line= bottom, axis y line= left, xmin=-1, xmax=10, ymin=-1, ymax=6, xlabel=Reaction coordinate, ylabel=$\Delta$E (kcal/mol), xtick=\empty ] \addplot[smooth,solid,blue] coordinates { (0,0)(1,0) (2,4)(3,4) (4,3)(5,3) (6,4)(7,4) (8,1)(9,1)}; \node at (axis cs:4.5,2.5) {Intermediate}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis x line= bottom, axis y line= left, xmin=-1, xmax=6, ymin=-1, ymax=15, xlabel=Reaction coordinate, ylabel=$\Delta$E (kcal/mol), xtick=\empty ] \addplot[smooth,solid,blue] coordinates { (0,0)(1,0)}; \addplot[smooth,dotted,black] coordinates {(1,0)(2,11.7)}; \addplot[smooth,solid,blue] coordinates {(2,11.7)(3,11.7)}; \addplot[smooth,dotted,black] coordinates {(3,11.7)(4,10.5)}; \addplot[smooth,solid,blue] coordinates {(4,10.5)(5,10.5)}; \end{axis} \end{tikzpicture} \end{document}


17 September 2013

515. Very briefly: boot issues and nvram (anecdote)

I had to move offices at work last Friday (which partly explains my radio silence).

One of my nodes, with a Biostar 880G+ motherboard, wouldn't boot. The issue manifested itself in a few different ways (and not always at the same time):

Most of the time the bios portion of the boot would be very slow, and I'd get a loooooong beep when the voltages were echoed during what I presume is POST. I never made it to the GRUB screen. I'd had this happen once or twice before, especially when the computer had been turned off and/or unplugged for a longer period of time.

Occasionally I'd get a message about NVRAM being checked..

After
1) having checked that nothing had vibrated loose during the transport
2) having removed all cards and drives except a single RAM stick
3) having checked that RAM stick
I still wasn't getting any closer to getting booted. So I went into the BIOS. Having seen the message about nvram and having done a bit of reading online I selected to erase the NVRAM.

And suddenly booting worked...once.

After that I kept getting messages about nvram being corrupted and boot fail, or 'NVRAM...Update failed'.

I then set the CMOS jumpers to pin 2 and 3 (small jumper next to the CMOS battery)

And then it worked! It booted just fine! But I kept getting the following error echoing on my screen:

[ 120.718683] hub 3-0:1.0: unable to enumerate USB device on port 2 [ 120.932378] usb 3-2: new full-speed USB device number 28 using ohci_hcd [ 121.072497] usb 3-2: device descriptor read/64, error -62 [ 121.316673] usb 3-2: device descriptor read/64, error -62 [ 121.556904] usb 3-2: new full-speed USB device number 29 using ohci_hcd [ 121.697019] usb 3-2: device descriptor read/64, error -62 [ 121.941224] usb 3-2: device descriptor read/64, error -62 [ 122.181425] usb 3-2: new full-speed USB device number 30 using ohci_hcd
Unplugged all the USB devices. Turned out to be the KVM (ritmo). Turning it off (i.e. unplugging all USB input to the KVM so that it lost power) and plugging it in again solved it.

And ever since then all has been fine.

Presumably it's time to change the CMOS battery.