• 検索結果がありません。

5. NAREGI ミドルウェアの更新(CentOS の場合)

8.5 PBS Professional のインストールと動作確認

8.5.2 PBS Professional のインストール

(1) PBSサーバのインストール

GridVM 管理ノードにPBS のサーバ機能をインストールします。

# cd /tmp

# ls

PBSPro_9.1.0-linux24_i686_AS3.tar.gz

# tar zxvf PBSPro_9.1.0-linux24_i686_AS3.tar.gz PBSPro_9.1.0/INSTALL

PBSPro_9.1.0/PBS_License.txt PBSPro_9.1.0/README PBSPro_9.1.0/linux24_i686

PBSPro_9.1.0/linux24_i686/pbs-cmds-9.1.0.72982-0.i386.rpm

NAREGI Middleware 導入手引書

PBSPro_9.1.0/linux24_i686/pbs-9.1.0.72982-0.i386.rpm PBSPro_9.1.0/linux24_i686/pbs-mom-9.1.0.72982-0.i386.rpm

# cd PBSPro_9.1.0

# ./INSTALL

← インストール実施 Installation of PBS Professional

Terms of use for the software are available online at http://www.pbspro.com/UserArea/agreement.html, and are also included in our PBS Professional Administrator's Guide and PBS Professional User's Guide

The package system used on this machine cannot relocate software from the default location. The default location for the execution directory is:

/usr/pbs

/usr/pbs does not exist, I'll make it.

done

PBS needs to have a private directory (referred to as "PBS_HOME"

in the documentation) where it can permanently store information.

Please enter the full path for the PBS_HOME location you would like or press enter to accept the default.

Home directory? [/var/spool/PBS]

← ホームディレクトリの作成 (ここではデフォルト設定) You now need to decide what kind of PBS installation you want for

this machine. There are three possibilities: a server node, an execution node, or a client host.

If you are going to run PBS on a single timesharing host, install the server package.

If you are going to have a cluster of machines, you need to pick one to be the front end and install the server package there.

Then install the execution package on all the other nodes in the cluster.

The client package is for a host which will not be used for execution but still has access to PBS. It contains the commands, the GUI and man pages. This gives the ability to submit jobs and check status.

PBS Installation:

1. Server, execution and commands 2. Execution only

NAREGI Middleware 導入手引書

3. Commands only (1|2|3)?1

← サーバなので1を選択 PBS Professional version 9.0 and later is licensed

via the Altair License Manager.

The Altair License Manager can be downloaded from:

http://www.pbspro.com/UserArea/Software/

For more information, please refer to the PBS

Professional Administrator's Guide, or contact pbssupport@altair.com.

Continue with the installation ([y]|n)?

← リターンキー Please enter the list of Altair License file location(s)

in a colon-separated list of entries of the form <port>@<host>

@<host>

<license file path>

Examples:

7788@fest

7788@tokyo:7788@madrid:7788@rio @perikles:27000@aspasia

@127.3.4.5

/usr/local/altair/security/altair_lic.dat Enter License File Location(s):XXXX@XXXXX.naregi.org

← ライセンスサーバおよびポート の指定

Installing PBS for a Server Host.

*** PBS Installation Summary

***

***

*** Found existing /var/spool/PBS/pbs_environment

*** The PBS Server has been installed in /usr/pbs/sbin.

***

*** Setting default resource limits.

***

*** Setting license file location(s).

***

*** The PBS commands have been installed in /usr/pbs/bin.

***

*** PBS Mom has been installed in /usr/pbs/sbin.

***

*** The PBS Scheduler has been installed in /usr/pbs/sbin.

NAREGI Middleware 導入手引書

***

*** Copying startup script.

***

*** End of /usr/pbs/etc/pbs_postinstall Would you like to start PBS now (y|[n])?y

← PBS Professionalの起動を 選択(ここではyを選択) /etc/init.d/pbs

Starting PBS PBS mom PBS sched

Using license server at XXXX@XXXX.naregi.org PBS server

PBS started

Installation complete

# ps -ef |grep pbs

← PBS Professionalの起動を確認 root 4555 1 0 10:29 ? 00:00:00 /usr/pbs/sbin/pbs_server

root 4569 1 0 10:29 ? 00:00:00 /usr/pbs/sbin/pbs_mom root 4583 1 0 10:29 ? 00:00:00 /usr/pbs/sbin/pbs_sched root 4585 4443 0 10:29 pts/0 00:00:00 grep pbs

(2) PBS実行機能のインストール

GridVM計算ノードにPBS の実行機能をインストールします。

# cd /tmp

# ls

PBSPro_9.1.0-linux24_i686_AS3.tar.gz

# tar zxvf PBSPro_9.1.0-linux24_i686_AS3.tar.gz PBSPro_9.1.0/INSTALL

PBSPro_9.1.0/PBS_License.txt PBSPro_9.1.0/README PBSPro_9.1.0/linux24_i686

PBSPro_9.1.0/linux24_i686/pbs-cmds-9.1.0.72982-0.i386.rpm PBSPro_9.1.0/linux24_i686/pbs-9.1.0.72982-0.i386.rpm PBSPro_9.1.0/linux24_i686/pbs-mom-9.1.0.72982-0.i386.rpm

# cd PBSPro_9.1.0

# ./INSTALL

← インストールを実施 Installation of PBS Professional

Terms of use for the software are available online at http://www.pbspro.com/UserArea/agreement.html, and are also

NAREGI Middleware 導入手引書

included in our PBS Professional Administrator's Guide and PBS Professional User's Guide

The package system used on this machine cannot relocate software from the default location. The default location for the execution directory is:

/usr/pbs

/usr/pbs does not exist, I'll make it.

done

PBS needs to have a private directory (referred to as "PBS_HOME"

in the documentation) where it can permanently store information.

Please enter the full path for the PBS_HOME location you would like or press enter to accept the default.

Home directory? [/var/spool/PBS]

← ホームディレクトリの作成 (ここではデフォルト設定) You now need to decide what kind of PBS installation you want for

this machine. There are three possibilities: a server node, an execution node, or a client host.

If you are going to run PBS on a single timesharing host, install the server package.

If you are going to have a cluster of machines, you need to pick one to be the front end and install the server package there.

Then install the execution package on all the other nodes in the cluster.

The client package is for a host which will not be used for execution but still has access to PBS. It contains the commands, the GUI and man pages. This gives the ability to submit jobs and check status.

PBS Installation:

1. Server, execution and commands 2. Execution only

3. Commands only (1|2|3)?2

← 実行のみなので 2 を選択 PBS Professional version 9.0 and later is licensed

via the Altair License Manager.

The Altair License Manager can be downloaded from:

http://www.pbspro.com/UserArea/Software/

NAREGI Middleware 導入手引書

For more information, please refer to the PBS

Professional Administrator's Guide, or contact pbssupport@altair.com.

Continue with the installation ([y]|n)?

← リターンキー Installing PBS for an Execution Host.

You need to specify a hostname for the Server.

Hostname? [pbsserver] naregi-gvms1.naregi.org

← ホストサーバ(GridVM 管理 ノード)を入力(ここでは naregi-gvms1.naregi.orgを 入力)

you entered: naregi-gvms1.naregi.org is this correct?yes

←確認(yesを入力)

*** PBS Installation Summary

***

***

*** Found existing /var/spool/PBS/pbs_environment

*** This host does not have the PBS server installed.

*** the default name 'xxxxxxx.naregi.org' will be used.

***

*** The PBS commands have been installed in /usr/pbs/bin.

***

*** PBS Mom has been installed in /usr/pbs/sbin.

***

*** Copying startup script.

***

*** End of /usr/pbs/etc/pbs_postinstall Would you like to start PBS now (y|[n])?y

← PBS Professionalの起動を 選択(ここではyを選択)

/etc/init.d/pbs Starting PBS PBS mom PBS started

Installation complete

# ps -ef |grep pbs

← PBS Professionalの起動を確認 root 4569 1 0 10:29 ? 00:00:00 /usr/pbs/sbin/pbs_mom

root 4585 4443 0 10:29 pts/0 00:00:00 grep pbs

NAREGI Middleware 導入手引書

(3) PBS Professionalの動作確認

PBS Professionalの設定と動作確認を行います。

(3-1) 登録ノードの確認

インストール直後にPBSサーバノードで/usr/pbs/bin/pbsnodes -aを実行すると、PBS サーバノードしか表示されない場合があります。その場合、/usr/pbs/bin/qmgrによりノ ードの追加・削除を行い適切な環境に設定します。

<ノード追加例>

# /usr/pbs/bin/qmgr Max open servers: 4

← ライセンス数により異なる Qmgr: create node naregi-gvmc1.naregi.org

(必要なノードの設定が完了したら Qmgr: q [Enter] で終了する)

<ノード削除例>

# /usr/pbs/bin/qmgr Max open servers: 4

← ライセンス数により異なる Qmgr: delete node naregi-gvmc1.naregi.org

(必要なノードの設定が完了したら Qmgr: q [Enter] で終了する)

# /usr/pbs/bin/pbsnodes -a naregi-gvms1.naregi.org

← インストール時はサーバのみ 登録されている

Mom = naregi-gvms1.naregi.org Port = 15002

pbs_version = PBSPro_9.1.0.72982 ntype = PBS

state = free pcpus = 2

resources_available.arch = linux

resources_available.host = naregi-gvms1 resources_available.mem = 962500kb resources_available.ncpus = 2

resources_available.vnode = naregi-gvms1.naregi.org resources_assigned.mem = 0kb

resources_assigned.ncpus = 0 resources_assigned.vmem = 0kb resv_enable = True

sharing = default_shared

NAREGI Middleware 導入手引書

# /usr/pbs/bin/qmgr Max open servers: 4

← ライセンス数により異なる Qmgr: create node naregi-gvmc1.naregi.org

← create(追加)するノードを作成 Qmgr: q

# /usr/pbs/bin/pbsnodes –a

← createしたノード追加されて いるのを確認

naregi-gvms1.naregi.org

Mom = naregi-gvms1.naregi.org Port = 15002

pbs_version = PBSPro_9.1.0.72982 ntype = PBS

state = free pcpus = 2

resources_available.arch = linux

resources_available.host = naregi-gvms1 resources_available.mem = 962500kb resources_available.ncpus = 2

resources_available.vnode = naregi-gvms1.naregi.org resources_assigned.mem = 0kb

resources_assigned.ncpus = 0 resources_assigned.vmem = 0kb resv_enable = True

sharing = default_shared naregi-gvmc1.naregi.org

Mom = naregi-gvmc1.naregi.org Port = 15002

pbs_version = PBSPro_9.1.0.72982 ntype = PBS

state = free pcpus = 2

resources_available.arch = linux

resources_available.host = naregi-gvmc1 resources_available.mem = 962500kb resources_available.ncpus = 2

resources_available.vnode = naregi-gvmc1.naregi.org resources_assigned.mem = 0kb

resources_assigned.ncpus = 0 resources_assigned.vmem = 0kb resv_enable = True

sharing = default_shared

NAREGI Middleware 導入手引書

(4) キューステータスの確認

qstatの実行結果を確認します。

# su - naregiuser

$ /usr/pbs/bin/qstat -Qf Queue: workq

← workqになっていることを確認 queue_type = Execution

← Executionであることを確認 total_jobs = 0

← ジョブが実行されていないため

“0”である事を確認

state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:0 Exiting:0 Begun :0

resources_assigned.ncpus = 0 enabled = True

started = True

(5) ジョブの実行確認

テストジョブを投入して全ての計算資源上で実行されることを確認します。ここで は 、 途 中 30 秒 間 の sleep を 挿 入 し て 単 純 な コ マ ン ド を 実 行 す る ス ク リ プ ト

(pbs_test_30s.sh)と、それを指定回数分実行するスクリプト(qsub_loop.sh)を使用 する例を示します。

# su - naregiuser

$ ls

pbs.out pbs_test_30s.sh qsub_loop.sh

$ cat qsub_loop.sh

← 指定した回数分ジョブを実行 するスクリプト

#!/bin/sh

export PATH=/usr/pbs/bin:$PATH cd ~naregiuser/pbs.out/

← 結果出力ディレクトリに移動 i=0

while [ $i -lt $1 ] do

qsub ../pbs_test_30s.sh i=`expr $i + 1 ` done

NAREGI Middleware 導入手引書

$ cat pbs_test_30s.sh

← 日付とhostnameを出力する スクリプト

#!/bin/sh

echo "---"

date sleep 30 hostname date

echo "---"

$ chmod 755 pbs_test_30s.sh

$ chmod 755 qsub_loop.sh

$ ./qsub_loop.sh 4

← 同時実行のジョブ数を指定して 実行

0. naregi-gvms1 1. naregi-gvms1 2. naregi-gvms1 3. naregi-gvms1

$ qstat

← ジョブの状態確認

Job id Name User Time Use S Queue --- --- --- --- - ---

0. naregi-gvms1 pbs_test_30s.sh naregiuser 00:00:00 R workq 1. naregi-gvms1 pbs_test_30s.sh naregiuser 00:00:00 R workq 2. naregi-gvms1 pbs_test_30s.sh naregiuser 00:00:00 R workq 3. naregi-gvms1 pbs_test_30s.sh naregiuser 00:00:00 R workq

← Statusが「R(Running)」である ことを確認(本例は2台×2CPUで

4プロセスなのですべて「R」に なっている)

$ cd pbs.out

$ ls -l

← 結果出力ファイルの確認 -rw--- 1 naregiuser naregiuser 0 Apr 10 18:55 pbs_test_30s.sh.e0

-rw--- 1 naregiuser naregiuser 0 Apr 10 18:55 pbs_test_30s.sh.e1 -rw--- 1 naregiuser naregiuser 0 Apr 10 18:55 pbs_test_30s.sh.e2 -rw--- 1 naregiuser naregiuser 0 Apr 10 18:55 pbs_test_30s.sh.e3 -rw--- 1 naregiuser naregiuser 137 Apr 10 18:55 pbs_test_30s.sh.o0

NAREGI Middleware 導入手引書

-rw--- 1 naregiuser naregiuser 137 Apr 10 18:55 pbs_test_30s.sh.o1 -rw--- 1 naregiuser naregiuser 137 Apr 10 18:55 pbs_test_30s.sh.o2 -rw--- 1 naregiuser naregiuser 137 Apr 10 18:55 pbs_test_30s.sh.o3

$ cat pbs_test_30s.sh.o0 ---

Thu Apr 10 18:55:10 JST 2008 naregi-gvms1.naregi.org

← ジョブが実行されたサーバ名を 確認

Thu Apr 10 18:55:40 JST 2008 ---

$ cat pbs_test_30s.sh.o1 ---

Thu Apr 10 18:55:10 JST 2008 naregi-gvms1.naregi.org

Thu Apr 10 18:55:40 JST 2008 ---

$ cat pbs_test_30s.sh.o2 ---

Thu Apr 10 18:55:10 JST 2008 naregi-gvmc1.naregi.org

Thu Apr 10 18:55:40 JST 2008 ---

$ cat pbs_test_30s.sh.o3 ---

Thu Apr 10 18:55:10 JST 2008 naregi-gvmc1.naregi.org

Thu Apr 10 18:55:40 JST 2008 ---

NAREGI Middleware 導入手引書

9. ( 付録 ) GridRPC フロントエンドノードの構築

NAREGIミドルウェア環境上でGridRPCジョブを実行する際に必要となるGridRPC

ノードの構築手順を説明します。

関連したドキュメント