MPICH2 gethostbyname failed

后端 未结 5 696
余生分开走
余生分开走 2021-01-31 09:57

I don\'t understand the error message. I am trying to do is to run a MPICH2 application after I installed mpich2 version 1.4 or 1.5 to /opt/mpich2 (both version fai

相关标签:
5条回答
  • 2021-01-31 10:09

    Being the question different, the answer is probably the same I gave time ago for OpenMPI: gethostname() function missing in openMPI

    The MPI portable solution is to use MPI_Get_processor_name()

    0 讨论(0)
  • 2021-01-31 10:13

    Maybe your /dev/shm is full, try to clean it.

    0 讨论(0)
  • 2021-01-31 10:18

    This error indicates that there's a problem resolving localhost. Check your /etc/hosts file, make certain that you have localhost correctly defined here, it should be pointing to 127.0.0.1. Try using ssh to connect to localhost, make sure that works as well.

    0 讨论(0)
  • 2021-01-31 10:22

    Solution for macOS

    I stumbled upon this issue on macOS 10.12.1.

    The solution is to add 127.0.0.1 computername.local to /etc/hosts. Your file will look more or less like this:

    ##
    # 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
    127.0.0.1   computername.local
    255.255.255.255 broadcasthost
    ::1             localhost 
    

    You can change/check your computer's name if you go to System Preferences > Sharing > Computer Name.

    0 讨论(0)
  • 2021-01-31 10:22

    What worked for me was the following:

    Make sure your hostname is the same for 1 and 2 below:

    1. terminal hostname
    2. "/etc/hosts" hostname

    So if you type cat /etc/hosts in terminal it should look like:

    // 127.0.0.1       my_hostname
    

    My hostname was not the same for 1 and 2 for me. Once I changed them to match then my mpi program would execute.

    To change your terminal hostname type the following: sudo scutil --set HostName my_new_host_name

    To change your /etc/hosts hostname type the following: sudo nano /etc/hosts

    and then add the line

    127.0.0.1       my_new_hostname
    
    0 讨论(0)
提交回复
热议问题