source: benchmark/Makefile.am @ 0030ada3

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

Fixed makefiles missed in the removal of -in-tree

  • Property mode set to 100644
File size: 12.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 : Mon Jul 29 18:02:19 2019
14## Update Count     : 54
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_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
52# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
53repeats  = 5 # 31 for benchmarks
54arch     = x64
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        @-+make compile.diff.csv
104@DOendif@
105        @+make ctxswitch.csv
106        @-+make ctxswitch.diff.csv
107        @+make mutex.csv
108        @-+make mutex.diff.csv
109        @+make signal.csv
110        @-+make signal.diff.csv
111@DOifskipcompile@
112        cat compile.csv
113        -cat compile.diff.csv
114@DOendif@
115        cat ctxswitch.csv
116        -cat ctxswitch.diff.csv
117        cat mutex.csv
118        -cat mutex.diff.csv
119        cat signal.csv
120        -cat signal.diff.csv
121
122compile.csv:
123        @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
124        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
125        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
126        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
127        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
128        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
129        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
130        @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
131        @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
132        @$(srcdir)/fixcsv.sh $@
133
134ctxswitch.csv:
135        @echo "generator,coroutine,thread" > $@
136        @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
137        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
138        @+make ctxswitch-cfa_thread.runquiet >> $@
139        @$(srcdir)/fixcsv.sh $@
140
141mutex.csv:
142        @echo "1-monitor,2-monitor" > $@
143        @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
144        @+make mutex-cfa2.runquiet >> $@
145        @$(srcdir)/fixcsv.sh $@
146
147signal.csv:
148        @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
149        @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
150        @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
151        @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
152        @+make waitfor-cfa2.runquiet >> $@
153        @$(srcdir)/fixcsv.sh $@
154
155%.diff.csv: %.csv
156        @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
157        @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
158
159
160## =========================================================================================================
161loop$(EXEEXT):
162        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
163
164function$(EXEEXT):
165        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
166
167fetch_add$(EXEEXT):
168        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
169
170ttst_lock$(EXEEXT):
171        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
172
173tls-fetch_add$(EXEEXT):
174        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
175
176## =========================================================================================================
177CTXSWITCH_DEPEND  =                 \
178        loop.run                                \
179        function.run                    \
180        fetch_add.run                   \
181        ttst_lock.run                   \
182        tls-fetch_add.run                       \
183        ctxswitch-pthread.run           \
184        ctxswitch-cfa_generator.run     \
185        ctxswitch-cfa_coroutine.run     \
186        ctxswitch-cfa_thread.run        \
187        ctxswitch-cfa_thread2.run       \
188        ctxswitch-upp_coroutine.run     \
189        ctxswitch-upp_thread.run        \
190        ctxswitch-goroutine.run         \
191        ctxswitch-java_thread.run
192
193
194if WITH_LIBFIBRE
195CTXSWITCH_DEPEND  +=           \
196        ctxswitch-kos_fibre.run  \
197        ctxswitch-kos_fibre2.run
198
199
200ctxswitch-kos_fibre$(EXEEXT):
201        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
202
203ctxswitch-kos_fibre2$(EXEEXT):
204        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
205endif
206
207ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
208
209ctxswitch-pthread$(EXEEXT):
210        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
211
212ctxswitch-cfa_generator$(EXEEXT):
213        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
214
215ctxswitch-cfa_coroutine$(EXEEXT):
216        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
217
218ctxswitch-cfa_thread$(EXEEXT):
219        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
220
221ctxswitch-cfa_thread2$(EXEEXT):
222        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
223
224ctxswitch-upp_coroutine$(EXEEXT):
225        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
226
227ctxswitch-upp_thread$(EXEEXT):
228        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
229
230ctxswitch-goroutine$(EXEEXT):
231        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
232
233ctxswitch-java_thread$(EXEEXT):
234        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
235        @echo "#!/bin/sh" > a.out
236        @echo "java JavaThread" >> a.out
237        @chmod a+x a.out
238
239## =========================================================================================================
240mutex$(EXEEXT) :\
241        loop.run                        \
242        function.run            \
243        fetch_add.run           \
244        mutex-pthread_lock.run  \
245        mutex-upp.run           \
246        mutex-cfa1.run          \
247        mutex-cfa2.run          \
248        mutex-cfa4.run          \
249        mutex-java_thread.run
250
251mutex-pthread_lock$(EXEEXT):
252        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
253
254mutex-upp$(EXEEXT):
255        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
256
257mutex-cfa1$(EXEEXT):
258        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
259
260mutex-cfa2$(EXEEXT):
261        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
262
263mutex-cfa4$(EXEEXT):
264        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
265
266mutex-java_thread$(EXEEXT):
267        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
268        @echo "#!/bin/sh" > a.out
269        @echo "java JavaThread" >> a.out
270        @chmod a+x a.out
271
272## =========================================================================================================
273signal$(EXEEXT) :\
274        signal-pthread_cond.run \
275        signal-upp.run          \
276        signal-cfa1.run         \
277        signal-cfa2.run         \
278        signal-cfa4.run         \
279        signal-java_thread.run
280
281signal-pthread_cond$(EXEEXT):
282        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
283
284signal-upp$(EXEEXT):
285        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
286
287signal-cfa1$(EXEEXT):
288        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
289
290signal-cfa2$(EXEEXT):
291        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
292
293signal-cfa4$(EXEEXT):
294        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
295
296signal-java_thread$(EXEEXT):
297        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
298        @echo "#!/bin/sh" > a.out
299        @echo "java JavaThread" >> a.out
300        @chmod a+x a.out
301
302
303## =========================================================================================================
304waitfor$(EXEEXT) :\
305        waitfor-upp.run         \
306        waitfor-cfa1.run                \
307        waitfor-cfa2.run                \
308        waitfor-cfa4.run
309
310waitfor-upp$(EXEEXT):
311        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
312
313waitfor-cfa1$(EXEEXT):
314        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
315
316waitfor-cfa2$(EXEEXT):
317        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
318
319waitfor-cfa4$(EXEEXT):
320        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
321
322## =========================================================================================================
323creation$(EXEEXT) :\
324        creation-pthread.run                    \
325        creation-cfa_coroutine.run              \
326        creation-cfa_coroutine_eager.run        \
327        creation-cfa_thread.run                 \
328        creation-upp_coroutine.run              \
329        creation-upp_thread.run                 \
330        creation-goroutine.run                  \
331        creation-java_thread.run
332
333creation-cfa_coroutine$(EXEEXT):
334        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
335
336creation-cfa_coroutine_eager$(EXEEXT):
337        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
338
339creation-cfa_thread$(EXEEXT):
340        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
341
342creation-upp_coroutine$(EXEEXT):
343        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
344
345creation-upp_thread$(EXEEXT):
346        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
347
348creation-pthread$(EXEEXT):
349        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
350
351creation-goroutine$(EXEEXT):
352        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
353
354creation-java_thread$(EXEEXT):
355        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
356        @echo "#!/bin/sh" > a.out
357        @echo "java JavaThread" >> a.out
358        @chmod a+x a.out
359
360## =========================================================================================================
361
362compile$(EXEEXT) :\
363        compile-array.make      \
364        compile-attributes.make \
365        compile-empty.make      \
366        compile-expression.make \
367        compile-io.make         \
368        compile-monitor.make    \
369        compile-operators.make  \
370        compile-typeof.make
371
372
373testdir = $(top_srcdir)/tests
374
375compile-array$(EXEEXT):
376        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
377
378compile-attributes$(EXEEXT):
379        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
380
381compile-empty$(EXEEXT):
382        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
383
384compile-expression$(EXEEXT):
385        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
386
387compile-io$(EXEEXT):
388        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
389
390compile-monitor$(EXEEXT):
391        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
392
393compile-operators$(EXEEXT):
394        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
395
396compile-thread$(EXEEXT):
397        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
398
399compile-typeof$(EXEEXT):
400        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.