bash
(1)シェルが使われています。
SCBDSERV
およびPATH
を設定します。もし手動でインストールしたのでしたら、環境変数 SCBDSERV を設定してください。 そうでなければ login しなおしてください。 それでもまだこの変数が見えなければ、サーバホストの設定にしたがって
/etc/profile.d
のしたにあるあなたのログインシェルのための設定ファイルを 確認してください。- コンピュータホストロッククライアントの起動
$ msgb -group pcc &
pcc
はscoreboard
databaseで決定したグループ名です。
- MPC++ MTTLプログラムのコンパイルと実行
いかのプログラムを作成してください。hello.cc
とします。 このプログラムのコピーは/opt/score/example/mttl/hello.cc
にあります:#include <stdio.h> #include <mpcxx.h> main(int argc, char **argv) { mpcxx_spmd_initialize(argc, argv); printf("hello, world (from node %d)\n", myNode); exit(0); }mpc++
でこれをコンパイルします:一つの CPU でプログラムを実行します:$ mpc++ -o hello hello.cc
4ノードのcluster上で実行します:$ scrun -nodes=1 ./hello SCore-D 5.0.0 connected. <0:0> SCORE: One node ready. hello, world (from node 0) $$ scrun -nodes=4 ./hello SCore-D 5.0.0 connected. <0:0> SCORE: 4 nodes (4x1) ready. hello, world (from node 2) hello, world (from node 1) hello, world (from node 3) hello, world (from node 0) $- MPICH-SCoreプログラムのコンパイルと実行
/opt/score/example/mpi/cpi.c
のプログラムをワークディレクトリにコピーし、mpicc
でコンパイルします:$ mpicc -o cpi cpi.c -lm
scrun
とmpirun
の両方を用いて一つの CPU で実行します:$ scrun ./cpi SCore-D 5.0.0 connected. <0:0> SCORE: One node ready. Process 0 of 1 on comp3.pccluster.org pi is approximately 3.1416009869231254, Error is 0.0000083333333323 wall clock time = 0.000621 $ mpirun ./cpi SCore-D 5.0.0 connected. <0:0> SCORE: One node ready. Process 0 of 1 on comp3.pccluster.org pi is approximately 3.1416009869231254, Error is 0.0000083333333323 wall clock time = 0.000645 $scrun
とmpirun
の両方を用いて4ノードのcluster環境下で実行します:$ scrun -nodes=4 ./cpi SCore-D 5.0.0 connected. <0:0> SCORE: 4 nodes (4x1) ready. Process 1 of 4 on comp1.pccluster.org Process 3 of 4 on comp3.pccluster.org Process 2 of 4 on comp2.pccluster.org Process 0 of 4 on comp0.pccluster.org pi is approximately 3.1416009869231245, Error is 0.0000083333333314 wall clock time = 0.000945 $ mpirun -np 4 ./cpi SCore-D 5.0.0 connected. <0:0> SCORE: 4 nodes (4x1) ready. Process 2 of 4 on comp2.pccluster.org Process 1 of 4 on comp1.pccluster.org Process 0 of 4 on comp0.pccluster.org Process 3 of 4 on comp3.pccluster.org pi is approximately 3.1416009869231245, Error is 0.0000083333333314 wall clock time = 0.003627 $- Single-User環境の終了
$ exit SCOUT: session done $- Multi-User環境のためにSCore-D operating systemを起動
root
からscout
とSCore-D operating systemを実行します。scored
の起動が完了するには数秒かかります:$ /bin/su - # export SCBDSERV=`hostname` # export PATH=$PATH:/opt/score/bin:/opt/score/sbin:/opt/score/deploy # scout -g pcc SCOUT: Spawn done. SCOUT: session started # scored SYSLOG: /opt/score5.0.0/deploy/scored SYSLOG: SCore-D 5.0.0 $Id: init.cc,v 1.66 2002/02/13 04:18:40 hori Exp $ SYSLOG: Compile option(s): SYSLOG: SCore-D network: myrinet/myrinet SYSLOG: Cluster[0]: (0..3)x1.i386-redhat7-linux2_4.i686.500 SYSLOG: Memory: 249[MB], Swap: 259[MB], Disk: 3035[MB] SYSLOG: Network[0]: myrinet/myrinet SYSLOG: Network[1]: ethernet/ethernet SYSLOG: Scheduler initiated: Timeslice = 500 [msec] SYSLOG: Queue[0] activated, exclusive scheduling SYSLOG: Queue[1] activated, time-sharing scheduling SYSLOG: Queue[2] activated, time-sharing scheduling SYSLOG: Session ID: 0 SYSLOG: Server Host: comp3.pccluster.org SYSLOG: Backup Host: comp1.pccluster.org SYSLOG: Backup file is lost and create it. SYSLOG: Server file is lost and create it. SYSLOG: Operated by: root SYSLOG: ========= SCore-D (5.0.0) bootup in SECURE MODE ========msgb
ウィンドウでノードブロックが青から赤に変化するのが見えるでしょう。
- Multi-User環境下でMPC++ MTTLプログラムを実行
異なるシェルの下では、プログラムはローカルに実行されます。scored
serverが実行されているhostを特定しなければなりません。 デフォルトではclusterグループの最後のhostが該当します:メッセージ出力は$ scrun -scored=comp3 ./hello SCore-D 5.0.0 connected (jid=1). <0:0> SCORE: One node ready. hello, world (from node 0) $scored
が実行されているサーバで行なわれます。メッセージは以下に示すのと同じようなものです:4ノードのclusterグループでプログラムを実行します:SYSLOG: Login request: user1@server.pccluster.org:32878 SYSLOG: Login accepted: user1@server.pccluster.org:32878, JID: 1, Hosts: 1(1x1)@0, Priority: 1, Command: ./hello SYSLOG: Logout: user1@server.pccluster.org:32878, JOB-ID: 1, CPU Time: 134.0[m]$ scrun -scored=comp3,nodes=4 ./hello SCore-D 5.0.0 connected (jid=2). <0:0> SCORE: 4 hosts, single process/host ready. hello, world (from node 2) hello, world (from node 1) hello, world (from node 3) hello, world (from node 0) $- Multi-User環境でMPICH-SCoreプログラムを実行
scrun
とmpirun
の両方を使用して一つの CPU で実行します:$ export SCORE_OPTIONS=scored=comp3 $ scrun ./cpi SCore-D 5.0.0 connected (jid=3). <0:0> SCORE: One node ready. Process 0 of 1 on comp3.pccluster.org pi is approximately 3.1416009869231254, Error is 0.0000083333333323 wall clock time = 0.000621 $ mpirun ./cpi SCore-D 5.0.0 connected (jid=4). <0:0> SCORE: One node ready. Process 0 of 1 on comp3.pccluster.org pi is approximately 3.1416009869231254, Error is 0.0000083333333323 wall clock time = 0.000645 $scrun
とmpirun
の両方を使用して4ノードのcluster環境で実行します:もっと他のプログラムでテストしてい場合は$ scrun -nodes=4 ./cpi SCore-D 5.0.0 connected (jid=5). <0:0> SCORE: 4 nodes (4x1) ready. Process 1 of 4 on comp1.pccluster.org Process 3 of 4 on comp3.pccluster.org Process 2 of 4 on comp2.pccluster.org Process 0 of 4 on comp0.pccluster.org pi is approximately 3.1416009869231245, Error is 0.0000083333333314 wall clock time = 0.000945 $ mpirun -np 4 ./cpi SCore-D 5.0.0 connected (jid=6). <0:0> SCORE: 4 nodes (4x1) ready. Process 2 of 4 on comp2.pccluster.org Process 1 of 4 on comp1.pccluster.org Process 0 of 4 on comp0.pccluster.org Process 3 of 4 on comp3.pccluster.org pi is approximately 3.1416009869231245, Error is 0.0000083333333314 wall clock time = 0.003627 $/opt/score/example
ディレクトリの下を見てみてください。
- Multi-User環境の停止
別のウィンドウで次のコマンドを入力することでscored
を停止できます。:次のようなメッセージが# sc_console comp3 -c shutdown SCore-D Console: shutdown #scored
を実行したマシンから出力されます:SYSLOG: CONSOLE connected from server.pccluster.org CONSOLE: >> shutdown SYSLOG: SCore-D shutting down in 0 seconds. SYSLOG: Login disabled. SYSLOG: Waiting for all job terminates. SYSLOG: CONSOLE disconnected. SYSLOG: SCore-D shutdown. #msgb
ウィンドウ中でノードブロックが赤から青に変化するのが見えることでしょう。
この段階でscout
セッションを終了できます:# exit SCOUT: session done #
![]() |
PCクラスタコンソーシアム |