2017-03-12 9 views
0

私は、3つ以上のプロセスを持つ単純なmpiのpythonプログラムを実行しました。たとえば は:openmpi python 3つ以上のprcocesses

mpiexec -host master,w1,w2,w3 python code.py 

私はW1のいずれか2つを使用してプログラムを実行した場合

ssh: Could not resolve hostname w3: Name or service not known 
ORTE was unable to reliably start one or more daemons. 

This usually is caused by: 

* not finding the required libraries and/or binaries on 
    one or more nodes. Please check your PATH and LD_LIBRARY_PATH 
    settings, or configure OMPI with --enable-orterun-prefix-by-default 

* lack of authority to execute on one or more specified nodes. 
    Please verify your allocation and authorities. 

* the inability to write startup files into /tmp (--tmpdir/orte_tmpdir_base). 
    Please check with your sys admin to determine the correct location to use. 

* compilation of the orted with dynamic libraries when static are required 
    (e.g., on Cray). Please check your configure cmd line and consider using 
    one of the contrib/platform definitions for your system type. 

* an inability to create a connection back to mpirun due to a 
    lack of common network interfaces and/or no route found between 
    them. Please check network connectivity (including firewalls 
    and network routing requirements). 

しかし、W2、W3、それが機能することを示すいくつかのエラーがあります。 EX:

mpiexec -host master,w1,w3 python code.py 

そして、これは私がそれを解決するにはどうすればよいコード

import random 
import numpy as np 
from mpi4py import MPI 

comm = MPI.COMM_WORLD 
rank = comm.rank 
size = comm.size 

if rank ==0: 
print rank, 'worker' 
else: 
print rank, 'worker' 

のですか?ありがとう。出力によると

答えて

0

ssh: Could not resolve hostname w3: Name or service not known、問題は非常に明確である:

マスター・ノード(マシン)で識別することができませんw3ホスト名。 name - ipのマッピングを/etc/hostsに追加することができます。フォーマットはip nameです。 例: 255.255.255.0 the_name