[ac93b228] | 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 : Mon Jan 25 22:31:42 2016 |
---|
| 14 | ## Update Count : 25 |
---|
| 15 | ############################################################################### |
---|
| 16 | |
---|
[0c1b566] | 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
| 18 | |
---|
[ac93b228] | 19 | # applies to both programs |
---|
[7a7ab42] | 20 | include $(top_srcdir)/src/cfa.make |
---|
| 21 | |
---|
| 22 | UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) |
---|
| 23 | |
---|
| 24 | AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread |
---|
| 25 | AM_CFAFLAGS = -quiet -in-tree -nodebug |
---|
| 26 | AM_UPPFLAGS = -quiet -nodebug -multi |
---|
| 27 | |
---|
[b7170a64] | 28 | TOOLSDIR = ${abs_top_srcdir}/tools/ |
---|
| 29 | REPEAT = ${TOOLSDIR}repeat |
---|
| 30 | STATS = ${TOOLSDIR}stat.py |
---|
| 31 | repeats = 30 |
---|
[05f4b85] | 32 | skipcompile = no |
---|
[a5b7905] | 33 | TIME_FORMAT = "%E" |
---|
[2086ab2] | 34 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
[034165a] | 35 | |
---|
[7a7ab42] | 36 | LIBFIBRE_DIR ?= /home/tdelisle/software/KOS/src/ |
---|
| 37 | |
---|
[034165a] | 38 | .NOTPARALLEL: |
---|
[ac93b228] | 39 | |
---|
[b7170a64] | 40 | noinst_PROGRAMS = |
---|
[ac93b228] | 41 | |
---|
[4cedd9f] | 42 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
| 43 | |
---|
[a5b7905] | 44 | %.run : %$(EXEEXT) ${REPEAT} |
---|
| 45 | @rm -f .result.log |
---|
| 46 | @echo "------------------------------------------------------" |
---|
| 47 | @echo $< |
---|
| 48 | @${REPEAT} ${repeats} ./a.out | tee -a .result.log |
---|
| 49 | @${STATS} .result.log |
---|
| 50 | @echo "------------------------------------------------------" |
---|
| 51 | @rm -f a.out .result.log |
---|
[ac93b228] | 52 | |
---|
[a5b7905] | 53 | %.runquiet : |
---|
[52df81c] | 54 | @+make $(basename $@) CFLAGS="-w" |
---|
[05f4b85] | 55 | @taskset -c 1 ./a.out |
---|
[a5b7905] | 56 | @rm -f a.out |
---|
| 57 | |
---|
| 58 | %.make : |
---|
| 59 | @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) |
---|
| 60 | @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 |
---|
| 61 | |
---|
| 62 | ${REPEAT} : |
---|
| 63 | @+make -C ${TOOLSDIR} repeat |
---|
| 64 | |
---|
| 65 | ## ========================================================================================================= |
---|
| 66 | |
---|
| 67 | jenkins$(EXEEXT): |
---|
| 68 | @echo "{" |
---|
| 69 | @echo -e '\t"githash": "'${githash}'",' |
---|
| 70 | @echo -e '\t"arch": "' ${arch} '",' |
---|
[05f4b85] | 71 | @DOifskipcompile@ |
---|
[91496f3] | 72 | @echo -e '\t"compile": {' |
---|
| 73 | @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' |
---|
| 74 | @echo -e '\t\t"dummy" : {}' |
---|
| 75 | @echo -e '\t},' |
---|
[05f4b85] | 76 | @DOendif@ |
---|
[a5b7905] | 77 | @echo -e '\t"ctxswitch": {' |
---|
| 78 | @echo -en '\t\t"coroutine":' |
---|
| 79 | @+make ctxswitch-cfa_coroutine.runquiet |
---|
| 80 | @echo -en '\t\t,"thread":' |
---|
| 81 | @+make ctxswitch-cfa_thread.runquiet |
---|
| 82 | @echo -e '\t},' |
---|
| 83 | @echo -e '\t"mutex": [' |
---|
| 84 | @echo -en '\t\t' |
---|
| 85 | @+make mutex-cfa1.runquiet |
---|
| 86 | @echo -en '\t\t,' |
---|
| 87 | @+make mutex-cfa2.runquiet |
---|
| 88 | @echo -e '\t],' |
---|
| 89 | @echo -e '\t"scheduling": [' |
---|
| 90 | @echo -en '\t\t' |
---|
| 91 | @+make signal-cfa1.runquiet |
---|
| 92 | @echo -en '\t\t,' |
---|
| 93 | @+make signal-cfa2.runquiet |
---|
| 94 | @echo -en '\t\t,' |
---|
| 95 | @+make waitfor-cfa1.runquiet |
---|
| 96 | @echo -en '\t\t,' |
---|
| 97 | @+make waitfor-cfa2.runquiet |
---|
| 98 | @echo -e '\n\t],' |
---|
| 99 | @echo -e '\t"epoch": ' $(shell date +%s) |
---|
| 100 | @echo "}" |
---|
[ac93b228] | 101 | |
---|
[d885a58] | 102 | ## ========================================================================================================= |
---|
| 103 | loop$(EXEEXT): |
---|
[7a7ab42] | 104 | $(COMPILE) -DBENCH_N=5000000000 loop.c |
---|
[d885a58] | 105 | |
---|
| 106 | function$(EXEEXT): |
---|
[7a7ab42] | 107 | $(COMPILE) -DBENCH_N=5000000000 function.c |
---|
[d885a58] | 108 | |
---|
| 109 | fetch_add$(EXEEXT): |
---|
[7a7ab42] | 110 | $(COMPILE) -DBENCH_N=500000000 fetch_add.c |
---|
[d885a58] | 111 | |
---|
[034165a] | 112 | ## ========================================================================================================= |
---|
| 113 | ctxswitch$(EXEEXT): \ |
---|
[d885a58] | 114 | loop.run \ |
---|
| 115 | function.run \ |
---|
| 116 | fetch_add.run \ |
---|
[b7170a64] | 117 | ctxswitch-pthread.run \ |
---|
| 118 | ctxswitch-cfa_coroutine.run \ |
---|
| 119 | ctxswitch-cfa_thread.run \ |
---|
[6810fcb] | 120 | ctxswitch-cfa_thread2.run \ |
---|
[b7170a64] | 121 | ctxswitch-upp_coroutine.run \ |
---|
[50abab9] | 122 | ctxswitch-upp_thread.run \ |
---|
[6810fcb] | 123 | -ctxswitch-kos_fibre.run \ |
---|
| 124 | -ctxswitch-kos_fibre2.run \ |
---|
[50abab9] | 125 | ctxswitch-goroutine.run \ |
---|
| 126 | ctxswitch-java_thread.run |
---|
[034165a] | 127 | |
---|
[6810fcb] | 128 | ctxswitch-pthread$(EXEEXT): |
---|
[7a7ab42] | 129 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
[6810fcb] | 130 | |
---|
[034165a] | 131 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
[7a7ab42] | 132 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c |
---|
[034165a] | 133 | |
---|
| 134 | ctxswitch-cfa_thread$(EXEEXT): |
---|
[7a7ab42] | 135 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c |
---|
[6810fcb] | 136 | |
---|
| 137 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
[7a7ab42] | 138 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c |
---|
[034165a] | 139 | |
---|
| 140 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
[7a7ab42] | 141 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
[034165a] | 142 | |
---|
| 143 | ctxswitch-upp_thread$(EXEEXT): |
---|
[7a7ab42] | 144 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
[ac93b228] | 145 | |
---|
[6810fcb] | 146 | ctxswitch-kos_fibre$(EXEEXT): |
---|
[7a7ab42] | 147 | @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
[6810fcb] | 148 | |
---|
| 149 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
[7a7ab42] | 150 | @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
[034165a] | 151 | |
---|
[50abab9] | 152 | ctxswitch-goroutine$(EXEEXT): |
---|
[d3db83c] | 153 | @go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
[50abab9] | 154 | |
---|
| 155 | ctxswitch-java_thread$(EXEEXT): |
---|
[d3db83c] | 156 | @javac $(srcdir)/ctxswitch/JavaThread.java |
---|
[50abab9] | 157 | @echo "#!/bin/sh" > a.out |
---|
| 158 | @echo "cd ctxswitch && java JavaThread" >> a.out |
---|
| 159 | @chmod a+x a.out |
---|
| 160 | |
---|
[f54a0ab] | 161 | ## ========================================================================================================= |
---|
| 162 | mutex$(EXEEXT) :\ |
---|
[d885a58] | 163 | loop.run \ |
---|
| 164 | function.run \ |
---|
| 165 | fetch_add.run \ |
---|
[f54a0ab] | 166 | mutex-pthread_lock.run \ |
---|
| 167 | mutex-upp.run \ |
---|
| 168 | mutex-cfa1.run \ |
---|
| 169 | mutex-cfa2.run \ |
---|
[6aa537a4] | 170 | mutex-cfa4.run \ |
---|
| 171 | mutex-java_thread.run |
---|
[f54a0ab] | 172 | |
---|
| 173 | mutex-pthread_lock$(EXEEXT): |
---|
[7a7ab42] | 174 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
[f54a0ab] | 175 | |
---|
| 176 | mutex-upp$(EXEEXT): |
---|
[7a7ab42] | 177 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
[f54a0ab] | 178 | |
---|
| 179 | mutex-cfa1$(EXEEXT): |
---|
[7a7ab42] | 180 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c |
---|
[f54a0ab] | 181 | |
---|
| 182 | mutex-cfa2$(EXEEXT): |
---|
[7a7ab42] | 183 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c |
---|
[f54a0ab] | 184 | |
---|
| 185 | mutex-cfa4$(EXEEXT): |
---|
[7a7ab42] | 186 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c |
---|
[034165a] | 187 | |
---|
[6aa537a4] | 188 | mutex-java_thread$(EXEEXT): |
---|
[d3db83c] | 189 | @javac $(srcdir)/mutex/JavaThread.java |
---|
[6aa537a4] | 190 | @echo "#!/bin/sh" > a.out |
---|
| 191 | @echo "cd mutex && java JavaThread" >> a.out |
---|
| 192 | @chmod a+x a.out |
---|
| 193 | |
---|
[9f0b975] | 194 | ## ========================================================================================================= |
---|
| 195 | signal$(EXEEXT) :\ |
---|
[3eb4541] | 196 | signal-pthread_cond.run \ |
---|
[9f0b975] | 197 | signal-upp.run \ |
---|
| 198 | signal-cfa1.run \ |
---|
| 199 | signal-cfa2.run \ |
---|
[56de6b39] | 200 | signal-cfa4.run \ |
---|
| 201 | signal-java_thread.run |
---|
[9f0b975] | 202 | |
---|
[3eb4541] | 203 | signal-pthread_cond$(EXEEXT): |
---|
[7a7ab42] | 204 | @$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
[3eb4541] | 205 | |
---|
[9f0b975] | 206 | signal-upp$(EXEEXT): |
---|
[7a7ab42] | 207 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
[9f0b975] | 208 | |
---|
| 209 | signal-cfa1$(EXEEXT): |
---|
[7a7ab42] | 210 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c |
---|
[9f0b975] | 211 | |
---|
| 212 | signal-cfa2$(EXEEXT): |
---|
[7a7ab42] | 213 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c |
---|
[9f0b975] | 214 | |
---|
| 215 | signal-cfa4$(EXEEXT): |
---|
[7a7ab42] | 216 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c |
---|
[9f0b975] | 217 | |
---|
[6aa537a4] | 218 | signal-java_thread$(EXEEXT): |
---|
[d3db83c] | 219 | @javac $(srcdir)/schedint/JavaThread.java |
---|
[6aa537a4] | 220 | @echo "#!/bin/sh" > a.out |
---|
| 221 | @echo "cd schedint && java JavaThread" >> a.out |
---|
| 222 | @chmod a+x a.out |
---|
| 223 | |
---|
| 224 | |
---|
[9f0b975] | 225 | ## ========================================================================================================= |
---|
| 226 | waitfor$(EXEEXT) :\ |
---|
| 227 | waitfor-upp.run \ |
---|
| 228 | waitfor-cfa1.run \ |
---|
| 229 | waitfor-cfa2.run \ |
---|
| 230 | waitfor-cfa4.run |
---|
| 231 | |
---|
| 232 | waitfor-upp$(EXEEXT): |
---|
[7a7ab42] | 233 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
[9f0b975] | 234 | |
---|
| 235 | waitfor-cfa1$(EXEEXT): |
---|
[7a7ab42] | 236 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c |
---|
[9f0b975] | 237 | |
---|
| 238 | waitfor-cfa2$(EXEEXT): |
---|
[7a7ab42] | 239 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c |
---|
[9f0b975] | 240 | |
---|
| 241 | waitfor-cfa4$(EXEEXT): |
---|
[7a7ab42] | 242 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c |
---|
[9f0b975] | 243 | |
---|
[4cedd9f] | 244 | ## ========================================================================================================= |
---|
| 245 | creation$(EXEEXT) :\ |
---|
[3351cc0] | 246 | creation-pthread.run \ |
---|
| 247 | creation-cfa_coroutine.run \ |
---|
| 248 | creation-cfa_coroutine_eager.run \ |
---|
| 249 | creation-cfa_thread.run \ |
---|
| 250 | creation-upp_coroutine.run \ |
---|
[50abab9] | 251 | creation-upp_thread.run \ |
---|
| 252 | creation-goroutine.run \ |
---|
| 253 | creation-java_thread.run |
---|
[4cedd9f] | 254 | |
---|
| 255 | creation-cfa_coroutine$(EXEEXT): |
---|
[7a7ab42] | 256 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[4cedd9f] | 257 | |
---|
[3351cc0] | 258 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
[7a7ab42] | 259 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[3351cc0] | 260 | |
---|
[4cedd9f] | 261 | creation-cfa_thread$(EXEEXT): |
---|
[7a7ab42] | 262 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c |
---|
[4cedd9f] | 263 | |
---|
| 264 | creation-upp_coroutine$(EXEEXT): |
---|
[7a7ab42] | 265 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
[4cedd9f] | 266 | |
---|
| 267 | creation-upp_thread$(EXEEXT): |
---|
[7a7ab42] | 268 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
[4cedd9f] | 269 | |
---|
| 270 | creation-pthread$(EXEEXT): |
---|
[7a7ab42] | 271 | @$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
[4cedd9f] | 272 | |
---|
[50abab9] | 273 | creation-goroutine$(EXEEXT): |
---|
[d3db83c] | 274 | @go build -o a.out $(srcdir)/creation/goroutine.go |
---|
[50abab9] | 275 | |
---|
| 276 | creation-java_thread$(EXEEXT): |
---|
[d3db83c] | 277 | @javac $(srcdir)/creation/JavaThread.java |
---|
[50abab9] | 278 | @echo "#!/bin/sh" > a.out |
---|
| 279 | @echo "cd creation && java JavaThread" >> a.out |
---|
| 280 | @chmod a+x a.out |
---|
| 281 | |
---|
[034165a] | 282 | ## ========================================================================================================= |
---|
| 283 | |
---|
[3edc2df] | 284 | compile$(EXEEXT) :\ |
---|
[a5b7905] | 285 | compile-array.make \ |
---|
| 286 | compile-attributes.make \ |
---|
| 287 | compile-empty.make \ |
---|
| 288 | compile-expression.make \ |
---|
| 289 | compile-io.make \ |
---|
| 290 | compile-monitor.make \ |
---|
| 291 | compile-operators.make \ |
---|
| 292 | compile-typeof.make |
---|
[3edc2df] | 293 | |
---|
| 294 | |
---|
[524ed86] | 295 | testdir = $(top_srcdir)/tests |
---|
[d3db83c] | 296 | |
---|
[3edc2df] | 297 | compile-array$(EXEEXT): |
---|
[7a7ab42] | 298 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c |
---|
[3edc2df] | 299 | |
---|
| 300 | compile-attributes$(EXEEXT): |
---|
[7a7ab42] | 301 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.c |
---|
[3edc2df] | 302 | |
---|
| 303 | compile-empty$(EXEEXT): |
---|
[7a7ab42] | 304 | @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c |
---|
[3edc2df] | 305 | |
---|
| 306 | compile-expression$(EXEEXT): |
---|
[7a7ab42] | 307 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c |
---|
[3edc2df] | 308 | |
---|
| 309 | compile-io$(EXEEXT): |
---|
[7a7ab42] | 310 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c |
---|
[3edc2df] | 311 | |
---|
| 312 | compile-monitor$(EXEEXT): |
---|
[7a7ab42] | 313 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c |
---|
[3edc2df] | 314 | |
---|
| 315 | compile-operators$(EXEEXT): |
---|
[7a7ab42] | 316 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c |
---|
[3edc2df] | 317 | |
---|
| 318 | compile-thread$(EXEEXT): |
---|
[7a7ab42] | 319 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c |
---|
[3edc2df] | 320 | |
---|
| 321 | compile-typeof$(EXEEXT): |
---|
[7a7ab42] | 322 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c |
---|
[3edc2df] | 323 | |
---|