1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DependencyNeverSatisfiedやし勝手に消えるやろなぁ...

1
Last updated at Posted at 2020-03-29
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
               4     pc1       test.sh    user PD       0:00      1 pc1
               5     pc1       test3.sh   user PD       0:00      1 (Dependency)
               6     pc2       test2.sh   user PD       0:00      1 (DependencyNeverSatisfied)

終わらへんやんけ彡(゚)(゚)!

本編

個人利用の場合にはあまり出番はないかもしれませんが、Slurmというジョブスケジューラがあります。
要するにいい感じにCPUやGPUを割り当ててくれるものです。

インストール方法等は他の記事にお任せするとして、実際に使用する場面になると、「これ終わったらこれしたいみたいな」ことがあります。

そんな時に使うのは、sbatchの--dependencyオプションです。

# !/bin/bash

jid1=$(sbatch --gres=gpu:1 --parsable test1.sh)
jid2=$(sbatch --gres=gpu:1 --dependency=afterok:$jid1 test2.sh)

こんな感じに書くことでtest1.shを終わった後にtest2.shが行われる訳です(bashファイルにひとまとめに書く場合は--parsableも必要なので注意!)。

だたし、test1.shがjobがscancelやエラーで異常終了すると、上記のようにDependencyNeverSatisfiedというステータスになる訳ですね。

そして、それが終らないわけですね(もしかしたら長いこと放置してたら終わるかもしれないですが)。

こんな時使うならこちら!!!

--kill-on-invalid-dep=yes

このオプションはdependency元が正しく終了しなかった場合に勝手にkillしてくれるものですね。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?