source: benchmark/Makefile.am @ 26fd986

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

update benchmarks for concurrency paper

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