Changes in / [f2f22e3:8d61d620]
- Files:
-
- 4 deleted
- 43 edited
-
benchmark/Makefile.am (modified) (14 diffs)
-
benchmark/Makefile.in (modified) (11 diffs)
-
benchmark/bench.h (modified) (1 diff)
-
benchmark/creation/cfa_cor.cfa (modified) (2 diffs)
-
benchmark/creation/cfa_thrd.cfa (modified) (2 diffs)
-
benchmark/creation/pthreads.c (modified) (1 diff)
-
benchmark/creation/qthreads.c (deleted)
-
benchmark/creation/upp_cor.cc (modified) (1 diff)
-
benchmark/creation/upp_thrd.cc (modified) (1 diff)
-
benchmark/ctxswitch/cfa_cor.cfa (modified) (3 diffs)
-
benchmark/ctxswitch/cfa_cor_then.cfa (modified) (3 diffs)
-
benchmark/ctxswitch/cfa_gen.cfa (deleted)
-
benchmark/ctxswitch/cfa_thrd.cfa (modified) (3 diffs)
-
benchmark/ctxswitch/cfa_thrd2.cfa (modified) (3 diffs)
-
benchmark/ctxswitch/kos_fibre.cpp (modified) (1 diff)
-
benchmark/ctxswitch/kos_fibre2.cpp (modified) (1 diff)
-
benchmark/ctxswitch/pthreads.c (modified) (1 diff)
-
benchmark/ctxswitch/qthreads.c (deleted)
-
benchmark/ctxswitch/upp_cor.cc (modified) (1 diff)
-
benchmark/ctxswitch/upp_thrd.cc (modified) (1 diff)
-
benchmark/fetch_add.c (modified) (1 diff)
-
benchmark/function.c (modified) (1 diff)
-
benchmark/loop.c (modified) (1 diff)
-
benchmark/mutex/cfa1.cfa (modified) (2 diffs)
-
benchmark/mutex/cfa2.cfa (modified) (2 diffs)
-
benchmark/mutex/cfa4.cfa (modified) (2 diffs)
-
benchmark/mutex/pthreads.c (modified) (1 diff)
-
benchmark/mutex/upp.cc (modified) (1 diff)
-
benchmark/schedext/cfa1.cfa (modified) (4 diffs)
-
benchmark/schedext/cfa2.cfa (modified) (4 diffs)
-
benchmark/schedext/cfa4.cfa (modified) (4 diffs)
-
benchmark/schedext/upp.cc (modified) (1 diff)
-
benchmark/schedint/cfa1.cfa (modified) (4 diffs)
-
benchmark/schedint/cfa2.cfa (modified) (4 diffs)
-
benchmark/schedint/cfa4.cfa (modified) (4 diffs)
-
benchmark/schedint/pthreads.c (modified) (3 diffs)
-
benchmark/schedint/upp.cc (modified) (2 diffs)
-
benchmark/tls-fetch_add.c (modified) (1 diff)
-
benchmark/ttst_lock.c (deleted)
-
libcfa/src/concurrency/coroutine.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/invoke.h (modified) (4 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (5 diffs)
-
libcfa/src/concurrency/kernel.hfa (modified) (4 diffs)
-
libcfa/src/concurrency/thread.hfa (modified) (2 diffs)
-
src/ResolvExpr/Cost.h (modified) (3 diffs)
-
tests/concurrent/examples/boundedBufferTHREAD.cfa (modified) (1 diff)
-
tools/stat.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
rf2f22e3 r8d61d620 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sun Jun 23 12:34:29 201914 ## Update Count : 5213 ## Last Modified On : Tue Nov 6 09:01:23 2018 14 ## Update Count : 26 15 15 ############################################################################### 16 16 … … 21 21 include $(top_srcdir)/src/cfa.make 22 22 23 AM_CFLAGS = -O2 -Wall -Wextra - I$(srcdir) -lrt -pthread # -Werror23 AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread 24 24 AM_CFAFLAGS = -quiet -nodebug -in-tree 25 25 AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14 … … 31 31 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 32 32 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 33 BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))34 33 35 34 __quiet = verbose … … 46 45 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 47 46 __bench_v_UPP_verbose = $(AM_V_UPP) 48 __bench_v_QTHREAD_verbose = $(AM_V_CC) 47 49 48 50 49 … … 52 51 REPEAT = ${abs_top_builddir}/tools/repeat 53 52 STATS = ${abs_top_srcdir}/tools/stat.py 54 repeats = 3 # 3053 repeats = 30 55 54 skipcompile = no 56 55 TIME_FORMAT = "%E" … … 125 124 126 125 ctxswitch.csv: 127 @echo "generator,coroutine,thread" > $@ 128 @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 126 @echo "coroutine,thread" > $@ 129 127 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 130 128 @+make ctxswitch-cfa_thread.runquiet >> $@ … … 155 153 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 156 154 157 ttst_lock$(EXEEXT):158 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/ttst_lock.c159 160 155 tls-fetch_add$(EXEEXT): 161 156 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c … … 166 161 function.run \ 167 162 fetch_add.run \ 168 ttst_lock.run \169 163 tls-fetch_add.run \ 170 164 ctxswitch-pthread.run \ 171 ctxswitch-cfa_generator.run \172 165 ctxswitch-cfa_coroutine.run \ 173 166 ctxswitch-cfa_thread.run \ … … 176 169 ctxswitch-upp_thread.run \ 177 170 ctxswitch-goroutine.run \ 178 ctxswitch-java_thread.run \ 179 ctxswitch-qthreads.run 180 171 ctxswitch-java_thread.run 181 172 182 173 if WITH_LIBFIBRE … … 197 188 ctxswitch-pthread$(EXEEXT): 198 189 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 199 200 ctxswitch-cfa_generator$(EXEEXT):201 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa202 190 203 191 ctxswitch-cfa_coroutine$(EXEEXT): … … 224 212 @echo "java JavaThread" >> a.out 225 213 @chmod a+x a.out 226 227 ctxswitch-qthreads$(EXEEXT):228 $(BENCH_V_QTHREADS)$(COMPILE) -DBENCH_N=50000000 -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib $(srcdir)/ctxswitch/qthreads.c -lqthread229 214 230 215 ## ========================================================================================================= … … 320 305 creation-upp_thread.run \ 321 306 creation-goroutine.run \ 322 creation-java_thread.run \ 323 creation-qthreads.run 307 creation-java_thread.run 324 308 325 309 creation-cfa_coroutine$(EXEEXT): … … 349 333 @echo "java JavaThread" >> a.out 350 334 @chmod a+x a.out 351 352 creation-qthreads$(EXEEXT):353 $(BENCH_V_QTHREADS)$(COMPILE) -DBENCH_N=50000000 -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib $(srcdir)/ctxswitch/qthreads.c -lqthread354 335 355 336 ## ========================================================================================================= … … 394 375 compile-typeof$(EXEEXT): 395 376 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa 377 -
benchmark/Makefile.in
rf2f22e3 r8d61d620 363 363 am__v_GOC_0 = @echo " GOC " $@; 364 364 am__v_GOC_1 = 365 UPPCC = u++ -work365 UPPCC = u++ 366 366 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 367 367 AM_V_UPP = $(am__v_UPP_@AM_V@) … … 371 371 372 372 # applies to both programs 373 AM_CFLAGS = -O2 -Wall -Wextra - I$(srcdir) -lrt -pthread # -Werror373 AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread 374 374 AM_CFAFLAGS = -quiet -nodebug -in-tree 375 375 AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14 … … 380 380 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 381 381 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 382 BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))383 382 __quiet = verbose 384 383 __bench_v_CC_quiet = @ … … 394 393 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 395 394 __bench_v_UPP_verbose = $(AM_V_UPP) 396 __bench_v_QTHREAD_verbose = $(AM_V_CC)397 395 TOOLSDIR = ${abs_top_builddir}/tools/ 398 396 REPEAT = ${abs_top_builddir}/tools/repeat 399 397 STATS = ${abs_top_srcdir}/tools/stat.py 400 repeats = 3 # 30398 repeats = 30 401 399 skipcompile = no 402 400 TIME_FORMAT = "%E" … … 404 402 dummy_SOURCES = dummyC.c dummyCXX.cpp 405 403 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ 406 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run ttst_lock.run\404 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 407 405 tls-fetch_add.run ctxswitch-pthread.run \ 408 ctxswitch-cfa_generator.run ctxswitch-cfa_coroutine.run \ 409 ctxswitch-cfa_thread.run ctxswitch-cfa_thread2.run \ 410 ctxswitch-upp_coroutine.run ctxswitch-upp_thread.run \ 411 ctxswitch-goroutine.run ctxswitch-java_thread.run \ 412 ctxswitch-qthreads.run $(am__append_1) 406 ctxswitch-cfa_coroutine.run ctxswitch-cfa_thread.run \ 407 ctxswitch-cfa_thread2.run ctxswitch-upp_coroutine.run \ 408 ctxswitch-upp_thread.run ctxswitch-goroutine.run \ 409 ctxswitch-java_thread.run $(am__append_1) 413 410 testdir = $(top_srcdir)/tests 414 411 all: all-am … … 787 784 788 785 ctxswitch.csv: 789 @echo "generator,coroutine,thread" > $@ 790 @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 786 @echo "coroutine,thread" > $@ 791 787 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 792 788 @+make ctxswitch-cfa_thread.runquiet >> $@ … … 816 812 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 817 813 818 ttst_lock$(EXEEXT):819 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/ttst_lock.c820 821 814 tls-fetch_add$(EXEEXT): 822 815 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c … … 832 825 ctxswitch-pthread$(EXEEXT): 833 826 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 834 835 ctxswitch-cfa_generator$(EXEEXT):836 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa837 827 838 828 ctxswitch-cfa_coroutine$(EXEEXT): … … 859 849 @echo "java JavaThread" >> a.out 860 850 @chmod a+x a.out 861 862 ctxswitch-qthreads$(EXEEXT):863 $(BENCH_V_QTHREADS)$(COMPILE) -DBENCH_N=50000000 -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib $(srcdir)/ctxswitch/qthreads.c -lqthread864 851 865 852 mutex$(EXEEXT) :\ … … 950 937 creation-upp_thread.run \ 951 938 creation-goroutine.run \ 952 creation-java_thread.run \ 953 creation-qthreads.run 939 creation-java_thread.run 954 940 955 941 creation-cfa_coroutine$(EXEEXT): … … 979 965 @echo "java JavaThread" >> a.out 980 966 @chmod a+x a.out 981 982 creation-qthreads$(EXEEXT):983 $(BENCH_V_QTHREADS)$(COMPILE) -DBENCH_N=50000000 -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib $(srcdir)/ctxswitch/qthreads.c -lqthread984 967 985 968 compile$(EXEEXT) :\ -
benchmark/bench.h
rf2f22e3 r8d61d620 45 45 statement; \ 46 46 EndTime = bench_time(); \ 47 doubleoutput = \48 (double)( EndTime - StartTime ) / n;47 unsigned long long int output = \ 48 ( EndTime - StartTime ) / n; 49 49 50 50 #if defined(__cforall) -
benchmark/creation/cfa_cor.cfa
rf2f22e3 r8d61d620 10 10 #endif 11 11 } 12 void main(MyCoroutine & ) {}12 void main(MyCoroutine & this) {} 13 13 14 14 int main(int argc, char* argv[]) { 15 15 BENCH( 16 for ( i; n) {16 for (size_t i = 0; i < n; i++) { 17 17 MyCoroutine m; 18 18 }, … … 20 20 ) 21 21 22 printf("% g\n", result);22 printf("%llu\n", result); 23 23 } -
benchmark/creation/cfa_thrd.cfa
rf2f22e3 r8d61d620 5 5 6 6 thread MyThread {}; 7 void main(MyThread & ) {}7 void main(MyThread & this) {} 8 8 9 9 int main(int argc, char* argv[]) { 10 10 BENCH( 11 for ( i; n) {11 for (size_t i = 0; i < n; i++) { 12 12 MyThread m; 13 13 }, … … 15 15 ) 16 16 17 printf("% g\n", result);17 printf("%llu\n", result); 18 18 } -
benchmark/creation/pthreads.c
rf2f22e3 r8d61d620 25 25 ) 26 26 27 printf("% g\n", result);27 printf("%llu\n", result); 28 28 } -
benchmark/creation/upp_cor.cc
rf2f22e3 r8d61d620 15 15 ) 16 16 17 printf("% g\n", result);17 printf("%llu\n", result); 18 18 } -
benchmark/creation/upp_thrd.cc
rf2f22e3 r8d61d620 15 15 ) 16 16 17 printf("% g\n", result);17 printf("%llu\n", result); 18 18 } -
benchmark/ctxswitch/cfa_cor.cfa
rf2f22e3 r8d61d620 1 #include <stdio.h> 1 2 #include <kernel.hfa> 2 3 #include <thread.hfa> … … 20 21 21 22 BENCH( 22 for ( i; n) {23 for (size_t i = 0; i < n; i++) { 23 24 resume( s ); 24 25 }, … … 26 27 ) 27 28 28 printf("% g\n", result);29 printf("%llu\n", result); 29 30 } -
benchmark/ctxswitch/cfa_cor_then.cfa
rf2f22e3 r8d61d620 1 #include <stdio.h> 1 2 #include <kernel.hfa> 2 3 #include <thread.hfa> … … 22 23 23 24 BENCH( 24 for ( i; n) {25 for (size_t i = 0; i < n; i++) { 25 26 resume( s ); 26 27 }, … … 28 29 ) 29 30 30 printf("% g\n", result);31 printf("%llu\n", result); 31 32 } -
benchmark/ctxswitch/cfa_thrd.cfa
rf2f22e3 r8d61d620 1 #include <stdio.h> 1 2 #include <thread.hfa> 2 3 … … 5 6 int main(int argc, char* argv[]) { 6 7 BENCH( 7 for ( i; n) {8 for (size_t i = 0; i < n; i++) { 8 9 yield(); 9 10 }, … … 11 12 ) 12 13 13 printf("% g\n", result);14 printf("%llu\n", result); 14 15 } -
benchmark/ctxswitch/cfa_thrd2.cfa
rf2f22e3 r8d61d620 1 #include <stdio.h> 1 2 #include <thread.hfa> 2 3 … … 16 17 Fibre f1; 17 18 BENCH( 18 for ( i; n) {19 for (size_t i = 0; i < n; i++) { 19 20 yield(); 20 21 }, … … 22 23 ) 23 24 24 printf("% g\n", result);25 printf("%llu\n", result); 25 26 done = true; 26 27 return 0; -
benchmark/ctxswitch/kos_fibre.cpp
rf2f22e3 r8d61d620 10 10 result 11 11 ) 12 printf("% g\n", result);12 printf("%llu\n", result); 13 13 return 0; 14 14 } -
benchmark/ctxswitch/kos_fibre2.cpp
rf2f22e3 r8d61d620 19 19 result 20 20 ) 21 printf("% g\n", result);21 printf("%llu\n", result); 22 22 done = true; 23 23 Fibre::yield(); -
benchmark/ctxswitch/pthreads.c
rf2f22e3 r8d61d620 14 14 ) 15 15 16 printf("% g\n", result);16 printf("%llu\n", result); 17 17 } -
benchmark/ctxswitch/upp_cor.cc
rf2f22e3 r8d61d620 30 30 ) 31 31 32 printf("% g\n", result);32 printf("%llu\n", result); 33 33 } -
benchmark/ctxswitch/upp_thrd.cc
rf2f22e3 r8d61d620 11 11 ) 12 12 13 printf("% g\n", result);13 printf("%llu\n", result); 14 14 } -
benchmark/fetch_add.c
rf2f22e3 r8d61d620 19 19 ) 20 20 21 printf("% g\n", result);21 printf("%llu\n", result); 22 22 } -
benchmark/function.c
rf2f22e3 r8d61d620 15 15 ) 16 16 17 printf("% g\n", result);17 printf("%llu\n", result); 18 18 } -
benchmark/loop.c
rf2f22e3 r8d61d620 11 11 ) 12 12 13 printf("% g\n", result);13 printf("%llu\n", result); 14 14 } -
benchmark/mutex/cfa1.cfa
rf2f22e3 r8d61d620 10 10 M m; 11 11 BENCH( 12 for ( i; n) {12 for (size_t i = 0; i < n; i++) { 13 13 call(m); 14 14 }, … … 16 16 ) 17 17 18 printf("% g\n", result);18 printf("%llu\n", result); 19 19 } -
benchmark/mutex/cfa2.cfa
rf2f22e3 r8d61d620 10 10 M m1, m2; 11 11 BENCH( 12 for ( i; n) {12 for (size_t i = 0; i < n; i++) { 13 13 call(m1, m2); 14 14 }, … … 16 16 ) 17 17 18 printf("% g\n", result);18 printf("%llu\n", result); 19 19 } -
benchmark/mutex/cfa4.cfa
rf2f22e3 r8d61d620 11 11 M m1, m2, m3, m4; 12 12 BENCH( 13 for ( i; n) {13 for (size_t i = 0; i < n; i++) { 14 14 call(m1, m2, m3, m4); 15 15 }, … … 17 17 ) 18 18 19 printf("% g\n", result);19 printf("%llu\n", result); 20 20 } -
benchmark/mutex/pthreads.c
rf2f22e3 r8d61d620 19 19 ) 20 20 21 printf("% g\n", result);21 printf("%llu\n", result); 22 22 } -
benchmark/mutex/upp.cc
rf2f22e3 r8d61d620 17 17 ) 18 18 19 printf("% g\n", result);19 printf("%llu\n", result); 20 20 } -
benchmark/schedext/cfa1.cfa
rf2f22e3 r8d61d620 18 18 go = 1; 19 19 BENCH( 20 for ( i; n) {20 for (size_t i = 0; i < n; i++) { 21 21 waitfor(call, a1); 22 22 }, … … 24 24 ) 25 25 26 printf("% g\n", result);26 printf("%llu\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & ) {33 void main( T & this ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1); } … … 37 37 } 38 38 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 40 42 T t; 41 43 return wait(m1); -
benchmark/schedext/cfa2.cfa
rf2f22e3 r8d61d620 18 18 go = 1; 19 19 BENCH( 20 for ( i; n) {20 for (size_t i = 0; i < n; i++) { 21 21 waitfor(call, a1, a2); 22 22 }, … … 24 24 ) 25 25 26 printf("% g\n", result);26 printf("%llu\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & ) {33 void main( T & this ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1, m2); } … … 37 37 } 38 38 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 40 42 T t; 41 43 return wait(m1, m2); -
benchmark/schedext/cfa4.cfa
rf2f22e3 r8d61d620 18 18 go = 1; 19 19 BENCH( 20 for ( i; n) {20 for (size_t i = 0; i < n; i++) { 21 21 waitfor(call, a1, a2, a3, a4); 22 22 }, … … 24 24 ) 25 25 26 printf("% g\n", result);26 printf("%llu\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & ) {33 void main( T & this ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1, m2, m3, m4); } … … 37 37 } 38 38 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 40 42 T t; 41 43 return wait(m1, m2, m3, m4); -
benchmark/schedext/upp.cc
rf2f22e3 r8d61d620 20 20 ) 21 21 22 printf("% g\n", result);22 printf("%llu\n", result); 23 23 go = 0; 24 24 return 0; -
benchmark/schedint/cfa1.cfa
rf2f22e3 r8d61d620 21 21 go = 1; 22 22 BENCH( 23 for ( i; n) {23 for (size_t i = 0; i < n; i++) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% g\n", result);29 printf("%llu\n", result); 30 30 go = 0; 31 31 return 0; … … 33 33 34 34 thread T {}; 35 void ^?{}( T & mutex ) {}36 void main( T & ) {35 void ^?{}( T & mutex this ) {} 36 void main( T & this ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1); } … … 40 40 } 41 41 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 43 45 T t; 44 46 return wait(m1); -
benchmark/schedint/cfa2.cfa
rf2f22e3 r8d61d620 21 21 go = 1; 22 22 BENCH( 23 for ( i; n) {23 for (size_t i = 0; i < n; i++) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% g\n", result);29 printf("%llu\n", result); 30 30 go = 0; 31 31 return 0; … … 34 34 thread T {}; 35 35 void ^?{}( T & mutex this ) {} 36 void main( T & ) {36 void main( T & this ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1, m2); } … … 40 40 } 41 41 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 43 45 T t; 44 46 return wait(m1, m2); -
benchmark/schedint/cfa4.cfa
rf2f22e3 r8d61d620 21 21 go = 1; 22 22 BENCH( 23 for ( i; n) {23 for (size_t i = 0; i < n; i++) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% g\n", result);29 printf("%llu\n", result); 30 30 go = 0; 31 31 return 0; … … 34 34 thread T {}; 35 35 void ^?{}( T & mutex this ) {} 36 void main( T & ) {36 void main( T & this ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1, m2, m3, m4); } … … 40 40 } 41 41 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 43 45 T t; 44 46 return wait(m1, m2, m3, m4); -
benchmark/schedint/pthreads.c
rf2f22e3 r8d61d620 27 27 ) 28 28 29 printf("% g\n", result);29 printf("%llu\n", result); 30 30 go = 0; 31 31 pthread_mutex_unlock(&m); … … 33 33 } 34 34 35 void* thread_main( __attribute__((unused)) void * arg) {35 void* thread_main(void * a) { 36 36 while(go == 0) { sched_yield(); } 37 37 while(go == 1) { call(); } … … 39 39 } 40 40 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 41 int main(int margc, char* margv[]) { 42 argc = margc; 43 argv = margv; 42 44 pthread_t thread; 43 45 if (pthread_create(&thread, NULL, thread_main, NULL) < 0) { -
benchmark/schedint/upp.cc
rf2f22e3 r8d61d620 23 23 ) 24 24 25 printf("% g\n", result);25 printf("%llu\n", result); 26 26 go = 0; 27 27 return 0; … … 39 39 }; 40 40 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 41 int main(int margc, char* margv[]) { 42 argc = margc; 43 argv = margv; 42 44 T t; 43 45 return m.wait(); -
benchmark/tls-fetch_add.c
rf2f22e3 r8d61d620 24 24 ) 25 25 26 printf("% g\n", result);26 printf("%llu\n", result); 27 27 } -
libcfa/src/concurrency/coroutine.hfa
rf2f22e3 r8d61d620 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 17:49:39 201913 // Update Count : 912 // Last Modified On : Fri Mar 30 18:23:45 2018 13 // Update Count : 8 14 14 // 15 15 … … 53 53 forall(dtype T | is_coroutine(T)) 54 54 void prime(T & cor); 55 56 static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }57 55 58 56 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/invoke.h
rf2f22e3 r8d61d620 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 22 18:19:13 201913 // Update Count : 4012 // Last Modified On : Sat May 19 08:23:21 2018 13 // Update Count : 31 14 14 // 15 15 … … 46 46 #ifdef __cforall 47 47 extern "Cforall" { 48 static inline struct thread_desc * & get_next( struct thread_desc & this );49 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );48 static inline struct thread_desc * & get_next( struct thread_desc & this ); 49 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this ); 50 50 51 51 extern thread_local struct KernelThreadData { … … 199 199 #ifdef __cforall 200 200 extern "Cforall" { 201 static inline thread_desc *& get_next( thread_desc & this ) { 201 static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; } 202 static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); } 203 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE 204 205 static inline thread_desc * & get_next( thread_desc & this ) { 202 206 return this.next; 203 207 } … … 206 210 return this.node.[next, prev]; 207 211 } 212 213 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this ); 208 214 209 215 static inline void ?{}(__monitor_group_t & this) { -
libcfa/src/concurrency/kernel.cfa
rf2f22e3 r8d61d620 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 20 17:21:23 201913 // Update Count : 2 512 // Last Modified On : Mon Apr 9 16:11:46 2018 13 // Update Count : 24 14 14 // 15 15 … … 907 907 void doregister( cluster * cltr, thread_desc & thrd ) { 908 908 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 909 cltr->nthreads += 1;910 909 push_front(cltr->threads, thrd); 911 910 unlock (cltr->thread_list_lock); … … 915 914 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 916 915 remove(cltr->threads, thrd ); 917 cltr->nthreads -= 1;918 916 unlock(cltr->thread_list_lock); 919 917 } … … 921 919 void doregister( cluster * cltr, processor * proc ) { 922 920 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 923 cltr->nprocessors += 1;924 921 push_front(cltr->procs, *proc); 925 922 unlock (cltr->proc_list_lock); … … 929 926 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 930 927 remove(cltr->procs, *proc ); 931 cltr->nprocessors -= 1;932 928 unlock(cltr->proc_list_lock); 933 929 } -
libcfa/src/concurrency/kernel.hfa
rf2f22e3 r8d61d620 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 22 11:39:17 201913 // Update Count : 1 612 // Last Modified On : Tue Apr 10 14:46:49 2018 13 // Update Count : 10 14 14 // 15 15 … … 91 91 this.lock = NULL; 92 92 } 93 static inline void ^?{}(FinishAction & ) {}93 static inline void ^?{}(FinishAction & this) {} 94 94 95 95 // Processor … … 176 176 __dllist_t(struct processor) procs; 177 177 __dllist_t(struct processor) idles; 178 unsigned int nprocessors; 179 180 // List of threads 178 179 // List of processors 181 180 __spinlock_t thread_list_lock; 182 181 __dllist_t(struct thread_desc) threads; 183 unsigned int nthreads;184 182 185 183 // Link lists fields … … 202 200 } 203 201 204 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE205 static inline struct cluster * active_cluster () { return TL_GET( this_processor )->cltr; }206 207 202 // Local Variables: // 208 203 // mode: c // -
libcfa/src/concurrency/thread.hfa
rf2f22e3 r8d61d620 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 17:51:33 201913 // Update Count : 512 // Last Modified On : Thu Mar 29 14:07:11 2018 13 // Update Count : 4 14 14 // 15 15 … … 91 91 void yield( unsigned times ); 92 92 93 static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); }94 95 93 // Local Variables: // 96 94 // mode: c // -
src/ResolvExpr/Cost.h
rf2f22e3 r8d61d620 10 10 // Created On : Sun May 17 09:39:50 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 11:39:13201913 // Update Count : 6312 // Last Modified On : Mon Apr 29 18:33:44 2019 13 // Update Count : 49 14 14 // 15 15 … … 21 21 22 22 namespace ResolvExpr { 23 #if 0 24 25 //*************************** OLD *************************** 26 27 class Cost { 28 private: 29 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 30 int varCost, int specCost, int referenceCost ); 31 public: 32 Cost & incUnsafe( int inc = 1 ); 33 Cost & incPoly( int inc = 1 ); 34 Cost & incSafe( int inc = 1 ); 35 Cost & incSign( int inc = 1 ); 36 Cost & incVar( int inc = 1 ); 37 Cost & decSpec( int inc = 1 ); 38 Cost & incReference( int inc = 1 ); 39 40 int get_unsafeCost() const { return unsafeCost; } 41 int get_polyCost() const { return polyCost; } 42 int get_safeCost() const { return safeCost; } 43 int get_signCost() const { return signCost; } 44 int get_varCost() const { return varCost; } 45 int get_specCost() const { return specCost; } 46 int get_referenceCost() const { return referenceCost; } 47 48 Cost operator+( const Cost &other ) const; 49 Cost &operator+=( const Cost &other ); 50 bool operator<( const Cost &other ) const; 51 bool operator==( const Cost &other ) const; 52 bool operator!=( const Cost &other ) const; 53 friend std::ostream &operator<<( std::ostream &os, const Cost &cost ); 54 // returns negative for *this < other, 0 for *this == other, positive for *this > other 55 int compare( const Cost &other ) const; 56 57 static const Cost zero; 58 static const Cost infinity; 59 60 static const Cost unsafe; 61 static const Cost poly; 62 static const Cost safe; 63 static const Cost sign; 64 static const Cost var; 65 static const Cost spec; 66 static const Cost reference; 67 68 private: 69 int unsafeCost; ///< Unsafe (narrowing) conversions 70 int polyCost; ///< Count of parameters and return values bound to some poly type 71 int safeCost; ///< Safe (widening) conversions 72 int signCost; ///< Count of safe sign conversions 73 int varCost; ///< Count of polymorphic type variables 74 int specCost; ///< Polymorphic type specializations (type assertions), negative cost 75 int referenceCost; ///< reference conversions 76 }; 77 78 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 79 int varCost, int specCost, int referenceCost ) 80 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), signCost( signCost ), 81 varCost( varCost ), specCost( specCost ), referenceCost( referenceCost ) {} 82 83 inline Cost & Cost::incUnsafe( int inc ) { 84 if ( *this == infinity ) return *this; 85 unsafeCost += inc; 86 return *this; 87 } 88 89 inline Cost & Cost::incPoly( int inc ) { 90 if ( *this == infinity ) return *this; 91 polyCost += inc; 92 return *this; 93 } 94 95 inline Cost & Cost::incSafe( int inc ) { 96 if ( *this == infinity ) return *this; 97 safeCost += inc; 98 return *this; 99 } 100 101 inline Cost & Cost::incSign( int inc ) { 102 if ( *this == infinity ) return *this; 103 signCost += inc; 104 return *this; 105 } 106 107 inline Cost & Cost::incVar( int inc ) { 108 if ( *this == infinity ) return *this; 109 varCost += inc; 110 return *this; 111 } 112 113 inline Cost& Cost::decSpec( int dec ) { 114 if ( *this == infinity ) return *this; 115 specCost -= dec; 116 return *this; 117 } 118 119 inline Cost & Cost::incReference( int inc ) { 120 if ( *this == infinity ) return *this; 121 referenceCost += inc; 122 return *this; 123 } 124 125 inline Cost Cost::operator+( const Cost &other ) const { 126 if ( *this == infinity || other == infinity ) return infinity; 127 return Cost{ 128 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 129 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost, 130 referenceCost + other.referenceCost }; 131 } 132 133 inline Cost &Cost::operator+=( const Cost &other ) { 134 if ( *this == infinity ) return *this; 135 if ( other == infinity ) { 136 *this = infinity; 137 return *this; 138 } 139 unsafeCost += other.unsafeCost; 140 polyCost += other.polyCost; 141 safeCost += other.safeCost; 142 signCost += other.signCost; 143 varCost += other.varCost; 144 specCost += other.specCost; 145 referenceCost += other.referenceCost; 146 return *this; 147 } 148 149 inline bool Cost::operator<( const Cost &other ) const { 150 if ( *this == infinity ) return false; 151 if ( other == infinity ) return true; 152 153 if ( unsafeCost > other.unsafeCost ) { 154 return false; 155 } else if ( unsafeCost < other.unsafeCost ) { 156 return true; 157 } else if ( polyCost > other.polyCost ) { 158 return false; 159 } else if ( polyCost < other.polyCost ) { 160 return true; 161 } else if ( safeCost > other.safeCost ) { 162 return false; 163 } else if ( safeCost < other.safeCost ) { 164 return true; 165 } else if ( signCost > other.signCost ) { 166 return false; 167 } else if ( signCost < other.signCost ) { 168 return true; 169 } else if ( varCost > other.varCost ) { 170 return false; 171 } else if ( varCost < other.varCost ) { 172 return true; 173 } else if ( specCost > other.specCost ) { 174 return false; 175 } else if ( specCost > other.specCost ) { 176 return true; 177 } else if ( referenceCost > other.referenceCost ) { 178 return false; 179 } else if ( referenceCost < other.referenceCost ) { 180 return true; 181 } else { 182 return false; 183 } // if 184 } 185 186 inline int Cost::compare( const Cost &other ) const { 187 if ( *this == infinity ) return +1; 188 if ( other == infinity ) return -1; 189 190 int c = unsafeCost - other.unsafeCost; if ( c ) return c; 191 c = polyCost - other.polyCost; if ( c ) return c; 192 c = safeCost - other.safeCost; if ( c ) return c; 193 c = signCost - other.signCost; if ( c ) return c; 194 c = varCost - other.varCost; if ( c ) return c; 195 c = specCost - other.specCost; if ( c ) return c; 196 return referenceCost - other.referenceCost; 197 } 198 199 inline bool Cost::operator==( const Cost &other ) const { 200 return unsafeCost == other.unsafeCost 201 && polyCost == other.polyCost 202 && safeCost == other.safeCost 203 && signCost == other.signCost 204 && varCost == other.varCost 205 && specCost == other.specCost 206 && referenceCost == other.referenceCost; 207 } 208 209 inline bool Cost::operator!=( const Cost &other ) const { 210 return !( *this == other ); 211 } 212 213 inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) { 214 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " 215 << cost.safeCost << ", " << cost.signCost << ", " 216 << cost.varCost << ", " << cost.specCost << ", " 217 << cost.referenceCost << " )"; 218 } 219 220 #else 221 222 //*************************** NEW *************************** 223 23 224 // To maximize performance and space, the 7 resolution costs are packed into a single 64-bit word. However, the 24 225 // specialization cost is a negative value so a correction is needed is a few places. … … 170 371 << ", " << cost.get_referenceCost() << " )"; 171 372 } 373 #endif // 0 172 374 } // namespace ResolvExpr 173 375 -
tests/concurrent/examples/boundedBufferTHREAD.cfa
rf2f22e3 r8d61d620 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // boundedBuffer THREAD.c --7 // boundedBufferEXT.c -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Apr 18 22:52:12 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 11:50:12201913 // Update Count : 2 412 // Last Modified On : Fri Jun 21 08:15:58 2019 13 // Update Count : 23 14 14 // 15 15 -
tools/stat.py
rf2f22e3 r8d61d620 11 11 content = f.readlines() 12 12 content = [x.strip() for x in content] 13 content = [ float(x) for x in content] # expect floating-point strings14 content.remove(max(content)) # need at least 4 data values because15 content.remove(min(content)) # the max and min values are removed16 med = numpy. median(content)17 avg = numpy. mean (content)18 std = numpy. std (content)19 print "median {0 :.1f} avg {1:.1f} stddev {2:.2f}".format( med, avg, std )13 content = [int(x) for x in content] 14 content.remove(max(content)) 15 content.remove(min(content)) 16 med = numpy.around( numpy.median(content), decimals=1) 17 avg = numpy.around( numpy.mean (content), decimals=2) 18 std = numpy.around( numpy.std (content), decimals=2) 19 print "median {0} avg {1} stddev {2}".format( med, avg, std ) 20 20 21 21
Note:
See TracChangeset
for help on using the changeset viewer.