$HOSTNAME is not getting set for some reason, so that method didn't
work when I first tried it [using getenv ("HOSTNAME") the result was
null]
gethostname () worked fine though, thanks to the recommendations of
some very helpful lam mailing list people :-)
I'll try MPI_Get_processor_name () when I get back, just to know how it works.
Thanks,
elie
On Tue, 08 Feb 2005 15:21:27 -0500, Chris James <ctjames_at_[hidden]> wrote:
> You could make a system call to get the hostname:
>
> system("echo $HOSTNAME");
>
> MPI_Get_processor_name() may also work, but the exact name returned may
> not be the
> actual hostname. It will be a name that should identify that particular
> node however.
>
>
> Elie Choueiri 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/
> >
> >
> >
>
>
|