# HG changeset patch # User Henry S. Thompson # Date 1541619390 0 # Node ID 58d46e6983faf41b31eca72e23e256c84593c872 # Parent 1b9329f6b5e1480c97512d6f556d9b29ffb25180 -mforce (?) multiple processors to be used diff -r 1b9329f6b5e1 -r 58d46e6983fa workers/bin/fixAndMerge.sh --- a/workers/bin/fixAndMerge.sh Wed Nov 07 17:37:27 2018 +0000 +++ b/workers/bin/fixAndMerge.sh Wed Nov 07 19:36:30 2018 +0000 @@ -28,8 +28,8 @@ cd /var/data tar -czhf - m.* res* | \ ssh -o StrictHostKeyChecking=no -q $home \"{ cd data - mkdir -p mergedWhich.16 - cd mergedWhich.16 + mkdir -p mergedWhich + cd mergedWhich tar -xzf - ; } 2>>errs\" rm -rf res* m.* cd @@ -40,10 +40,11 @@ log=$res/log echo \# $(date) "running |$proc|$home|$pause|$wp|" >> $log pRes=0 -echo "# $(date) $proc $(wc -l ifile.txt)" >> $log -parallel --round-robin --pipe -j $wp "_fixAndMerge.sh {#} $home $pause > $res/m.{#} 2>>$res/errs{#}" &2 +N=$(wc -l< ifile.txt) +echo "# $(date) $proc $N" >> $log +parallel --pipe -N$((N / wp)) -j $wp "_fixAndMerge.sh {#} $home $pause > $res/m.{#} 2>>$res/errs{#}" >$res/errs|| echo "ppfailed $? ${PIPESTATUS[@]}" >> $res/errs echo \# $(date) subprocs done >> $log -cat $res/m.* | awk '{c[$1 "\t" $2 "\t" $3]+=$4} END {for (k in c) {print k "\t" c[k]}}' > /var/data/m.$proc +cat $res/m.* | awk '{c[$1 "\t" $2 "\t" $3]+=$4} END {for (k in c) {print k "\t" c[k]}}' > /var/data/m.$proc 2>> $res/errs echo \# $(date) subres merged >> $log rm .running