I want to be able to alternate an argument for each execution of my parallel command.
I have a script to process images and I use GNU Parallel to launch several process at the same time. I use GPU core in this script but only one of my 2 GPU core is used.
I want to be able to use 2 different configuration file (one for GPU 1 et one for GPU 2) but I don't know how to do that.
gsutil ls -d $ee_repo | parallel -j 10 -k "task {} $PWD $year $config"
With $config changing from gpu_1 to gpu_2 every other execution
Is this possible or not ?
Thanks
EDIT:
Using the job number of the parallel command ({#}) as an argument, then get 0 or 1 by using the modulo of this job number:
gsutil ls -d $ee_repo | parallel -j 10 -k "task {} $PWD $year {#}"
In the task function:
task(){
...
jobnumber=$4
gpu=$(expr $jobnumber% 2)
...
}