History

added a scale testing scripts and a stupid timestamp dt calculator.

John (EBo) David committed 15 years ago

Commit 3e27bdf1 parent 1bdcd093 files · +327 −0Browse files

Unified · Split

3 files
  1. sys/src/cmd/uem/tests/scale.rc +165 −0
  2. sys/src/cmd/uem/tests/scale_run.rc +54 −0
  3. sys/src/cmd/uem/tests/time-stat.c +108 −0
sys/src/cmd/uem/tests/scale.rc+165−0
@@ -0,0 +1,165 @@
1+#!/bin/rc
2+#
3+# Pretend to mimic the BG/P setup
4+#
5+
6+echo '== Test gangfs across a simulated BlueGene/P node structure =='
7+
8+# fake the IO node's IP
9+IO=128.0.1
10+IP=11.$IO
11+
12+#
13+# Parameters
14+#
15+if(~ $#* 0 1) DEBUG=''
16+if not DEBUG=$2
17+
18+#if(~ $#* 1) {
19+# DEBUG=''
20+#}
21+#if not {
22+# DEBUG=$2
23+#}
24+echo 'DEBUG='$DEBUG
25+
26+#TESTDIR=.test/pbg
27+TESTDIR=/tmp/testbed/pbg
28+
29+GANGLOG=$TESTDIR'/gangfs'-$IP'.log'
30+EXECLOG=$TESTDIR'/exec2fs'-$IP'.log'
31+MPIPELOG=$TESTDIR'/mpipefs'-$IP'.log'
32+ERRORLOG=$TESTDIR'/error.log'
33+
34+G_MNTPATH=/n/$IP/proc
35+
36+#CMD='/bin/date'
37+CMD='../8.poke -L '$TESTDIR
38+
39+# setup
40+#
41+#NUM=64 # succeds on 9vx with extended memory and procs
42+#NUM=75 # succeds on 9vx with extended memory and procs
43+#NUM=80 # fails
44+
45+# 16 should always work
46+NUM=$1
47+
48+TIMINGTST=$TESTDIR'/time_'$NUM'.dat'
49+
50+I_MAX=1
51+J_MAX=1
52+K_MAX=4
53+
54+fn enum_tests {
55+ TESTNUM=`{awk 'BEGIN {
56+ for (i = 1; i <= '$1'; i++) printf "%d ", i
57+ exit }'}
58+ #`# shut up the code coloring bug...
59+}
60+
61+fn enum_srv {
62+ SRVNUM=`{awk 'BEGIN {
63+ for (i=0; i<'$I_MAX'; i++)
64+ for (j=0; j<'$J_MAX'; j++)
65+ for (k=1; k<='$K_MAX'; k++)
66+ printf "%d.%d.%d ", i, j, k
67+ exit }'}
68+ #`# shut up the code coloring bug...
69+}
70+
71+#
72+# Setup a testdirp
73+#
74+fn testdir {
75+ echo 'TESTDIR='$TESTDIR
76+ mkdir -p $TESTDIR
77+}
78+
79+fn myexec {
80+ mypid=`{cat} #`
81+
82+ echo -n 'RES: ' >> $TIMINGTST
83+ ../$O.poke -N >> $TIMINGTST
84+ echo res $NUM>>[2] $ERRORLOG
85+
86+ echo -n 'EXEC: ' >> $TIMINGTST
87+ ../$O.poke -N >> $TIMINGTST
88+ echo exec $CMD>>[2] $ERRORLOG
89+
90+ echo -n 'AGG: ' >> $TIMINGTST
91+ ../$O.poke -N >> $TIMINGTST
92+ cat $G_MNTPATH/g$mypid/stdout > $TESTDIR/test1 >>[2] $ERRORLOG
93+
94+ echo -n 'TERM: ' >> $TIMINGTST
95+ ../$O.poke -N >> $TIMINGTST
96+}
97+
98+fn basic {
99+ echo -n 'Basic Test for NUM='$NUM' procs....'
100+
101+ # initialize files
102+ echo > $TESTDIR/test1
103+
104+ # execute test
105+ myexec <>$G_MNTPATH/gclone >[1=0]
106+
107+ # verify results -- date returns time time in seconds, so
108+ # simply varify that the number of procs returned are the same
109+ # as those requested.
110+ LEN=`{wc -l $TESTDIR/test1 | sed 's% *[a-zA-Z0-9/.]*$%%'} #`
111+ echo -n ' (LEN='$LEN') '
112+ if(! ~ $LEN $NUM) {
113+ echo FAILED!
114+ exit 'stdout: test failed'
115+ }
116+
117+ echo Success!
118+ # cleanup
119+ #rm -rf $TESTDIR/*
120+}
121+
122+
123+# Setup
124+rfork
125+
126+#cleanup
127+rm -f $TESTDIR'/error.log'
128+rm -f $TESTDIR'/gangfs'* $MPIPELOG $TESTDIR'/mpipefs'* $TESTDIR'/execfs'*
129+
130+testdir
131+
132+enum_srv
133+
134+########################################
135+
136+echo -n 'BEGIN: ' > $TIMINGTST
137+../$O.poke -N >> $TIMINGTST
138+
139+# fake the BG/P profile (1 I/O node and 4 CPU nodes)
140+echo '############ starting next '$IP' ############' >>[2] $GANGLOG
141+cpunode=0 treeip=$IO profile.pbg $DEBUG
142+
143+#srvfs io /n/$IP
144+
145+# generate tje fake CPU nodes and moutn them
146+for(i in $SRVNUM){
147+ echo '############ starting next '11.$i' ############' >>[2] $GANGLOG
148+ cpunode=1 treeip=$i profile.pbg $DEBUG
149+}
150+
151+########################################
152+
153+# Tests
154+basic
155+
156+echo -n 'DONE: ' >> $TIMINGTST
157+../$O.poke -N >> $TIMINGTST
158+
159+SCALETST=pbg_scale
160+mkdir -p $SCALETST
161+cp $TIMINGTST $SCALETST
162+
163+# Cleanup
164+#rm -rf $TESTDIR
165+#cleanup
sys/src/cmd/uem/tests/scale_run.rc+54−0
@@ -0,0 +1,54 @@
1+#!/bin/rc
2+#
3+# a UEM Scale Test Run
4+#
5+
6+R_MAX=16
7+#R_MAX=2048
8+
9+TESTNUM=''
10+
11+fn enum_tests {
12+ switch($#*){
13+ case 0
14+ TESTNUM=`{awk 'BEGIN {
15+ for (i = 1; i <= '$R_MAX'; i*=2) printf "%d ",i
16+ exit }'}
17+ #`# shut up the code coloring bug...
18+ case 1
19+ TESTNUM=`{awk 'BEGIN {
20+ for (i = 1; i <= '$R_MAX'; i*=2) printf "%d_%d ",i,'$1'
21+ exit }'}
22+ #`# shut up the code coloring bug...
23+ case *
24+ echo Usage: tests ... >[1=2]
25+ exit usage
26+ }
27+}
28+
29+enum_tests
30+#if(~ $#* 0) enum_tests
31+#if not enum_tests $1
32+
33+echo -n 'TESTNUM= '
34+echo $TESTNUM
35+
36+EXT='1'
37+
38+for(i in $TESTNUM){
39+ echo '############ starting next '$i' ############'
40+ mk tidy
41+ rc scale.rc $i 0x00
42+
43+ echo '############ processing /'$i'/ ############'
44+ if(~ $#* 0) {
45+ mv pbg_scale/time_$i^.dat pbg_scale/time_$i^_sav.dat
46+ $O.time-stat -i pbg_scale/time_$i^_sav.dat -o pbg_scale/time_$i^.out
47+ }
48+ if not {
49+ mv pbg_scale/time_$i^.dat pbg_scale/time_$i^_$1^_sav.dat
50+ $O.time-stat -i pbg_scale/time_$i^_$1^_sav.dat -o pbg_scale/time_$i^_$1^.out
51+ }
52+ mk tidy
53+ echo ''
54+}
sys/src/cmd/uem/tests/time-stat.c+108−0
@@ -0,0 +1,108 @@
1+/*
2+ time-stat -- a trivial utility to calculate the dt stats from nsec(poke) info
3+*/
4+
5+#include <u.h>
6+#include <stdio.h>
7+#include <libc.h>
8+
9+#define MAXSTR 256
10+#define MAXTAG 32
11+#define MAXENT 32
12+
13+int chatty = 0;
14+char *mppath;
15+
16+typedef struct Ent Ent;
17+struct Ent {
18+ char tag[MAXSTR];
19+ vlong tstamp;
20+};
21+
22+Ent ent[MAXENT];
23+
24+static void
25+usage(void)
26+{
27+ fprint(2, "time-stat ...\n");
28+ exits("usage");
29+}
30+
31+/* data format:
32+ char * tag
33+ vlong time in nsec
34+*/
35+
36+void
37+main(int argc, char *argv[])
38+{
39+ int i, n;
40+ FILE *fin=nil;
41+ FILE *fout=nil;
42+ int fdout;
43+ char *arg;
44+ int list = 0;
45+
46+ ARGBEGIN{
47+ case 'l':
48+ list = 1;
49+ break;
50+ case 'i':
51+ arg=ARGF();
52+ fin = fopen(arg, "r");
53+ if(fin==nil){
54+ fprint(2, "couldn't open input file %s\n", arg);
55+ exits("open input file");
56+ }
57+ break;
58+ case 'o':
59+ arg=ARGF();
60+ fout = fopen(arg, "w");
61+ if(fout==nil){
62+ fprint(2, "couldn't open output file %s\n", arg);
63+ exits("open output file");
64+ }
65+ break;
66+ default:
67+ usage();
68+ }ARGEND
69+
70+ if(argc != 0)
71+ usage();
72+
73+ if(fin==nil || fout==nil)
74+ usage();
75+
76+ fdout = fileno(fout);
77+
78+ /* read in the data */
79+ for (i=0; i<MAXENT; i++){
80+ n = fscanf(fin, "%s%ld", ent[i].tag, &(ent[i].tstamp));
81+ if(n<=0)
82+ break;
83+ }
84+
85+ if(i>=MAXENT){
86+ fprint(2, "*error*: ran out of space\n");
87+ exits("out of space");
88+ }
89+
90+ /* process what we have */
91+ for (n=0; n<i; n++){
92+ fprint(fdout,"%lld %s\n", ent[n].tstamp, ent[n].tag);
93+ }
94+
95+ /* process what we have */
96+ vlong dt;
97+ for (n=1; n<i; n++){
98+ dt = ent[n].tstamp - ent[n-1].tstamp;
99+ fprint(fdout,"%lld (%s-%s)\n", dt, ent[n].tag, ent[n-1].tag);
100+ }
101+ /* do the total */
102+ dt = ent[i-1].tstamp - ent[0].tstamp;
103+ fprint(fdout,"%lld total=(%s-%s)\n", dt, ent[i-1].tag, ent[0].tag);
104+
105+ fclose(fin);
106+ fclose(fout);
107+ exits(0);
108+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t