source: benchmark/Makefile.am @ ca59826

ADTarm-ehast-experimentalcleanup-dtorsenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since ca59826 was 528ccc8, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Fix printing in all the different modes of the benchmarks

  • Property mode set to 100644
File size: 10.6 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 : Tue Nov  6 09:01:23 2018
14## Update Count     : 26
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 -I$(srcdir) -lrt -pthread
24AM_CFAFLAGS = -quiet -in-tree -nodebug
25AM_UPPFLAGS = -quiet -nodebug -multi
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
49
50TOOLSDIR = ${abs_top_builddir}/tools/
51REPEAT   = ${abs_top_builddir}/tools/repeat
52STATS    = ${abs_top_srcdir}/tools/stat.py
53repeats  = 30
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
70## =========================================================================================================
71all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
72
73%.run : %$(EXEEXT) ${REPEAT}
74        @rm -f .result.log
75        @echo "------------------------------------------------------"
76        @echo $<
77        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
78        @${STATS} .result.log
79        @echo "------------------------------------------------------"
80        @rm -f a.out .result.log *.class
81
82%.runquiet :
83        @+make $(basename $@) CFLAGS="-w" __quiet=quiet
84        @taskset -c 1 ./a.out
85        @rm -f a.out
86
87%.make :
88        @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
89        @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
90
91${REPEAT} :
92        @+make -C ${abs_top_builddir}/tools repeat
93
94## =========================================================================================================
95
96jenkins$(EXEEXT):
97        @echo "{"
98        @echo -e '\t"githash": "'${githash}'",'
99        @echo -e '\t"arch": "'   ${arch}   '",'
100@DOifskipcompile@
101        @echo -e '\t"compile": {'
102        @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :'
103        @echo -e '\t\t"dummy" : {}'
104        @echo -e '\t},'
105@DOendif@
106        @echo -e '\t"ctxswitch": {'
107        @echo -en '\t\t"coroutine":'
108        @+make ctxswitch-cfa_coroutine.runquiet
109        @echo -en '\t\t,"thread":'
110        @+make ctxswitch-cfa_thread.runquiet
111        @echo -e '\t},'
112        @echo -e '\t"mutex": ['
113        @echo -en '\t\t'
114        @+make mutex-cfa1.runquiet
115        @echo -en '\t\t,'
116        @+make mutex-cfa2.runquiet
117        @echo -e '\t],'
118        @echo -e '\t"scheduling": ['
119        @echo -en '\t\t'
120        @+make signal-cfa1.runquiet
121        @echo -en '\t\t,'
122        @+make signal-cfa2.runquiet
123        @echo -en '\t\t,'
124        @+make waitfor-cfa1.runquiet
125        @echo -en '\t\t,'
126        @+make waitfor-cfa2.runquiet
127        @echo -e '\n\t],'
128        @echo -e '\t"epoch": ' $(shell date +%s)
129        @echo "}"
130
131## =========================================================================================================
132loop$(EXEEXT):
133        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
134
135function$(EXEEXT):
136        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
137
138fetch_add$(EXEEXT):
139        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
140
141## =========================================================================================================
142CTXSWITCH_DEPEND  =                 \
143        loop.run                                \
144        function.run                    \
145        fetch_add.run                   \
146        ctxswitch-pthread.run           \
147        ctxswitch-cfa_coroutine.run     \
148        ctxswitch-cfa_thread.run        \
149        ctxswitch-cfa_thread2.run       \
150        ctxswitch-upp_coroutine.run     \
151        ctxswitch-upp_thread.run        \
152        ctxswitch-goroutine.run         \
153        ctxswitch-java_thread.run
154
155if WITH_LIBFIBRE
156CTXSWITCH_DEPEND  +=           \
157        ctxswitch-kos_fibre.run  \
158        ctxswitch-kos_fibre2.run
159
160
161ctxswitch-kos_fibre$(EXEEXT):
162        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
163
164ctxswitch-kos_fibre2$(EXEEXT):
165        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
166endif
167
168ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
169
170ctxswitch-pthread$(EXEEXT):
171        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
172
173ctxswitch-cfa_coroutine$(EXEEXT):
174        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
175
176ctxswitch-cfa_thread$(EXEEXT):
177        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
178
179ctxswitch-cfa_thread2$(EXEEXT):
180        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
181
182ctxswitch-upp_coroutine$(EXEEXT):
183        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
184
185ctxswitch-upp_thread$(EXEEXT):
186        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
187
188ctxswitch-goroutine$(EXEEXT):
189        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
190
191ctxswitch-java_thread$(EXEEXT):
192        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
193        @echo "#!/bin/sh" > a.out
194        @echo "java JavaThread" >> a.out
195        @chmod a+x a.out
196
197## =========================================================================================================
198mutex$(EXEEXT) :\
199        loop.run                        \
200        function.run            \
201        fetch_add.run           \
202        mutex-pthread_lock.run  \
203        mutex-upp.run           \
204        mutex-cfa1.run          \
205        mutex-cfa2.run          \
206        mutex-cfa4.run          \
207        mutex-java_thread.run
208
209mutex-pthread_lock$(EXEEXT):
210        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
211
212mutex-upp$(EXEEXT):
213        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
214
215mutex-cfa1$(EXEEXT):
216        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
217
218mutex-cfa2$(EXEEXT):
219        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
220
221mutex-cfa4$(EXEEXT):
222        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
223
224mutex-java_thread$(EXEEXT):
225        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
226        @echo "#!/bin/sh" > a.out
227        @echo "java JavaThread" >> a.out
228        @chmod a+x a.out
229
230## =========================================================================================================
231signal$(EXEEXT) :\
232        signal-pthread_cond.run \
233        signal-upp.run          \
234        signal-cfa1.run         \
235        signal-cfa2.run         \
236        signal-cfa4.run         \
237        signal-java_thread.run
238
239signal-pthread_cond$(EXEEXT):
240        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
241
242signal-upp$(EXEEXT):
243        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
244
245signal-cfa1$(EXEEXT):
246        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
247
248signal-cfa2$(EXEEXT):
249        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
250
251signal-cfa4$(EXEEXT):
252        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
253
254signal-java_thread$(EXEEXT):
255        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
256        @echo "#!/bin/sh" > a.out
257        @echo "java JavaThread" >> a.out
258        @chmod a+x a.out
259
260
261## =========================================================================================================
262waitfor$(EXEEXT) :\
263        waitfor-upp.run         \
264        waitfor-cfa1.run                \
265        waitfor-cfa2.run                \
266        waitfor-cfa4.run
267
268waitfor-upp$(EXEEXT):
269        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
270
271waitfor-cfa1$(EXEEXT):
272        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
273
274waitfor-cfa2$(EXEEXT):
275        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
276
277waitfor-cfa4$(EXEEXT):
278        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
279
280## =========================================================================================================
281creation$(EXEEXT) :\
282        creation-pthread.run                    \
283        creation-cfa_coroutine.run              \
284        creation-cfa_coroutine_eager.run        \
285        creation-cfa_thread.run                 \
286        creation-upp_coroutine.run              \
287        creation-upp_thread.run                 \
288        creation-goroutine.run                  \
289        creation-java_thread.run
290
291creation-cfa_coroutine$(EXEEXT):
292        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
293
294creation-cfa_coroutine_eager$(EXEEXT):
295        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
296
297creation-cfa_thread$(EXEEXT):
298        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
299
300creation-upp_coroutine$(EXEEXT):
301        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
302
303creation-upp_thread$(EXEEXT):
304        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
305
306creation-pthread$(EXEEXT):
307        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
308
309creation-goroutine$(EXEEXT):
310        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
311
312creation-java_thread$(EXEEXT):
313        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
314        @echo "#!/bin/sh" > a.out
315        @echo "java JavaThread" >> a.out
316        @chmod a+x a.out
317
318## =========================================================================================================
319
320compile$(EXEEXT) :\
321        compile-array.make      \
322        compile-attributes.make \
323        compile-empty.make      \
324        compile-expression.make \
325        compile-io.make         \
326        compile-monitor.make    \
327        compile-operators.make  \
328        compile-typeof.make
329
330
331testdir = $(top_srcdir)/tests
332
333compile-array$(EXEEXT):
334        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
335
336compile-attributes$(EXEEXT):
337        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
338
339compile-empty$(EXEEXT):
340        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
341
342compile-expression$(EXEEXT):
343        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
344
345compile-io$(EXEEXT):
346        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
347
348compile-monitor$(EXEEXT):
349        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
350
351compile-operators$(EXEEXT):
352        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
353
354compile-thread$(EXEEXT):
355        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
356
357compile-typeof$(EXEEXT):
358        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
359
Note: See TracBrowser for help on using the repository browser.