source: benchmark/Makefile.am @ 8633485b

arm-ehjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since 8633485b was 8633485b, checked in by Peter A. Buhr <pabuhr@…>, 21 months ago

update Nodejs experiment for concurrency paper

  • Property mode set to 100644
File size: 15.4 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 : Sat Jan 25 09:20:44 2020
14## Update Count     : 255
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  = 13 # 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 schedint.csv
78
79## =========================================================================================================
80
81all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
82
83basic_loop_DURATION = 15000000000
84basic_function_DURATION = 10000000000
85basic_tls_fetch_add_DURATION = 10000000000
86basic_DURATION = 250000000
87
88ctxswitch_pthread_DURATION = 25000000
89ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
90ctxswitch_cfa_generator_DURATION = 5000000000
91ctxswitch_nodejs_await_DURATION = 5000000
92ctxswitch_DURATION = 100000000
93
94#mutex_java_DURATION = 10000000
95mutex_DURATION = 50000000
96
97schedint_pthread_DURATION = 1000000
98schedint_java_DURATION = $(schedint_pthread_DURATION)
99schedint_rust_DURATION = $(schedint_pthread_DURATION)
100schedint_DURATION = 10000000
101
102schedext_DURATION = 10000000
103
104creation_pthread_DURATION = 250000
105creation_rust_thread_DURATION = ${creation_pthread_DURATION}
106creation_java_thread_DURATION = ${creation_pthread_DURATION}
107creation_cfa_coroutine_DURATION = 100000000
108creation_cfa_coroutine_eager_DURATION = 10000000
109creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION}
110creation_cfa_thread_DURATION = 10000000
111creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION}
112creation_DURATION = 10000000
113
114%.run : %$(EXEEXT) ${REPEAT}
115        rm -f .result.log
116        echo "------------------------------------------------------"
117        echo $<
118        ${REPEAT} ${repeats} -- ./a.out\
119                $(if ${$(subst -,_,$(basename $@))_DURATION},\
120                        ${$(subst -,_,$(basename $@))_DURATION},\
121                        ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log
122        ${STATS} .result.log
123        echo "------------------------------------------------------"
124        rm -f a.out .result.log *.class
125
126#       ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out
127
128%.runquiet :
129        +make $(basename $@) CFLAGS="-w" __quiet=quiet
130        taskset -c 1 ./a.out
131        rm -f a.out
132
133%.make :
134        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
135        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
136
137${REPEAT} :
138        +make -C ${abs_top_builddir}/tools repeat
139
140## =========================================================================================================
141
142FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
143
144jenkins$(EXEEXT):
145@DOifskipcompile@
146        +make compile.csv
147        -+make compile.diff.csv
148@DOendif@
149        +make basic.csv
150        -+make basic.diff.csv
151        +make ctxswitch.csv
152        -+make ctxswitch.diff.csv
153        +make mutex.csv
154        -+make mutex.diff.csv
155        +make schedint.csv
156        -+make schedint.diff.csv
157@DOifskipcompile@
158        cat compile.csv
159        -cat compile.diff.csv
160@DOendif@
161        cat basic.csv
162        -cat basic.diff.csv
163        cat ctxswitch.csv
164        -cat ctxswitch.diff.csv
165        cat mutex.csv
166        -cat mutex.diff.csv
167        cat schedint.csv
168        -cat schedint.diff.csv
169
170compile.csv:
171        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
172        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
173        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
174        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
175        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
176        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
177        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
178        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
179        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
180        $(srcdir)/fixcsv.sh $@
181
182basic.csv:
183        echo "generator,coroutine,thread" > $@
184        +make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
185        +make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
186        +make basic-cfa_thread.runquiet >> $@
187        $(srcdir)/fixcsv.sh $@
188
189ctxswitch.csv:
190        echo "generator,coroutine,thread" > $@
191        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
192        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
193        +make ctxswitch-cfa_thread.runquiet >> $@
194        $(srcdir)/fixcsv.sh $@
195
196mutex.csv:
197        echo "1-monitor,2-monitor" > $@
198        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
199        +make mutex-cfa2.runquiet >> $@
200        $(srcdir)/fixcsv.sh $@
201
202schedint.csv:
203        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
204        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
205        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
206        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
207        +make schedext-cfa2.runquiet >> $@
208        $(srcdir)/fixcsv.sh $@
209
210%.diff.csv: %.csv
211        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
212        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
213
214## =========================================================================================================
215
216BASIC_DEPEND  =                                 \
217        basic-loop.run                          \
218        basic-function.run                      \
219        basic-fetch_add.run                     \
220        basic-ttst_lock.run                     \
221        basic-tls-fetch_add.run
222
223basic-loop$(EXEEXT):
224        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
225
226basic-function$(EXEEXT):
227        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
228
229basic-fetch_add$(EXEEXT):
230        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
231
232basic-ttst_lock$(EXEEXT):
233        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
234
235basic-tls-fetch_add$(EXEEXT):
236        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
237
238basic$(EXEEXT): $(BASIC_DEPEND)
239
240## =========================================================================================================
241
242CTXSWITCH_DEPEND  =                     \
243        ctxswitch-cfa_generator.run     \
244        ctxswitch-cfa_coroutine.run     \
245        ctxswitch-cfa_thread.run        \
246        ctxswitch-cfa_thread2.run       \
247        ctxswitch-upp_coroutine.run     \
248        ctxswitch-upp_thread.run        \
249        ctxswitch-python_coroutine.run  \
250        ctxswitch-nodejs_coroutine.run  \
251        ctxswitch-nodejs_await.run      \
252        ctxswitch-goroutine_thread.run  \
253        ctxswitch-rust_thread.run       \
254        ctxswitch-nodejs_coroutine.run  \
255        ctxswitch-java_thread.run       \
256        ctxswitch-pthread.run
257
258if WITH_LIBFIBRE
259CTXSWITCH_DEPEND  +=                    \
260        ctxswitch-kos_fibre.run         \
261        ctxswitch-kos_fibre2.run
262
263ctxswitch-kos_fibre$(EXEEXT):
264        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
265
266ctxswitch-kos_fibre2$(EXEEXT):
267        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
268endif
269
270ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
271
272ctxswitch-cfa_generator$(EXEEXT):
273        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
274
275ctxswitch-cfa_coroutine$(EXEEXT):
276        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
277
278ctxswitch-cfa_thread$(EXEEXT):
279        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
280
281ctxswitch-cfa_thread2$(EXEEXT):
282        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
283
284ctxswitch-upp_coroutine$(EXEEXT):
285        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
286
287ctxswitch-upp_thread$(EXEEXT):
288        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
289
290ctxswitch-python_coroutine$(EXEEXT):
291        echo "#!/bin/sh" > a.out
292        echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out
293        chmod a+x a.out
294
295ctxswitch-nodejs_coroutine$(EXEEXT):
296        echo "#!/bin/sh" > a.out
297        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
298        chmod a+x a.out
299
300ctxswitch-nodejs_await$(EXEEXT):
301        echo "#!/bin/sh" > a.out
302        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
303        chmod a+x a.out
304
305ctxswitch-goroutine_thread$(EXEEXT):
306        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
307
308ctxswitch-rust_thread$(EXEEXT):
309        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
310
311ctxswitch-java_thread$(EXEEXT):
312        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
313        echo "#!/bin/sh" > a.out
314        echo "java JavaThread" >> a.out
315        chmod a+x a.out
316
317ctxswitch-pthread$(EXEEXT):
318        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
319
320## =========================================================================================================
321
322mutex$(EXEEXT) :                \
323        mutex-cfa1.run          \
324        mutex-cfa2.run          \
325        mutex-cfa4.run          \
326        mutex-upp.run           \
327        mutex-go.run            \
328        mutex-rust.run          \
329        mutex-java.run          \
330        mutex-pthread.run
331
332mutex-pthread$(EXEEXT):
333        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
334
335mutex-cfa1$(EXEEXT):
336        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
337
338mutex-cfa2$(EXEEXT):
339        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
340
341mutex-cfa4$(EXEEXT):
342        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
343
344mutex-upp$(EXEEXT):
345        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
346
347mutex-go$(EXEEXT):
348        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
349
350mutex-rust$(EXEEXT):
351        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
352
353mutex-java$(EXEEXT):
354        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
355        echo "#!/bin/sh" > a.out
356        echo "java JavaThread" >> a.out
357        chmod a+x a.out
358
359## =========================================================================================================
360
361schedint$(EXEEXT) :             \
362        schedint-cfa1.run       \
363        schedint-cfa2.run       \
364        schedint-cfa4.run       \
365        schedint-upp.run        \
366        schedint-rust.run       \
367        schedint-java.run       \
368        schedint-pthread.run
369
370schedint-cfa1$(EXEEXT):
371        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
372
373schedint-cfa2$(EXEEXT):
374        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
375
376schedint-cfa4$(EXEEXT):
377        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
378
379schedint-upp$(EXEEXT):
380        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
381
382schedint-rust$(EXEEXT):
383        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
384
385schedint-java$(EXEEXT):
386        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
387        echo "#!/bin/sh" > a.out
388        echo "java JavaThread" >> a.out
389        chmod a+x a.out
390
391schedint-pthread$(EXEEXT):
392        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
393
394## =========================================================================================================
395
396schedext$(EXEEXT) :             \
397        schedext-cfa1.run       \
398        schedext-cfa2.run       \
399        schedext-cfa4.run       \
400        schedext-upp.run        \
401        schedext-goroutine.run
402
403schedext-cfa1$(EXEEXT):
404        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
405
406schedext-cfa2$(EXEEXT):
407        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
408
409schedext-cfa4$(EXEEXT):
410        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
411
412schedext-upp$(EXEEXT):
413        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
414
415schedext-goroutine$(EXEEXT):
416        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
417
418
419## =========================================================================================================
420
421creation$(EXEEXT) :                             \
422        creation-cfa_generator.run              \
423        creation-cfa_coroutine.run              \
424        creation-cfa_coroutine_eager.run        \
425        creation-cfa_thread.run                 \
426        creation-upp_coroutine.run              \
427        creation-upp_thread.run                 \
428        creation-python_coroutine.run           \
429        creation-nodejs_coroutine.run           \
430        creation-goroutine_thread.run           \
431        creation-rust_thread.run                \
432        creation-java_thread.run                \
433        creation-pthread.run
434
435creation-cfa_generator$(EXEEXT):
436        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
437
438creation-cfa_coroutine$(EXEEXT):
439        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
440
441creation-cfa_coroutine_eager$(EXEEXT):
442        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
443
444creation-cfa_thread$(EXEEXT):
445        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
446
447creation-upp_coroutine$(EXEEXT):
448        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
449
450creation-upp_thread$(EXEEXT):
451        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
452
453creation-python_coroutine$(EXEEXT):
454        echo "#!/bin/sh" > a.out
455        echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out
456        chmod a+x a.out
457
458creation-nodejs_coroutine$(EXEEXT):
459        echo "#!/bin/sh" > a.out
460        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
461        chmod a+x a.out
462
463creation-goroutine_thread$(EXEEXT):
464        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
465
466creation-rust_thread$(EXEEXT):
467        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
468
469creation-java_thread$(EXEEXT):
470        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
471        echo "#!/bin/sh" > a.out
472        echo "java JavaThread" >> a.out
473        chmod a+x a.out
474
475creation-pthread$(EXEEXT):
476        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
477
478## =========================================================================================================
479
480compile$(EXEEXT) :              \
481        compile-array.make      \
482        compile-attributes.make \
483        compile-empty.make      \
484        compile-expression.make \
485        compile-io.make         \
486        compile-monitor.make    \
487        compile-operators.make  \
488        compile-typeof.make
489
490testdir = $(top_srcdir)/tests
491
492compile-array$(EXEEXT):
493        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
494
495compile-attributes$(EXEEXT):
496        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
497
498compile-empty$(EXEEXT):
499        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
500
501compile-expression$(EXEEXT):
502        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
503
504compile-io$(EXEEXT):
505        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
506
507compile-monitor$(EXEEXT):
508        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
509
510compile-operators$(EXEEXT):
511        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
512
513compile-thread$(EXEEXT):
514        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
515
516compile-typeof$(EXEEXT):
517        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
Note: See TracBrowser for help on using the repository browser.