A Brief Guide to Working with Multiple Machines in the NLP Group

Easy ssh

It is useful to be able to ssh to any machine without your password (and a few shortcuts depend on this):

  1. ssh-keygen -d -q and hit enter thrice.
  2. cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
  3. chmod 0600 !$
  4. bash -c 'for i in `cat /u/nlp/machine-info/machines.txt`; do ssh $i echo $i; done' and type yes for each machine. y is insufficient.

Checking machines

http://nlp.stanford.edu/local/machines.shtml. This displays the status of all NLP machines and is updated every 5 minutes. (You'll need to authenticate to access it. The username is nlp; the password is Chris's middle name backwards.)

Alternatively, the mstat command will give much the same information (make sure you are running the version in /u/nlp/bin/mstat. Run 'mstat -h' for all options).

It is good to get in the habit of checking either before running any large jobs. To see what jobs you are currently running, the mps command is useful - it polls all the machines and generate a ps-style listing of all your jobs. (It takes a few seconds to run)

Claiming machines

To claim a machine, put a line of the format machinename: reason in ~/.javanlp-claims. Claims expire after 5 days.

Being a good NLP citizen

To attach an explanatory note about your jobs, which you should do if you have many and/or long jobs, put a line of text in ~/.javanlp-note explaining what you are doing and how long it should take.

Screen tips

man screen for an introduction

Put the following in ~/.screenrc:

escape ^pp
defscrollback         999            # default: 100
defencoding utf8
defutf8         on
encoding utf8 utf8
hardstatus alwayslastline "%m/%d %c | %w  "
activity              "activity in %n (%t) [%w:%s]"
This makes ctrl-p the screen escape key rather than ctrl-a, allows utf8 characters to be displayed correctly, and shows a status line so you don't forget you're running screen already and try to run a nested one. (Painful!)

All you really need to know:

Run gos for a menu of all running screens on all machines, and the ability to swap between them easily.



With many thanks to William Morgan for the original version of this page and many of the scripts/tips therein. Page last updated 26 Oct 2009 by Rob Munro.