MPI, Loopback, and other network phenomena

Name lookup order

The hostname lookup order is slightly illogical in OSX: DNS before NetInfo database. At least, that's argued in http://www.macwrite.com/criticalmass/ten-mac-os-x-ends.php, and you can check for yourself by typing

lookupd -configuration
which gives something like
LookupOrder: CacheAgent FFAgent NIAgent DNSAgent YPAgent NILAgent
The author of the above named article advocates editing /etc/lookupd/hosts to make it have
LookupOrder CacheAgent FFAgent NIAgent DNSAgent YPAgent NILAgent
You may first have to create the /etc/lookupd directory. You will also have to reboot to make this change take effect.

hostname, gethostname

It can happen that the C/Unix command gethostname(char *name,int maxlen) or the shell command hostname gives you a strange name, not at all looking like a Unixy hostname. Most likely it will give you the name that you gave your machine in the Sharing preference pane. For instance, I called my laptop Victor's TiBook and gethostname gave me Victor's as hostname. Not good. Btw, this computer name (which is what appears if your machine is on an AppleTalk network) is kept in /etc/hostconfig.

Also in /etc/hostconfig is the value displayed by hostname. You can edit this (with 'sudo'); it does not seem possible to do this with NetInfo.

Running mpich locally

In order to run mpich locally you need to fill in the HOSTNAME variable in /etc/hostconfig to localhost; if you want a different name, you need to change the name of the localhost in NetInfo to that name too. The two need to be the same.

You need to restart for these values to take effect.