26061762ff27ce6d549cb4205d90c3a6b9a32e35
[nit.git] / benchmarks / bench_languages.sh
1 #!/bin/bash
2 # This file is part of NIT ( http://www.nitlanguage.org ).
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 # This shell script helps running benchmarks
17
18 # TODO: cleanup and libify the helper-parts
19
20 source ./bench_plot.sh
21
22 ## CONFIGURATION OPTIONS ##
23
24 # Default number of times a command must be run with bench_command
25 # Can be overrided with 'the option -n'
26 count=2
27
28 ### HELPER FUNCTIONS ##
29
30 function die()
31 {
32 echo >&2 "error: $*"
33 died=1
34 }
35
36 # Run a single command multiple time and store the execution times
37 # in the current $res file.
38 #
39 # $1: title of the command
40 # $2: long desription of the command
41 # rest: the command to execute
42 function bench_command()
43 {
44 if [ "$dry_run" = "true" ]; then return; fi
45 local title="$1"
46 local desc="$2"
47 shift
48 shift
49 if test "$verbose" = true; then outputopts="/dev/stdout"; else outputopts="/dev/null"; fi
50 timeout="time.out"
51 echo "$title" > "$timeout"
52 echo "# $desc" >> "$timeout"
53 echo "\$ $@" >> "$timeout"
54 echo
55 echo "** [$title] $desc **"
56 echo " $ $@"
57
58 # Execute the commands $count times
59 for i in `seq 1 "$count"`; do
60 (ulimit -t 60; /usr/bin/time -f "%U" -o "$timeout" -a "$@") > $outputopts 2>&1 || die "$1: failed"
61 echo -n "$i. "
62 tail -n 1 "$timeout"
63 done
64
65 line=`compute_stats "$timeout"`
66 echo "$line ($res)"
67 echo $line >> "$res"
68 rm $timeout
69 }
70
71 # Run a simple command witout storing the execution time
72 # Used to display command on verbose and skip long executions when dry_run is given
73 # $@ command to execute
74 function run_command()
75 {
76 if [ "$dry_run" = "true" ]; then return; fi
77 echo " $ $@"
78 (ulimit -t 180; "$@") || die "$@: failed"
79 }
80
81 # Check if the test should be skiped according to its name
82 # $1: name of the test
83 # $2: description of the test
84 # $NOTSKIPED: arguments
85 function skip_test()
86 {
87 if test -z "$NOTSKIPED"; then
88 echo "* $1"
89 return 0
90 fi
91 if test "$NOTSKIPED" = "all"; then
92 : # Execute anyway
93 elif echo "$1" | egrep "$NOTSKIPED" >/dev/null 2>&1; then
94 : # Found one to execute
95 else
96 return 0
97 fi
98 echo "*"
99 echo "* $1 *****"
100 echo "*"
101 return 1
102 }
103
104 ## HANDLE OPTIONS ##
105
106 function usage()
107 {
108 echo "run_bench: [options]* benchname"
109 echo " -v: verbose mode"
110 echo " -n count: number of execution for each bar (default: $count)"
111 echo " --dry: Do not run the commands, just reuse the data and generate the graph"
112 echo " --fast: Run less and faster tests"
113 echo " -h: this help"
114 }
115
116 stop=false
117 while [ "$stop" = false ]; do
118 case "$1" in
119 -v) verbose=true; shift;;
120 -h) usage; exit;;
121 -n) count="$2"; shift; shift;;
122 --dry) dry_run=true; shift;;
123 --fast) fast=true; shift;;
124 *) stop=true
125 esac
126 done
127
128 NOTSKIPED="$*"
129
130 if test -z "$NOTSKIPED"; then
131 usage
132 echo "List of available benches:"
133 echo "* all: run all the benches"
134 fi
135
136 ## COMPILE ENGINES
137 cd ../src
138 test -f ./nitc_3 || ./ncall.sh -O
139 cd ../benchmarks
140 test -f ./nitg || ../src/nitc_3 ../src/nitg.nit -O -v
141
142 ## EFFECTIVE BENCHS ##
143
144 function bench_typetest_languages()
145 {
146 name="$FUNCNAME"
147 skip_test "$name" && return
148
149 t=t
150 s=20
151 seq="w2_h2 w50_h2 w2_h25 w50_h25"
152 for b in $seq; do
153 run_command ./nitg languages/gen.nit
154 run_command ./gen.bin "${t}_$b" "$b"
155 done
156
157 prepare_res "$name-g++.dat" "g++" "g++"
158 for b in $seq; do
159 run_command g++ "${t}_$b.cpp" -O2 -o "${t}_$b.g++.bin"
160 bench_command "$b" "" "./${t}_$b.g++.bin" $s
161 done
162
163 prepare_res "$name-clang++.dat" "clang++" "clang++"
164 for b in $seq; do
165 run_command clang++ "${t}_$b.cpp" -O2 -o "${t}_$b.clang++.bin"
166 bench_command "$b" "" "./${t}_$b.clang++.bin" $s
167 done
168
169 prepare_res "$name-java.dat" "java" "java"
170 for b in $seq; do
171 run_command javac ${t}_$b.java
172 bench_command "$b" "" java "${t}_$b" $s
173 done
174
175 prepare_res "$name-scala.dat" "scala" "scala"
176 for b in $seq; do
177 run_command scalac ${t}_$b.scala
178 bench_command "$b" "" scala "${t}_$b" $s
179 done
180
181 prepare_res "$name-cs.dat" "c#" "c#"
182 for b in $seq; do
183 run_command gmcs ${t}_$b.cs
184 bench_command "$b" "" mono "${t}_$b.exe" $s
185 done
186
187 prepare_res "$name-es.dat" "es" "es"
188 for b in $seq; do
189 run_command ec -clean -finalize ${t}_$b/app${t}_$b.e
190 chmod +x app${t}_$b
191 mv app${t}_$b ${t}_$b.es.bin
192 bench_command "$b" "" "./${t}_$b.es.bin" $s
193 done
194
195 prepare_res "$name-se.dat" "se" "se"
196 for b in $seq; do
197 run_command se compile -no_check app${t}_${b}_se.e -loadpath ${t}_${b}_se -o ${t}_$b.se.bin
198 bench_command "$b" "" "./${t}_$b.se.bin" $s
199 done
200
201 #too slow
202 #prepare_res "$name-nitg.dat" "nitg" "nitg"
203 #for b in $seq; do
204 # run_command ./nitg "${t}_$b.nit" -o "${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
205 # bench_command "$b" "" "./${t}_$b.nitg.bin" $s
206 #done
207
208 prepare_res "$name-nitg-s.dat" "nitg-s" "nitg-s"
209 for b in $seq; do
210 run_command ./nitg ${t}_$b.nit --separate -o "${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
211 bench_command "$b" "" "./${t}_$b.nitg-s.bin" $s
212 done
213
214 prepare_res "$name-nitg-su.dat" "nitg-su" "nitg-su"
215 for b in $seq; do
216 run_command ./nitg ${t}_$b.nit --separate --no-check-covariance -o "${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
217 bench_command "$b" "" "./${t}_$b.nitg-su.bin" $s
218 done
219
220
221 prepare_res "$name-nitg-e.dat" "nitg-e" "nitg-e"
222 for b in $seq; do
223 run_command ./nitg ${t}_$b.nit --erasure -o "${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
224 bench_command "$b" "" "./${t}_$b.nitg-e.bin" $s
225 done
226
227 prepare_res "$name-nitg-eu.dat" "nitg-eu" "nitg-eu"
228 for b in $seq; do
229 run_command ./nitg ${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
230 bench_command "$b" "" "./${t}_$b.nitg-eu.bin" $s
231 done
232
233 plot "$name.gnu"
234 }
235 bench_typetest_languages
236
237 function bench_typetest_depth()
238 {
239 name="$FUNCNAME"
240 skip_test "$name" && return
241 rootdir=`pwd`
242 basedir="./${name}.out"
243
244 mkdir $basedir
245
246 t=t
247 s=20
248 seq="10 25 50 100"
249 for b in $seq; do
250 run_command ./nitg languages/$name.nit -o $basedir/$name.bin
251 run_command $basedir/$name.bin $basedir "${t}_$b" "$b"
252 done
253
254 prepare_res $basedir/$name-g++.dat "g++" "g++"
255 cppdir="${basedir}/cpp"
256 for b in $seq; do
257 run_command g++ "${cppdir}/${t}_$b.cpp" -O2 -o "${cppdir}/${t}_$b.g++.bin"
258 bench_command "$b" "" "${cppdir}/${t}_$b.g++.bin" $s
259 done
260
261 prepare_res $basedir/$name-clang++.dat "clang++" "clang++"
262 for b in $seq; do
263 run_command clang++ "${cppdir}/${t}_$b.cpp" -O2 -o "${cppdir}/${t}_$b.clang++.bin"
264 bench_command "$b" "" "${cppdir}/${t}_$b.clang++.bin" $s
265 done
266
267 prepare_res $basedir/$name-java.dat "java" "java"
268 javadir="${basedir}/java"
269 for b in $seq; do
270 run_command javac "${javadir}/${t}_$b.java"
271 bench_command "$b" "" java -cp "${javadir}/" "${t}_$b" $s
272 done
273
274 prepare_res $basedir/$name-gcj.dat "gcj" "gcj"
275 for b in $seq; do
276 run_command gcj --main=${t}_$b -O2 "${javadir}/${t}_$b.java" -o "${javadir}/${t}_$b.gcj.bin"
277 bench_command "$b" "" "${javadir}/${t}_$b.gcj.bin" $s
278 done
279
280 prepare_res $basedir/$name-scala.dat "scala" "scala"
281 scaladir="${basedir}/scala"
282 for b in $seq; do
283 run_command scalac "${scaladir}/${t}_$b.scala" -d "${scaladir}"
284 bench_command "$b" "" scala -cp "${scaladir}/" "${t}_$b" $s
285 done
286
287 prepare_res $basedir/$name-cs.dat "c#" "c#"
288 csdir="${basedir}/cs"
289 for b in $seq; do
290 run_command gmcs "$csdir/${t}_$b.cs"
291 bench_command "$b" "" mono "$csdir/${t}_$b.exe" $s
292 done
293
294 prepare_res $basedir/$name-es.dat "es" "es"
295 esdir="${basedir}/es"
296 for b in $seq; do
297 cd $esdir
298 run_command ec -clean -finalize ${t}_$b/app${t}_$b.e
299 chmod +x app${t}_$b
300 mv app${t}_$b ${t}_$b.es.bin
301 cd $rootdir
302 bench_command "$b" "" "$esdir/${t}_$b.es.bin" $s
303 done
304
305 prepare_res $basedir/$name-se.dat "se" "se"
306 sedir="${basedir}/se"
307 for b in $seq; do
308 cd $sedir
309 run_command se compile -no_check app${t}_${b}_se.e -loadpath ${t}_${b}_se -o ${t}_$b.se.bin
310 cd $rootdir
311 bench_command "$b" "" "$sedir/${t}_$b.se.bin" $s
312 done
313
314 nitdir="${basedir}/nit"
315 prepare_res $nitdir/$name-nitg.dat "nitg" "nitg"
316 for b in $seq; do
317 run_command ./nitg $nitdir/${t}_$b.nit -o "$nitdir/${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
318 bench_command "$b" "" "$nitdir/${t}_$b.nitg.bin" $s
319 done
320
321 prepare_res $nitdir/$name-nitg-s.dat "nitg-s" "nitg-s"
322 for b in $seq; do
323 run_command ./nitg $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
324 bench_command "$b" "" "$nitdir/${t}_$b.nitg-s.bin" $s
325 done
326
327 tg="nitg-s-bm"
328 prepare_res $nitdir/$name-$tg.dat "$tg" "$tg"
329 for b in $seq; do
330 run_command ./nitg $nitdir/${t}_$b.nit --separate --bm-typing -o "$nitdir/${t}_$b.$tg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
331 bench_command "$b" "" "$nitdir/${t}_$b.$tg.bin" $s
332 done
333
334 tg="nitg-s-pha"
335 prepare_res $nitdir/$name-$tg.dat "$tg" "$tg"
336 for b in $seq; do
337 run_command ./nitg $nitdir/${t}_$b.nit --separate --phand-typing -o "$nitdir/${t}_$b.$tg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
338 bench_command "$b" "" "$nitdir/${t}_$b.$tg.bin" $s
339 done
340
341 tg="nitg-s-phm"
342 prepare_res $nitdir/$name-$tg.dat "$tg" "$tg"
343 for b in $seq; do
344 run_command ./nitg $nitdir/${t}_$b.nit --separate --phmod-typing -o "$nitdir/${t}_$b.$tg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
345 bench_command "$b" "" "$nitdir/${t}_$b.$tg.bin" $s
346 done
347
348 prepare_res $nitdir/$name-nitg-su.dat "nitg-su" "nitg-su"
349 for b in $seq; do
350 run_command ./nitg $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
351 bench_command "$b" "" "$nitdir/${t}_$b.nitg-su.bin" $s
352 done
353
354 prepare_res $nitdir/$name-nitg-e.dat "nitg-e" "nitg-e"
355 for b in $seq; do
356 run_command ./nitg $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
357 bench_command "$b" "" "$nitdir/${t}_$b.nitg-e.bin" $s
358 done
359
360 prepare_res $nitdir/$name-nitg-eu.dat "nitg-eu" "nitg-eu"
361 for b in $seq; do
362 run_command ./nitg $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
363 bench_command "$b" "" "$nitdir/${t}_$b.nitg-eu.bin" $s
364 done
365
366 plot $basedir/$name.gnu
367 }
368 bench_typetest_depth
369
370 function bench_typetest_fts_depth()
371 {
372 name="$FUNCNAME"
373 skip_test "$name" && return
374 rootdir=`pwd`
375 basedir="./${name}.out"
376
377 mkdir $basedir
378
379 t=t
380 s=20
381 seq="10 25 50 100"
382 for b in $seq; do
383 run_command ./nitg languages/$name.nit -o $basedir/$name.bin
384 run_command $basedir/$name.bin $basedir "${t}_$b" "$b"
385 done
386
387 prepare_res $basedir/$name-cs.dat "c#" "c#"
388 csdir="${basedir}/cs"
389 for b in $seq; do
390 run_command gmcs "$csdir/${t}_$b.cs"
391 bench_command "$b" "" mono "$csdir/${t}_$b.exe" $s
392 done
393
394 prepare_res $basedir/$name-es.dat "es" "es"
395 esdir="${basedir}/es"
396 for b in $seq; do
397 cd $esdir
398 run_command ec -clean -finalize ${t}_$b/app${t}_$b.e
399 chmod +x app${t}_$b
400 mv app${t}_$b ${t}_$b.es.bin
401 cd $rootdir
402 bench_command "$b" "" "$esdir/${t}_$b.es.bin" $s
403 done
404
405 prepare_res $basedir/$name-se.dat "se" "se"
406 sedir="${basedir}/se"
407 for b in $seq; do
408 cd $sedir
409 run_command se compile -no_check app${t}_${b}_se.e -loadpath ${t}_${b}_se -o ${t}_$b.se.bin
410 cd $rootdir
411 bench_command "$b" "" "$sedir/${t}_$b.se.bin" $s
412 done
413
414 nitdir="${basedir}/nit"
415 prepare_res $nitdir/$name-nitg.dat "nitg" "nitg"
416 for b in $seq; do
417 run_command ./nitg $nitdir/${t}_$b.nit -o "$nitdir/${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
418 bench_command "$b" "" "$nitdir/${t}_$b.nitg.bin" $s
419 done
420
421 prepare_res $nitdir/$name-nitg-s.dat "nitg-s" "nitg-s"
422 for b in $seq; do
423 run_command ./nitg $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
424 bench_command "$b" "" "$nitdir/${t}_$b.nitg-s.bin" $s
425 done
426
427 prepare_res $nitdir/$name-nitg-su.dat "nitg-su" "nitg-su"
428 for b in $seq; do
429 run_command ./nitg $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
430 bench_command "$b" "" "$nitdir/${t}_$b.nitg-su.bin" $s
431 done
432
433 prepare_res $nitdir/$name-nitg-e.dat "nitg-e" "nitg-e"
434 for b in $seq; do
435 run_command ./nitg $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
436 bench_command "$b" "" "$nitdir/${t}_$b.nitg-e.bin" $s
437 done
438
439 prepare_res $nitdir/$name-nitg-eu.dat "nitg-eu" "nitg-eu"
440 for b in $seq; do
441 run_command ./nitg $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
442 bench_command "$b" "" "$nitdir/${t}_$b.nitg-eu.bin" $s
443 done
444
445 plot $basedir/$name.gnu
446 }
447 bench_typetest_fts_depth
448
449 function bench_typetest_fts_width()
450 {
451 name="$FUNCNAME"
452 skip_test "$name" && return
453 rootdir=`pwd`
454 basedir="./${name}.out"
455
456 mkdir $basedir
457
458 t=t
459 s=20
460 depth=10
461 seq="1 2 5 10"
462 for b in $seq; do
463 run_command ./nitg languages/$name.nit -o $basedir/$name.bin
464 run_command $basedir/$name.bin $basedir "${t}_$b" $depth $b
465 done
466
467 prepare_res $basedir/$name-cs.dat "c#" "c#"
468 csdir="${basedir}/cs"
469 for b in $seq; do
470 run_command gmcs "$csdir/${t}_$b.cs"
471 bench_command "$b" "" mono "$csdir/${t}_$b.exe" $s
472 done
473
474 prepare_res $basedir/$name-es.dat "es" "es"
475 esdir="${basedir}/es"
476 for b in $seq; do
477 cd $esdir
478 run_command ec -clean -finalize ${t}_$b/app${t}_$b.e
479 chmod +x app${t}_$b
480 mv app${t}_$b ${t}_$b.es.bin
481 cd $rootdir
482 bench_command "$b" "" "$esdir/${t}_$b.es.bin" $s
483 done
484
485 prepare_res $basedir/$name-se.dat "se" "se"
486 sedir="${basedir}/se"
487 for b in $seq; do
488 cd $sedir
489 run_command se compile -no_check app${t}_${b}_se.e -loadpath ${t}_${b}_se -o ${t}_$b.se.bin
490 cd $rootdir
491 bench_command "$b" "" "$sedir/${t}_$b.se.bin" $s
492 done
493
494 nitdir="${basedir}/nit"
495
496 prepare_res $nitdir/$name-nitg.dat "nitg" "nitg"
497 for b in $seq; do
498 run_command ./nitg $nitdir/${t}_$b.nit -o "$nitdir/${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
499 bench_command "$b" "" "$nitdir/${t}_$b.nitg.bin" $s
500 done
501
502 prepare_res $nitdir/$name-nitg-s.dat "nitg-s" "nitg-s"
503 for b in $seq; do
504 run_command ./nitg $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
505 bench_command "$b" "" "$nitdir/${t}_$b.nitg-s.bin" $s
506 done
507
508 prepare_res $nitdir/$name-nitg-su.dat "nitg-su" "nitg-su"
509 for b in $seq; do
510 run_command ./nitg $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
511 bench_command "$b" "" "$nitdir/${t}_$b.nitg-su.bin" $s
512 done
513
514 prepare_res $nitdir/$name-nitg-e.dat "nitg-e" "nitg-e"
515 for b in $seq; do
516 run_command ./nitg $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
517 bench_command "$b" "" "$nitdir/${t}_$b.nitg-e.bin" $s
518 done
519
520 prepare_res $nitdir/$name-nitg-eu.dat "nitg-eu" "nitg-eu"
521 for b in $seq; do
522 run_command ./nitg $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
523 bench_command "$b" "" "$nitdir/${t}_$b.nitg-eu.bin" $s
524 done
525
526 plot $basedir/$name.gnu
527 }
528 bench_typetest_fts_width
529
530 function bench_typetest_fts_nesting()
531 {
532 name="$FUNCNAME"
533 skip_test "$name" && return
534 rootdir=`pwd`
535 basedir="./${name}.out"
536
537 mkdir $basedir
538
539 t=t
540 s=20
541 depth=5
542 seq="1 2 5 10"
543 for b in $seq; do
544 run_command ./nitg languages/$name.nit -o $basedir/$name.bin
545 run_command $basedir/$name.bin $basedir "${t}_$b" $depth $b
546 done
547
548 prepare_res $basedir/$name-cs.dat "c#" "c#"
549 csdir="${basedir}/cs"
550 for b in $seq; do
551 run_command gmcs "$csdir/${t}_$b.cs"
552 bench_command "$b" "" mono "$csdir/${t}_$b.exe" $s
553 done
554
555 prepare_res $basedir/$name-es.dat "es" "es"
556 esdir="${basedir}/es"
557 for b in $seq; do
558 cd $esdir
559 run_command ec -clean -finalize ${t}_$b/app${t}_$b.e
560 chmod +x app${t}_$b
561 mv app${t}_$b ${t}_$b.es.bin
562 cd $rootdir
563 bench_command "$b" "" "$esdir/${t}_$b.es.bin" $s
564 done
565
566 prepare_res $basedir/$name-se.dat "se" "se"
567 sedir="${basedir}/se"
568 for b in $seq; do
569 cd $sedir
570 run_command se compile -no_check app${t}_${b}_se.e -loadpath ${t}_${b}_se -o ${t}_$b.se.bin
571 cd $rootdir
572 bench_command "$b" "" "$sedir/${t}_$b.se.bin" $s
573 done
574
575 nitdir="${basedir}/nit"
576
577 prepare_res $nitdir/$name-nitg.dat "nitg" "nitg"
578 for b in $seq; do
579 run_command ./nitg $nitdir/${t}_$b.nit -o "$nitdir/${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
580 bench_command "$b" "" "$nitdir/${t}_$b.nitg.bin" $s
581 done
582
583 prepare_res $nitdir/$name-nitg-s.dat "nitg-s" "nitg-s"
584 for b in $seq; do
585 run_command ./nitg $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
586 bench_command "$b" "" "$nitdir/${t}_$b.nitg-s.bin" $s
587 done
588
589 prepare_res $nitdir/$name-nitg-su.dat "nitg-su" "nitg-su"
590 for b in $seq; do
591 run_command ./nitg $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
592 bench_command "$b" "" "$nitdir/${t}_$b.nitg-su.bin" $s
593 done
594
595 prepare_res $nitdir/$name-nitg-e.dat "nitg-e" "nitg-e"
596 for b in $seq; do
597 run_command ./nitg $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
598 bench_command "$b" "" "$nitdir/${t}_$b.nitg-e.bin" $s
599 done
600
601 prepare_res $nitdir/$name-nitg-eu.dat "nitg-eu" "nitg-eu"
602 for b in $seq; do
603 run_command ./nitg $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
604 bench_command "$b" "" "$nitdir/${t}_$b.nitg-eu.bin" $s
605 done
606
607 plot $basedir/$name.gnu
608 }
609 bench_typetest_fts_nesting
610
611 if test -n "$died"; then
612 echo "Some commands failed"
613 exit 1
614 fi
615 exit 0