很多重复命令(如:建几万个基因树)用 for 循环串行太慢了,可以使用 ParaFly 并行。

    • 操作
      先用 for 循环或者 awk 将要运行的命令放入文件 cmd.sh
    1. ParaFly -c cmd.sh -CPU 20
    • 运行结束后
    1. Number of Commands: 22967
    2. All commands completed successfully. :-)
    • 参数意义
    1. $ ParaFly
    2. ##########################################################
    3. #
    4. # Usage: ParaFly (opts)
    5. #
    6. # Required:
    7. # -c <str> :filename containing list of bash-style commands to execute.
    8. # -CPU <int> :number_of_threads
    9. #
    10. # Optional:
    11. # -shuffle :randomly shuffles the command order.
    12. # -failed_cmds <str> :filename to capture failed commands. default("FailedCommands")
    13. # -v :simple progress monitoring.
    14. # -vv :increased verbosity in progress monitoring.
    15. #
    16. ##########################################################
    17. Note: This process creates a file named based on your commands filename with a .completed extension.
    18. This enables a resume functionality, where if rerun, only those commands not completed successfully will be reprocessed.