wow! a question i think i can actually answer!
try doing a man on 'gethostname'; i have used gethostname to get the
hostname of the machine on which the code is being run
don't forget the include mentioned in the manual page : #include <unistd.h>
On Tue, 8 Feb 2005 21:26:53 +0200, Elie Choueiri
<elie.choueiri_at_[hidden]> wrote:
> Hi all
>
> This seems like a really silly question, but I couldn't find what I
> was looking for elsewhere..
>
> Anyway, I was wondering how to get the IP or hostname of the machine
> I'm currently on from within my MPI program. Hopefully without using
> getenv () as it seems like the environment variables aren't getting
> set properly..
>
> Thanks,
>
> elie
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
|