source: benchmark/Makefile.am @ 2316525

arm-ehenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since 2316525 was 2316525, checked in by Peter A. Buhr <pabuhr@…>, 2 years ago

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 14.3 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 : Sun Jan 19 12:55:02 2020
14## Update Count     : 232
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  = 5 # 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} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./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%.runquiet :
125        +make $(basename $@) CFLAGS="-w" __quiet=quiet
126        taskset -c 1 ./a.out
127        rm -f a.out
128
129%.make :
130        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
131        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
132
133${REPEAT} :
134        +make -C ${abs_top_builddir}/tools repeat
135
136## =========================================================================================================
137
138FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
139
140jenkins$(EXEEXT):
141@DOifskipcompile@
142        +make compile.csv
143        -+make compile.diff.csv
144@DOendif@
145        +make basic.csv
146        -+make basic.diff.csv
147        +make ctxswitch.csv
148        -+make ctxswitch.diff.csv
149        +make mutex.csv
150        -+make mutex.diff.csv
151        +make signal.csv
152        -+make signal.diff.csv
153@DOifskipcompile@
154        cat compile.csv
155        -cat compile.diff.csv
156@DOendif@
157        cat basic.csv
158        -cat basic.diff.csv
159        cat ctxswitch.csv
160        -cat ctxswitch.diff.csv
161        cat mutex.csv
162        -cat mutex.diff.csv
163        cat signal.csv
164        -cat signal.diff.csv
165
166compile.csv:
167        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
168        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
169        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
170        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
171        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
172        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
173        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
174        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
175        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
176        $(srcdir)/fixcsv.sh $@
177
178basic.csv:
179        echo "generator,coroutine,thread" > $@
180        +make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
181        +make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
182        +make basic-cfa_thread.runquiet >> $@
183        $(srcdir)/fixcsv.sh $@
184
185ctxswitch.csv:
186        echo "generator,coroutine,thread" > $@
187        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
188        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
189        +make ctxswitch-cfa_thread.runquiet >> $@
190        $(srcdir)/fixcsv.sh $@
191
192mutex.csv:
193        echo "1-monitor,2-monitor" > $@
194        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
195        +make mutex-cfa2.runquiet >> $@
196        $(srcdir)/fixcsv.sh $@
197
198signal.csv:
199        echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
200        +make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
201        +make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
202        +make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
203        +make waitfor-cfa2.runquiet >> $@
204        $(srcdir)/fixcsv.sh $@
205
206%.diff.csv: %.csv
207        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
208        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
209
210## =========================================================================================================
211
212BASIC_DEPEND  =                                 \
213        basic-loop.run                          \
214        basic-function.run                      \
215        basic-fetch_add.run                     \
216        basic-ttst_lock.run                     \
217        basic-tls-fetch_add.run
218
219basic-loop$(EXEEXT):
220        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
221
222basic-function$(EXEEXT):
223        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
224
225basic-fetch_add$(EXEEXT):
226        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
227
228basic-ttst_lock$(EXEEXT):
229        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
230
231basic-tls-fetch_add$(EXEEXT):
232        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
233
234basic$(EXEEXT): $(BASIC_DEPEND)
235
236## =========================================================================================================
237
238CTXSWITCH_DEPEND  =                     \
239        ctxswitch-pthread.run           \
240        ctxswitch-cfa_generator.run     \
241        ctxswitch-cfa_coroutine.run     \
242        ctxswitch-cfa_thread.run        \
243        ctxswitch-cfa_thread2.run       \
244        ctxswitch-upp_coroutine.run     \
245        ctxswitch-upp_thread.run        \
246        ctxswitch-goroutine.run         \
247        ctxswitch-rust_thread.run       \
248        ctxswitch-nodejs_coroutine.run  \
249        ctxswitch-java_thread.run
250
251if WITH_LIBFIBRE
252CTXSWITCH_DEPEND  +=                    \
253        ctxswitch-kos_fibre.run         \
254        ctxswitch-kos_fibre2.run
255
256ctxswitch-kos_fibre$(EXEEXT):
257        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
258
259ctxswitch-kos_fibre2$(EXEEXT):
260        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
261endif
262
263ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
264
265ctxswitch-pthread$(EXEEXT):
266        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
267
268ctxswitch-cfa_generator$(EXEEXT):
269        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
270
271ctxswitch-cfa_coroutine$(EXEEXT):
272        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
273
274ctxswitch-cfa_thread$(EXEEXT):
275        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
276
277ctxswitch-cfa_thread2$(EXEEXT):
278        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
279
280ctxswitch-upp_coroutine$(EXEEXT):
281        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
282
283ctxswitch-upp_thread$(EXEEXT):
284        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
285
286ctxswitch-goroutine$(EXEEXT):
287        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
288
289ctxswitch-rust_thread$(EXEEXT):
290        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
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-java_thread$(EXEEXT):
298        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
299        echo "#!/bin/sh" > a.out
300        echo "java JavaThread" >> a.out
301        chmod a+x a.out
302
303## =========================================================================================================
304
305mutex$(EXEEXT) :                \
306        mutex-pthread.run       \
307        mutex-cfa1.run          \
308        mutex-cfa2.run          \
309        mutex-cfa4.run          \
310        mutex-upp.run           \
311        mutex-go.run            \
312        mutex-rust.run          \
313        mutex-java.run
314
315mutex-pthread$(EXEEXT):
316        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
317
318mutex-cfa1$(EXEEXT):
319        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
320
321mutex-cfa2$(EXEEXT):
322        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
323
324mutex-cfa4$(EXEEXT):
325        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
326
327mutex-upp$(EXEEXT):
328        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
329
330mutex-go$(EXEEXT):
331        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
332
333mutex-rust$(EXEEXT):
334        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
335
336mutex-java$(EXEEXT):
337        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
338        echo "#!/bin/sh" > a.out
339        echo "java JavaThread" >> a.out
340        chmod a+x a.out
341
342## =========================================================================================================
343
344signal$(EXEEXT) :               \
345        signal-pthread.run      \
346        signal-upp.run          \
347        signal-cfa1.run         \
348        signal-cfa2.run         \
349        signal-cfa4.run         \
350        signal-rust.run         \
351        signal-java.run
352
353signal-pthread$(EXEEXT):
354        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
355
356signal-upp$(EXEEXT):
357        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
358
359signal-cfa1$(EXEEXT):
360        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
361
362signal-cfa2$(EXEEXT):
363        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
364
365signal-cfa4$(EXEEXT):
366        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
367
368signal-rust$(EXEEXT):
369        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
370
371signal-java$(EXEEXT):
372        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
373        echo "#!/bin/sh" > a.out
374        echo "java JavaThread" >> a.out
375        chmod a+x a.out
376
377## =========================================================================================================
378
379waitfor$(EXEEXT) :              \
380        waitfor-upp.run         \
381        waitfor-cfa1.run        \
382        waitfor-cfa2.run        \
383        waitfor-cfa4.run
384
385waitfor-upp$(EXEEXT):
386        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
387
388waitfor-cfa1$(EXEEXT):
389        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
390
391waitfor-cfa2$(EXEEXT):
392        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
393
394waitfor-cfa4$(EXEEXT):
395        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
396
397## =========================================================================================================
398
399creation$(EXEEXT) :                             \
400        creation-pthread.run                    \
401        creation-cfa_coroutine.run              \
402        creation-cfa_coroutine_eager.run        \
403        creation-cfa_thread.run                 \
404        creation-upp_coroutine.run              \
405        creation-upp_thread.run                 \
406        creation-goroutine.run                  \
407        creation-rust.run                       \
408        creation-nodejs_coroutine.run           \
409        creation-java.run
410
411creation-cfa_coroutine$(EXEEXT):
412        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
413
414creation-cfa_coroutine_eager$(EXEEXT):
415        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
416
417creation-cfa_thread$(EXEEXT):
418        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
419
420creation-upp_coroutine$(EXEEXT):
421        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
422
423creation-upp_thread$(EXEEXT):
424        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
425
426creation-pthread$(EXEEXT):
427        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
428
429creation-goroutine$(EXEEXT):
430        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
431
432creation-rust$(EXEEXT):
433        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
434
435creation-nodejs_coroutine$(EXEEXT):
436        echo "#!/bin/sh" > a.out
437        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
438        chmod a+x a.out
439
440creation-java$(EXEEXT):
441        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
442        echo "#!/bin/sh" > a.out
443        echo "java JavaThread" >> a.out
444        chmod a+x a.out
445
446## =========================================================================================================
447
448compile$(EXEEXT) :              \
449        compile-array.make      \
450        compile-attributes.make \
451        compile-empty.make      \
452        compile-expression.make \
453        compile-io.make         \
454        compile-monitor.make    \
455        compile-operators.make  \
456        compile-typeof.make
457
458testdir = $(top_srcdir)/tests
459
460compile-array$(EXEEXT):
461        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
462
463compile-attributes$(EXEEXT):
464        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
465
466compile-empty$(EXEEXT):
467        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
468
469compile-expression$(EXEEXT):
470        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
471
472compile-io$(EXEEXT):
473        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
474
475compile-monitor$(EXEEXT):
476        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
477
478compile-operators$(EXEEXT):
479        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
480
481compile-thread$(EXEEXT):
482        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
483
484compile-typeof$(EXEEXT):
485        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.