source: benchmark/Makefile.am @ c12869e

arm-ehjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since c12869e was c12869e, checked in by Peter A. Buhr <pabuhr@…>, 21 months ago

update benchmarks for concurrency paper

  • 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 : Mon Jan 20 11:50:13 2020
14## Update Count     : 244
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.ONESHELL:              # use one shell to execute recipe
76.NOTPARALLEL:
77.PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv signal.csv
78
79## =========================================================================================================
80
81all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
82
83basic_loop_DURATION = 15000000000
84basic_function_DURATION = 10000000000
85basic_tls_fetch_add_DURATION = 10000000000
86basic_DURATION = 250000000
87
88ctxswitch_pthread_DURATION = 25000000
89ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
90ctxswitch_cfa_generator_DURATION = 5000000000
91ctxswitch_DURATION = 100000000
92
93mutex_java_DURATION = 10000000
94mutex_DURATION = 50000000
95
96signal_pthread_DURATION = 1000000
97signal_java_DURATION = $(signal_pthread_DURATION)
98signal_rust_DURATION = $(signal_pthread_DURATION)
99signal_DURATION = 10000000
100
101waitfor_DURATION = 10000000
102
103creation_pthread_DURATION = 250000
104creation_rust_DURATION = ${creation_pthread_DURATION}
105creation_cfa_coroutine_DURATION = 100000000
106creation_cfa_coroutine_eager_DURATION = 10000000
107creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION}
108creation_cfa_thread_DURATION = 10000000
109creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION}
110creation_DURATION = 10000000
111
112%.run : %$(EXEEXT) ${REPEAT}
113        rm -f .result.log
114        echo "------------------------------------------------------"
115        echo $<
116        ${REPEAT} ${repeats} -- ./a.out\
117                $(if ${$(subst -,_,$(basename $@))_DURATION},\
118                        ${$(subst -,_,$(basename $@))_DURATION},\
119                        ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log
120        ${STATS} .result.log
121        echo "------------------------------------------------------"
122        rm -f a.out .result.log *.class
123
124#       ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out
125
126%.runquiet :
127        +make $(basename $@) CFLAGS="-w" __quiet=quiet
128        taskset -c 1 ./a.out
129        rm -f a.out
130
131%.make :
132        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
133        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
134
135${REPEAT} :
136        +make -C ${abs_top_builddir}/tools repeat
137
138## =========================================================================================================
139
140FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
141
142jenkins$(EXEEXT):
143@DOifskipcompile@
144        +make compile.csv
145        -+make compile.diff.csv
146@DOendif@
147        +make basic.csv
148        -+make basic.diff.csv
149        +make ctxswitch.csv
150        -+make ctxswitch.diff.csv
151        +make mutex.csv
152        -+make mutex.diff.csv
153        +make signal.csv
154        -+make signal.diff.csv
155@DOifskipcompile@
156        cat compile.csv
157        -cat compile.diff.csv
158@DOendif@
159        cat basic.csv
160        -cat basic.diff.csv
161        cat ctxswitch.csv
162        -cat ctxswitch.diff.csv
163        cat mutex.csv
164        -cat mutex.diff.csv
165        cat signal.csv
166        -cat signal.diff.csv
167
168compile.csv:
169        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
170        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
171        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
172        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
173        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
174        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
175        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
176        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
177        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
178        $(srcdir)/fixcsv.sh $@
179
180basic.csv:
181        echo "generator,coroutine,thread" > $@
182        +make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
183        +make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
184        +make basic-cfa_thread.runquiet >> $@
185        $(srcdir)/fixcsv.sh $@
186
187ctxswitch.csv:
188        echo "generator,coroutine,thread" > $@
189        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
190        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
191        +make ctxswitch-cfa_thread.runquiet >> $@
192        $(srcdir)/fixcsv.sh $@
193
194mutex.csv:
195        echo "1-monitor,2-monitor" > $@
196        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
197        +make mutex-cfa2.runquiet >> $@
198        $(srcdir)/fixcsv.sh $@
199
200signal.csv:
201        echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
202        +make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
203        +make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
204        +make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
205        +make waitfor-cfa2.runquiet >> $@
206        $(srcdir)/fixcsv.sh $@
207
208%.diff.csv: %.csv
209        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
210        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
211
212## =========================================================================================================
213
214BASIC_DEPEND  =                                 \
215        basic-loop.run                          \
216        basic-function.run                      \
217        basic-fetch_add.run                     \
218        basic-ttst_lock.run                     \
219        basic-tls-fetch_add.run
220
221basic-loop$(EXEEXT):
222        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
223
224basic-function$(EXEEXT):
225        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
226
227basic-fetch_add$(EXEEXT):
228        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
229
230basic-ttst_lock$(EXEEXT):
231        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
232
233basic-tls-fetch_add$(EXEEXT):
234        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
235
236basic$(EXEEXT): $(BASIC_DEPEND)
237
238## =========================================================================================================
239
240CTXSWITCH_DEPEND  =                     \
241        ctxswitch-cfa_generator.run     \
242        ctxswitch-cfa_coroutine.run     \
243        ctxswitch-cfa_thread.run        \
244        ctxswitch-cfa_thread2.run       \
245        ctxswitch-upp_coroutine.run     \
246        ctxswitch-upp_thread.run        \
247        ctxswitch-python_coroutine.run  \
248        ctxswitch-nodejs_coroutine.run  \
249        ctxswitch-goroutine_thread.run  \
250        ctxswitch-rust_thread.run       \
251        ctxswitch-nodejs_coroutine.run  \
252        ctxswitch-java_thread.run       \
253        ctxswitch-pthread.run
254
255if WITH_LIBFIBRE
256CTXSWITCH_DEPEND  +=                    \
257        ctxswitch-kos_fibre.run         \
258        ctxswitch-kos_fibre2.run
259
260ctxswitch-kos_fibre$(EXEEXT):
261        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
262
263ctxswitch-kos_fibre2$(EXEEXT):
264        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
265endif
266
267ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
268
269ctxswitch-cfa_generator$(EXEEXT):
270        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
271
272ctxswitch-cfa_coroutine$(EXEEXT):
273        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
274
275ctxswitch-cfa_thread$(EXEEXT):
276        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
277
278ctxswitch-cfa_thread2$(EXEEXT):
279        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
280
281ctxswitch-upp_coroutine$(EXEEXT):
282        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
283
284ctxswitch-upp_thread$(EXEEXT):
285        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
286
287ctxswitch-python_coroutine$(EXEEXT):
288        echo "#!/bin/sh" > a.out
289        echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out
290        chmod a+x a.out
291
292ctxswitch-nodejs_coroutine$(EXEEXT):
293        echo "#!/bin/sh" > a.out
294        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
295        chmod a+x a.out
296
297ctxswitch-goroutine_thread$(EXEEXT):
298        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
299
300ctxswitch-rust_thread$(EXEEXT):
301        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
302
303ctxswitch-java_thread$(EXEEXT):
304        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
305        echo "#!/bin/sh" > a.out
306        echo "java JavaThread" >> a.out
307        chmod a+x a.out
308
309ctxswitch-pthread$(EXEEXT):
310        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
311
312## =========================================================================================================
313
314mutex$(EXEEXT) :                \
315        mutex-cfa1.run          \
316        mutex-cfa2.run          \
317        mutex-cfa4.run          \
318        mutex-upp.run           \
319        mutex-go.run            \
320        mutex-rust.run          \
321        mutex-java.run          \
322        mutex-pthread.run
323
324mutex-pthread$(EXEEXT):
325        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
326
327mutex-cfa1$(EXEEXT):
328        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
329
330mutex-cfa2$(EXEEXT):
331        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
332
333mutex-cfa4$(EXEEXT):
334        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
335
336mutex-upp$(EXEEXT):
337        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
338
339mutex-go$(EXEEXT):
340        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
341
342mutex-rust$(EXEEXT):
343        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
344
345mutex-java$(EXEEXT):
346        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
347        echo "#!/bin/sh" > a.out
348        echo "java JavaThread" >> a.out
349        chmod a+x a.out
350
351## =========================================================================================================
352
353signal$(EXEEXT) :               \
354        signal-cfa1.run         \
355        signal-cfa2.run         \
356        signal-cfa4.run         \
357        signal-upp.run          \
358        signal-rust.run         \
359        signal-java.run         \
360        signal-pthread.run
361
362signal-pthread$(EXEEXT):
363        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
364
365signal-upp$(EXEEXT):
366        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
367
368signal-cfa1$(EXEEXT):
369        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
370
371signal-cfa2$(EXEEXT):
372        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
373
374signal-cfa4$(EXEEXT):
375        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
376
377signal-rust$(EXEEXT):
378        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
379
380signal-java$(EXEEXT):
381        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
382        echo "#!/bin/sh" > a.out
383        echo "java JavaThread" >> a.out
384        chmod a+x a.out
385
386## =========================================================================================================
387
388waitfor$(EXEEXT) :              \
389        waitfor-cfa1.run        \
390        waitfor-cfa2.run        \
391        waitfor-cfa4.run        \
392        waitfor-upp.run
393
394waitfor-upp$(EXEEXT):
395        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
396
397waitfor-cfa1$(EXEEXT):
398        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
399
400waitfor-cfa2$(EXEEXT):
401        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
402
403waitfor-cfa4$(EXEEXT):
404        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
405
406## =========================================================================================================
407
408creation$(EXEEXT) :                             \
409        creation-cfa_coroutine.run              \
410        creation-cfa_coroutine_eager.run        \
411        creation-cfa_thread.run                 \
412        creation-upp_coroutine.run              \
413        creation-upp_thread.run                 \
414        creation-python_coroutine.run           \
415        creation-nodejs_coroutine.run           \
416        creation-goroutine_thread.run           \
417        creation-rust_thread.run                \
418        creation-java_thread.run                \
419        creation-pthread.run
420
421creation-cfa_coroutine$(EXEEXT):
422        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
423
424creation-cfa_coroutine_eager$(EXEEXT):
425        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
426
427creation-cfa_thread$(EXEEXT):
428        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
429
430creation-upp_coroutine$(EXEEXT):
431        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
432
433creation-upp_thread$(EXEEXT):
434        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
435
436creation-python_coroutine$(EXEEXT):
437        echo "#!/bin/sh" > a.out
438        echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out
439        chmod a+x a.out
440
441creation-nodejs_coroutine$(EXEEXT):
442        echo "#!/bin/sh" > a.out
443        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
444        chmod a+x a.out
445
446creation-goroutine_thread$(EXEEXT):
447        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
448
449creation-rust_thread$(EXEEXT):
450        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
451
452creation-java$(EXEEXT):
453        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
454        echo "#!/bin/sh" > a.out
455        echo "java JavaThread" >> a.out
456        chmod a+x a.out
457
458creation-pthread$(EXEEXT):
459        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
460
461## =========================================================================================================
462
463compile$(EXEEXT) :              \
464        compile-array.make      \
465        compile-attributes.make \
466        compile-empty.make      \
467        compile-expression.make \
468        compile-io.make         \
469        compile-monitor.make    \
470        compile-operators.make  \
471        compile-typeof.make
472
473testdir = $(top_srcdir)/tests
474
475compile-array$(EXEEXT):
476        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
477
478compile-attributes$(EXEEXT):
479        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
480
481compile-empty$(EXEEXT):
482        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
483
484compile-expression$(EXEEXT):
485        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
486
487compile-io$(EXEEXT):
488        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
489
490compile-monitor$(EXEEXT):
491        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
492
493compile-operators$(EXEEXT):
494        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
495
496compile-thread$(EXEEXT):
497        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
498
499compile-typeof$(EXEEXT):
500        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.