📄 mpb-split.in
字号:
#! @SH_JOB@if test x"`echo $1 | egrep '^[0-9]*$'`" = x; then echo "Syntax: $0 <num-split> [mpb arguments...]" 1>&2 exit 1fitmpname=/tmp/mpb-split.$$.tmp # unique temporary filenamesubprocesses="" # keep a list of the subprocess ids launched# If a SIGINT or SIGHUP is received, kill subprocesses and delete temp. files:trap 'echo "killing subprocesses: $subprocesses"; kill -9 $subprocesses; rm -f $tmpname.*; exit 1' 1 2# Run num-split instances of mpb, each with a chunk of k-points, with# the first chunk going to stdout and the rest going to temporary files# to be output later../mpb interactive?=false k-split-index=0 k-split-num=$* &subprocesses="$subprocesses $!"i=1while test `expr $i \< $1` = 1; do ./mpb interactive?=false k-split-index=$i k-split-num=$* > $tmpname.$i & subprocesses="$subprocesses $!" i=`expr $i + 1`done# After all mpb processes have finished, concatenate their outputs in order.waiti=1while test `expr $i \< $1` = 1; do cat $tmpname.$i rm -f $tmpname.$i i=`expr $i + 1`done
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -