I want to run 3 jobs (A, B, C) on 2 cores of a machine with >2 cores. I know that:
runtime(A)>runtime(C)
runtime(B)>runtime(C)
It is unknown in advance if runtime(A)>runtime(B) or runtime(A)<runtime(B).
What I want to do is:
How can this be achieved (in bash, if possible)?
Just tell GNU Parallel it can use 2 cores:
parallel -j 2 ::: jobA jobB jobC
Note that the jobs will run in the order you specified, but the output may come in a different order. If that is an issue, add -k
parameter to keep output in order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With