Mercurial > hg > cc > cirrus_work
comparison bin/_nl1.sh @ 4:f27061e8a9da
convert to no longer need uniq -c
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 20 Jul 2022 19:38:30 +0100 |
parents | b4801f5696b2 |
children |
comparison
equal
deleted
inserted
replaced
3:668579197bec | 4:f27061e8a9da |
---|---|
28 | 28 |
29 doit () { | 29 doit () { |
30 echo $(date) start $1 $task $PARALLEL_SEQ 1>&2 | 30 echo $(date) start $1 $task $PARALLEL_SEQ 1>&2 |
31 fgrep ' w ' $srcdir/$1.tsv | \ | 31 fgrep ' w ' $srcdir/$1.tsv | \ |
32 awk 'BEGIN {while (getline < "'$langfile'") {l[$0]=1}} | 32 awk 'BEGIN {while (getline < "'$langfile'") {l[$0]=1}} |
33 {if (l[$4]) {print $1,$4}}' | uniq -c | \ | 33 {if (l[$5]) {print $1,$2,$5}}' | \ |
34 $W/shared/bin/uniq_merge.py > $resdir/${langs}_$1.tsv | 34 $W/shared/bin/uniq_merge.py > $resdir/${langs}_$1.tsv |
35 echo $(date) end $1 $task $PARALLEL_SEQ 1>&2 | 35 echo $(date) end $1 $task $PARALLEL_SEQ 1>&2 |
36 } | 36 } |
37 | 37 |
38 export -f doit | 38 export -f doit |
39 export srcdir resdir task langs langfile | 39 export srcdir resdir task langs langfile |
40 | 40 |
41 seq $s1 $sn | while read i | 41 $W/hst/bin/share_by_task.sh -f "%03g\n" -s $s1 $sn $n $task | parallel -j $pjobs doit '{}' |
42 do if [ $((i % $n)) -eq $task ] | |
43 then printf '%03g\n' $i | |
44 fi | |
45 done | \ | |
46 parallel -j $pjobs doit '{}' | |
47 | 42 |
48 echo $(date) task $n.$task on $nodename:$N.$node end 1>&2 | 43 echo $(date) task $n.$task on $nodename:$N.$node end 1>&2 |
49 | 44 |