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 -configurationwhich gives something like
LookupOrder: CacheAgent FFAgent NIAgent DNSAgent YPAgent NILAgentThe author of the above named article advocates editing
/etc/lookupd/hosts
to make it haveLookupOrder CacheAgent FFAgent NIAgent DNSAgent YPAgent NILAgentYou may first have to create the
/etc/lookupd directory.
You will also have to reboot to make this change take effect.
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.
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.