I'd like to use the --shard flag in GNU parallel to do some concurrency control.
My input file (input.csv) looks like this:
node-foo,op1
node-bar,op2
node-baz,op3
node-foo,op4
node-blah,op5
...
I'm using parallel to send ops to nodes. Node names may appear more than once in the first column. I'd like to use --shard to ensure that at most one op is sent to a node at a time.
My command looks something like this:
parallel --shard 1 send_op.sh --node={1} --op={2} ::: input.csv
Unfortunately, this doesn't work. parallel tells me "--shard requires --jobs to be higher than the number of arguments. Increase --jobs."
This doesn't make sense to me. Doesn't it defeat the point of --shard if --jobs is set to be higher than the number of input lines (the number of ops in my example)? How can I achieve my desired concurrency property?