-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuildtimestab.sh
executable file
·50 lines (45 loc) · 1.22 KB
/
buildtimestab.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
#
# File: buildtimestab.sh
# Author: Alex Stivala
# Created: September 2013
#
#
# Build table for reading into R of elapsed times of snowball esitmation
#
# Usage: buildtimestab.sh joboutputroot
#
# E.g.:
# buildtimestab.sh ~/snowball_estimations_kstart_n5000
#
# Output is to stdout with column for sample and total elapsed time (seconds)
#
# Uses various GNU utils options on echo, etc.
PATH=$PATH:`dirname $0`
if [ $# -ne 1 ]; then
echo "usage: $0 joboutputrootdir" >&2
exit 1
fi
joboutputroot=$1
echo "# Generated by: $0 $*"
echo "# At: " `date`
echo "# On: " `uname -a`
echo -e "sampleId\telapsedTime\tnodeCount"
for outfile in ${joboutputroot}/sample*/slurm-*.out
do
sampledir=`dirname ${outfile}`
sampleid=`basename "${sampledir}" | sed 's/sample//g'`
networkfile=${sampledir}/network.txt
networkedgefile=${sampledir}/arclist.txt
if [ -f ${networkfile} ]; then
nodecount=`cat ${networkfile} | grep -v '^$' |wc -l`
elif [ -f ${networkedgefile} ]; then
nodecount=`cat ${networkedgefile} | grep -i '^*Vertices'| awk '{print $2}'`
else
nodecount="NA"
fi
echo -e -n "${sampleid}\t"
sumtimes.sh -s $outfile
echo -e -n "\t${nodecount}"
echo
done