source: benchmark/Makefile.am @ 1d60da8

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 1d60da8 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
RevLine 
[ac93b228]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
[2385236]13## Last Modified On : Mon Jul 29 18:02:19 2019
14## Update Count     : 54
[ac93b228]15###############################################################################
16
[0c1b566]17AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
[107b01a]18ACLOCAL_AMFLAGS  = -I automake
[0c1b566]19
[ac93b228]20# applies to both programs
[7a7ab42]21include $(top_srcdir)/src/cfa.make
22
[dc33b5b]23AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
[abec2f8]24AM_CFAFLAGS = -quiet -nodebug
[5a8037a7]25AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
[7a7ab42]26
[528ccc8]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
[5e49e47]49TOOLSDIR = ${abs_top_builddir}/tools/
50REPEAT   = ${abs_top_builddir}/tools/repeat
51STATS    = ${abs_top_srcdir}/tools/stat.py
[2385236]52# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
53repeats  = 5 # 31 for benchmarks
[c6f1f3e]54arch     = x64
[05f4b85]55skipcompile = no
[a5b7905]56TIME_FORMAT = "%E"
[2086ab2]57PRINT_FORMAT = %20s: #Comments needed for spacing
[034165a]58
[d0c91a6]59# Dummy hack tricks
[5e49e47]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
[034165a]69.NOTPARALLEL:
[f15fe0a]70.PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv
[ac93b228]71
[43fa66e]72## =========================================================================================================
[4cedd9f]73all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
74
[a5b7905]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 "------------------------------------------------------"
[88e139e]82        @rm -f a.out .result.log *.class
[ac93b228]83
[a5b7905]84%.runquiet :
[528ccc8]85        @+make $(basename $@) CFLAGS="-w" __quiet=quiet
[05f4b85]86        @taskset -c 1 ./a.out
[a5b7905]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} :
[5e49e47]94        @+make -C ${abs_top_builddir}/tools repeat
[a5b7905]95
96## =========================================================================================================
97
[f15fe0a]98FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
99
[a5b7905]100jenkins$(EXEEXT):
[05f4b85]101@DOifskipcompile@
[f15fe0a]102        @+make compile.csv
[c6f1f3e]103        @-+make compile.diff.csv
[05f4b85]104@DOendif@
[f15fe0a]105        @+make ctxswitch.csv
[c6f1f3e]106        @-+make ctxswitch.diff.csv
[f15fe0a]107        @+make mutex.csv
[c6f1f3e]108        @-+make mutex.diff.csv
[f15fe0a]109        @+make signal.csv
[c6f1f3e]110        @-+make signal.diff.csv
[d9f2874]111@DOifskipcompile@
[c6f1f3e]112        cat compile.csv
113        -cat compile.diff.csv
[d9f2874]114@DOendif@
[c6f1f3e]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
[f15fe0a]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:
[dc33b5b]135        @echo "generator,coroutine,thread" > $@
136        @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
[f15fe0a]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 $@
[ac93b228]154
[c6f1f3e]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
[d885a58]160## =========================================================================================================
161loop$(EXEEXT):
[528ccc8]162        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
[d885a58]163
164function$(EXEEXT):
[528ccc8]165        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
[d885a58]166
167fetch_add$(EXEEXT):
[528ccc8]168        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
[d885a58]169
[dc33b5b]170ttst_lock$(EXEEXT):
171        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
172
[7a8f5246]173tls-fetch_add$(EXEEXT):
174        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
175
[034165a]176## =========================================================================================================
[41cca44]177CTXSWITCH_DEPEND  =                 \
[d885a58]178        loop.run                                \
179        function.run                    \
180        fetch_add.run                   \
[dc33b5b]181        ttst_lock.run                   \
[7a8f5246]182        tls-fetch_add.run                       \
[b7170a64]183        ctxswitch-pthread.run           \
[dc33b5b]184        ctxswitch-cfa_generator.run     \
[b7170a64]185        ctxswitch-cfa_coroutine.run     \
186        ctxswitch-cfa_thread.run        \
[6810fcb]187        ctxswitch-cfa_thread2.run       \
[b7170a64]188        ctxswitch-upp_coroutine.run     \
[50abab9]189        ctxswitch-upp_thread.run        \
190        ctxswitch-goroutine.run         \
[64dc36e]191        ctxswitch-java_thread.run
[dc33b5b]192
[034165a]193
[41cca44]194if WITH_LIBFIBRE
195CTXSWITCH_DEPEND  +=           \
196        ctxswitch-kos_fibre.run  \
197        ctxswitch-kos_fibre2.run
198
199
200ctxswitch-kos_fibre$(EXEEXT):
[528ccc8]201        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
[41cca44]202
203ctxswitch-kos_fibre2$(EXEEXT):
[528ccc8]204        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
[41cca44]205endif
206
207ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
208
[6810fcb]209ctxswitch-pthread$(EXEEXT):
[528ccc8]210        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
[6810fcb]211
[dc33b5b]212ctxswitch-cfa_generator$(EXEEXT):
213        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
214
[034165a]215ctxswitch-cfa_coroutine$(EXEEXT):
[528ccc8]216        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
[034165a]217
218ctxswitch-cfa_thread$(EXEEXT):
[528ccc8]219        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
[6810fcb]220
221ctxswitch-cfa_thread2$(EXEEXT):
[528ccc8]222        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
[034165a]223
224ctxswitch-upp_coroutine$(EXEEXT):
[528ccc8]225        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
[034165a]226
227ctxswitch-upp_thread$(EXEEXT):
[528ccc8]228        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
[ac93b228]229
[50abab9]230ctxswitch-goroutine$(EXEEXT):
[528ccc8]231        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
[50abab9]232
233ctxswitch-java_thread$(EXEEXT):
[528ccc8]234        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
[50abab9]235        @echo "#!/bin/sh" > a.out
[5e49e47]236        @echo "java JavaThread" >> a.out
[50abab9]237        @chmod a+x a.out
238
[f54a0ab]239## =========================================================================================================
240mutex$(EXEEXT) :\
[d885a58]241        loop.run                        \
242        function.run            \
243        fetch_add.run           \
[f54a0ab]244        mutex-pthread_lock.run  \
245        mutex-upp.run           \
246        mutex-cfa1.run          \
247        mutex-cfa2.run          \
[6aa537a4]248        mutex-cfa4.run          \
249        mutex-java_thread.run
[f54a0ab]250
251mutex-pthread_lock$(EXEEXT):
[528ccc8]252        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
[f54a0ab]253
254mutex-upp$(EXEEXT):
[528ccc8]255        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
[f54a0ab]256
257mutex-cfa1$(EXEEXT):
[528ccc8]258        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
[f54a0ab]259
260mutex-cfa2$(EXEEXT):
[528ccc8]261        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
[f54a0ab]262
263mutex-cfa4$(EXEEXT):
[528ccc8]264        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
[034165a]265
[6aa537a4]266mutex-java_thread$(EXEEXT):
[528ccc8]267        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
[6aa537a4]268        @echo "#!/bin/sh" > a.out
[5e49e47]269        @echo "java JavaThread" >> a.out
[6aa537a4]270        @chmod a+x a.out
271
[9f0b975]272## =========================================================================================================
273signal$(EXEEXT) :\
[3eb4541]274        signal-pthread_cond.run \
[9f0b975]275        signal-upp.run          \
276        signal-cfa1.run         \
277        signal-cfa2.run         \
[56de6b39]278        signal-cfa4.run         \
279        signal-java_thread.run
[9f0b975]280
[3eb4541]281signal-pthread_cond$(EXEEXT):
[528ccc8]282        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
[3eb4541]283
[9f0b975]284signal-upp$(EXEEXT):
[528ccc8]285        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
[9f0b975]286
287signal-cfa1$(EXEEXT):
[528ccc8]288        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
[9f0b975]289
290signal-cfa2$(EXEEXT):
[528ccc8]291        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
[9f0b975]292
293signal-cfa4$(EXEEXT):
[528ccc8]294        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
[9f0b975]295
[6aa537a4]296signal-java_thread$(EXEEXT):
[528ccc8]297        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
[6aa537a4]298        @echo "#!/bin/sh" > a.out
[5e49e47]299        @echo "java JavaThread" >> a.out
[6aa537a4]300        @chmod a+x a.out
301
302
[9f0b975]303## =========================================================================================================
304waitfor$(EXEEXT) :\
305        waitfor-upp.run         \
306        waitfor-cfa1.run                \
307        waitfor-cfa2.run                \
308        waitfor-cfa4.run
309
310waitfor-upp$(EXEEXT):
[528ccc8]311        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
[9f0b975]312
313waitfor-cfa1$(EXEEXT):
[528ccc8]314        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
[9f0b975]315
316waitfor-cfa2$(EXEEXT):
[528ccc8]317        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
[9f0b975]318
319waitfor-cfa4$(EXEEXT):
[528ccc8]320        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
[9f0b975]321
[4cedd9f]322## =========================================================================================================
323creation$(EXEEXT) :\
[3351cc0]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              \
[50abab9]329        creation-upp_thread.run                 \
330        creation-goroutine.run                  \
[64dc36e]331        creation-java_thread.run
[4cedd9f]332
333creation-cfa_coroutine$(EXEEXT):
[528ccc8]334        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
[4cedd9f]335
[3351cc0]336creation-cfa_coroutine_eager$(EXEEXT):
[528ccc8]337        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
[3351cc0]338
[4cedd9f]339creation-cfa_thread$(EXEEXT):
[528ccc8]340        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
[4cedd9f]341
342creation-upp_coroutine$(EXEEXT):
[528ccc8]343        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
[4cedd9f]344
345creation-upp_thread$(EXEEXT):
[528ccc8]346        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
[4cedd9f]347
348creation-pthread$(EXEEXT):
[528ccc8]349        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
[4cedd9f]350
[50abab9]351creation-goroutine$(EXEEXT):
[528ccc8]352        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
[50abab9]353
354creation-java_thread$(EXEEXT):
[528ccc8]355        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
[50abab9]356        @echo "#!/bin/sh" > a.out
[5e49e47]357        @echo "java JavaThread" >> a.out
[50abab9]358        @chmod a+x a.out
359
[034165a]360## =========================================================================================================
361
[3edc2df]362compile$(EXEEXT) :\
[a5b7905]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
[3edc2df]371
372
[524ed86]373testdir = $(top_srcdir)/tests
[d3db83c]374
[3edc2df]375compile-array$(EXEEXT):
[528ccc8]376        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
[3edc2df]377
378compile-attributes$(EXEEXT):
[528ccc8]379        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
[3edc2df]380
381compile-empty$(EXEEXT):
[528ccc8]382        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
[3edc2df]383
384compile-expression$(EXEEXT):
[528ccc8]385        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
[3edc2df]386
387compile-io$(EXEEXT):
[528ccc8]388        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
[3edc2df]389
390compile-monitor$(EXEEXT):
[528ccc8]391        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
[3edc2df]392
393compile-operators$(EXEEXT):
[528ccc8]394        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
[3edc2df]395
396compile-thread$(EXEEXT):
[528ccc8]397        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
[3edc2df]398
399compile-typeof$(EXEEXT):
[528ccc8]400        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.