source: benchmark/Makefile.am @ c6f1f3e

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since c6f1f3e was c6f1f3e, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Jenkins now also computes various speed-up graphs for performance monitoring

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