[mpich-discuss] MPID_nem_tcp_init(377)... gethostbyname failed, mac (errno 1)

Balaji, Pavan balaji at anl.gov
Fri Feb 28 07:35:15 CST 2014


Your mac doesn’t seem to know “localhost”.  Did you check if your /etc/hosts file?

  — Pavan

On Feb 28, 2014, at 6:50 AM, Luis Cebamanos <l.cebamanos at epcc.ed.ac.uk> wrote:

> Hi, 
> 
> I have also tried the following, with similar result:
> 
> 
> $ mpiexec -n 1 -host localhost ./hello
> [mpiexec at mac] HYDU_sock_is_local (utils/sock/sock.c:532): gethostbyname error on mac: Unknown host
> [mpiexec at mac] main (ui/mpich/mpiexec.c:291): unable to check if localhost is local
> 
>  thought it could add some more info.
> 
> Cheers,
> Luis
> 
> 
> 
> On 28 Feb 2014, at 12:25, Luis Cebamanos <l.cebamanos at epcc.ed.ac.uk> wrote:
> 
>> Hi all,
>> 
>> I have installed MPICH2 in a Mac 10.9.2 using homebrew. The installation process went OK, no problems were reported. Then I created a small hello world example just to test the MPI:
>> 
>> #include <stdio.h>
>> #include "mpi.h"
>> 
>> int main (argc, argv)
>>     int argc;
>>     char *argv[];
>> {
>>  int rank, size;
>> 
>>  MPI_Init (&argc, &argv);/* starts MPI */
>>  MPI_Comm_rank (MPI_COMM_WORLD, &rank);/* get current process id */
>>  MPI_Comm_size (MPI_COMM_WORLD, &size);/* get number of processes */
>> 
>>  printf( "Hello world from process %d of %d\n", rank, size );
>> 
>>  MPI_Finalize();
>>  return 0;
>> }
>> 
>> compile it ($mpicc -o hello hello.c), all went fine too; and finally run it ($mpiexec -n 2 ./hello). However, that is the problem reported by mpiexec:
>> 
>> $ mpiexec -n 2 ./hello
>> Fatal error in MPI_Init: Other MPI error, error stack:
>> MPIR_Init_thread(467)..............: 
>> MPID_Init(177).....................: channel initialization failed
>> MPIDI_CH3_Init(70).................: 
>> MPID_nem_init(319).................: 
>> MPID_nem_tcp_init(171).............: 
>> MPID_nem_tcp_get_business_card(418): 
>> MPID_nem_tcp_init(377).............: gethostbyname failed, mac (errno 1)
>> Fatal error in MPI_Init: Other MPI error, error stack:
>> MPIR_Init_thread(467)..............: 
>> MPID_Init(177).....................: channel initialization failed
>> MPIDI_CH3_Init(70).................: 
>> MPID_nem_init(319).................: 
>> MPID_nem_tcp_init(171).............: 
>> MPID_nem_tcp_get_business_card(418): 
>> MPID_nem_tcp_init(377).............: gethostbyname failed, mac (errno 1)
>> 
>> ===================================================================================
>> =   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
>> =   PID 653 RUNNING AT mac
>> =   EXIT CODE: 1
>> =   CLEANING UP REMAINING PROCESSES
>> =   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
>> ===================================================================================
>> 
>> The version installed:
>> $ mpichversion 
>> MPICH Version:    	3.1
>> MPICH Release date:	Thu Feb 20 11:41:13 CST 2014
>> MPICH Device:    	ch3:nemesis
>> MPICH configure: 	--disable-dependency-tracking --disable-silent-rules --prefix=/usr/local/Cellar/mpich2/3.1 --mandir=/usr/local/Cellar/mpich2/3.1/share/man
>> MPICH CC: 	clang    -O2
>> MPICH CXX: 	clang++  
>> MPICH F77: 	/usr/local/bin/gfortran   -O2
>> MPICH FC: 	/usr/local/bin/gfortran  
>> 
>> Does anyone have any idea of why I am getting this error? The hostname command is also working fine, so I do NOT understand this problem. Furthermore, the idea is to run MPICH2 on my mac, not in a cluster so it should be straightforward to pick the hostname. My /etc/hosts shows the following:
>> $ cat /etc/hosts
>> ##
>> # Host Database
>> #
>> # localhost is used to configure the loopback interface
>> # when the system is booting.  Do not change this entry.
>> ##
>> 127.0.0.1	localhost
>> 255.255.255.255	broadcasthost
>> ::1             localhost 
>> fe80::1%lo0	localhost
>> 
>> Any ideas? Any help, suggestions or workarounds would be much appreciated.
>> 
>> Best regards,
>> LuisThe University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>> _______________________________________________
>> discuss mailing list     discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
> 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss




More information about the discuss mailing list