很多重复命令(如:建几万个基因树)用 for 循环串行太慢了,可以使用 ParaFly 并行。
- 操作
先用 for 循环或者awk将要运行的命令放入文件cmd.sh
ParaFly -c cmd.sh -CPU 20
- 运行结束后
Number of Commands: 22967All commands completed successfully. :-)
- 参数意义
$ ParaFly############################################################ Usage: ParaFly (opts)## Required:# -c <str> :filename containing list of bash-style commands to execute.# -CPU <int> :number_of_threads## Optional:# -shuffle :randomly shuffles the command order.# -failed_cmds <str> :filename to capture failed commands. default("FailedCommands")# -v :simple progress monitoring.# -vv :increased verbosity in progress monitoring.###########################################################Note: This process creates a file named based on your commands filename with a .completed extension.This enables a resume functionality, where if rerun, only those commands not completed successfully will be reprocessed.
