Omitting your other parallel flags just to stay focused...
parallel --link pf ::: A B ::: C D
This will run your function first with a=A, b=C followed by a=B, b=D or
a=A b=C
a=B b=D
Without --link you get full combination like this:
a=A b=C
a=A b=D
a=B b=C
a=B b=D
Update: As Ole Tange metioned in a comment [since deleted Ole Tange metioned in a comment- Ed.] there is another way to do this,: use the :::+ operator. ThereHowever, there is an important difference between the two alternatives IF the number of arguments is not the same in each param positionif the number of arguments is not the same in each param position. An example will illustrate:.
parallel --link pf ::: A B ::: C D E output:
a=A b=C
a=B b=D
a=A b=E
parallel pf ::: A B :::+ C D E output:
a=A b=C
a=B b=D
So --link will "wrap" sosuch that all arguments are consumed while :::+ will ignore the extra argument. Personally(In the general case I don't like when things are silently ignored so that's why my preference isprefer --link since the alternative is in some sense silently ignoring input. YMMV.)