Ant Man
Ant Man

Reputation: 83

How can I stop gnu parallel jobs when any one of them terminates?

Suppose I am running N jobs with the following gnu parallel command:

seq $N | parallel -j 0 --progress ./job.sh

How can I invoke parallel to kill all running jobs and accept no more as soon as any one of them exits?

Upvotes: 7

Views: 2682

Answers (2)

Ole Tange
Ole Tange

Reputation: 33715

You can use --halt:

seq $N | parallel -j 0 --halt now,done=1 ./job.sh

Upvotes: 5

yanpas
yanpas

Reputation: 2225

You may also use killall perl. It's not accurate way, but easy to remember

Upvotes: -1

Related Questions