######################## -*- Mode: Makefile-Automake -*- ###################### ## ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo ## ## The contents of this file are covered under the licence agreement in the ## file "LICENCE" distributed with Cforall. ## ## Makefile.am -- ## ## Author : Peter A. Buhr ## Created On : Sun May 31 09:08:15 2015 ## Last Modified By : Peter A. Buhr ## Last Modified On : Sat Jan 25 09:20:44 2020 ## Update Count : 255 ############################################################################### AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names ACLOCAL_AMFLAGS = -I automake # applies to both programs include $(top_srcdir)/src/cfa.make AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror AM_CFAFLAGS = -quiet -nodebug AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14 BENCH_V_CC = $(__bench_v_CC_$(__quiet)) BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet)) BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet)) BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) __quiet = verbose __bench_v_CC_quiet = @ __bench_v_CFA_quiet = @ __bench_v_CXX_quiet = @ __bench_v_UPP_quiet = @ __bench_v_GOC_quiet = @ __bench_v_RUSTC_quiet = @ __bench_v_JAVAC_quiet = @ __bench_v_CC_verbose = $(AM_V_CC) __bench_v_CFA_verbose = $(AM_V_CFA) __bench_v_CXX_verbose = $(AM_V_CXX) __bench_v_UPP_verbose = $(AM_V_UPP) __bench_v_GOC_verbose = $(AM_V_GOC) __bench_v_RUSTC_verbose = $(AM_V_RUSTC) __bench_v_NODEJS_verbose = $(AM_V_NODEJS) __bench_v_JAVAC_verbose = $(AM_V_JAVAC) TOOLSDIR = ${abs_top_builddir}/tools/ REPEAT = ${abs_top_builddir}/tools/repeat STATS = ${abs_top_srcdir}/tools/stat.py # NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED repeats = 13 # 31 for benchmarks arch = x64 skipcompile = no TIME_FORMAT = "%E" PRINT_FORMAT = %20s: #Comments needed for spacing # Dummy hack tricks EXTRA_PROGRAMS = dummy # build but do not install dummy_SOURCES = dummyC.c dummyCXX.cpp dummyC.c: echo "int main() { return 0; }" > ${@} dummyCXX.cpp: echo "int main() { return 0; }" > ${@} .SILENT: # do not print recipe .NOTPARALLEL: .PHONY: jenkins cleancsv ## ========================================================================================================= all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT) basic_loop_DURATION = 15000000000 basic_function_DURATION = 10000000000 basic_tls_fetch_add_DURATION = 10000000000 basic_DURATION = 250000000 ctxswitch_pthread_DURATION = 25000000 ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION) ctxswitch_cfa_generator_DURATION = 5000000000 ctxswitch_nodejs_await_DURATION = 5000000 ctxswitch_DURATION = 100000000 #mutex_java_DURATION = 10000000 mutex_DURATION = 50000000 schedint_pthread_DURATION = 1000000 schedint_java_DURATION = $(schedint_pthread_DURATION) schedint_rust_DURATION = $(schedint_pthread_DURATION) schedint_DURATION = 10000000 schedext_DURATION = 10000000 creation_pthread_DURATION = 250000 creation_rust_thread_DURATION = ${creation_pthread_DURATION} creation_java_thread_DURATION = ${creation_pthread_DURATION} creation_cfa_coroutine_DURATION = 100000000 creation_cfa_coroutine_eager_DURATION = 10000000 creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION} creation_cfa_thread_DURATION = 10000000 creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION} creation_DURATION = 10000000 %.run : %$(EXEEXT) ${REPEAT} rm -f .result.log echo "------------------------------------------------------" echo $< ${REPEAT} ${repeats} -- ./a.out\ $(if ${$(subst -,_,$(basename $@))_DURATION},\ ${$(subst -,_,$(basename $@))_DURATION},\ ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log ${STATS} .result.log echo "------------------------------------------------------" rm -f a.out .result.log *.class # ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out %.runquiet : +make $(basename $@) CFLAGS="-w" __quiet=quiet taskset -c 1 ./a.out rm -f a.out %.make : printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 ${REPEAT} : +make -C ${abs_top_builddir}/tools repeat ## ========================================================================================================= FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ cleancsv: rm -f compile.csv basic.csv ctxswitch.csv mutex.csv schedint.csv jenkins$(EXEEXT): cleancsv @DOifskipcompile@ +make compile.csv -+make compile.diff.csv @DOendif@ +make ctxswitch.csv -+make ctxswitch.diff.csv +make mutex.csv -+make mutex.diff.csv +make schedint.csv -+make schedint.diff.csv @DOifskipcompile@ cat compile.csv -cat compile.diff.csv @DOendif@ cat ctxswitch.csv -cat ctxswitch.diff.csv cat mutex.csv -cat mutex.diff.csv cat schedint.csv -cat schedint.diff.csv compile.csv: echo "building $@" echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ $(srcdir)/fixcsv.sh $@ # basic.csv: # echo "$@" # echo "generator,coroutine,thread" > $@ # +make basic-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ # +make basic-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ # +make basic-cfa_thread.runquiet >> $@ # $(srcdir)/fixcsv.sh $@ ctxswitch.csv: echo "building $@" echo "generator,coroutine,thread" > $@ +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ +make ctxswitch-cfa_thread.runquiet >> $@ $(srcdir)/fixcsv.sh $@ mutex.csv: echo "building $@" echo "1-monitor,2-monitor" > $@ +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ +make mutex-cfa2.runquiet >> $@ $(srcdir)/fixcsv.sh $@ schedint.csv: echo "building $@" echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@ +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@ +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@ +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@ +make schedext-cfa2.runquiet >> $@ $(srcdir)/fixcsv.sh $@ %.diff.csv: %.csv test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false) $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@ ## ========================================================================================================= BASIC_DEPEND = \ basic-loop.run \ basic-function.run \ basic-fetch_add.run \ basic-ttst_lock.run \ basic-tls-fetch_add.run basic-loop$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c basic-function$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c basic-fetch_add$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c basic-ttst_lock$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c basic-tls-fetch_add$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c basic$(EXEEXT): $(BASIC_DEPEND) ## ========================================================================================================= CTXSWITCH_DEPEND = \ ctxswitch-cfa_generator.run \ ctxswitch-cfa_coroutine.run \ ctxswitch-cfa_thread.run \ ctxswitch-cfa_thread2.run \ ctxswitch-upp_coroutine.run \ ctxswitch-upp_thread.run \ ctxswitch-python_coroutine.run \ ctxswitch-nodejs_coroutine.run \ ctxswitch-nodejs_await.run \ ctxswitch-goroutine_thread.run \ ctxswitch-rust_thread.run \ ctxswitch-nodejs_coroutine.run \ ctxswitch-java_thread.run \ ctxswitch-pthread.run if WITH_LIBFIBRE CTXSWITCH_DEPEND += \ ctxswitch-kos_fibre.run \ ctxswitch-kos_fibre2.run ctxswitch-kos_fibre$(EXEEXT): $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre ctxswitch-kos_fibre2$(EXEEXT): $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre endif ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) ctxswitch-cfa_generator$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa ctxswitch-cfa_coroutine$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa ctxswitch-cfa_thread$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa ctxswitch-cfa_thread2$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa ctxswitch-upp_coroutine$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc ctxswitch-upp_thread$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc ctxswitch-python_coroutine$(EXEEXT): echo "#!/bin/sh" > a.out echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out chmod a+x a.out ctxswitch-nodejs_coroutine$(EXEEXT): echo "#!/bin/sh" > a.out echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out chmod a+x a.out ctxswitch-nodejs_await$(EXEEXT): echo "#!/bin/sh" > a.out echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out chmod a+x a.out ctxswitch-goroutine_thread$(EXEEXT): $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go ctxswitch-rust_thread$(EXEEXT): $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs ctxswitch-java_thread$(EXEEXT): $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java echo "#!/bin/sh" > a.out echo "java JavaThread" >> a.out chmod a+x a.out ctxswitch-pthread$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c ## ========================================================================================================= mutex$(EXEEXT) : \ mutex-cfa1.run \ mutex-cfa2.run \ mutex-cfa4.run \ mutex-upp.run \ mutex-go.run \ mutex-rust.run \ mutex-java.run \ mutex-pthread.run mutex-pthread$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c mutex-cfa1$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa mutex-cfa2$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa mutex-cfa4$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa mutex-upp$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc mutex-go$(EXEEXT): $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go mutex-rust$(EXEEXT): $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs mutex-java$(EXEEXT): $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java echo "#!/bin/sh" > a.out echo "java JavaThread" >> a.out chmod a+x a.out ## ========================================================================================================= schedint$(EXEEXT) : \ schedint-cfa1.run \ schedint-cfa2.run \ schedint-cfa4.run \ schedint-upp.run \ schedint-rust.run \ schedint-java.run \ schedint-pthread.run schedint-cfa1$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa schedint-cfa2$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa schedint-cfa4$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa schedint-upp$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc schedint-rust$(EXEEXT): $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs schedint-java$(EXEEXT): $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java echo "#!/bin/sh" > a.out echo "java JavaThread" >> a.out chmod a+x a.out schedint-pthread$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c ## ========================================================================================================= schedext$(EXEEXT) : \ schedext-cfa1.run \ schedext-cfa2.run \ schedext-cfa4.run \ schedext-upp.run \ schedext-goroutine.run schedext-cfa1$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa schedext-cfa2$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa schedext-cfa4$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa schedext-upp$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc schedext-goroutine$(EXEEXT): $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go ## ========================================================================================================= creation$(EXEEXT) : \ creation-cfa_generator.run \ creation-cfa_coroutine.run \ creation-cfa_coroutine_eager.run \ creation-cfa_thread.run \ creation-upp_coroutine.run \ creation-upp_thread.run \ creation-python_coroutine.run \ creation-nodejs_coroutine.run \ creation-goroutine_thread.run \ creation-rust_thread.run \ creation-java_thread.run \ creation-pthread.run creation-cfa_generator$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa creation-cfa_coroutine$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa creation-cfa_coroutine_eager$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa -DEAGER creation-cfa_thread$(EXEEXT): $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa creation-upp_coroutine$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc creation-upp_thread$(EXEEXT): $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc creation-python_coroutine$(EXEEXT): echo "#!/bin/sh" > a.out echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out chmod a+x a.out creation-nodejs_coroutine$(EXEEXT): echo "#!/bin/sh" > a.out echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out chmod a+x a.out creation-goroutine_thread$(EXEEXT): $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go creation-rust_thread$(EXEEXT): $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs creation-java_thread$(EXEEXT): $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java echo "#!/bin/sh" > a.out echo "java JavaThread" >> a.out chmod a+x a.out creation-pthread$(EXEEXT): $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c ## ========================================================================================================= compile$(EXEEXT) : \ compile-array.make \ compile-attributes.make \ compile-empty.make \ compile-expression.make \ compile-io.make \ compile-monitor.make \ compile-operators.make \ compile-typeof.make testdir = $(top_srcdir)/tests compile-array$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa compile-attributes$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa compile-empty$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa compile-expression$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa compile-io$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa compile-monitor$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa compile-operators$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa compile-thread$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa compile-typeof$(EXEEXT): $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa