Skip to content

Instantly share code, notes, and snippets.

@masa16
Last active July 17, 2018 08:43
Show Gist options
  • Save masa16/73aee18e50f93d06fa4a376a8cd6e955 to your computer and use it in GitHub Desktop.
Save masa16/73aee18e50f93d06fa4a376a8cd6e955 to your computer and use it in GitHub Desktop.
Gfarm用ジョブキューシステム gfqsub

Gfarm用ジョブキューシステム gfqsub

https://github.com/chokkan/gfqsub

Gfarmファイルシステムに置かれたファイルの局所性を考慮した簡単なジョブキューシステム。岡崎さん作。Pythonで記述。Qiitaの記事で少しだけ触れられている。

使い方

設定ファイル

~/.gfqsub に設定を書く。

[gfarm]
root = /tmp/gfarm_tanaka

[hosts]
# 1 core per node
chris1 = chris04-ib
         chris05-ib
         chris06-ib
         chris07-ib

# 4 core per node
chris4 = chris04-ib:4
         chris05-ib:4
         chris06-ib:4
         chris07-ib:4

コマンドリスト

1行が以下の形式でタスクリストを記述。

task_name gfarm_file command param1 param2 ...

gfarm_file が格納されているノードで command が実行される。

$ cat commands
task1 file1 sleep 1; hostname > out1
task2 file2 sleep 1; hostname > out2
task3 file3 sleep 1; hostname > out3
task4 file4 sleep 1; hostname > out4
task5 file5 sleep 1; hostname > out5
task6 file6 sleep 1; hostname > out6
task7 file7 sleep 1; hostname > out7
task8 file8 sleep 1; hostname > out8

実行

$ cat commands | gfqsub -w chris1

-w オプションに、~/.gfqsub の hosts に設定したホストリストを指定

結果

$ tail out*
==> out1 <==
chris04

==> out2 <==
chris05

==> out3 <==
chris06

==> out4 <==
chris07

==> out5 <==
chris04

==> out6 <==
chris05

==> out7 <==
chris06

==> out8 <==
chris07

制限事項

  • 入力ファイルとして指定できるのは1ファイルのみ。
  • 指定したファイルが、ホストリストのホストのどれかに格納されていないと、エラーになる。
  • ファイル格納ホストに基づいて割り当てられたホスト以外では実行されない。あるワーカーのジョブが先に終了しても、別のワーカーからジョブを取ってくることはない。
  • gfarm2fsはプロセス毎にマウントポイントを分けないと性能が出ないが、このツールは複数マウントポイントはサポートしていない。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment