source: benchmark/Makefile.am @ dc33b5b

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

update benchmarks and add benchmarks for qthreads

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