source: benchmark/Makefile.am @ 846c026

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 846c026 was 90cb6f7, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

begin updating benchmark build

  • Property mode set to 100644
File size: 14.8 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 : Tue Jan  7 15:37:42 2020
14## Update Count     : 70
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_JAVAC = $(__bench_v_JAVAC_$(__quiet))
34
35__quiet = verbose
36__bench_v_CC_quiet = @
37__bench_v_CFA_quiet = @
38__bench_v_CXX_quiet = @
39__bench_v_UPP_quiet = @
40__bench_v_GOC_quiet = @
41__bench_v_RUSTC_quiet = @
42__bench_v_JAVAC_quiet = @
43__bench_v_CC_verbose = $(AM_V_CC)
44__bench_v_CFA_verbose = $(AM_V_CFA)
45__bench_v_CXX_verbose = $(AM_V_CXX)
46__bench_v_UPP_verbose = $(AM_V_UPP)
47__bench_v_GOC_verbose = $(AM_V_GOC)
48__bench_v_RUSTC_verbose = $(AM_V_RUSTC)
49__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
50
51
52TOOLSDIR = ${abs_top_builddir}/tools/
53REPEAT   = ${abs_top_builddir}/tools/repeat
54STATS    = ${abs_top_srcdir}/tools/stat.py
55# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
56repeats  = 5 # 31 for benchmarks
57arch     = x64
58skipcompile = no
59TIME_FORMAT = "%E"
60PRINT_FORMAT = %20s: #Comments needed for spacing
61
62# Dummy hack tricks
63EXTRA_PROGRAMS = dummy # build but do not install
64dummy_SOURCES = dummyC.c dummyCXX.cpp
65
66dummyC.c:
67        @echo "int main() { return 0; }" > ${@}
68
69dummyCXX.cpp:
70        @echo "int main() { return 0; }" > ${@}
71
72.NOTPARALLEL:
73.PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv signal.csv
74
75## =========================================================================================================
76
77all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
78
79%.run : %$(EXEEXT) ${REPEAT}
80        @rm -f .result.log
81        @echo "------------------------------------------------------"
82        @echo $<
83        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
84        @${STATS} .result.log
85        @echo "------------------------------------------------------"
86        @rm -f a.out .result.log *.class
87
88%.runquiet :
89        @+make $(basename $@) CFLAGS="-w" __quiet=quiet
90        @taskset -c 1 ./a.out
91        @rm -f a.out
92
93%.make :
94        @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
95        @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
96
97${REPEAT} :
98        @+make -C ${abs_top_builddir}/tools repeat
99
100## =========================================================================================================
101
102FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
103
104jenkins$(EXEEXT):
105@DOifskipcompile@
106        @+make compile.csv
107        @-+make compile.diff.csv
108@DOendif@
109        @+make basic.csv
110        @-+make basic.diff.csv
111        @+make ctxswitch.csv
112        @-+make ctxswitch.diff.csv
113        @+make mutex.csv
114        @-+make mutex.diff.csv
115        @+make signal.csv
116        @-+make signal.diff.csv
117@DOifskipcompile@
118        cat compile.csv
119        -cat compile.diff.csv
120@DOendif@
121        cat basic.csv
122        -cat basic.diff.csv
123        cat ctxswitch.csv
124        -cat ctxswitch.diff.csv
125        cat mutex.csv
126        -cat mutex.diff.csv
127        cat signal.csv
128        -cat signal.diff.csv
129
130compile.csv:
131        @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
132        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
133        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
134        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
135        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
136        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
137        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
138        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
139        @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
140        @$(srcdir)/fixcsv.sh $@
141
142basic.csv:
143        @echo "generator,coroutine,thread" > $@
144        @+make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
145        @+make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
146        @+make basic-cfa_thread.runquiet >> $@
147        @$(srcdir)/fixcsv.sh $@
148
149ctxswitch.csv:
150        @echo "generator,coroutine,thread" > $@
151        @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
152        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
153        @+make ctxswitch-cfa_thread.runquiet >> $@
154        @$(srcdir)/fixcsv.sh $@
155
156mutex.csv:
157        @echo "1-monitor,2-monitor" > $@
158        @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
159        @+make mutex-cfa2.runquiet >> $@
160        @$(srcdir)/fixcsv.sh $@
161
162signal.csv:
163        @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
164        @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
165        @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
166        @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
167        @+make waitfor-cfa2.runquiet >> $@
168        @$(srcdir)/fixcsv.sh $@
169
170%.diff.csv: %.csv
171        @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
172        @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
173
174## =========================================================================================================
175
176BASIC_DEPEND  =                         \
177        basic-loop.run                  \
178        basic-function.run                      \
179        basic-fetch_add.run                     \
180        basic-ttst_lock.run                     \
181        basic-tls-fetch_add.run
182
183basic-loop$(EXEEXT):
184        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
185
186basic-function$(EXEEXT):
187        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
188
189basic-fetch_add$(EXEEXT):
190        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
191
192basic-ttst_lock$(EXEEXT):
193        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
194
195basic-tls-fetch_add$(EXEEXT):
196        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
197
198basic$(EXEEXT): $(BASIC_DEPEND)
199
200basic-loop.run : basic-loop$(EXEEXT) ${REPEAT}
201        @rm -f .result.log
202        @echo "------------------------------------------------------"
203        @echo $<
204        @${REPEAT} ${repeats} ./a.out 10000000000 | tee -a .result.log
205        @${STATS} .result.log
206        @echo "------------------------------------------------------"
207        @rm -f a.out .result.log *.class
208
209basic-function.run : basic-function$(EXEEXT) ${REPEAT}
210        @rm -f .result.log
211        @echo "------------------------------------------------------"
212        @echo $<
213        @${REPEAT} ${repeats} ./a.out 5000000000 | tee -a .result.log
214        @${STATS} .result.log
215        @echo "------------------------------------------------------"
216        @rm -f a.out .result.log *.class
217
218basic-%.run : basic-%$(EXEEXT) ${REPEAT}
219        @rm -f .result.log
220        @echo "------------------------------------------------------"
221        @echo $<
222        @${REPEAT} ${repeats} ./a.out 500000000 | tee -a .result.log
223        @${STATS} .result.log
224        @echo "------------------------------------------------------"
225        @rm -f a.out .result.log *.class
226
227## =========================================================================================================
228
229CTXSWITCH_DEPEND  =                     \
230        ctxswitch-pthread.run           \
231        ctxswitch-cfa_generator.run     \
232        ctxswitch-cfa_coroutine.run     \
233        ctxswitch-cfa_thread.run        \
234        ctxswitch-cfa_thread2.run       \
235        ctxswitch-upp_coroutine.run     \
236        ctxswitch-upp_thread.run        \
237        ctxswitch-goroutine.run         \
238        ctxswitch-rust_thread.run       \
239        ctxswitch-nodejs_thread.run     \
240        ctxswitch-java_thread.run
241
242if WITH_LIBFIBRE
243CTXSWITCH_DEPEND  +=                    \
244        ctxswitch-kos_fibre.run         \
245        ctxswitch-kos_fibre2.run
246
247ctxswitch-kos_fibre$(EXEEXT):
248        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
249
250ctxswitch-kos_fibre2$(EXEEXT):
251        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
252endif
253
254ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
255
256ctxswitch-pthread$(EXEEXT):
257        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
258
259ctxswitch-cfa_generator$(EXEEXT):
260        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
261
262ctxswitch-cfa_coroutine$(EXEEXT):
263        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
264
265ctxswitch-cfa_thread$(EXEEXT):
266        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
267
268ctxswitch-cfa_thread2$(EXEEXT):
269        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
270
271ctxswitch-upp_coroutine$(EXEEXT):
272        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
273
274ctxswitch-upp_thread$(EXEEXT):
275        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
276
277ctxswitch-goroutine$(EXEEXT):
278        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
279
280ctxswitch-rust_thread$(EXEEXT):
281        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
282
283ctxswitch-java_thread$(EXEEXT):
284        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
285        @echo "#!/bin/sh" > a.out
286        @echo "java JavaThread" >> a.out
287        @chmod a+x a.out
288
289ctxswitch-nodejs.run : ctxswitch-nodejs$(EXEEXT) ${REPEAT}
290        @rm -f .result.log
291        @echo "------------------------------------------------------"
292        @echo $<
293        @${REPEAT} ${repeats} node node_cor.js 50000000 | tee -a .result.log
294        @${STATS} .result.log
295        @echo "------------------------------------------------------"
296        @rm -f a.out .result.log *.class
297
298ctxswitch-%.run : ctxswitch-%$(EXEEXT) ${REPEAT}
299        @rm -f .result.log
300        @echo "------------------------------------------------------"
301        @echo $<
302        @${REPEAT} ${repeats} ./a.out 50000000 | tee -a .result.log
303        @${STATS} .result.log
304        @echo "------------------------------------------------------"
305        @rm -f a.out .result.log *.class
306
307## =========================================================================================================
308
309mutex$(EXEEXT) :                \
310        mutex-pthread.run       \
311        mutex-upp.run           \
312        mutex-cfa1.run          \
313        mutex-cfa2.run          \
314        mutex-cfa4.run          \
315        mutex-go.run            \
316        mutex-rust.run          \
317        mutex-java.run
318
319mutex-pthread$(EXEEXT):
320        $(BENCH_V_CC)$(COMPILE)     -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
321
322mutex-upp$(EXEEXT):
323        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
324
325mutex-cfa1$(EXEEXT):
326        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/cfa1.cfa
327
328mutex-cfa2$(EXEEXT):
329        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/cfa2.cfa
330
331mutex-cfa4$(EXEEXT):
332        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/cfa4.cfa
333
334mutex-go$(EXEEXT):
335        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
336
337mutex-rust$(EXEEXT):
338        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
339
340mutex-java$(EXEEXT):
341        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
342        @echo "#!/bin/sh" > a.out
343        @echo "java JavaThread" >> a.out
344        @chmod a+x a.out
345
346## =========================================================================================================
347
348signal$(EXEEXT) :               \
349        signal-pthread.run      \
350        signal-upp.run          \
351        signal-cfa1.run         \
352        signal-cfa2.run         \
353        signal-cfa4.run         \
354        signal-rust.run         \
355        signal-java.run
356
357signal-pthread$(EXEEXT):
358        $(BENCH_V_CC)$(COMPILE)     -DBENCH_N=5000000  $(srcdir)/schedint/pthreads.c
359
360signal-upp$(EXEEXT):
361        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/schedint/upp.cc
362
363signal-cfa1$(EXEEXT):
364        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/schedint/cfa1.cfa
365
366signal-cfa2$(EXEEXT):
367        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/schedint/cfa2.cfa
368
369signal-cfa4$(EXEEXT):
370        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/schedint/cfa4.cfa
371
372signal-rust$(EXEEXT):
373        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
374
375signal-java$(EXEEXT):
376        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
377        @echo "#!/bin/sh" > a.out
378        @echo "java JavaThread" >> a.out
379        @chmod a+x a.out
380
381## =========================================================================================================
382
383waitfor$(EXEEXT) :              \
384        waitfor-upp.run         \
385        waitfor-cfa1.run        \
386        waitfor-cfa2.run        \
387        waitfor-cfa4.run
388
389waitfor-upp$(EXEEXT):
390        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
391
392waitfor-cfa1$(EXEEXT):
393        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
394
395waitfor-cfa2$(EXEEXT):
396        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
397
398waitfor-cfa4$(EXEEXT):
399        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
400
401## =========================================================================================================
402
403creation$(EXEEXT) :                             \
404        creation-pthread.run                    \
405        creation-cfa_coroutine.run              \
406        creation-cfa_coroutine_eager.run        \
407        creation-cfa_thread.run                 \
408        creation-upp_coroutine.run              \
409        creation-upp_thread.run                 \
410        creation-goroutine.run                  \
411        creation-rust.run                       \
412        creation-java.run
413
414creation-cfa_coroutine$(EXEEXT):
415        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
416
417creation-cfa_coroutine_eager$(EXEEXT):
418        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
419
420creation-cfa_thread$(EXEEXT):
421        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
422
423creation-upp_coroutine$(EXEEXT):
424        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
425
426creation-upp_thread$(EXEEXT):
427        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
428
429creation-pthread$(EXEEXT):
430        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c
431
432creation-goroutine$(EXEEXT):
433        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
434
435creation-rust$(EXEEXT):
436        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
437
438creation-java$(EXEEXT):
439        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
440        @echo "#!/bin/sh" > a.out
441        @echo "java JavaThread" >> a.out
442        @chmod a+x a.out
443
444## =========================================================================================================
445
446compile$(EXEEXT) :              \
447        compile-array.make      \
448        compile-attributes.make \
449        compile-empty.make      \
450        compile-expression.make \
451        compile-io.make         \
452        compile-monitor.make    \
453        compile-operators.make  \
454        compile-typeof.make
455
456testdir = $(top_srcdir)/tests
457
458compile-array$(EXEEXT):
459        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
460
461compile-attributes$(EXEEXT):
462        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
463
464compile-empty$(EXEEXT):
465        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
466
467compile-expression$(EXEEXT):
468        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
469
470compile-io$(EXEEXT):
471        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
472
473compile-monitor$(EXEEXT):
474        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
475
476compile-operators$(EXEEXT):
477        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
478
479compile-thread$(EXEEXT):
480        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
481
482compile-typeof$(EXEEXT):
483        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.