How to run a command (1000 times) that requires two different types of input files

后端 未结 3 960
青春惊慌失措
青春惊慌失措 2021-01-17 03:56

I have calculated directed modularity by means of DirectedLouvain (https://github.com/nicolasdugue/DirectedLouvain). I am now trying to test the significance of the values o

3条回答
  •  不思量自难忘°
    2021-01-17 04:41

    You could use GNU Parallel to run your jobs in parallel across all your CPU cores like this:

    parallel convert -i {} -o {.}.bin -w {.}.weights ::: input*.txt
    

    Initially, you may like to do a "dry run" that shows what it would do without actually doing anything:

    parallel --dry-run convert -i {} -o {.}.bin -w {.}.weights ::: input*.txt
    

    If you get errors about the argument list being too long because you have too many files, you can feed their names in on stdin like this instead:

    find . -name "input*txt" -print0 | parallel -0 convert -i {} -o {.}.bin -w {.}.weights
    

提交回复
热议问题