1

Is it possible to make chunk request instead of request for each job?

function $1 $2 $3 | parallel --gnu --group --interactive -k -j 4 function_run {}

In that case, GNU Parallel is asking question to run each job, but i want question to run next chunk of 4 parallel jobs. And it would be great, if I could change -j in run process.

Varek
  • 13
  • 4

1 Answers1

0

-j can read from a file: If the file changes, it will be re-read after each job stops. The content is the same as you would give to -j (e.g. 4, 100%, or -1).

If you want --interactive for chunks of 4 jobs, then you could write a wrapper:

run4() {
  parallel echo ::: "$@"
}
export -f run4
seq 10 | parallel -n4 --interactive run4
run4 1 2 3 4 ?...y
run4 5 6 7 8 ?...n
run4 9 10 ?...n

(--group is default).

Ole Tange
  • 31,768
  • 5
  • 86
  • 104