SGE tips

Warning: no access to tty (不正なファイル記述子です).の対処。

その1、キューの属性shell_start_modeの値を変更する。


変更前
shell_start_mode posix_compliant
変更後
shell_start_mode unix_behavior



gridengine Eセットアップ@SL

単一ノード前提


# yum install gridengine gridengine-qmaster gridengine-qmon gridengine-execd

再ログインし環境設定を読み込んだ後、

# cd $SGE_ROOT
キューマスタのセットアップ
# ./inst_sge -m

※ ホスト名が見つからない場合、/etc/hostsを調整する等して
"$ hostname -f"でホスト名を返すように変更する。loは不適。

質問に頑張って答えていく。。
環境設定の内容は以下。
$ . /usr/share/gridengine/default/common/settings.sh

ジョブ投入ホストのセットアップ
# ./inst_sge -s
実行ホストのセットアップ
# ./inst_sge -x


SGEセットアップ@ubuntu

簡単編?


$ sudo apt-cache search gridengine
でヒットするものをすべてインストール。
管理ホスト名入力。
ユーザで、password-less-sshを通す。

$ sudo qconf -qa default.q
あれ、
$ sudo qconf -aq default.q
が正しい?バージョンで違うかな。適宜、qconf -helpで確認。
キュー作成。

$ sudo qconf -qp smp
内容、
pe_name smp
slots 32
user_lists NONE
xuser_lists NONE
start_proc_args /bin/true
stop_proc_args /bin/true
allocation_rule $pe_slots
control_slaves TRUE
job_is_first_task FALSE
urgency_slots min
accounting_summary TRUE
キュー修正。

$ sudo qconf -mq default.q
投入ホスト追加。

$ sudo qconf -qs hostname
実行ホスト追加、確認

$ sudo qconf -ae hostname
$ sudo qconf -sel

とりあえず、ここまで。

参照
http://pka.engr.ccny.cuny.edu/~jmao/node/49

$sudo qmon
して、実行ホスト追加、ユーザ許可などを行う。



ジョブにSIGTERMを送りたいんだけども、qsigがない。。


対処法1


1. ジョブIDを取得

例えば、ジョブ投入時に出力を保存しておき、それを参照するとか。。
JOBID=`cat /tmp/hoge | awk -F " " '{print $3;}'`


2. qstatで実行ホスト情報を取得

例、
EXEHOST=`qstat -j $JOBID | grep sge_o_host | awk -F " " '{print $2;}'`


3. ジョブのプロセスIDを取得

例、
JOBPID=`cat ${SGE_ROOT}/default/spool/${EXEHOST}/active_jobs/${JOBID}.1/pid`


4. リモートシェル越しにkillコマンド実行

例、
rsh $EXEHOST kill -15 $JOBPID



対処法2
queueのconfigurationで、terminate_methodをSIGTERMに変更する。
するとqdelから送信可。デフォルトは、SIGSTOPらしい。

http://manpages.ubuntu.com/manpages/lucid/man5/sge_queue_conf.5.html


terminate_method
These parameters can be used for overwriting the default method used by
Sun Grid Engine for suspension, release of a suspension and for
termination of a job. Per default, the signals SIGSTOP, SIGCONT and
SIGKILL are delivered to the job to perform these actions. However, for
some applications this is not appropriate.

If no executable path is given, Sun Grid Engine takes the specified
parameter entries as the signal to be delivered instead of the default
signal. A signal must be either a positive number or a signal name with
"SIG" as prefix and the signal name as printed by kill -l (e.g.
SIGTERM).



エラー対処

#001
error: unable to contact qmaster using port 6444

ローカルホスト内で通信ができない場合、hostsファイルのlocalhostの行がおかしいかも?
/etc/hostsで、


127.0.0.1 localhost
127.0.1.1 theta

127.0.0.1 localhost theta
#127.0.1.1 theta
とすると通信できた。

#002
error: commlib error: got select error (Connection refused)

masterがこけてる?


$ sudo /etc/init.d/gridengine stop
$ sudo /etc/init.d/gridengine stop


#003


$ sudo qconf -ae localhost
とすると、次のエラー。
localhost is no exec host

sge_execdデーモンが正しく動作していない?

/etc/init.d/gridengine_exeから再起動しようとすると、次のエラーが。

critical error: abort qmaster registration due to communication errors

$ sudo killall sge_execd
として強制終了し、スクリプトから再起動。