Results 1 to 8 of 8

Thread: MPICH2, mpirun > ssh: Could not resolve hostname

  1. #1

    Default MPICH2, mpirun > ssh: Could not resolve hostname

    Hello,

    I installed my first linux on my laptop (Toshiba Satellite R830-1GZ, 4 cores) and am trying to make an environment for mpirun. For installation of MPICH2 (1.4.1p1), I followed this instruction: Installing MPI | MPI Tutorial .

    Also I tried to follow this instruction to check if my installation is correct: MPI Hello World | MPI Tutorial .
    I think I succeeded the compilation of the sample program provided there, and executed using "mpirun -np 4 file". Then I've got following message and the program doesn't run.

    ssh: Could not resolve hostname MY_MACHINE_NAME: Name or service not known

    Since I want to run the program over single laptop with 4 cores, I don't think I need host file. I also try other test programs written in Fortran, which work on other clusters, but the results are the same. Could anyone please tell me the reason and how to fix this problem?

    Thanks


    > mpich2version
    MPICH2 Version: 1.4.1p1
    MPICH2 Release date: Thu Sep 1 13:53:02 CDT 2011
    MPICH2 Device: ch3:nemesis
    MPICH2 configure:
    MPICH2 CC: gcc -O2
    MPICH2 CXX: c++ -O2
    MPICH2 F77: ifort -O2
    MPICH2 FC: ifort -O2

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,152

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    Just a remark about using these forums.
    Please post copied/pasted computer text between CODE tags: http://forums.opensuse.org/english/i...ags-guide.html

    Since I want to run the program over single laptop with 4 cores, I don't think I need host file. I
    I can not follow your strain of thoughts here. Not being able to resolve a hostname means that the gethostbyname() routine can not find an IP address belonging to that host (which is not to strange as MY_MACHINE_NAME is not a real hostname). There is no connection with the number of cores in your CPU.
    Henk van Velden

  3. #3

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    Thanks. The reason why I thought I didn't need the host file is that the site, MPI Hello World | MPI Tutorial, says I can disregard the host file, If I am simply running MPI on a laptop or a single machine. Do I have to prepare host file as well? Also my computer does not have SSH access.



    Quote Originally Posted by hcvv View Post
    Just a remark about using these forums.
    Please post copied/pasted computer text between CODE tags: http://forums.opensuse.org/english/i...ags-guide.html


    I can not follow your strain of thoughts here. Not being able to resolve a hostname means that the gethostbyname() routine can not find an IP address belonging to that host (which is not to strange as MY_MACHINE_NAME is not a real hostname). There is no connection with the number of cores in your CPU.

  4. #4
    Join Date
    May 2012
    Location
    Thessaloniki, Greece
    Posts
    84

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    I'm not sure if it's any help, but I had the same issue a year ago when I was using mpi. Try running 'mpd &', it starts an mpi demon on your machine, then try executing your compiled program (I'm 99% this is the correct command)
    Hope it helps..

  5. #5

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    Problem solved! I had to run my job as something like:

    mpirun -np 4 -host localhost my_program

    when I run on a single machine. No host file is needed.


    Quote Originally Posted by ym270 View Post
    Thanks. The reason why I thought I didn't need the host file is that the site, MPI Hello World | MPI Tutorial, says I can disregard the host file, If I am simply running MPI on a laptop or a single machine. Do I have to prepare host file as well? Also my computer does not have SSH access.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,152

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    Quote Originally Posted by ym270 View Post
    Problem solved! I had to run my job as something like:

    mpirun -np 4 -host localhost my_program

    when I run on a single machine. No host file is needed.
    I do not quite understand what you mean with a host file. Because this is about name resolving, I guess you mean /etc/hosts. And I bet you have one. Do:
    Code:
    cat /etc/hosts
    and see what is there. I bet also that localhost is defined in one of the lines there.
    Henk van Velden

  7. #7

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    hcvv wrote:
    > ym270;2464540 Wrote:
    >> Problem solved! I had to run my job as something like:
    >>
    >> mpirun -np 4 -host localhost my_program
    >>
    >> when I run on a single machine. No host file is needed.

    > I do not quite understand what you mean with a host file. Because this
    > is about name resolving, I guess you mean /etc/hosts. And I bet you have
    > one. Do:


    No, It's an mpi-specific config file that's being referred to. How sad
    am I, I actually wasted time looking at the page the OP linked.

  8. #8

    Default Re: MPICH2, mpirun > ssh: Could not resolve hostname

    Yeah I had localhost defined there (I didn't know why -host localhost worked, but I think I do now). Thanks alot!

    Quote Originally Posted by hcvv View Post
    I do not quite understand what you mean with a host file. Because this is about name resolving, I guess you mean /etc/hosts. And I bet you have one. Do:
    Code:
    cat /etc/hosts
    and see what is there. I bet also that localhost is defined in one of the lines there.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •