Search code examples
gnu-parallel

Gnu Parallel with multiple commands and multiple configurations


I start several gnu parallel jobs from a bash file like this:

parallel -a jobs_A.sh --workdir workDir_A_Path --results logDir_A_Path --joblog logDir_A_Path
parallel -a jobs_B.sh --workdir workDir_B_Path --results logDir_B_Path --joblog logDir_B_Path

I can append jobs_A.sh and jobs_B.sh.

Now I want one single parallel call to submit the jobs to the workers.

However, how can I tell parallel which workdir, results and joblog folder to use, respectively ?


Solution

  • You cannot do that because neither --results nor --joblog are computed per job.

    You can get the workdir, though:

    parallel --xapply --workdir {1} --results logDir_Path --joblog logDir_common_Path {2} \
    :::: <(perl -ne 'print "workDir_A_Path\n"' jobs_A.sh; perl -ne 'print "workDir_B_Path\n"' jobs_B.sh;) \
    :::: <(cat jobs_A.sh jobs_B.sh)