LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Davide Cesari (dcesari_at_[hidden])
Date: 2006-04-10 09:43:01


François-Xavier Payet a écrit:
> Hi,
>
> Is there a way to get a list of the hosts on wich MPI is running (the
> hosts from the bhosts file) from a MPI process?
>
> Thanks
>
>

As far as I know, MPI does not officially give you this service since MPI
standard deliberately interpose a deep abstraction layer between the application
and the hardware it is running on. Said that, if you really need this host list,
you can do some tricks like launching "lamnodes" command and capturing the
output, using some environmental variables from your batch scheduler which may
contain this information (both non portable), or, probably the most portable
way, using the gethostname system call on every MPI process and collect the
values with a proper MPI statement.
        Hope it helps, Davide