Bag of ML Words

ML = Machine Learning, Music Love, and Miscellaneous things in daily Livings

C++学習記(5): boost mpi (+openmpi) on multiple CPUs (machines)

Boost MPIに複数コア分散計算のお仕事は終わったので、いよいよ複数マシンによる盛大な負荷分散をやろうと思う。

 

簡単じゃない?簡単じゃない

 

hostsを指定するファイルを作って

 # nodes_for_MPI.txt

host.1.xx.yyy cpu=4

host.2.xx.yyy cpu=2

 

 mpirun起動時に指定するのみ。簡単じゃない?

mpirun -np 6 --hostfile nodes_for_MPI.txt ./helloBoostMPI

 

ORTE was unable to reliably start one or more daemons.
This usually is caused by:
 

 はい死んだー。

 

sshで直接コマンド渡すとき~

FAQ: Running MPI jobs

のdiagnosisに従うと、まず2番目、ssh経由でコマンド渡すときのpath設定があってなかった。

ということで

ssh-env - ssh実行時に環境変数を設定/変更したい - spikelet days

に従って、/etc/ssh/sshd_configの修正と.ssh/environmentの作成。

pathとかはすべて一つにまとめて直書きする必要があります。

 

sudo service sshd restart

sshdをリスタートして・・。

 

mpirun -np 6 --hostfile nodes_for_MPI.txt ./helloBoostMPI

ORTE was unable to reliably start one or more daemons.
This usually is caused by:
 

まだできない。

 

ファイヤーウォール氏~

--mca plm_base_verbose 10 をオプションとしてつけると、TCP/IPコネクションの問題ぽい。ファイヤーウォールの設定ぽいな・・・。

sudo /etc/init.d/iptable. stop

mpirunをたたく側のマシンのiptableをカット。まあ、社内ファイヤーウォール内だから大丈夫でしょう。。。

 

mpirun --hostfile nodes_for_mpi.txt ./helloBoostMPI
My rank =1 of 6
My rank =4 of 6
My rank =0 of 6
My rank =5 of 6
My rank =2 of 6
My rank =3 of 6

やったねたえちゃん!