File: 520

package info (click to toggle)
pcp 4.3.2%2Breally4.3.1-0.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 175,188 kB
  • sloc: ansic: 261,305; sh: 123,606; xml: 107,279; cpp: 72,127; perl: 18,283; python: 15,453; yacc: 8,249; lex: 2,585; makefile: 1,957; fortran: 60; java: 52
file content (108 lines) | stat: -rwxr-xr-x 2,929 bytes parent folder | download | duplicates (5)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/sh
# PCP QA Test No. 520
#
# pmie - lots of expressions, checking pmie -d output and %v binding
# - multihost cases, see also QA 514
#
# Copyright (c) 2012 Ken McDonell.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

status=1	# failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    sed \
	-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z]  *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
	-e 's/DATE [12][0-9][0-9][0-9]/DATE/' \
	-e '/evaluator exiting/s/pmie([0-9][0-9]*)/pmie(PID)/' \
	-e '/Performance Co-Pilot Inference Engine/s/Version .*/Version .../'
}

# mapping to 0x0 -> (nil) needed for C compilers that don't do the
# (nil) translation automatically for a printf %p
#
_filter2()
{
    sed \
	-e 's/0x0\([ (]\)/(nil)\1/g' \
	-e 's/0x0$/(nil)/' \
    | $PCP_AWK_PROG '
$1 == "pmie:"		{ print; next }
/failed: /		{ print; next }
$1 == "bundle:"	{ skip=1 }
skip == 1		{ if ($1 == "Rule:") skip = 0 }
skip == 1		{ next }
			{ print }' >$tmp.tmp
    tr ' =' '\012' <$tmp.tmp \
    | grep '0x' \
    | $PCP_AWK_PROG >$tmp.sed '
BEGIN	{ n = 0 }
    	{ if (seen[$1] == 1) next
	  printf "s/%s/ADDR%03d/\n",$1,n
	  n++
	  seen[$1] = 1
	}'
    sed -f $tmp.sed <$tmp.tmp
}

cat <<'End-of-File' >$tmp.pmie
hosts = ":vm00 :vm01 :vm02 :vm03";
some_host sampledso.drift $hosts > 0 -> print "some_host:" " @%h %v";
all_host 10 * sampledso.drift $hosts == sampledso.ulong.ten $hosts * sampledso.drift $hosts -> print "all_host:" " @%h %v";
25%_host (hinv.physmem $hosts / (1024*1024)) > 512 -> print "25%_host:" " @%h %v";
min_host hinv.physmem $hosts == 239 * 1024 Kbyte -> print "min_host:" " @%h %v";
max_host sampledso.colour $hosts #'red' < max_host max_inst (sampledso.colour $hosts) -> print "max_host:" " @%h %v";
sum_host hinv.ncpu $hosts == hinv.ncpu :vm00 + hinv.ncpu :vm01 + hinv.ncpu :vm02 + hinv.ncpu :vm03 -> print "sum_host:" " @%h %v";
avg_host min_inst sampledso.bin $hosts == 100 -> print "avg_host:" " @%h [%i] %v";
count_host (some_inst sampledso.part_bin > 300) > 0 -> print "count_host:" " @%h [%i] %v";
End-of-File

# real QA test starts here
cat <<End-of-File | pmie -t 2sec -d -Dappl1 -a archives/multi-vm00 -a archives/multi-vm01 -a archives/multi-vm02 -a archives/multi-vm03 >$tmp.out 2>$tmp.err &
f $tmp.pmie
l
r 10sec
v
End-of-File

wait

# strange but true ... sometimes don't need an echo here to deal
# with the pmie> (and no newline) prompt ...
#
case $PCP_PLATFORM
in
    darwin)
	: no
	;;
    *)
	: yes
	echo >>$tmp.out
    ;;
esac

echo >>$seq.full
echo "pmie PID $!" >>$seq.full
echo >>$seq.full
echo "=== pmie output ===" >>$seq.full
cat $tmp.out >>$seq.full
echo >>$seq.full
echo "=== pmie errors ===" >>$seq.full
cat $tmp.err >>$seq.full

_filter2 <$tmp.err | _filter
_filter <$tmp.out

# success, all done
status=0
exit