source: benchmark/Makefile.am @ 9e1fa35

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

attempt to get RUST and nodejs benchmarks to print titles (still not working)

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