source: benchmark/Makefile.am @ 32ce9b7

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 32ce9b7 was 4aac9ff, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Fixed jenkins benchmark

  • Property mode set to 100644
File size: 15.4 KB
Line 
1######################## -*- Mode: Makefile-Automake -*- ######################
2##
3## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
4##
5## The contents of this file are covered under the licence agreement in the
6## file "LICENCE" distributed with Cforall.
7##
8## Makefile.am --
9##
10## Author           : Peter A. Buhr
11## Created On       : Sun May 31 09:08:15 2015
12## Last Modified By : Peter A. Buhr
13## Last Modified On : Sat Jan 25 09:20:44 2020
14## Update Count     : 255
15###############################################################################
16
17AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
18ACLOCAL_AMFLAGS  = -I automake
19
20# applies to both programs
21include $(top_srcdir)/src/cfa.make
22
23AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
24AM_CFAFLAGS = -quiet -nodebug
25AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
26
27BENCH_V_CC = $(__bench_v_CC_$(__quiet))
28BENCH_V_CFA = $(__bench_v_CFA_$(__quiet))
29BENCH_V_CXX = $(__bench_v_CXX_$(__quiet))
30BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
31BENCH_V_GOC = $(__bench_v_GOC_$(__quiet))
32BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet))
33BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet))
34BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
35
36__quiet = verbose
37__bench_v_CC_quiet = @
38__bench_v_CFA_quiet = @
39__bench_v_CXX_quiet = @
40__bench_v_UPP_quiet = @
41__bench_v_GOC_quiet = @
42__bench_v_RUSTC_quiet = @
43__bench_v_JAVAC_quiet = @
44__bench_v_CC_verbose = $(AM_V_CC)
45__bench_v_CFA_verbose = $(AM_V_CFA)
46__bench_v_CXX_verbose = $(AM_V_CXX)
47__bench_v_UPP_verbose = $(AM_V_UPP)
48__bench_v_GOC_verbose = $(AM_V_GOC)
49__bench_v_RUSTC_verbose = $(AM_V_RUSTC)
50__bench_v_NODEJS_verbose = $(AM_V_NODEJS)
51__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
52
53
54TOOLSDIR = ${abs_top_builddir}/tools/
55REPEAT   = ${abs_top_builddir}/tools/repeat
56STATS    = ${abs_top_srcdir}/tools/stat.py
57# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
58repeats  = 13 # 31 for benchmarks
59arch     = x64
60skipcompile = no
61TIME_FORMAT = "%E"
62PRINT_FORMAT = %20s: #Comments needed for spacing
63
64# Dummy hack tricks
65EXTRA_PROGRAMS = dummy # build but do not install
66dummy_SOURCES = dummyC.c dummyCXX.cpp
67
68dummyC.c:
69        echo "int main() { return 0; }" > ${@}
70
71dummyCXX.cpp:
72        echo "int main() { return 0; }" > ${@}
73
74.SILENT:                # do not print recipe
75.NOTPARALLEL:
76.PHONY: jenkins cleancsv
77
78## =========================================================================================================
79
80all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
81
82basic_loop_DURATION = 15000000000
83basic_function_DURATION = 10000000000
84basic_tls_fetch_add_DURATION = 10000000000
85basic_DURATION = 250000000
86
87ctxswitch_pthread_DURATION = 25000000
88ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
89ctxswitch_cfa_generator_DURATION = 5000000000
90ctxswitch_nodejs_await_DURATION = 5000000
91ctxswitch_DURATION = 100000000
92
93#mutex_java_DURATION = 10000000
94mutex_DURATION = 50000000
95
96schedint_pthread_DURATION = 1000000
97schedint_java_DURATION = $(schedint_pthread_DURATION)
98schedint_rust_DURATION = $(schedint_pthread_DURATION)
99schedint_DURATION = 10000000
100
101schedext_DURATION = 10000000
102
103creation_pthread_DURATION = 250000
104creation_rust_thread_DURATION = ${creation_pthread_DURATION}
105creation_java_thread_DURATION = ${creation_pthread_DURATION}
106creation_cfa_coroutine_DURATION = 100000000
107creation_cfa_coroutine_eager_DURATION = 10000000
108creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION}
109creation_cfa_thread_DURATION = 10000000
110creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION}
111creation_DURATION = 10000000
112
113%.run : %$(EXEEXT) ${REPEAT}
114        rm -f .result.log
115        echo "------------------------------------------------------"
116        echo $<
117        ${REPEAT} ${repeats} -- ./a.out\
118                $(if ${$(subst -,_,$(basename $@))_DURATION},\
119                        ${$(subst -,_,$(basename $@))_DURATION},\
120                        ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log
121        ${STATS} .result.log
122        echo "------------------------------------------------------"
123        rm -f a.out .result.log *.class
124
125#       ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out
126
127%.runquiet :
128        +make $(basename $@) CFLAGS="-w" __quiet=quiet
129        taskset -c 1 ./a.out
130        rm -f a.out
131
132%.make :
133        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
134        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
135
136${REPEAT} :
137        +make -C ${abs_top_builddir}/tools repeat
138
139## =========================================================================================================
140
141FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
142
143cleancsv:
144        rm -f compile.csv basic.csv ctxswitch.csv mutex.csv schedint.csv
145
146jenkins$(EXEEXT): cleancsv
147@DOifskipcompile@
148        +make compile.csv
149        -+make compile.diff.csv
150@DOendif@
151        +make ctxswitch.csv
152        -+make ctxswitch.diff.csv
153        +make mutex.csv
154        -+make mutex.diff.csv
155        +make schedint.csv
156        -+make schedint.diff.csv
157@DOifskipcompile@
158        cat compile.csv
159        -cat compile.diff.csv
160@DOendif@
161        cat ctxswitch.csv
162        -cat ctxswitch.diff.csv
163        cat mutex.csv
164        -cat mutex.diff.csv
165        cat schedint.csv
166        -cat schedint.diff.csv
167
168compile.csv:
169        echo "building $@"
170        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
171        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
172        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
173        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
174        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
175        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
176        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
177        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
178        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
179        $(srcdir)/fixcsv.sh $@
180
181# basic.csv:
182#       echo "$@"
183#       echo "generator,coroutine,thread" > $@
184#       +make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
185#       +make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
186#       +make basic-cfa_thread.runquiet >> $@
187#       $(srcdir)/fixcsv.sh $@
188
189ctxswitch.csv:
190        echo "building $@"
191        echo "generator,coroutine,thread" > $@
192        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
193        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
194        +make ctxswitch-cfa_thread.runquiet >> $@
195        $(srcdir)/fixcsv.sh $@
196
197mutex.csv:
198        echo "building $@"
199        echo "1-monitor,2-monitor" > $@
200        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
201        +make mutex-cfa2.runquiet >> $@
202        $(srcdir)/fixcsv.sh $@
203
204schedint.csv:
205        echo "building $@"
206        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
207        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
208        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
209        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
210        +make schedext-cfa2.runquiet >> $@
211        $(srcdir)/fixcsv.sh $@
212
213%.diff.csv: %.csv
214        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
215        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
216
217## =========================================================================================================
218
219BASIC_DEPEND  =                                 \
220        basic-loop.run                          \
221        basic-function.run                      \
222        basic-fetch_add.run                     \
223        basic-ttst_lock.run                     \
224        basic-tls-fetch_add.run
225
226basic-loop$(EXEEXT):
227        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
228
229basic-function$(EXEEXT):
230        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
231
232basic-fetch_add$(EXEEXT):
233        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
234
235basic-ttst_lock$(EXEEXT):
236        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
237
238basic-tls-fetch_add$(EXEEXT):
239        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
240
241basic$(EXEEXT): $(BASIC_DEPEND)
242
243## =========================================================================================================
244
245CTXSWITCH_DEPEND  =                     \
246        ctxswitch-cfa_generator.run     \
247        ctxswitch-cfa_coroutine.run     \
248        ctxswitch-cfa_thread.run        \
249        ctxswitch-cfa_thread2.run       \
250        ctxswitch-upp_coroutine.run     \
251        ctxswitch-upp_thread.run        \
252        ctxswitch-python_coroutine.run  \
253        ctxswitch-nodejs_coroutine.run  \
254        ctxswitch-nodejs_await.run      \
255        ctxswitch-goroutine_thread.run  \
256        ctxswitch-rust_thread.run       \
257        ctxswitch-nodejs_coroutine.run  \
258        ctxswitch-java_thread.run       \
259        ctxswitch-pthread.run
260
261if WITH_LIBFIBRE
262CTXSWITCH_DEPEND  +=                    \
263        ctxswitch-kos_fibre.run         \
264        ctxswitch-kos_fibre2.run
265
266ctxswitch-kos_fibre$(EXEEXT):
267        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
268
269ctxswitch-kos_fibre2$(EXEEXT):
270        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
271endif
272
273ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
274
275ctxswitch-cfa_generator$(EXEEXT):
276        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
277
278ctxswitch-cfa_coroutine$(EXEEXT):
279        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
280
281ctxswitch-cfa_thread$(EXEEXT):
282        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
283
284ctxswitch-cfa_thread2$(EXEEXT):
285        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
286
287ctxswitch-upp_coroutine$(EXEEXT):
288        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
289
290ctxswitch-upp_thread$(EXEEXT):
291        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
292
293ctxswitch-python_coroutine$(EXEEXT):
294        echo "#!/bin/sh" > a.out
295        echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out
296        chmod a+x a.out
297
298ctxswitch-nodejs_coroutine$(EXEEXT):
299        echo "#!/bin/sh" > a.out
300        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
301        chmod a+x a.out
302
303ctxswitch-nodejs_await$(EXEEXT):
304        echo "#!/bin/sh" > a.out
305        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
306        chmod a+x a.out
307
308ctxswitch-goroutine_thread$(EXEEXT):
309        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
310
311ctxswitch-rust_thread$(EXEEXT):
312        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
313
314ctxswitch-java_thread$(EXEEXT):
315        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
316        echo "#!/bin/sh" > a.out
317        echo "java JavaThread" >> a.out
318        chmod a+x a.out
319
320ctxswitch-pthread$(EXEEXT):
321        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
322
323## =========================================================================================================
324
325mutex$(EXEEXT) :                \
326        mutex-cfa1.run          \
327        mutex-cfa2.run          \
328        mutex-cfa4.run          \
329        mutex-upp.run           \
330        mutex-go.run            \
331        mutex-rust.run          \
332        mutex-java.run          \
333        mutex-pthread.run
334
335mutex-pthread$(EXEEXT):
336        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
337
338mutex-cfa1$(EXEEXT):
339        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
340
341mutex-cfa2$(EXEEXT):
342        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
343
344mutex-cfa4$(EXEEXT):
345        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
346
347mutex-upp$(EXEEXT):
348        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
349
350mutex-go$(EXEEXT):
351        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
352
353mutex-rust$(EXEEXT):
354        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
355
356mutex-java$(EXEEXT):
357        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
358        echo "#!/bin/sh" > a.out
359        echo "java JavaThread" >> a.out
360        chmod a+x a.out
361
362## =========================================================================================================
363
364schedint$(EXEEXT) :             \
365        schedint-cfa1.run       \
366        schedint-cfa2.run       \
367        schedint-cfa4.run       \
368        schedint-upp.run        \
369        schedint-rust.run       \
370        schedint-java.run       \
371        schedint-pthread.run
372
373schedint-cfa1$(EXEEXT):
374        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
375
376schedint-cfa2$(EXEEXT):
377        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
378
379schedint-cfa4$(EXEEXT):
380        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
381
382schedint-upp$(EXEEXT):
383        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
384
385schedint-rust$(EXEEXT):
386        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
387
388schedint-java$(EXEEXT):
389        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
390        echo "#!/bin/sh" > a.out
391        echo "java JavaThread" >> a.out
392        chmod a+x a.out
393
394schedint-pthread$(EXEEXT):
395        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
396
397## =========================================================================================================
398
399schedext$(EXEEXT) :             \
400        schedext-cfa1.run       \
401        schedext-cfa2.run       \
402        schedext-cfa4.run       \
403        schedext-upp.run        \
404        schedext-goroutine.run
405
406schedext-cfa1$(EXEEXT):
407        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
408
409schedext-cfa2$(EXEEXT):
410        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
411
412schedext-cfa4$(EXEEXT):
413        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
414
415schedext-upp$(EXEEXT):
416        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
417
418schedext-goroutine$(EXEEXT):
419        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
420
421
422## =========================================================================================================
423
424creation$(EXEEXT) :                             \
425        creation-cfa_generator.run              \
426        creation-cfa_coroutine.run              \
427        creation-cfa_coroutine_eager.run        \
428        creation-cfa_thread.run                 \
429        creation-upp_coroutine.run              \
430        creation-upp_thread.run                 \
431        creation-python_coroutine.run           \
432        creation-nodejs_coroutine.run           \
433        creation-goroutine_thread.run           \
434        creation-rust_thread.run                \
435        creation-java_thread.run                \
436        creation-pthread.run
437
438creation-cfa_generator$(EXEEXT):
439        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
440
441creation-cfa_coroutine$(EXEEXT):
442        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
443
444creation-cfa_coroutine_eager$(EXEEXT):
445        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
446
447creation-cfa_thread$(EXEEXT):
448        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
449
450creation-upp_coroutine$(EXEEXT):
451        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
452
453creation-upp_thread$(EXEEXT):
454        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
455
456creation-python_coroutine$(EXEEXT):
457        echo "#!/bin/sh" > a.out
458        echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out
459        chmod a+x a.out
460
461creation-nodejs_coroutine$(EXEEXT):
462        echo "#!/bin/sh" > a.out
463        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
464        chmod a+x a.out
465
466creation-goroutine_thread$(EXEEXT):
467        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
468
469creation-rust_thread$(EXEEXT):
470        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
471
472creation-java_thread$(EXEEXT):
473        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
474        echo "#!/bin/sh" > a.out
475        echo "java JavaThread" >> a.out
476        chmod a+x a.out
477
478creation-pthread$(EXEEXT):
479        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
480
481## =========================================================================================================
482
483compile$(EXEEXT) :              \
484        compile-array.make      \
485        compile-attributes.make \
486        compile-empty.make      \
487        compile-expression.make \
488        compile-io.make         \
489        compile-monitor.make    \
490        compile-operators.make  \
491        compile-typeof.make
492
493testdir = $(top_srcdir)/tests
494
495compile-array$(EXEEXT):
496        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
497
498compile-attributes$(EXEEXT):
499        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
500
501compile-empty$(EXEEXT):
502        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
503
504compile-expression$(EXEEXT):
505        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
506
507compile-io$(EXEEXT):
508        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
509
510compile-monitor$(EXEEXT):
511        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
512
513compile-operators$(EXEEXT):
514        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
515
516compile-thread$(EXEEXT):
517        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
518
519compile-typeof$(EXEEXT):
520        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.