[[TORQUE]]

本家様 [[http://crd.lbl.gov/departments/computer-science/CLaSS/research/BLCR/>+http://crd.lbl.gov/departments/computer-science/CLaSS/research/BLCR/]]

CentOS7ではビルドできませんでした。CentOS6ならいけた。
LinuxなTORQUEでjobをsuspend状態にはできないけど、hibernateにはできるのがこれみたい。
だが、
&ref(2016y04m10d_135630071.png,nolink);
出典:http://docs.adaptivecomputing.com/torque/4-2-10/Content/topics/2-jobs/jobCheckpointAndRestart.htm

とあり計算ノードを複数使うジョブには適用できないみたい。

BLCRはカーネルにモジュールを組み込みさせます。なので計算ノードらはすべて同一のカーネルが望ましく
っとなると &color(red){PXE}; とかで DiskLess クラスター を用意したほうが楽なのかも

***BLCR構築 [#j6c86c8f]
本家様より &color(orangered){SRPM}; を取得して rpmbuild にてパッケージを作成した。

#code(nonumber){{
[root@pbs ~]# rpm -Uvh blcr-0.8.5-1.src.rpm
[root@pbs ~]# rpmbuild -bb rpmbuild/SPECS/blcr-0.8.5.spec  --define 'with_multilib 0'
[root@pbs ~]# ls -l rpmbuild/RPMS/x86_64/
合計 1232
-rw-r--r-- 1 root root  77872  4月  9 09:29 2016 blcr-0.8.5-1.x86_64.rpm
-rw-r--r-- 1 root root  32084  4月  9 09:29 2016 blcr-devel-0.8.5-1.x86_64.rpm
-rw-r--r-- 1 root root  40336  4月  9 09:29 2016 blcr-libs-0.8.5-1.x86_64.rpm
-rw-r--r-- 1 root root 899620  4月  9 09:29 2016 blcr-modules_2.6.32_573.22.1.el6.x86_64-0.8.5-1.x86_64.rpm
-rw-r--r-- 1 root root 200716  4月  9 09:29 2016 blcr-testsuite-0.8.5-1.x86_64.rpm
[root@pbs ~]#
[root@pbs ~]# cd rpmbuild/RPMS/x86_64
[root@pbs x86_64]# yum localinstall ./blcr-0.8.5-1.x86_64.rpm \
                                    ./blcr-libs-0.8.5-1.x86_64.rpm \
                                    ./blcr-devel-0.8.5-1.x86_64.rpm \
                                    ./blcr-modules_2.6.32_573.22.1.el6.x86_64-0.8.5-1.x86_64.rpm
[root@pbs x86_64]#
}}
&color(red){*};&size(10){'with_multilib 0'は32bit向けの対応なのだが64bitしかない環境なので disable(0) にした};

***TORQUE構築 [#xd317095]
BLCRと連携するTorqueも &color(orangered){SRPM}; を取得して展開する
#code(nonumber){{
[root@pbs ~]# yum install epel-release
[root@pbs ~]# yum -y install yum-utils
[root@pbs ~]# yumdownloader --source torque

[root@pbs ~]# rpm -Uvh torque-4.2.10-9.el6.src.rpm
}}
ここでSPECファイルに対して、BLCRの有効化とNUMAサポート削除を行った。変更箇所は下記のとおりである

#code(diff,nonumber){{
[root@pbs ~]# cp -p rpmbuild/SPECS/torque.spec rpmbuild/SPECS/torque.spec.orig
[root@pbs ~]# diff -u rpmbuild/SPECS/torque.spec.orig rpmbuild/SPECS/torque.spec
--- rpmbuild/SPECS/torque.spec.orig     2016-02-21 15:17:47.000000000 +0900
+++ rpmbuild/SPECS/torque.spec  2016-04-09 09:56:48.917187898 +0900
@@ -382,7 +382,9 @@
   --with-sendmail=%{_sbindir}/sendmail --disable-static \
   --with-tcp-retry-limit=2 --without-debug \
   --enable-drmaa --enable-munge-auth --with-munge \
-  --enable-cpuset --enable-numa-support \
+  --enable-cpuset \
+  --with-blcr=/usr --with-blcr-include=/usr/include --with-blcr-lib=/usr/lib64 \
+  --with-blcr-bin=/usr/bin \
   %{server_nameflags} %{guiflags} %{tclflags} %{rcpflags}

 make %{?_smp_mflags}
[root@pbs ~]#
}}


ビルドに必要な関連パッケージをインストールして rpmbuild にてパッケージを作成した。
#code(nonumber){{
[root@pbs ~]# yum -y install desktop-file-utils pam-devel xauth readline-devel ncurses-devel \
 gperf openssl-devel hwloc-devel libxml2-devel munge-devel tcl-devel tk-devel graphviz \
 texlive-latex

[root@pbs ~]# rpmbuild -bb rpmbuild/SPECS/torque.spec
}}
これら作ったパッケージを管理ノード、計算ノード、ジョブ発行ノードに適時インストールした。

***パッケージのインストール [#v5d092e8]
各ノードで必要なパッケージは下表参照
|BGCOLOR(yellow):役目|BGCOLOR(yellow):ホスト名|BGCOLOR(yellow):IPアドレス|BGCOLOR(yellow):core数|BGCOLOR(yellow):備考|
|管理ノード|pbs.sybyl.local|192.168.0.57|1|torque, torque-libs, torque-client, torque-server&br;blcr-libs|
|計算ノード|n1.sybyl.local|192.168.0.52|1|torque, torque-libs, torque-mom&br;blcr, blcr-libs, blcr-modules |
|~|n2.sybyl.local|192.168.0.53|1|~|
|~|n3.sybyl.local|192.168.0.54|1|~|
|ジョブ発行ノード|client.sybyl.local|192.168.0.20|1|torque, torque-libs, torque-client&br;blcr-libs|
その他の各ノードの調整はほとんどが[[TORQUE]]と同じです
-管理ノード
[[TORQUE#j55196bb]](データベースの作成、nodesファイル、queue作成)、[[TORQUE#s0512ad7]](munge)と同じように行う。
~
-計算ノード
BLCRを有効を有効にさせて、BLCRのスクリプトを定義する。
#code(nonumber){{
[root@n1 ~]# chkconfig blcr on && /etc/init.d/blcr start
[root@n1 ~]# vi /var/lib/torque/mom_priv/config
$pbsserver          pbs
$usecp              *:/home /home
$log_file_suffix    %h
$log_keep_days      10

$checkpoint_script  /var/lib/torque/mom_priv/checkpoint_script
$restart_script     /var/lib/torque/mom_priv/restart_script
$checkpoint_run_exe /usr/bin/cr_run
$loglevel           7

[root@n1 ~]# yum --enablerepo=epel install perl-Unix-Syslog
}}
&color(orangered){blcr_checkpoint_script};と&color(orangered){blcr_checkpoint_script};は torque の source に含まれている。
それらを全計算ノードにコピーします。
#code(nonumber){{
[root@pbs ~]# scp rpmbuild/BUILD/torque-4.2.10/contrib/blcr/checkpoint_script root@n1:/var/lib/torque/mom_priv/
[root@pbs ~]# scp rpmbuild/BUILD/torque-4.2.10/contrib/blcr/restart_script root@n1:/var/lib/torque/mom_priv/
}}
&color(red){*};&size(10){adaptivecomputingのドキュメントに書かれている&color(orangered){blcr_checkpoint_script};には typo があって動かない};
スクリプトのパーミッションを適切に付与します。
#code(nonumber){{
[root@n1 ~]# cd /var/lib/torque/mom_priv
[root@n1 mom_priv]# chmod 754 checkpoint_script restart_script
[root@n1 mom_priv]# ls -l
合計 20
-rwxr-xr-- 1 root root 3624  4月 10 09:06 2016 checkpoint_script
lrwxrwxrwx 1 root root   22  4月  9 16:50 2016 config -> /etc/torque/mom/config
drwxr-xr-x 2 root root 4096  4月  9 10:04 2016 jobs
-rw-r--r-- 1 root root    6  4月 10 05:27 2016 mom.lock
-rwxr-xr-- 1 root root 5761  4月 10 09:06 2016 restart_script
[root@n1 mom_priv]#
}}
-ジョブ発行ノード
[[TORQUE#h6416803]](mungeのコピーら)と同じように対処する

***パスワードなしsshの有効化 [#p3ec15b0]
非常に重要な用件なのだが、計算ノードから管理ノードへ scp ができるように調整が必要
参照:[[ssh/ホストベース認証]]

***Torque with BLCRのテスト [#yf22d00a]

題材として
[[http://docs.adaptivecomputing.com/torque/4-2-10/help.htm>+http://docs.adaptivecomputing.com/torque/4-2-10/help.htm]]の「&color(green){Appendix M: BLCR acceptance tests};」を取り上げてみる。使用するサンプルプログラム至って簡単。一秒毎にカウントを表示するプログラムです。
#code(c,noblock,nonumber,nooutline){{
[illya@client ~]$ cat test.c
#include <stdio.h>
int main( int argc, char *argv[] )
{
int i;

    for (i=0; i<100; i++)
    {
        printf("i = %d\n", i);
        fflush(stdout);
        sleep(1);
    }
}
[illya@client ~]$
}}
これをコンパイルして、実行してみます。途中終了は[Ctl-C]です。
#code(nonumber){{
[illya@client ~]$ gcc -o test ./test.c
[illya@client ~]$ ./test
i = 0
i = 1
i = 2
i = 3
^C
[illya@client ~]$
}}
では実際にジョブを停止して、再開させてみる。
この test を含むシェルスクリプトを用意して
#code(nonumber){{
[illya@client ~]$ mkdir pbs && cd pbs
[illya@client pbs]$ cat test.sh
#!/bin/bash
/home/illya/test

[illya@client pbs]$ qsub -c enabled test.sh
29.pbs.sybyl.local
[illya@client pbs]$
[illya@client pbs]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
29.pbs                     test.sh          illya                  0 R batch
[illya@client pbs]$
}}
と計算が実行される。そして qhold コマンドでとめてみる
#code(nonumber){{
[illya@client pbs]$ qhold 29
[illya@client pbs]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
29.pbs                     test.sh          illya           00:00:00 H batch
[illya@client pbs]$
}}
この段階で、管理ノードの checkpoint ディレクトリにファイルが用意される

#code(nonumber){{
[root@pbs torque]# cd
[root@pbs ~]# cd /var/lib/torque
[root@pbs torque]# ls -l checkpoint/29.pbs.sybyl.local.CK/
合計 752
-r-------- 1 illya fate 766510  4月 10 14:53 2016 ckpt.29.pbs.sybyl.local.1460267627
[root@pbs torque]#
}}
再び、計算を再開させる

#code(nonumber){{
[illya@client pbs]$ qrls 29
[illya@client pbs]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
29.pbs                     test.sh          illya           00:00:00 R batch
[illya@client pbs]$
}}

とうまく一時停止させて、再開することができた。




1

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS