source: benchmark/Makefile.am @ 580c11b

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

fix nodejs build

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