24 August 2013

501. Briefly: Adding a new node to SGE

I've done this a couple of times by now, and I always forget one step or another. Most of the information is on http://verahill.blogspot.com.au/2012/06/setting-up-sun-grid-engine-with-three.html but here it is in a briefer form:

In the example I've used krypton as the node name, and 192.168.1.180 as the IP.
My front node is called beryllium and has an IP of 192.168.1.1.

0. On the front node
Add the new node name to the front node/queue master

Add execution host
qconf -ae 

which opens a text file in vim

Edited hostname (krypton) but nothing else. Saving returns
added host krypton to exec host list
Add krypton as a submit host
qconf -as krypton
krypton added to submit host list
Doing this before touching the node makes life a little bit easier.

1. Edit /etc/hosts on the node
Leave
127.0.0.1 localhost
but remove
127.0.1.1 krypton
and make sure that it says
192.168.1.180 krypton
instead.

Throw in
192.168.1.1 beryllium
as well.

2. Install SGE on node
sudo apt-get install gridengine-exec gridengine-client

You'll be asked about
Configure automatically: yes Cell name: rupert Master hostname: beryllium
3. Add node to queue and group
I maintain separate queues and groups depending on how many cores each node has. See e.g. http://verahill.blogspot.com.au/2012/06/setting-up-sun-grid-engine-with-three.html for how to create queues and groups.

If they already exits, just do

qconf -aattr hostgroup hostlist krypton @fourcores
qconf -aattr queue slots "[krypton=4]" fourcores.q

to add the new node.

4. Add pe to queue if necessary
Since I have different queues depending on the number of cores of a node, I tend to have to fiddle with this.

See e.g. http://verahill.blogspot.com.au/2012/06/setting-up-sun-grid-engine-with-three.html for how to create pe:s.

If the pe you need is already created, you can do
qconf -mq fourcores.q

and edit pe_list

5. Check
On the front node, do
qhost
HOSTNAME ARCH NCPU LOAD MEMTOT MEMUSE SWAPTO SWAPUS ------------------------------------------------------------------------------- global - - - - - - - beryllium lx26-amd64 3 0.16 7.8G 5.3G 14.9G 398.2M boron lx26-amd64 6 6.02 7.6G 1.6G 14.9G 0.0 helium lx26-amd64 2 - 2.0G - 1.9G - lithium lx26-amd64 3 - 3.9G - 0.0 - neon lx26-amd64 8 8.01 31.4G 1.3G 59.6G 0.0 krypton lx26-amd64 4 4.01 15.6G 2.8G 14.9G 0.0

23 August 2013

500. Changing language in Debian (GNOME 3, terminal) to e.g. fr_CH

This is both obvious, and tricky at the same time.

1. Install locales
The first step is to install the languages you need
sudo apt-get install locales
sudo dpkg-reconfigure locales

2. Optional: language packs
If you want e.g. libreoffice to use the new language, you'll need to install the corresponding language pack. Most programmes will NOT need this, but libreoffice and iceweasel do. The same goes for KDE.
sudo apt-get install libreoffice-l10n-fr iceweasel-l10n-fr icedove-l10n-fr

Basically, search for packages with l10n in their names.

3. GNOME
Select the new language in GNOME 3 by gong to Region and Language:
Now, here's the trick: even if the language you want is listed, click on the "+" sign in the bottom left corner, and select it like this:
While you now have two 'French' items, this is necessary or the language will not be correctly set. If you do NOT do this some things will change language, some won't (e.g. Activities won't change to Activités). In that case, if you log out, then back in and go to Languages you'll find that the language is set to "Unspecified [ANSI_X3.4-1968]". See the screenshot at the very  bottom of this post for an example of what it looks like.


Log out of GNOME and log back in again. Et voilà.
And...we have French! French everywhere.


4. Optional: set it in terminal
If you set the language in GNOME as shown above you shouldn't need to do this. However, if you are not using GNOME 3 you may want to set the language explicitly in your terminal by sticking the following in your ~/.profile or ~/.bashrc
export LANG="fr_CH.utf8"

When it's NOT OK:
Note how it says 'Pays et Langue' but still says 'Activities' i.e. the language for some items has been changed, but not all.
See step 3 for an explanation of what's going on.

499. Briefly: Drawing NMR sequences using metapost and Mark White's pulse.mp

Since it's Friday afternoon and I'm not likely to get anything useful done in the hour that remains before going home, I might as well put up another post.

Since posting http://verahill.blogspot.com.au/2013/08/498-briefly-drawing-nmr-pulse-sequences.html I've had a look at this: http://www.celos.net/comp/pulses/

And that actually is (almost -- let's not get carried away here) exactly what I have been looking for. The main issue was that it's meant for metapost -- or rather, the main issue was my unfamiliarity with metapost. Anyway, my life is know complete.

So here's how to get started...

First 'install' the metapost script:
sudo apt-get install texlive-metapost
mkdir ~/texmf/metapost
cd ~/texmf/metapost -p
wget http://www.celos.net/comp/pulses/pulses.mp
sudo texhash

Next, time to test-drive it
mkdir ~/tmp/pulse_test -p
cd ~/tmp/pulse_test
vim test.mp
input pulses.mp beginfig(0); initf; startline(rf,"RF"); xline(1); xpulse(0.5,0.5,"90"); ospan(-0.25,-1.0,1.5,"d1"); xline(0.75); xpulse(1.0,0.5,"180"); ospan(-0.5,-1.0,1.5,"d1"); xline(1.0); ospan(0,-1.0,1.5,"vd"); xline(1.5); xacq(2); endfig;
mpost test.mp mptopdf test.0 pdftops -eps test-0.pdf test-0.eps





Now, I somehow suspect you can embed metapost scripts directly in .tex documents, but from my brief testing I haven't quite managed to make it work.