source: benchmark/Makefile.am @ c93fd72

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

augmented duration values for benchmarks

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