Mercurial > hg > cc > cirrus_work
view bin/mime_by_seg.sh @ 220:9bd304c8a962
merge
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 28 Feb 2024 10:20:44 +0000 |
parents | a5dafc1364ed |
children |
line wrap: on
line source
#!/bin/bash # This runs on the compute nodes in nl1_counts inside a _runme doit # Args: # Computes the by-mime totals for this segment pjobs=4 # 10 parallel invocations of this are running, task=$PARALLEL_SEQ # {1..10} seg=$1 echo $(date) $seg as 3.$task on start doit () { i=$1 echo $(date) start $task.$seg $i $PARALLEL_SEQ 1>&2 awk -v seg=$seg '{if ($2==seg) {ll[$3]+=$1}} END {for (l in ll) print ll[l],l}' top21s_$i.tsv echo $(date) end $task.$seg $i $PARALLEL_SEQ 1>&2 } export -f doit export task seg seq -f '%03g' 0 299 | parallel -j $pjobs doit '{}' | uniq_merge.py > $seg.tsv echo $(date) task $n.$task on $nodename:$N.$node end 1>&2