Gnu Parallel : nested parallelism

后端 未结 1 818
庸人自扰
庸人自扰 2021-02-20 16:06

Is it possible to call gnu parallel from within multiple runs of a script that are in-turn spawned by gnu parallel?

I have a python script that runs for 100s of

1条回答
  •  后悔当初
    2021-02-20 16:39

    Yes. GNU Parallel is designed (and tested heavily) to be able to be called from GNU Parallel - either directly or through a script.

    If called directly you are likely to need to change -I. What does the second {} mean here (does it refer to the first or the second parallel?):

    seq 10 | parallel 'seq {} | parallel echo {}'
    

    Here it is very clear:

    seq 10 | parallel 'seq {} | parallel -I // echo //'
    seq 10 | parallel 'seq {} | parallel -I // echo {} //'
    

    PS Good to hear you find GNU Parallel awesome. If you like GNU Parallel:

    • Walk through the tutorial (http://www.gnu.org/software/parallel/parallel_tutorial.html)
    • Give a demo at your local user group/team/colleagues
    • Post the intro videos and tutorial on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
    • Request or write a review for your favourite blog or magazine
    • Invite me for your next conference

    If you use GNU Parallel for research:

    • Please cite GNU Parallel in you publications (use --bibtex)

    If GNU Parallel saves you money:

    • (Have your company) donate to FSF https://my.fsf.org/donate/

    0 讨论(0)
提交回复
热议问题