現在Openmpiを使用して並列化計算を行いたいと思っています。
質問が操作方法に関する単純な内容で申し訳ございません。
ユーザーガイド「3.4アプリケーションの並列実行」に従って進めているのですが、LAMマルチコンピュータのホストマシンの指定方法がよく理解できま
せん。
ユーザーガイドでは、<machies> というファイルのなかに
aaa
bbb cpu=2
ccc
とホスト名を入力するようになっておりますが、ホスト名を打ちこんで
mpirun --hostfile <machines> ・・・・ 以下省略
とターミナルで打ち込んでもうまく実行できません。
ちなみにmachinesファイルは、$FOAM_RUN/tutorials/interFoam/damBreakに作成しています。
他に何か特別な操作が必要なのでしょうか?
初歩的な質問で恐縮ですがご教示お願いします。
文章から推察しますに,OpenFOAM-1.5でチュートリアルのdamBreakケースをコピーしたものをinterFoamソルバで実行しようと
したということと理解しています.
チュートリアルを実行してみましたが,SARU様が述べられているような方法で実行してみましたがエラー確認できませんでした.
確かめるのに使用しました当方の環境ではLAMを使用していないので参私にならないかもしれませんが,
当方が行ったこと/実行環境を恥ずかしながら述べさせていただきます.
--------------------------------------------------------
[テストした実行環境]
・CPU: Intel(R) Core2Quad 2.4GHz
・Memory: 4GB
・OS: Fedora9
[実行した手順]
0.チュートリアルのケースに移動
1.system/decomposeParDict を用意.
2.machinesファイルを用意.中には
localhost cpu=4
と記述
3.decomposePar を実行-->processor0~processor3までができる.
4.以下のように並列実行
mpirun -np 4 -hostfile machines interFoam -parallel
5.reconstructPar を実行して出来たファイルをまとめる
--------------------------------------------------------
と実行しました.
よその環境(LAM)で計算させていただいたときにも同様のmachinesファイルを用いて計算ができたので,
上記の方法で実行できるものと思っております.
個人的に思いつくところは
・実績のあるプログラム,例えばランクとサイズを返すようなプログラムをご自身の環境でmpirun実行できるか
・OpenFOAM,ThirdPartyがインストールできている
かを確認されてみてはいかがでしょうか?
[実行環境]
CPU:Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz
Memory:2GB
OS名:GNU/Linux
山田様のおっしゃる通り実行した結果,計算が動きました。ご教示頂き誠にありがとうございます。
また,もしもう1点お分かりでしたらご教示頂きたいのですが,
LANケーブルを介して他のコンピュータで計算を行わせたいときは,OpenFOAM/ThirdParty/openmpi-1.2.6/
platforms/linuxGccDPOpt/etc内のopenmpi-default-hostfileの最後の行のIPアドレスとホスト名を
指定して同じホスト名をmachinesファイルに作成するとパソコンを数台使って並列計算が行えるのでしょうか?
上記のように設定行い,mpirun -np 4 -hostfile machines interFoam -parallel を実行する
と,ssh: asaec25: Name or service not known
[asaec45:31708] [0,0,0] ORTE_ERROR_LOG: Timeout in file base/
pls_base_orted_cmds.c at line 275
[asaec45:31708] [0,0,0] ORTE_ERROR_LOG: Timeout in file
pls_rsh_module.c at line 1166
[asaec45:31708] [0,0,0] ORTE_ERROR_LOG: Timeout in file errmgr_hnp.c
at line 90
[asaec45:31708] ERROR: A daemon on node asaec25 failed to start as
expected.
[asaec45:31708] ERROR: There may be more information available from
[asaec45:31708] ERROR: the remote shell (see above).
[asaec45:31708] ERROR: The daemon exited unexpectedly with status 255.
[asaec45:31708] [0,0,0] ORTE_ERROR_LOG: Timeout in file base/
pls_base_orted_cmds.c at line 188
[asaec45:31708] [0,0,0] ORTE_ERROR_LOG: Timeout in file
pls_rsh_module.c at line 1198
--------------------------------------------------------------------------
mpirun was unable to cleanly terminate the daemons for this job.
Returned value Timeout instead of ORTE_SUCCESS.
※ asaec25は,LANケーブルで接続しているホスト名です.
というエラーが発生致しました.エラー文をみるとasaec25が見つからないようですが,LANケーブルで接続した別のパソコンのホストの設定はどこ
で行えばよろしいのですか?
お分かりでしたらご教示お願いします.
/etc/hostsの登録後,sshでパスワードなしのログインが出来ればmpirunが通るのではないかと思います.
蛇足ですが,
パスワードなしのsshに関しては,googleで「ssh」「公開鍵」等のキーワードと一緒に検索をかけますと多数見つかります.
rshでアクセスする場合には(rshサーバを起動した上で).rhostsを用意して
mpirun -np XX -mca pls_rsh_agent rsh -hostfile machines interFoam -
parallel
としてやれば良いはずです.
ご自身の環境に合わせてやっていただければと思います.
ご教示頂いた内容でやってみたところ,LANで接続したパソコンにログインすることができました.
そこでmpirunを試してみたのですが,decomposeParDictの設定におかしなところがあるらしく,エラーが出てしまいます.
decomposeParDictの内容は以下のものです.
numberOfSubdomains 4;
method simple;
simpleCoeffs
{
n (2 2 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (1 1 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
processorWeights
(
1
1
1
1
);
}
manualCoeffs
{
dataFile "";
}
distributed yes;
roots
{
4
(
"asaec45/home/user1/OpenFOAM/OpenFOAM-1.5/applications/bin/
linuxGccDPOpt/interFoam"
"asaec25/home/user2/OpenFOAM/OpenFOAM-1.5/applications/bin/
linuxGccDPOpt/interFoam"
);
}
//
************************************************************************* //
実行結果に付いては,
--> FOAM Warning :
From function entry::getKeyword(word& keyword, Istream& is)
in file db/dictionary/entry/entryIO.C at line 72
Reading /home/user1/OpenFOAM/user1-1.5/run/tutorials/interFoam/
test/system/decomposeParDict
found on line 54 the label 4
expected either } or EOF
--> FOAM Warning :
From function entry::getKeyword(word& keyword, Istream& is)
in file db/dictionary/entry/entryIO.C at line 72
Reading /home/user1/OpenFOAM/user1-1.5/run/tutorials/interFoam/
test/system/decomposeParDict
found on line 55 the punctuation token '('
expected either } or EOF
[0]
[0]
[0] Attempt to return dictionary entry as a primitive
[0]
[0] file: /home/user1/OpenFOAM/user1-1.5/run/tutorials/interFoam/test/
system/decomposeParDict::roots
[0]
[0] From function ITstream& primitiveEntry::stream() const
[0] in file db/dictionary/dictionaryEntry/dictionaryEntry.C at
line 83.
[0]
FOAM parallel run aborting
[0]
[0] #0 Foam::error::printStack(Foam::Ostream&) in "/home/user1/
OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
[0] #1 Foam::IOerror::abort() in "/home/user1/OpenFOAM/OpenFOAM-1.5/
lib/linuxGccDPOpt/libOpenFOAM.so"
[0] #2 Foam::dictionaryEntry::stream() const in "/home/user1/OpenFOAM/
OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
[0] #3 Foam::dictionary::lookup(Foam::word const&, bool) const in "/
home/user1/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
[0] #4 Foam::argList::argList(int&, char**&, bool, bool) in "/home/
user1/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
[0] #5 main in "/home/user1/OpenFOAM/OpenFOAM-1.5/applications/bin/
linuxGccDPOpt/interFoam"
[0] #6 __libc_start_main in "/lib/libc.so.6"
[0] #7 Foam::regIOobject::readIfModified() in "/home/user1/OpenFOAM/
OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interFoam"
[asaec45:01256] MPI_ABORT invoked on rank 0 in communicator
MPI_COMM_WORLD with errorcode 1
mpirun noticed that job rank 1 with PID 1257 on node
asaec45.cmproxy2.nda.ac.jp exited on signal 15 (Terminated).
となります.
どのように修正をしたらよいかご教示頂ければと思います.