我想这个问题/问题可以通过满足以下一个(或多个)问题来解决
1)如何显示剩余的工作?
2)我如何使–eta的输出相当漂亮
1)我已经检查了手册页,我目前在我的函数中使用$PARALLEL_SEQ,但是如何才能保留这些工作? Parallel帮我编译了大约800个文件,我想知道我的工作还剩下什么.
2)或者,是否有更好(更好)的方式输出–eta?我的输出看起来很乱.我只想看一个ETA.
我正在使用的并行标志: – no-notice –keep-order –group
输出示例:
819: Compiling form: USER_Q ok
ETA: 8s 13left 0.61avg local:4/819/100%/0.6s
820: Compiling form: USER_RESERVE_STOCK ok
ETA: 7s 12left 0.61avg local:4/820/100%/0.6s
821: Compiling form: USERS_AUTO ok
ETA: 7s 11left 0.61avg local:4/821/100%/0.6s
822: Compiling form: USERS ok
ETA: 6s 10left 0.61avg local:4/822/100%/0.6s
823: Compiling form: USERS_MENU ok
ETA: 6s 9left 0.61avg local:4/823/100%/0.6s
824: Compiling form: USER_SUPP ok
ETA: 4s 8left 0.61avg local:4/824/100%/0.6s
825: Compiling form: VARIANCE_L ok
ETA: 4s 7left 0.61avg local:4/825/100%/0.6s
826: Compiling form: VAR_L ok
ETA: 3s 6left 0.61avg local:4/826/100%/0.6s
827: Compiling form: WASTE ok
ETA: 3s 5left 0.61avg local:4/827/100%/0.6s
828: Compiling form: WASTE_L ok
ETA: 2s 2left 0.61avg local:2/830/100%/0.6s
829: Compiling form: WEATHER ok
最佳答案 您需要重定向作业的输出以使–eta看起来不错:
seq 10 | parallel --eta 'echo foo; sleep .{}' >/dev/null
这也将显示剩余的工作岗位数量.你也可以找到–bar可用:
seq 10 | parallel --bar 'echo foo; sleep .{}' >/dev/null
或者更高级的例子:
seq 1000 | parallel -j30 --bar '(echo {};sleep 0.3)' 2> >(zenity --progress --auto-kill) | wc